function show_img(img,iwidth,iheight,title,host){
   var a,b,url;
   vidWindowWidth=iwidth+17;
   vidWindowHeight=iheight+2;
   a=(screen.height-vidWindowHeight)/5;
   b=(screen.width-vidWindowWidth)/2;
   features="top="+a+",left="+b+",width="+vidWindowWidth+",height="+vidWindowHeight+",toolbar=no,menubar=no,location=no,directories=no,scrollbars=yes,resizable=yes";;
   url=host+"i.php?img="+img+"&h="+iheight+"&w="+iwidth+"&title="+title;
   window.open(url,'',features,true);
}

function setmail(s2,s1,subj){document.write('<a class="mail" target="_blank" href="mai'+'lto:'+s1+'@'+s2+'?sub'+'ject='+subj+'">'+s1+"@"+s2+'</a>');}

function Set_Cookie(name,value){
var today=new Date();
var expires=new Date(today.getTime()+15000000);
if(value =='')expires=";expires=Thu, 01-Jan-70 00:00:01 GMT"; else expires=";expires="+expires.toGMTString();
document.cookie=name+"="+escape(value)+expires+"; path=/";
window.location.href=window.location.href;}


function gencity(rubid,parentid){
parentid = "city"+parentid;
if (rubid >-1){
document.getElementById(parentid).innerHTML ='<img src="'+'http://'+document.domain+'/images/load.gif" />';
var r = new JsHttpRequest();
r.onreadystatechange = function(){if(r.readyState == 4){document.getElementById(parentid).innerHTML=r.responseJS['rub'];}}
r.open(null,'http://'+ document.domain + '/lib/addcity.php', true); r.send({id:rubid});
return false;} else {document.getElementById(parentid).innerHTML ='';}
}

function genrub(rubid,parentid){
if (rubid >-1){
document.getElementById(parentid).innerHTML ='<img src="'+'http://'+document.domain+'/images/load.gif" />';
var r = new JsHttpRequest();
r.onreadystatechange = function(){if(r.readyState==4){document.getElementById(parentid).innerHTML=r.responseJS['rub'];}}
r.open(null,'http://'+ document.domain + '/lib/addmsg.php',true); r.send({id:rubid});
return false; } else {document.getElementById(parentid).innerHTML ='';}
}

function filter(){
var meta=document.getElementById('idmeta').value;
var city=document.getElementById('idcity').value;
var r = new JsHttpRequest();
r.onreadystatechange = function(){if(r.readyState==4){window.location.reload(true);}}
r.open(null,'http://'+ document.domain + '/lib/filter.php',true); r.send({idmeta:meta,idcity:city});
}

function genfcity(rubid,parentid){
parentid = "city"+parentid;
if (rubid >-1){
document.getElementById(parentid).innerHTML ='<img src="'+'http://'+document.domain+'/images/load.gif" />';
var r = new JsHttpRequest();
r.onreadystatechange = function(){if(r.readyState == 4){document.getElementById(parentid).innerHTML=r.responseJS['rub'];}}
r.open(null,'http://'+ document.domain + '/lib/addcity.php', true); r.send({id:rubid});
return false;} else {document.getElementById(parentid).innerHTML ='';}
}
