function txt(cl){
var tx=document.getElementById("txt");
  if (cl==1) {
 tx.style.display='block';
}
else {
 tx.style.display='none';}
}

function nav(pob,uzb){
 if(navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1) {
  if(uzb==1){
   pob.style.behavior='url(#default#homepage)';
   pob.setHomePage('http://www.tourlink.ru'); }
  else{
   window.external.AddFavorite('http://<%=Request.ServerVariables("Server_Name")%>/','Система Интернет-бронирования Турлинк')
  }
 }else{
  var ifs=document.getElementById("ifrm");
  if(uzb==1){
   ifs.src="user.html"
  }else{
   ifs.src="uzbr.html"
  }
  divh(1);
 }
}

/* если не експлорер */
function divh(nvg){
 var dv=document.getElementById("hus");
 if (nvg==1) {
  dv.style.display='block';
 }else {
  dv.style.display='none';
 }
}
 
function slct(prm) {
 document.htl0.c.value=prm;
 document.htl0.submit();
}

function chgd(rg){
var x1=document.getElementById('lfrm');
var x3=document.getElementById('tst');
var x2=document.getElementById('srchz');
if (rg==1) {
 mv(x3);
 x2.style.display='none';
 x1.style.display='block';
 document.f1.rfc.focus();}
else {
 x1.style.display='none';}
}

function srchz(rg){
var x1=document.getElementById('srchz');
var x2=document.getElementById('lfrm');
var x3=document.getElementById('srchh');
if (rg==1) {
 x1.style.display='block';
 x2.style.display='none';
 x3.style.display='none';
 document.htl.s1.focus();}
else {
 x1.style.display='none';}
}

function srchh(rg){
var x1=document.getElementById('srchh');
var x2=document.getElementById('srchz');
var x3=document.getElementById('lfrm');
if (rg==1) {
 x1.style.display='block';
 x2.style.display='none';
 x3.style.display='none';
 document.historyFrm.profileLN.focus();}
else { x1.style.display='none';}
}
/*
function filfl(){
 msg="";
// ss=document.htl.s1.value+document.htl.s2.value+document.htl.s3.value;
 ss=document.htl.s1.value+document.htl.s3.value;
 eml=document.htl.eml.value;
 if (eml=="") msg="Введите E-Mail заявки";
 if (ss=="") msg=msg+"\nВведите номер заявки!!!";
 if (document.htl.s3.value=="") msg=msg+"\nНе полный номер заявки!!!";
 if (msg==""){
		prm_str='s1='+document.htl.s1.value+'&s3='+document.htl.s3.value+'&eml='+document.htl.eml.value;
		mkUrl("tstz",prm_str);
//  document.htl.submit();
 }else{
  alert(msg);
 }
}
*/
function filfh(){
 msg="";
 eml=document.historyFrm.profileMail.value;
 if (eml=="") msg="Введите E-Mail заказа";
 if (document.historyFrm.profileLN.value=="") msg=msg+"\nВведите Фамилию!!!";
 if (msg==""){
  document.historyFrm.submit();
 }else{
  alert(msg);
  return false;
 }
}

function rimg(){
 var zz=document.getElementById('tlimg');
  if(window.screen.width<1024){
  zz.src="tl520.jpg";
 } else{
   zz.src="tl.jpg";
 }
}

function show_news(dt,nm,txt,fid,fty){
 str=''; hrf='';
 str+='<b>'+dt+'</b><br>';
 if (fty=='h') hrf='<a href=hotwp.asp?lxa='+fid+' target=_blank>';
 if (fty=='t') hrf='<a href=tfnpr.asp?lxa='+fid+' target=_blank>';
if (nm!=''){
  str+='<b>'+hrf+nm+'</a></b>'+'<br>';
 }
 str+=txt;
 str='<html><head><LINK href="main.css" rel="stylesheet" type="text/css"></head><body><table width=100% border=0 cellpadding=0 cellspacing=0 class=ts><tr><td>'+str+'</td></tr></table></body></html>'
 elm=document.getElementById('ifrm');
 elm.src='';
 window.parent.frames['ifrm'].document.open();
 window.parent.frames['ifrm'].document.write(str);
 window.parent.frames['ifrm'].document.close();
 divh(1);
} 
var dgdt1 = "",dgdt2 = "",dgdt3 = "";

function chkDates1() {
	if ( (dgdt1 != "") && (dgdt2 != "") && (dgdt3 != "") ) {
		if ( (dgdt1 != document.searchForm1.b1.value) || (dgdt2 != document.searchForm1.b2.value) || ( (dgdt3 != document.searchForm1.ngh.value) && (document.searchForm1.ngh.value != "") && !(isNaN(document.searchForm1.ngh.value))) ) {
			updCounter = -1;
			
			//// ыыы
			if (dgdt1 != document.searchForm1.b1.value) {
				alignDates(document.searchForm1.b1,document.searchForm1.b2,document.searchForm1.ngh,1);
				dgdt1 = document.searchForm1.b1.value;
				dgdt2 = document.searchForm1.b2.value;
			} else if (dgdt2 != document.searchForm1.b2.value) {
				alignDates(document.searchForm1.b1,document.searchForm1.b2,document.searchForm1.ngh,0);
				dgdt2 = document.searchForm1.b2.value;
				dgdt3 = document.searchForm1.ngh.value;
			} else if ( (gdt3 != document.searchForm1.ngh.value) && (document.searchForm1.ngh.value != "") && !(isNaN(document.searchForm1.ngh.value)) ) {
				alignDates(document.searchForm1.b1,document.searchForm1.b2,document.searchForm1.ngh,1);
				dgdt2 = document.searchForm1.b2.value;
				dgdt3 = document.searchForm1.ngh.value;
			}
			document.searchForm1.a1.value = dgdt1.substr(6,4) + dgdt1.substr(3,2) + dgdt1.substr(0,2);
			document.searchForm1.a2.value = dgdt2.substr(6,4) + dgdt2.substr(3,2) + dgdt2.substr(0,2);
			//// ыыы
			
//			runTimedUpdate();
		}
	} else {
		dgdt1 = document.searchForm1.b1.value;
		dgdt2 = document.searchForm1.b2.value;
		dgdt3 = document.searchForm1.ngh.value;
	}
	setTimeout("chkDates1()",0);
}

