var loc1opened=0;
var loc2opened=0;
var loc3opened=0;
var loc4opened=0;
var loc5opened=0;
var loc6opened=0;
var fonopened=0;
var fonclosed=1;
var allsopened=0;
var iframeopened=0;
var opacity=1;
var moveC=0;
var diffLayers=0;
var opacity_= new Array();
var splash_= new Array();
var fade_= new Array();
opacity_["african"]=0;splash_['african']=0;fade_['african']=0;
opacity_["middleeast"]=0;splash_['middleeast']=0;fade_['middleeast']=0;
opacity_["india"]=0;splash_['india']=0;fade_['india']=0;
opacity_["canada"]=0;splash_['canada']=0;fade_['canada']=0;
opacity_["usa"]=0;splash_['usa']=0;fade_['usa']=0;
opacity_["australia"]=0;splash_['australia']=0;fade_['australia']=0;
opacity_["britain"]=0;splash_['britain']=0;fade_['britain']=0;
opacity_["islands"]=0;splash_['islands']=0;fade_['islands']=0;
opacity_["southamerica"]=0;splash_['southamerica']=0;fade_['southamerica']=0;
opacity_["neurope"]=0;splash_['neurope']=0;fade_['neurope']=0;
opacity_["germany"]=0;splash_['germany']=0;fade_['germany']=0;
opacity_["camerica"]=0;splash_['camerica']=0;fade_['camerica']=0;
opacity_["westeurope"]=0;splash_['westeurope']=0;fade_['westeurope']=0;
opacity_["easteurope"]=0;splash_['easteurope']=0;fade_['easteurope']=0;
opacity_["southeurope"]=0;splash_['southeurope']=0;fade_['southeurope']=0;
opacity_["asia"]=0;splash_['asia']=0;fade_['asia']=0;
opacity_["seasia"]=0;splash_['seasia']=0;fade_['seasia']=0;
opacity_["oceania"]=0;splash_['oceania']=0;fade_['oceania']=0;
opacity_["sng"]=0;splash_['sng']=0;fade_['sng']=0;
opacity_["arussia"]=0;splash_['arussia']=0;fade_['arussia']=0;
opacity_["erussia"]=0;splash_['erussia']=0;fade_['erussia']=0;

function changeLogos1() {
if(Counter1<(sbornpic1.length-1)){
Counter1++;
}else{
Counter1=0;
}
chlogo1.innerHTML='<a href=/companies/avia/'+sbornlink1[Counter1]+'/ class=linkss><img src=/download/'+sbornpic1[Counter1]+' width=80 height=40 border=0 title="'+sborncode1[Counter1]+'-'+sbornname1[Counter1]+'"></a>';
setTimeout("changeLogos1()",2000);
}

function changeLogos2() {
if(Counter2<(sbornpic2.length-1)){
Counter2++;
}else{
Counter2=0;
}
chlogo2.innerHTML='<a href=/companies/avia/'+sbornlink2[Counter2]+'/ class=linkss><img src=/download/'+sbornpic2[Counter2]+' width=80 height=40 border=0 title="'+sborncode2[Counter2]+'-'+sbornname2[Counter2]+'"></a>';
setTimeout("changeLogos2()",2500);
}

function changeLogos3() {
if(Counter3<(sbornpic3.length-1)){
Counter3++;
}else{
Counter3=0;
}
chlogo3.innerHTML='<a href=/companies/avia/'+sbornlink3[Counter3]+'/ class=linkss><img src=/download/'+sbornpic3[Counter3]+' width=80 height=40 border=0 alt="'+sborncode3[Counter3]+'-'+sbornname3[Counter3]+'"></a>';
setTimeout("changeLogos3()",2000);
}


function changeLogos6() {
if(Counter6<(sbornpic6.length-1)){
Counter6++;
}else{
Counter6=0;
}
chlogo6.innerHTML='<a href=/companies/avia/'+sbornlink6[Counter6]+'/ class=linkss><img src=/download/'+sbornpic6[Counter6]+' width=80 height=40 border=0 alt="'+sborncode6[Counter6]+'-'+sbornname6[Counter6]+'"></a>';
setTimeout("changeLogos6()",2500);
}

function changeLogos5() {
if(Counter5<(sbornpic5.length-1)){
Counter5++;
}else{
Counter5=0;
}
chlogo5.innerHTML='<a href=/companies/avia/'+sbornlink5[Counter5]+'/ class=linkss><img src=/download/'+sbornpic5[Counter5]+' width=80 height=40 border=0 alt="'+sborncode5[Counter5]+'-'+sbornname5[Counter5]+'"></a>';
setTimeout("changeLogos5()",2500);
}


function doSendTourist() {
if (document.sendform.forg.value=='') {
alert('Не указано название организации.');
document.sendform.forg.focus();
return false;
}
if (document.sendform.fphone.value=='') {
alert('Не указан контактный телефон.');
document.sendform.fphone.focus();
return false;
}
bnum = document.getElementsByName('fout[]'); 
for (i = 0; i < bnum.length; i++){ 
if (bnum[i].value=='') {
alert('Не указан пункт вылета.');
bnum[i].focus();
return false;
}}
bnum = document.getElementsByName('fin[]'); 
for (i = 0; i < bnum.length; i++){ 
if (bnum[i].value=='') {
alert('Не указан пункт прилета.');
bnum[i].focus();
return false;
}}
bnum = document.getElementsByName('fdate[]'); 
for (i = 0; i < bnum.length; i++){ 
if (bnum[i].value=='') {
alert('Не указана дата вылета.');
bnum[i].focus();
return false;
}}
bnum = document.getElementsByName('fklass[]'); 
for (i = 0; i < bnum.length; i++){ 
if (bnum[i].value=='') {
alert('Не указан класс.');
bnum[i].focus();
return false;
}}
bnum = document.getElementsByName('fpfio[]'); 
for (i = 0; i < bnum.length; i++){ 
if (bnum[i].value=='') {
alert('Не указаны ФИО пассажира.');
bnum[i].focus();
return false;
}}
document.sendform.submit();
}


function doSendZhd() {
if (document.sendzhd.ffio.value=='') {
alert('Не указано ФИО Заказчика.');
document.sendzhd.ffio.focus();
return false;
}
if (document.sendzhd.fphone.value=='') {
alert('Не указан контактный телефон.');
document.sendzhd.fphone.focus();
return false;
}
if (document.sendzhd.fotpr.value=='') {
alert('Не указана станция отправления.');
document.sendzhd.fotpr.focus();
return false;
}
if (document.sendzhd.fnazn.value=='') {
alert('Не указана станция прибытия.');
document.sendzhd.fnazn.focus();
return false;
}
if (document.sendzhd.fdotpr.value=='') {
alert('Не указана дата отправления.');
document.sendzhd.fdotpr.focus();
return false;
}
bnum = document.getElementsByName('fpfio[]'); 
for (i = 0; i < bnum.length; i++){ 
if (bnum[i].value=='') {
alert('Не указаны ФИО пассажира.');
bnum[i].focus();
return false;
}}
bnum = document.getElementsByName('fpseria[]'); 
for (i = 0; i < bnum.length; i++){ 
if (bnum[i].value=='') {
alert('Не указана серия документа.');
bnum[i].focus();
return false;
}}
bnum = document.getElementsByName('fpnumber[]'); 
for (i = 0; i < bnum.length; i++){ 
if (bnum[i].value=='') {
alert('Не указан номер документа.');
bnum[i].focus();
return false;
}}
document.sendzhd.submit();
}


function AddN(btn){ 
if(document.getElementById) { 
tr = btn; 
while (tr.tagName != 'DIV') tr = tr.parentNode; 
var idSuffix = Math.round(Math.random()*1000); 
var newTr = tr.parentNode.insertBefore(tr.cloneNode(true),tr.previousSibling); 
newTr.innerHTML = '<table width=100% cellspacing=0 cellpadding=0 border=0 bgcolor=#D5E5F4><tr><td valign=top class=btx style="padding-top:10;padding-left:20;" width=7% align=center><input name=nnum readonly style="background-color:#D5E5F4;width:20;border:solid 1px #D5E5F4;"></td><td valign=top class=btx style="padding-top:10;padding-left:10;" width=18%><input type=text class=mtx style="width:100%;" name="fout[]" value=""></td><td valign=top class=btx style="padding-top:10;padding-left:10;" width=18%><input type=text class=mtx style="width:100%;" name="fin[]" value=""></td><td valign=top class=btx style="padding-top:10;padding-left:10;" width=10%><input type=text class=mtx style="width:100%;" name="fdate[]" value=""></td><td valign=top class=btx style="padding-top:10;padding-left:10;" width=10%><input type=text class=mtx style="width:100%;" name="fklass[]" value=""></td><td valign=top class=btx style="padding-top:10;padding-left:10;" width=29%><input type=text class=mtx style="width:100%;" name="fcomp[]" value=""></td><td valign=top class=btx style="padding-top:10;padding-left:10;" width=8%><input type=button class=mtx value="-" onclick=DelN(this); name=drop></td></tr></table>'; 
} 
checkForLast(); 
}
function AddP(btn){ 
if(document.getElementById) { 
tr = btn; 
while (tr.tagName != 'DIV') tr = tr.parentNode; 
var idSuffix = Math.round(Math.random()*1000); 
var newTr = tr.parentNode.insertBefore(tr.cloneNode(true),tr.previousSibling); 
newTr.innerHTML = '<table width=100% cellspacing=0 cellpadding=0 border=0 bgcolor=#D5E5F4><tr><td valign=bottom class=btx style="padding-top:20;padding-left:20;" align=center width=7%>№</td><td valign=bottom class=btx style="padding-top:20;padding-left:10;" align=center width=50%>ФИО <span class=txtx>*</span> <span class=smmtx>(для международных перелетов по загранпаспорту)</span></td><td valign=bottom class=btx style="padding-top:20;padding-left:10;" align=center width=35%>Гражданство <span class=smmtx>(для граждан не РФ)</span></td><td valign=top class=btx style="padding-top:10;padding-left:10;" width=8%></td></tr></table><table width=100% cellspacing=0 cellpadding=0 border=0 bgcolor=#D5E5F4><tr><td valign=top class=btx style="padding-top:5;padding-left:20;" width=7% align=center><input name=snum readonly style="background-color:#D5E5F4;width:14;border:solid 1px #D5E5F4;"></td><td valign=top class=btx style="padding-top:5;padding-left:10;" width=50%><input type=text class=mtx style="width:100%;" name="fpfio[]" value=""></td><td valign=top class=btx style="padding-top:5;padding-left:10;" width=35%><input type=text class=mtx style="width:100%;" name="fgras[]" value=""></td><td valign=top class=btx style="padding-top:5;padding-left:10;" width=8%><input type=button class=mtx value="-" onclick=DelP(this); name=srop></td></tr></table><table width=100% cellspacing=0 cellpadding=0 border=0 bgcolor=#D5E5F4><tr><td width=7%></td><td valign=bottom class=btx style="padding-top:10;padding-left:10;" align=center width=31%>№ паспорта  <span class=smmtx>(загранпаспорта)</span> <span class=dtxtx>*</span></td><td valign=bottom class=btx style="padding-top:10;padding-left:10;" align=center width=19%>Дата рождения <span class=dtxtx>*</span></td><td valign=bottom class=btx style="padding-top:10;padding-left:10;" align=center width=35%>Срок действия загранпаспорта  <span class=dtxtx>*</span></td><td width=8%></td></tr></table><table width=100% cellspacing=0 cellpadding=0 border=0 bgcolor=#D5E5F4><tr><td valign=top class=btx style="padding-top:5;padding-left:20;" width=7% align=center></td><td valign=top class=btx style="padding-top:5;padding-left:10;" width=31%><input type=text class=mtx style="width:100%;" name="fnpass[]" value=""></td><td valign=top class=btx style="padding-top:5;padding-left:10;" width=19%><input type=text class=mtx style="width:100%;" name="fbirth[]" value=""></td><td valign=top class=btx style="padding-top:5;padding-left:10;" width=35%><input type=text class=mtx style="width:100%;" name="fsrok[]" value=""></td><td valign=top class=btx style="padding-top:5;padding-left:10;" width=8%></td></tr></table>'; 
} 
checkForLast2(); 
}

function AddZd(btn){ 
if(document.getElementById) { 
tr = btn; 
while (tr.tagName != 'DIV') tr = tr.parentNode; 
var idSuffix = Math.round(Math.random()*1000); 
var newTr = tr.parentNode.insertBefore(tr.cloneNode(true),tr.previousSibling); 
newTr.innerHTML = '<table width=100% cellspacing=0 cellpadding=0 border=0 bgcolor=#D5E5F4><tr><td valign=bottom class=btx style="padding-top:20;padding-left:20;" align=center width=7%>№</td><td valign=bottom class=btx style="padding-top:20;padding-left:10;" align=center width=32%>Фамилия, Имя, Отчество <span class=txtx>*</span></td><td valign=bottom class=btx style="padding-top:20;padding-left:10;" align=center width=30%>Документ <span class=txtx>*</span></td><td valign=bottom class=btx style="padding-top:20;padding-left:10;" align=center width=11%>Серия <span class=txtx>*</span></td><td valign=bottom class=btx style="padding-top:20;padding-left:10;" align=center width=12%>Номер <span class=txtx>*</span></td><td valign=top class=btx style="padding-top:10;padding-left:10;" width=8%></td></tr></table><table width=100% cellspacing=0 cellpadding=0 border=0 bgcolor=#D5E5F4><tr><td valign=top class=btx style="padding-top:5;padding-left:20;" width=7% align=center><input name=snum readonly style="background-color:#D5E5F4;width:14;border:solid 1px #D5E5F4;"></td><td valign=top class=btx style="padding-top:5;padding-left:10;" width=32%><input type=text class=mtx style="width:100%;" name="fpfio[]" value=""></td><td valign=top class=btx style="padding-top:5;padding-left:10;" width=30%><select type=text class=mtx style="width:100%;" name="fgras[]"><option value=\'паспорт РФ\'>паспорт РФ</option><option value=\'паспорт СССР\'>паспорт СССР</option><option value=\'загранпаспорт\'>загранпаспорт</option><option value=\'удостоверение личности\'>удостоверение личности</option><option value=\'свидетельство о рождении\'>свидетельство о рождении</option></select></td><td valign=top class=btx style="padding-top:5;padding-left:10;" width=11%><input type=text class=mtx style="width:100%;" name="fpseria[]" value=""></td><td valign=top class=btx style="padding-top:5;padding-left:10;" width=12%><input type=text class=mtx style="width:100%;" name="fpnumber[]" value=""></td><td valign=top class=btx style="padding-top:5;padding-left:10;" width=8%><input type=button class=mtx value="-" onclick=DelP(this); name=srop></td></tr></table>'; 
} 
checkForLast2(); 
}

function DelN(btn){ 
if(document.getElementById) { 
tr = btn; 
while (tr.tagName != 'DIV') tr = tr.parentNode; 
tr.parentNode.removeChild(tr); 
checkForLast(); 
} 
} 
function DelP(btn){ 
if(document.getElementById) { 
tr = btn; 
while (tr.tagName != 'DIV') tr = tr.parentNode; 
tr.parentNode.removeChild(tr); 
checkForLast2(); 
} 
} 
function checkForLast(){ 
btns = document.getElementsByName('drop'); 
bnum = document.getElementsByName('nnum'); 
for (i = 0; i < btns.length; i++){ 
btns[i].disabled = (btns.length == 1) ? true : false; 
bnum[i].value=i+1;
} 
}
function checkForLast2(){ 
btns = document.getElementsByName('srop'); 
bnum = document.getElementsByName('snum'); 
for (i = 0; i < btns.length; i++){ 
btns[i].disabled = (btns.length == 1) ? true : false; 
bnum[i].value=i+1;
} 
}
function doOpen(uurl) {
	var w = 600;
	var h = 600;
	var t = (document.body.clientHeight-h)/2;
	var l = (document.body.clientWidth-w)/2;
window.open(uurl,'subscribe','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+w+',height='+h+',left='+l+',top='+t);
}
function openTariff(tid){
if (window.mmap){mmap.close();} hei=(screen.height/2-200);widt=(screen.width/2-225);mmap=window.open('/show_tariff/'+tid+'/','mapp','width=450,height=400,screenX=0,screenY=0,left='+widt+',top='+hei+',scrollbars=no');mmap.focus();
}
function openNTariff(tid){
if (window.mmap){mmap.close();} hei=(screen.height/2-200);widt=(screen.width/2-225);mmap=window.open('/show_news_tariff/'+tid+'/','mapp','width=450,height=400,screenX=0,screenY=0,left='+widt+',top='+hei+',scrollbars=no');mmap.focus();
}
function send_to_friend(tid){
if (window.mmap){mmap.close();} hei=(screen.height/2-150);widt=(screen.width/2-200);mmap=window.open('/sendnews/'+tid+'/','mapp','width=400,height=300,screenX=0,screenY=0,left='+widt+',top='+hei+',scrollbars=no');mmap.focus();
}
function show_big_item(){
hei=(screen.height/2-170);wid=(screen.width/2-150);big_item=window.open("http://www.max-avia.ru/freewebcall.html","mapp","width=300,height=340,screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();
}


function setScroll(dest,current,wait){
if (current<=dest){
newdest=current+wait;
window.scrollTo(current,newdest);
setTimeout("setScroll("+dest+","+newdest+","+wait+")",0);
}
else{
if (count<numacties){count++;setTimeout(acti[count],0);return;}
}
}


function setScroll2(dest,current){
if (current>0){
newdest=current-0.5;
window.scrollTo(current,newdest);
setTimeout("setScroll2("+dest+","+newdest+")",0);
}
}

function framesize() 
{ 
alert(mainf.document.body.scrollHeight);
document.getElementById('mainf').style.height = mainf.document.body.scrollHeight; 
} 

function uCookie(){
document.getElementById('mainf').style.height=mainf.document.body.scrollHeight;
}


function MouseMove(stX,stY,endX,endY,speedM){
document.all["arrL"].style.visibility="visible";
if (endX>stX){wayX="LtoR";destX=endX-stX;} else{wayX="RtoL";destX=stX-endX;}
if (endY>stY){wayY="UtoD";destY=endY-stY;} else{wayY="DtoU";destY=stY-endY;}
if (destX>destY){speedX=speedM;speedY=(destY*speedM)/destX;}
else{speedY=speedM;speedX=(destX*speedM)/destY;}
setTimeout("RealMouseMove("+stX+","+stY+","+endX+","+endY+",'"+wayX+"','"+wayY+"',"+speedX+","+speedY+")",0);
}

function RealMouseMove(stX,stY,endX,endY,wayX,wayY,speedX,speedY){
if (wayX=="LtoR"){
if (stX>=endX){if (count<numacties){count++;setTimeout(acti[count],0);return;} else{return;}}
stX=stX+speedX;document.all["arrL"].style.left=stX;
}
if (wayX=="RtoL"){
if (stX<=endX){if (count<numacties){count++;setTimeout(acti[count],0);return;} else{return;}}
stX=stX-speedX;document.all["arrL"].style.left=stX;
}
if (wayY=="UtoD"){
if (stY>=endY){if (count<numacties){count++;setTimeout(acti[count],0);return;} else{return;}}
stY=stY+speedY;document.all["arrL"].style.top=stY;
}
if (wayY=="DtoU"){
if (stY<=endY){if (count<numacties){count++;setTimeout(acti[count],0);return;} else{return;}}
stY=stY-speedY;document.all["arrL"].style.top=stY;
}
setTimeout("RealMouseMove("+stX+","+stY+","+endX+","+endY+",'"+wayX+"','"+wayY+"',"+speedX+","+speedY+")",0);
}



//if (stX<endX){
//stX=stX+0.5;
//document.all["arrL"].style.left=stX;
//}
//if (stY<endY){
//stY=stY+1;
//document.all["arrL"].style.top=stY;
//}
//setTimeout("MouseMove("+stX+","+stY+","+endX+","+endY+",1)",0);
//}

function checkString(enterStr){
if(enterStr!="" && enterStr!=null){
var reg_chr_all = /^([0-9A-ZА-Я]+)$/;
var reg_chr = /^([0-9A-Z]+)$/;
var reg_chr_rus = /^([0-9А-Я]+)$/;
if(!reg_chr_all.test(enterStr)){errorTx.className="atick2";}
else{
errorTx.className="atick";
if(!reg_chr.test(enterStr) && !reg_chr_rus.test(enterStr)){errorTx2.className="atick2";} else{errorTx2.className="atick";}
}
}
}

function checkF3F10(){
var reg_chr_all = /^([0-9]+)$/;
if ((document.getElementById("f3").value!="" && document.getElementById("f3").value!=null && !reg_chr_all.test(document.getElementById("f3").value)) || (document.getElementById("f6").value!="" && document.getElementById("f6").value!=null && !reg_chr_all.test(document.getElementById("f6").value)) || (document.getElementById("f8").value!="" && document.getElementById("f8").value!=null && !reg_chr_all.test(document.getElementById("f8").value)) || (document.getElementById("f10").value!="" && document.getElementById("f10").value!=null && !reg_chr_all.test(document.getElementById("f10").value))){errorTx3.className="atick2";} else{errorTx3.className="atick";}
}

function f3Check(enterStr,kcode){
if (enterStr.length>=3){document.getElementById("f6").focus();}
this.checkF3F10();
}

function f6Check(enterStr,kcode){
if (f6stat==0 && kcode==8){
document.getElementById("f3").value=document.getElementById("f3").value.substring(0,2);
if (navigator.appName == "MSIE" || navigator.appName == "Microsoft Internet Explorer"){
var r=document.getElementById("f3").createTextRange();
r.collapse(false);
r.select();
}
else{
var end = document.getElementById("f3").value.length;
document.getElementById("f3").setSelectionRange(end,end);
document.getElementById("f3").focus();
}
}
if (enterStr.length==0){f6stat=0;}
else{f6stat=1;}
if (enterStr.length>=3){document.getElementById("f8").focus();}
this.checkF3F10();
}

function f8Check(enterStr,kcode){
if (f8stat==0 && kcode==8){
document.getElementById("f6").value=document.getElementById("f6").value.substring(0,2);
if (navigator.appName == "MSIE" || navigator.appName == "Microsoft Internet Explorer"){
var r=document.getElementById("f6").createTextRange();
r.collapse(false);
r.select();
}
else{
var end = document.getElementById("f6").value.length;
document.getElementById("f6").setSelectionRange(end,end);
document.getElementById("f6").focus();
}
}
if (enterStr.length==0){f8stat=0;}
else{f8stat=1;}
if (enterStr.length>=2){document.getElementById("f10").focus();}
this.checkF3F10();
}

function f10Check(enterStr,kcode){
if (f10stat==0 && kcode==8){
document.getElementById("f8").value=document.getElementById("f8").value.substring(0,1);
if (navigator.appName == "MSIE" || navigator.appName == "Microsoft Internet Explorer"){
var r=document.getElementById("f8").createTextRange();
r.collapse(false);
r.select();
}
else{
var end = document.getElementById("f8").value.length;
document.getElementById("f8").setSelectionRange(end,end);
document.getElementById("f8").focus();
}
}
if (enterStr.length==0){f10stat=0;}
else{f10stat=1;}
this.checkF3F10();
}


function showAddShop(){
document.getElementById("AddShop").className="atick2";
}

function hideAddShop(){
document.getElementById("AddShop").className="atick";
}

function hideAddShop2(){
document.getElementById("EditShop").className="atick";
}

function askTables(){
if(document.getElementById("wtarif").checked==true){
document.getElementById("askTtables").className="atick2";
document.getElementById("padpad").className="padpad2";
}
else{
document.getElementById("askTtables").className="atick";
document.getElementById("padpad").className="padpad1";
}
}

function createSch(){
for (var i=0; i < document.senda.statbron.length; i++){
if (document.senda.statbron[i].checked) var statbron=document.senda.statbron[i].value;
}
//var reg_chr_all = /^([0-9]+)$/;
//if(reg_chr_all.test(document.getElementById("sumbron").value) && statbron==2){
if(statbron==2){
var innerHTM='';
innerHTM+='<table cellspacing=0 cellpadding=0 border=0>';
innerHTM+='<tr>';
var numsch=Math.ceil(document.getElementById("sumbron").value/14000);
var ostatok=document.getElementById("sumbron").value-((numsch-1)*14000);
ostatok=ostatok.toFixed(2);
for (ii=0;ii<numsch;ii++){
if (ii==3){innerHTM+='</tr><tr><td colspan=3 height=30></td></tr><tr>';}
innerHTM+='<td valign=top style="padding-left:15;pading-right:15;">';
innerHTM+='<table cellspacing=0 cellpadding=0 border=0>';
innerHTM+='<tr><td valign=top class=btx style="padding-top:3;"><b>Счет '+(ii+1)+'</b></td></tr>';
innerHTM+='<tr><td valign=top class=mtx style="padding-right:5;padding-top:15;">Сумма</td></tr>';
if (ii<(numsch-1)){innerHTM+='<tr><td valign=top><input type=text name=sum[] value="14000" class=mtx style="width:172;"></td></tr>';}
else{innerHTM+='<tr><td valign=top><input type=text name=sum[] value="'+ostatok+'" class=mtx style="width:172;"></td></tr>';}
innerHTM+='<tr><td valign=top class=mtx style="padding-top:15;">Назначение платежа</td></tr>';
innerHTM+='<tr><td valign=top><textarea name=plat[] rows=4 cols=30 class=mtx>Номер брони: '+document.getElementById("numbron").value+'\nна общую сумму '+document.getElementById("sumbron").value+' руб.\nСчет №'+(ii+1)+'\nПассажир: '+document.getElementById("fiobron").value+'</textarea></td></tr>';
innerHTM+='</table>';
innerHTM+='</td>';
}
innerHTM+='</tr>';
innerHTM+='</table>';
document.getElementById("scheta").innerHTML=innerHTM;
}
else{
document.getElementById("scheta").innerHTML='';
}
}


function getXmlHttp(){
  var xmlhttp;
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
      xmlhttp = false;
    }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
}


function formExpress(){
var from = document.getElementById("from").value;
var to = document.getElementById("to").value;
var day1 = document.getElementById("day1").value;
var month1 = document.getElementById("month1").value;


var req = getXmlHttp();
req.onreadystatechange = function() {  
// onreadystatechange активируется при получении ответа сервера
if (req.readyState == 4) { 
// если запрос закончил выполняться
//statusElem.innerHTML = req.statusText // показать статус (Not Found, ОК..)
if(req.status == 200) { 
// если статус 200 (ОК) - выдать ответ пользователю
if (req.responseText.length>0){
document.getElementById("trainform").innerHTML=req.responseText;
trainsend.submit();
}
}
// тут можно добавить else с обработкой ошибок запроса
}
}
// (3) задать адрес подключения
req.open('GET', '/express.php?from='+encodeURI(from)+'&to='+encodeURI(to)+'&day1='+day1+'&month1='+month1, true);  

// объект запроса подготовлен: указан адрес и создана функция onreadystatechange
// для обработки ответа сервера
// (4)
req.send(null);  // отослать запрос
}

function getAuto_zhd(str,id){
if (str.length>0){
var req = getXmlHttp();

req.onreadystatechange = function() {  
// onreadystatechange активируется при получении ответа сервера
if (req.readyState == 4) { 
// если запрос закончил выполняться
//statusElem.innerHTML = req.statusText // показать статус (Not Found, ОК..)
if(req.status == 200) { 
// если статус 200 (ОК) - выдать ответ пользователю
document.getElementById("loc"+id).innerHTML=req.responseText;
if (req.responseText.length>0){
document.getElementById("loc"+id).className="loc";
if (id==6){loc6opened=1;}
if (id==7){loc7opened=1;}
setTimeout("locOpenState("+id+")",5);
}
else{
document.getElementById("loc"+id).className="atick";
}
}
// тут можно добавить else с обработкой ошибок запроса
}
}
// (3) задать адрес подключения
req.open('GET', '/getAuto_zhd.php?str='+encodeURI(str)+"&id="+id, true);  

// объект запроса подготовлен: указан адрес и создана функция onreadystatechange
// для обработки ответа сервера
// (4)
req.send(null);  // отослать запрос
}
else{
document.getElementById("loc"+id).className="atick";
}
}

function locOpenState(id){
if(id==1){loc1opened=2;}
if(id==2){loc2opened=2;}
if(id==3){loc3opened=2;}
if(id==4){loc4opened=2;}
if(id==5){loc5opened=2;}
if(id==6){loc6opened=2;}
if(id==9){allsopened=2;}
if(id==10){iframeopened=2;}
}

function closeFunction(){
if (loc1opened==2){document.getElementById("loc1").className = "shownone"; loc1opened=0;}
if (loc2opened==2){document.getElementById("loc2").className = "shownone"; loc2opened=0;}
if (loc3opened==2){document.getElementById("loc3").className = "shownone"; loc3opened=0;}
if (loc4opened==2){document.getElementById("loc4").className = "shownone"; loc4opened=0;}
if (loc5opened==2){document.getElementById("loc5").className = "shownone"; loc5opened=0;}
if (loc6opened==2){document.getElementById("loc6").className = "shownone"; loc6opened=0;}
if (fonopened==2){document.getElementById("ipfon").className = "atick"; fonopened=0;}
if (allsopened==2){document.getElementById("alls").className = "atick"; allsopened=0;}
}

function closeIpTel(){
if (fonopened==2){document.getElementById("ipfon").className = "atick"; fonopened=0;}
fonclosed=2;
}


function showLayer(layer){
var h3=parseInt(document.getElementById("llayer"+layer).style.height);
if (h3==1){setTimeout("openLayer("+layer+")",1);}
else{setTimeout("closeLayer("+layer+")",1);}
}

function openLayer(layer){
var h=parseInt(document.getElementById("llayer"+layer).style.height);
var h2=parseInt(document.getElementById("layer"+layer).offsetHeight);
if (h<h2){
h=h+10;
if (h>h2){h=h2;}
document.getElementById("llayer"+layer).style.height=h;
setTimeout("openLayer("+layer+")",1);
}
}

function closeLayer(layer){
var h=parseInt(document.getElementById("llayer"+layer).style.height);
if (h>1){
h=h-10;
if (h<1){h=1;}
document.getElementById("llayer"+layer).style.height=h;
setTimeout("closeLayer("+layer+")",1);
}
}

function ipOn(){
}

function ipOff(){
}

function showIp(){
var req = getXmlHttp();
req.onreadystatechange = function() {  
if (req.readyState == 4) { 
if(req.status == 200) { 
document.getElementById("ipfon").innerHTML=req.responseText;
document.getElementById("ipfon").className="atick2";
fonopened=1;
fonclosed=1;
setTimeout("fonOpenState()",5);
}
}
}
req.open('GET', '/freewebcall.php', true);  
req.send(null);  // отослать запрос
}

function fonOpenState(){
fonopened=2;
}

function doNotClose(){
if (fonclosed==1){
document.getElementById("ipfon").className="atick2";
fonopened=1;
setTimeout("fonOpenState()",5);
}
}

function moveDiv(id){
if (id==1){
moveC=0;
opacity=1;
document.getElementById("mmtable").style.width=document.getElementById("mmain").offsetWidth;
//alert(document.getElementById("mmbg").height);
//diffLayers=4;
setTimeout("moveAvia()",1);
}
}

function moveDivBack(id){
moveC=0;
opacity=1;
document.getElementById("aatable").style.width=document.getElementById("aavia").offsetWidth;
//document.getElementById("aavia").style.width=1000;
//document.getElementById("aavia").scrollLeft=200;
//alert(document.getElementById("aavia").offsetWidth);
setTimeout("moveAviaBack()",1);
}


function moveAvia(){
var currentLeft=document.getElementById("mmain").scrollLeft;
var currentWidth=document.getElementById("mmain").offsetWidth;
var currentHeight=parseInt(document.getElementById("mmbg").style.height);
opacity=opacity-0.1;
document.getElementById("mmain").style.width=currentWidth-20;
document.getElementById("mmain").scrollLeft=currentLeft+20;
if (opacity>0){
document.getElementById("mmain").style.opacity=opacity;
document.getElementById("mmain").style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+(opacity*100)+")";
}
if (moveC<10){
document.getElementById("mmbg").style.height=currentHeight+4;
moveC++;
setTimeout("moveAvia()",1);
}
else{
document.getElementById("mmain").className="atick";
document.getElementById("aavia").className="atick2";
document.getElementById("moveBack").className="atick2";
document.getElementById("mmain").scrollLeft=0;
document.getElementById("mmain").style.width="100%";
document.getElementById("mmain").style.opacity=1;
document.getElementById("mmain").style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=100)";
}
}


function moveAviaBack(){
var currentLeft=parseInt(document.getElementById("aavia").style.paddingLeft);
var currentWidth=document.getElementById("aavia2").offsetWidth;
var currentHeight=parseInt(document.getElementById("mmbg").style.height);
opacity=opacity-0.1;
document.getElementById("aavia2").style.width=currentWidth-20;
document.getElementById("aavia").style.paddingLeft=currentLeft+20;
if (opacity>0){
document.getElementById("aavia").style.opacity=opacity;
document.getElementById("aavia").style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+(opacity*100)+")";
}
if (moveC<10){
document.getElementById("mmbg").style.height=currentHeight-4;
moveC++;
setTimeout("moveAviaBack()",1);
}
else{
document.getElementById("aavia").className="atick";
document.getElementById("aavia").style.paddingLeft=0;
document.getElementById("aavia2").style.width="100%";
document.getElementById("aavia").style.opacity=1;
document.getElementById("aavia").style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=100)";
document.getElementById("mmain").className="atick2";
document.getElementById("moveBack").className="atick";
}
}


function getAuto(str,id){
if (str.length>1){
var req = getXmlHttp();

req.onreadystatechange = function() {  
// onreadystatechange активируется при получении ответа сервера
if (req.readyState == 4) { 
// если запрос закончил выполняться
//statusElem.innerHTML = req.statusText // показать статус (Not Found, ОК..)
if(req.status == 200) { 
// если статус 200 (ОК) - выдать ответ пользователю
document.getElementById("loc"+id).innerHTML=req.responseText;
if (req.responseText.length>0){
if (id==1){document.getElementById("loc"+id).className="loc";}
else{document.getElementById("loc"+id).className="loc_";}
if (id==1){loc1opened=1;}
if (id==2){loc2opened=1;}
setTimeout("locOpenState("+id+")",5);
}
else{
document.getElementById("loc"+id).className="shownone";
}
}
// тут можно добавить else с обработкой ошибок запроса
}
}
// (3) задать адрес подключения
req.open('GET', '/getAuto.php?str='+encodeURI(str)+"&id="+id, true);  

// объект запроса подготовлен: указан адрес и создана функция onreadystatechange
// для обработки ответа сервера
// (4)
req.send(null);  // отослать запрос
}
else{
document.getElementById("loc"+id).className="shownone";
}
}

function doSub(city,country,id){
if(id==1){document.getElementById("B_LOCATION_1").value=city;document.getElementById("fromC").value=country;}
if(id==2){document.getElementById("E_LOCATION_1").value=city;document.getElementById("toC").value=country;}
if(id==3){document.getElementById("origin-city-name").value=city;}
if(id==4){document.getElementById("destination-city-name").value=city;}
if(id==5){document.getElementById("from").value=city;}
if(id==6){document.getElementById("to").value=city;}
document.getElementById("loc"+id).className="shownone";
}

function doSubSm(city,id){
if(id==6){document.getElementById("from").value=city;}
if(id==7){document.getElementById("to").value=city;}
document.getElementById("loc"+id).className="atick";
}


function showAlls(){
document.getElementById("alls").className="atick2";
allsopened=1;
setTimeout("locOpenState(9)",5);
}


function showAviaForm(id)
{
var xScroll, yScroll;

if (window.innerHeight && window.scrollMaxY) { 
xScroll = document.body.scrollWidth;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}

var windowWidth, windowHeight;
if (self.innerHeight) { // all except Explorer
windowWidth = self.innerWidth;
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
} 

// for small pages with total height less then height of the viewport
if(yScroll < windowHeight){
pageHeight = windowHeight;
} else { 
pageHeight = yScroll;
}

// for small pages with total width less then width of the viewport
if(xScroll < windowWidth){ 
pageWidth = windowWidth;
} else {
pageWidth = xScroll;
}

document.getElementById("AviaFormWait").style.height = pageHeight + "px";
document.getElementById("AviaFormWait").style.display = "block";
document.getElementById("AviaFormContent").style.display = "block";
document.getElementById("AviaFormContent").style.top=(document.body.clientHeight/2-200)+document.body.scrollTop;
document.body.style.overflow="hidden";
//alert(document.body.scrollTop);
}

function showIframe(){
var xScroll, yScroll;

if (window.innerHeight && window.scrollMaxY) { 
xScroll = document.body.scrollWidth;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}

var windowWidth, windowHeight;
if (self.innerHeight) { // all except Explorer
windowWidth = self.innerWidth;
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
} 

// for small pages with total height less then height of the viewport
if(yScroll < windowHeight){
pageHeight = windowHeight;
} else { 
pageHeight = yScroll;
}

// for small pages with total width less then width of the viewport
if(xScroll < windowWidth){ 
pageWidth = windowWidth;
} else {
pageWidth = xScroll;
}

document.getElementById("AviaFormWait").style.height = pageHeight + "px";
document.getElementById("AviaFormWait").style.display = "block";
document.getElementById("AviaFormContent").style.display = "block";
document.getElementById("AviaFormContent").style.top=(document.body.clientHeight/2-200)+document.body.scrollTop;
document.body.style.overflow="hidden";
document.getElementById("AviaFormInside").style.height=document.body.clientHeight-40;
document.getElementById("AviaFormContent").style.top=document.body.scrollTop+10;
document.getElementById("AviaFormInside").bgColor="#91BEDD";
document.getElementById("AviaFormInside").style.border="solid 2px #FFFFFF";
document.getElementById("AviaFormInside").innerHTML='<iframe frameborder="0" src="" id=aviaEngine name=aviaEngine class=atick width=100% height='+(document.body.clientHeight-76)+' style="border:solid 2px white;"></iframe><div id=AvPreload><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="100%" height='+(document.body.clientHeight-76)+' id="maxavia" ALIGN="" alt="Расписание рейсов, бронирование on-line"><PARAM NAME=movie VALUE="/img/preload3.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#D8DEEC> <EMBED src="/img/preload3.swf" quality=high bgcolor=#D8DEEC  WIDTH="100%" height='+(document.body.clientHeight-76)+' NAME="maxavia" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT></div>';
var chooseA=document.getElementsByName("chooseA");
if (chooseA[0].checked==true){document.getElementById("amadeuSend").action='/clickandfly.php';}
else{document.getElementById("amadeuSend").action='/amadeusAIE.php';}
document.amadeuSend.submit();
setTimeout("preloaderClose()",5000);
setTimeout("locOpenState(10)",5);
}



function showIframeZZ(){
var xScroll, yScroll;

if (window.innerHeight && window.scrollMaxY) { 
xScroll = document.body.scrollWidth;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}

var windowWidth, windowHeight;
if (self.innerHeight) { // all except Explorer
windowWidth = self.innerWidth;
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
} 

// for small pages with total height less then height of the viewport
if(yScroll < windowHeight){
pageHeight = windowHeight;
} else { 
pageHeight = yScroll;
}

// for small pages with total width less then width of the viewport
if(xScroll < windowWidth){ 
pageWidth = windowWidth;
} else {
pageWidth = xScroll;
}

document.getElementById("AviaFormWait").style.height = pageHeight + "px";
document.getElementById("AviaFormWait").style.display = "block";
document.getElementById("AviaFormContent").style.display = "block";
document.getElementById("AviaFormContent").style.top=(document.body.clientHeight/2-200)+document.body.scrollTop;
document.body.style.overflow="hidden";
document.getElementById("AviaFormInside").style.height=document.body.clientHeight-40;
document.getElementById("AviaFormContent").style.top=document.body.scrollTop+10;
document.getElementById("AviaFormInside").bgColor="#91BEDD";
document.getElementById("AviaFormInside").style.border="solid 2px #FFFFFF";
document.getElementById("AviaFormInside").innerHTML='<iframe frameborder="0" src="" id=aviaEngine name=aviaEngine class=atick width=100% height='+(document.body.clientHeight-76)+' style="border:solid 2px white;"></iframe><div id=AvPreload><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="100%" height='+(document.body.clientHeight-76)+' id="maxavia" ALIGN="" alt="Расписание рейсов, бронирование on-line"><PARAM NAME=movie VALUE="/img/preload3.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#D8DEEC> <EMBED src="/img/preload3.swf" quality=high bgcolor=#D8DEEC  WIDTH="100%" height='+(document.body.clientHeight-76)+' NAME="maxavia" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT></div>';
document.getElementById("amadeuSend").action='/epower.php';
document.amadeuSend.submit();
setTimeout("preloaderClose()",10000);
setTimeout("locOpenState(10)",5);
}




function showIschedule(){
var xScroll, yScroll;

if (window.innerHeight && window.scrollMaxY) { 
xScroll = document.body.scrollWidth;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}

var windowWidth, windowHeight;
if (self.innerHeight) { // all except Explorer
windowWidth = self.innerWidth;
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
} 

// for small pages with total height less then height of the viewport
if(yScroll < windowHeight){
pageHeight = windowHeight;
} else { 
pageHeight = yScroll;
}

// for small pages with total width less then width of the viewport
if(xScroll < windowWidth){ 
pageWidth = windowWidth;
} else {
pageWidth = xScroll;
}

document.getElementById("AviaFormWait").style.height = pageHeight + "px";
document.getElementById("AviaFormWait").style.display = "block";
document.getElementById("AviaFormContent").style.display = "block";
document.getElementById("AviaFormContent").style.top=(document.body.clientHeight/2-200)+document.body.scrollTop;
document.body.style.overflow="hidden";
document.getElementById("AviaFormInside").style.height=document.body.clientHeight-40;
document.getElementById("AviaFormContent").style.top=document.body.scrollTop+10;
document.getElementById("AviaFormInside").bgColor="#91BEDD";
document.getElementById("AviaFormInside").style.border="solid 2px #FFFFFF";
document.getElementById("AviaFormInside").innerHTML='<iframe frameborder="0" src="http://www.amadeusepower.com/max_avia/Portals/max_avia/flightschedulesearch.aspx" id=aviaEngine name=aviaEngine class=atick2 width=100% height='+(document.body.clientHeight-76)+' style="border:solid 2px white;"></iframe>';
setTimeout("preloaderClose()",5000);
setTimeout("locOpenState(10)",5);
}


function showItariff(city,param){
var xScroll, yScroll;

if (window.innerHeight && window.scrollMaxY) { 
xScroll = document.body.scrollWidth;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}

var windowWidth, windowHeight;
if (self.innerHeight) { // all except Explorer
windowWidth = self.innerWidth;
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
} 

// for small pages with total height less then height of the viewport
if(yScroll < windowHeight){
pageHeight = windowHeight;
} else { 
pageHeight = yScroll;
}

// for small pages with total width less then width of the viewport
if(xScroll < windowWidth){ 
pageWidth = windowWidth;
} else {
pageWidth = xScroll;
}

document.getElementById("AviaFormWait").style.height = pageHeight + "px";
document.getElementById("AviaFormWait").style.display = "block";
document.getElementById("AviaFormContent").style.display = "block";
document.getElementById("AviaFormContent").style.top=(document.body.clientHeight/2-200)+document.body.scrollTop;
document.body.style.overflow="hidden";
document.getElementById("AviaFormInside").style.height=document.body.clientHeight-40;
document.getElementById("AviaFormContent").style.top=document.body.scrollTop+10;
document.getElementById("AviaFormInside").bgColor="#91BEDD";
document.getElementById("AviaFormInside").style.border="solid 2px #FFFFFF";
document.getElementById("AviaFormInside").innerHTML='<iframe frameborder="0" src="https://www.amadeusepower.com/max_avia/Portals/max_avia/FlightFareSearch.aspx?External_FlightSearchTypeByProvider=AmadeusAndExtProviders&IsExternalAccess=true&Culture=ru-RU&External_FlightFareSearch_SearchType=RoundTrip&External_FlightFareSearch_To='+city+'&External_FlightFareSearch_From=MOW&External_FlightFareSearch_FlightClass='+param+'" id=aviaEngine name=aviaEngine class=atick2 width=100% height='+(document.body.clientHeight-76)+' style="border:solid 2px white;"></iframe>';
setTimeout("preloaderClose()",5000);
setTimeout("locOpenState(10)",5);
}




function preloaderClose(){
document.getElementById("AvPreload").className="atick";
document.getElementById("aviaEngine").className="atick2";
}

function changeAvTxt(id){
if (id==1){
document.getElementById("AvTxt").innerHTML='Вам будет предложено до 20 самых дешевых вариантов перелета, которые есть в наличии на момент бронирования.<br><br>Если предложенные цены высоки, значит, на запрашиваемые даты мест по дешевым тарифам нет,<br>или не выполняется правило применения дешевых тарифов<br>(например, бронирование не позднее 7/14 дней до вылета, Sunday Rule и др.),<br>попробуйте сделать запрос на  другие даты или пришлите нам <a href=/on_line/email/>запрос</a>.<br><br>Бронируя авиабилет  онлайн  или через наших агентов,  Вы соглашаетесь с  принятием условий  <a href=/oferta/>договора публичной оферты</a>.';
document.getElementById("AvOnly").className="atick2";
}
if (id==2){
document.getElementById("AvTxt").innerHTML='Если необходимо лететь ОПРЕДЕЛЕННЫМИ РЕЙСАМИ, воспользуйтесь данным алгоритмом.<br>Здесь сначала предлагается РАСПИСАНИЕ.  Вы выбираете нужные рейсы, после чего система рассчитывает<br>для них самую низкую стоимость с учетом наличия мест.<br><br>Для получения минимальной стоимости перелета «туда-обратно» старайтесь выбирать рейсы одной авиакомпании (альянса).<br><br>Бронируя авиабилет  онлайн  или через наших агентов,  Вы соглашаетесь с  принятием условий  <a href=/oferta/>договора публичной оферты</a>.';
document.getElementById("AvOnly").className="atick";
}
}

function closeAvia(){
document.getElementById("AviaFormWait").style.display = "none";
document.getElementById("AviaFormContent").style.display = "none";
document.body.style.overflow="auto";
iframeopened=0;
}

function setToursHeight(){
document.getElementById("minprices").style.height=window.frames["minprices"].document.body.scrollHeight;
}

function showMapOver(id){
if (id==1){var mapName='african';}
if (id==2){var mapName='middleeast';}
if (id==3){var mapName='india';}
if (id==4){var mapName='canada';}
if (id==5){var mapName='usa';}
if (id==6){var mapName='australia';}
if (id==7){var mapName='britain';}
if (id==8){var mapName='islands';}
if (id==9){var mapName='southamerica';}
if (id==10){var mapName='neurope';}
if (id==11){var mapName='germany';}
if (id==12){var mapName='camerica';}
if (id==13){var mapName='westeurope';}
if (id==14){var mapName='easteurope';}
if (id==15){var mapName='southeurope';}
if (id==16){var mapName='asia';}
if (id==17){var mapName='seasia';}
if (id==18){var mapName='oceania';}
if (id==19){var mapName='sng';}
if (id==20){var mapName='arussia';}
if (id==21){var mapName='erussia';}
document.getElementById(mapName).style.opacity=opacity_[mapName];
document.getElementById(mapName).style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+(opacity_[mapName]*100)+")";
document.getElementById(mapName).style.display='block';
setTimeout("splash('"+mapName+"')",1);
}

function hideMapOver(id){
if (id==1){var mapName='african';}
if (id==2){var mapName='middleeast';}
if (id==3){var mapName='india';}
if (id==4){var mapName='canada';}
if (id==5){var mapName='usa';}
if (id==6){var mapName='australia';}
if (id==7){var mapName='britain';}
if (id==8){var mapName='islands';}
if (id==9){var mapName='southamerica';}
if (id==10){var mapName='neurope';}
if (id==11){var mapName='germany';}
if (id==12){var mapName='camerica';}
if (id==13){var mapName='westeurope';}
if (id==14){var mapName='easteurope';}
if (id==15){var mapName='southeurope';}
if (id==16){var mapName='asia';}
if (id==17){var mapName='seasia';}
if (id==18){var mapName='oceania';}
if (id==19){var mapName='sng';}
if (id==20){var mapName='arussia';}
if (id==21){var mapName='erussia';}
setTimeout("fade('"+mapName+"')",1);
}



function splash(id){
if (splash_[id]==0){
var opacity=opacity_[id];
splash_[id]=1;
fade_[id]=0;
document.getElementById(id+'link').className='mmap_new_white';
document.getElementById(id+'pic').src='/img/two_.gif';
setTimeout("showSplash('"+id+"',"+opacity+")",1);
}
}

function showSplash(id,opacity){
if (opacity<1 && splash_[id]==1){
opacity=opacity+0.05;
document.getElementById(id).style.opacity=opacity;
document.getElementById(id).style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+(opacity*100)+")";
opacity_[id]=opacity;
setTimeout("showSplash('"+id+"',"+opacity+")",1);
}
else{
splash_[id]=0;
}
}

function fade(id){
if (fade_[id]==0){
opacity=opacity_[id];
fade_[id]=1;
splash_[id]=0;
document.getElementById(id+'link').className='mmap_new';
document.getElementById(id+'pic').src='/img/two.gif';
setTimeout("showFade('"+id+"',"+opacity+")",1);
}
}

function showFade(id,opacity){
if (opacity>0 && fade_[id]==1){
opacity=opacity-0.05;
document.getElementById(id).style.opacity=opacity;
document.getElementById(id).style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+(opacity*100)+")";
opacity_[id]=opacity;
setTimeout("showFade('"+id+"',"+opacity+")",1);
}
else{
document.getElementById(id).style.opacity=0;
document.getElementById(id).style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)";
fade_[id]=0;
}
}

function checkBooking(){
var req = getXmlHttp();
req.onreadystatechange = function() {  
if (req.readyState == 4) { 
if(req.status == 200) { 

document.getElementById("bookresult").innerHTML=req.responseText;

}
}
}
req.open('GET', '/getBooking.php?bronid='+encodeURI(document.getElementById("bronid").value)+'&manid='+encodeURI(document.getElementById("manid").value), true);  
req.send(null);  // отослать запрос
}

function subscribeNews(){
document.getElementById("messNews").className="shownone";
document.getElementById("subNews").innerHTML='<table cellspacing=0 cellpadding=0 border=0><td valign=center><img src=/img/ajax.gif width=34 height=34></td><td valign=center class=tzag style="padding-left:10px;">отправка данных</td></table>';
setTimeout("subscribeRealNews()",500);
}

function subscribeRealNews(){
if (document.getElementById("subscriber").value=='' || document.getElementById("subscriber").value==''){
document.getElementById("subNews").innerHTML='';
document.getElementById("messNews").innerHTML='<span class=redtx>Не указан или неверно указан адрес электронной почты</span>';
document.getElementById("messNews").className="atick2";
}
else if (document.getElementById("wnews").checked==false && document.getElementById("wtarif").checked==false){
document.getElementById("subNews").innerHTML='';
document.getElementById("messNews").innerHTML='<span class=redtx>К сожалению, Вы не указали рассылку, которую хотите получать.<br>Отметьте, пожалуйста, &laquo;галочками&raquo; новостную рассылку и (или) информацию по тарифам.</span>';
document.getElementById("messNews").className="atick2";
}
else{
var req = getXmlHttp();
req.onreadystatechange = function() {  
if (req.readyState == 4) { 
if(req.status == 200) {
document.getElementById("mySubscribe").innerHTML=req.responseText;
}
}
}

if (document.getElementById("wnews").checked==true){var wnews=1;} else{var wnews=0;}
if (document.getElementById("wtarif").checked==true){var wtarif=1;} else{var wtarif=0;}

req.open('GET', '/subscribe.php?mailer='+encodeURI(document.getElementById("subscriber").value)+'&wnews='+encodeURI(wnews)+'&wtarif='+encodeURI(wtarif), true);  
req.send(null);
}
}

function sizeCheck(){
var sizeTd=document.getElementsByName("sizeTd");
var sizeW=document.body.clientWidth;
if (sizeW>1800){
for (ii=0;ii<sizeTd.length;ii++){
sizeTd[ii].style.width="60%";
}
}
else if (sizeW>1600){
for (ii=0;ii<sizeTd.length;ii++){
sizeTd[ii].style.width="70%";
}
}
else{
for (ii=0;ii<sizeTd.length;ii++){
sizeTd[ii].style.width="95%";
}
}
this.bnNumCheck();
}


function bnNumCheck(){
var sizeW=document.body.clientWidth;
var allLength=0; var realLength=0;
var bnNum=document.getElementsByName("maxaviaBn");
for (ii=0;ii<bnNum.length;ii++){
allLength=allLength+316;
if (allLength<sizeW){realLength=realLength+316;}
}
document.getElementById("maxBnDiv").style.width=realLength+'px';
//document.getElementById("maxCalc").innerHTML=sizeW+':'+allLength;
}
