function getSelectionId(text, li) {	
    var str = li.id.split('__');
    document.getElementById('city').value=str[1];
    document.getElementById('ufi').value=str[0];
    document.getElementById('src_butt').style.display='block';		
}	
function cleanCityInput(){
        document.getElementById('city').value='';
        document.getElementById('ufi').value=0;
    //    document.getElementById('src_butt').style.display='none';
}
function amadChange(str_form){
    var tt = eval('document.'+str_form+'.arrivalDay.value');
    var dt=parseInt(tt);
    dt+=1;
    var tt1=eval('document.'+str_form+'.arrivalYearMonth.value');
    SetCalTime(str_form+'.departure',dt,tt1);
}
function SetCalTime(nm,dt,ym) {
    var daySel=eval('document.'+nm+'Day');
    for (i=0;i<daySel.options.length;i++) {
      if (daySel.options[i].value==dt){
        daySel.selectedIndex=i;
        break;
      }
    }
    var ymSel=eval('document.'+nm+'YearMonth');
    for (i=0;i<ymSel.options.length;i++) {
        if (ymSel.options[i].value==ym) {
            ymSel.selectedIndex=i;
            break;
        }
    }
}
function PickDate(str_form, back_action, date,ym) {
    SetCalTime(str_form+'.'+back_action,date,ym);
    if (back_action=='arrival')
      amadChange(str_form);
}


var shown = new Array();
function blocktoggle(i) {
    if (document.getElementById) {
        shown[i] = (shown[i]) ? false : true;
        currentdisplay = (shown[i]) ? 'block' : 'none';
        document.getElementById('blocktoggle'+i).style.display = currentdisplay;
    }
}

function newwin(url,lar,alt){
	var l=window.screen.width;
	var a=window.screen.height;
	var X=X||Math.ceil((l-lar)/2)
	var Y=Y||Math.ceil((a-alt)/2)
	var vWinCal = window.open(url, 'popup',
		"width="+lar+",height="+alt+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,top="+X+",left="+Y+"");
}

function show_hide(i) {
    if (document.getElementById) {
       if (document.getElementById(i).style.display == 'block') document.getElementById(i).style.display = 'none';
       else document.getElementById(i).style.display ='block';
    }
}

function fillSearch(city, ufi){
	document.getElementById('ufi').value=ufi;
	document.getElementById('city').value=city;
	document.hotForm.submit();
}