<!--
function check(id) {
	if (document.vvk_search[id].value>0) {document.vvk_search[id].value=0;}
	else {document.vvk_search[id].value=1;}
}
function validate() {
  if (document.vvk_search["d1"].value > document.vvk_search["d2"].value) { alert("Дата 'выезд с' не можем быть после 'выезд до'!"); document.vvk_search["d1"].focus(); return false; }
  if (document.vvk_search["nDays"].value < 2) { alert("Количество дней отдыха не можем быть меньше 2-х (1 ночь)!"); document.vvk_search["nDays"].focus(); return false; }
  return true;
}
function butSearch() {
	var URL='gen_test.php?act=vSearch'
	URL += '&d1='	+ document.vvk_search['d1'].value;
	URL += '&d2='	+ document.vvk_search['d2'].value;
	URL += '&days='	+ document.vvk_search['nDays'].value;
	URL += '&cID='	+ document.vvk_search['hCity'].value;
	URL += '&hID='	+ document.vvk_search['hotel'].value;
	URL += '&avia='	+ document.vvk_search['fly'].value;
	URL += '&pit='	+ document.vvk_search['pit'].value;
	URL += '&prm1='	+ document.vvk_search['prm1'].value;
	URL += '&prm2='	+ document.vvk_search['prm2'].value;
	URL += '&prm3='	+ document.vvk_search['prm3'].value;
	//alert('URL=='+URL);
	ajaxLoad('tttttt',URL,'','','');
	document.getElementById('tttttt').style.display='block';
	document.getElementById('UTP').style.display='block';
	document.getElementById('ind_rob').style.display='none';
	document.getElementById('spec').style.display='none';
}

function popUpPic(URL, sizex, sizey) {
  var inc_y = 75;
  var inc_x = 10;

  params = "top=40,left=140,width="+sizex+",height="+sizey+",Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=no,resizable=yes";
  popupWin = window.open("","popupWin",params);
  popupWin.focus();
  popupWin.document.open();
  popupWin.document.write("<html><head><title>!!!</title></head>");
  popupWin.document.write("<scri"+"pt language = JavaScript>");
  popupWin.document.write("function closeWindow() {");
  popupWin.document.write("parent.window.close();}");
  popupWin.document.write("</scr"+"ipt>");
  popupWin.document.write("<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><a href=''><img src='"+URL+"' border='0' name='cha1' onClick='closeWindow()' alt=''  onload='window.resizeTo(window.document.images[0].width+"+inc_x+",window.document.images[0].height+"+inc_y+")'></a></body></html>");
  popupWin.document.close();
} 

function getAbsPosTL(el) {
	var r = { x: el.offsetLeft, y: el.offsetTop };
	if (el.offsetParent) {
		var tmp = getAbsolutePosition(el.offsetParent);
		r.x += tmp.x;
		r.y += tmp.y;
	}
	return r;
}

function getAbsPosBL(el) {
	var r = { x: el.offsetLeft, y: el.offsetBottom };
	if (el.offsetParent) {
		var tmp = getAbsolutePosition(el.offsetParent);
		r.x += tmp.x;
		r.y += tmp.y;
	}
	return r;
}

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("p_menu");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() { this.className+=" over"; }
  				node.onmouseout=function() { this.className=this.className.replace(" over", ""); }
			}
		}
	}
}
//AJAX scripts for containers update (vvk add)
function ajaxLoad(obj,url,defMessage,post,callback){
	var ajaxObj;
	if (defMessage) document.getElementById(obj).innerHTML=defMessage;
	if(window.XMLHttpRequest){ajaxObj = new XMLHttpRequest();}
	else if(window.ActiveXObject){ajaxObj = new ActiveXObject("Microsoft.XMLHTTP");}
	else {return;} 
	ajaxObj.open ((post?'POST':'GET'), url);
	if (post&&ajaxObj.setRequestHeader)
		ajaxObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8;");
	ajaxObj.onreadystatechange = ajaxCallBack(obj,ajaxObj,(callback?callback:null));
	ajaxObj.send(post); 
	return false;
} 
function updateObj(obj, data, bold, blink){ 
	if(bold)data=data.bold();
	if(blink)data=data.blink();
	document.getElementById(obj).innerHTML = data; // упрощенный вариант, работает не во всех браузерах
} 
function ajaxCallBack(obj, ajaxObj, callback){
	return function(){
		if(ajaxObj.readyState == 4){
		   if(callback) if(!callback(obj,ajaxObj))return;
		   if (ajaxObj.status==200) updateObj(obj, ajaxObj.responseText);
		   else updateObj(obj, ajaxObj.status+' '+ajaxObj.statusText,1,1);
		}
	}
}
//-->
window.onload=startList;


