function popup(url,name,wd,he) {
  window.open(url,name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width='+wd+',height='+he+',screenX=150,screenY=150,top=150,left=150')
}

function help(id) {
  window.open('/help.php?id='+id,'mail','toolbar=no,location=no,width=400px,height=222px')
}

function booking(id) {
  window.open('/booking.php?id='+id,'mail','toolbar=no,location=no,width=700px,height=700px')
}

function preview(id, lang) {
  window.open('/preview.php?id='+id+'&prev_lang='+lang,'mail','toolbar=no,location=no,scrollbars=yes,width=595px,height=600px')
}

function do_click(id){
	window.open("/banner_redirect.php?id="+id);
}

function goTo(url){
	window.location = url;
}

function do_search(){
	var k=document.search.keyword.value
	if (k.length<5)
		alert('Sorry, the keyword is too short.');
	else
		document.search.submit();
}

function ShowPicture(Image, Width, Height) {
	openwin('/picture.php?name='+Image,'Picture','toolbar=0,status=0,menubars=0,scrollbars=0,resizable=0,location=0,directories=0,width='+Width+',height='+Height+',top=50,left=50');
}

function openwin(theURL,winName,features) {
	xaken=window.open(theURL,winName,features);
}
function mfrDevs()
{
cur_mfr=document.forms.sform.mfr.value;
dev=document.forms.sform.dev;
dev.length=dev_cnt;
dev.options[0].value='none';
dev.options[0].text='-------------';
ii=1;
for(i=0;i<dev_cnt;i++)
if(dev_mfrs[i]==cur_mfr)
{
dev.options[ii].value=dev_ids[i];
dev.options[ii].text=dev_names[i];
ii++;
}dev.length=ii;
}
function setPrevParams(pmfr,pdev)
{
  mfr=document.forms.sform.mfr;
for(i=0;i<mfr.options.length;i++)
{
if(mfr.options[i].value==pmfr)
{
mfr.selectedIndex=i;
break;
};
} mfr.onchange();
    dev=document.forms.sform.dev;
for(i=0;i<dev.options.length;i++)
{
if(dev.options[i].value==pdev)
{
dev.selectedIndex=i;
break;
};
}}

function submitRegionSelector(val){
	vorm=document.forms['regionSelector'];
	temp=val.split('.');
	
	vorm.elements['area_id'].value=temp[0];
	vorm.elements['city_id'].value=0;
	if(temp.length>1){
		
		vorm.elements['city_id'].value=temp[1];
	}
		
	vorm.submit();
}

function submitCountrySelector(val){
	vorm=document.forms['countrySelector'];
	
	vorm.elements['country_id'].value=val;
		
	vorm.submit();
}

var state = 'none';

function showhide(layer_ref) {

	if (state == 'block') {
		state = 'none';
	} else {
		state = 'block';
	}

	if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.display = state");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].display = state;
	}
	if (document.getElementById &&!document.all) {
		hza = document.getElementById(layer_ref);
		hza.style.display = state;
	}
}