function showWindow(val,obj,X){
obj.src="/img/win"+val+X+".gif";
if (val<4){obj.height=100;}
else{obj.height=170;}
}

function doRolik(){
if (window.big_item){big_item.close();}
hei=((screen.height-288)/2-30);wid=((screen.width-360)/2);big_item=window.open("/rolik/","mapp","width=350,height=278,screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();
}

function moveban(){
//topbar.x=((document.body.clientWidth)/2)-10;
}

function moveRolik(){
//topbar.style.left=document.body.clientWidth/2-20;
//topbar.className="fulldisp";
}


function showArc(){
if (document.all.isarc.checked){
document.all.wtarc.src="/img/arc.gif";
document.all.wtarc.height=70;
document.all.wtarc.width=142;
}
else{
document.all.wtarc.src="/img/null.gif";
document.all.wtarc.height=1;
document.all.wtarc.width=1;
}}

function showArc2(){
if (document.all.isarc.checked){
document.all.wtarc.src="/img/arc3.gif";
document.all.wtarc.height=35;
document.all.wtarc.width=70;
}
else{
document.all.wtarc.src="/img/null.gif";
document.all.wtarc.height=1;
document.all.wtarc.width=1;
}}

function CallMeasure(){
if (window.big_item){big_item.close();}
hei=((screen.height-430)/2-30);wid=((screen.width-400)/2);big_item=window.open("/online/","mapp","width=400,height=430,screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();
}

function CallMeasure2(){
if (window.big_item){big_item.close();}
hei=((screen.height-430)/2-30);wid=((screen.width-400)/2);big_item=window.open("/online2/","mapp","width=400,height=430,screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();
}

function perehod(){
if (navigator.appName.indexOf("Microsoft") != -1){document.all.special.movie="/img/perehod.swf";}
else{document.all.mspecial.innerHTML = '<EMBED src="/img/perehod.swf" quality=high scale=noborder wmode=transparent WIDTH="306" HEIGHT="90" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" id="special" MAYSCRIPT></EMBED>';}
}

function showRollin(){
//perehod();
document.all.mwindow.GotoFrame(2);document.all.mwindow.Play();
//setTimeout("showRollin2()",900);
}

function showRollin2(){
//if (navigator.appName.indexOf("Microsoft") != -1){document.all.special.movie="/banners/special1.swf";}
//else{document.all.mspecial.innerHTML = '<EMBED src="/banners/special1.swf" quality=high scale=noborder wmode=transparent WIDTH="306" HEIGHT="90" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" id="special" MAYSCRIPT></EMBED>';}
}

function showRollout(){
document.all.mwindow.GotoFrame(36);document.all.mwindow.Play();
}

function showAcin(){
	var macc = document.getElementById('macc');
	macc.GotoFrame(2);document.all.macc.Play();
}

function showAcin2(){
//if (navigator.appName.indexOf("Microsoft") != -1){document.all.special.movie="/banners/special3.swf";}
//else{document.all.mspecial.innerHTML = '<EMBED src="/banners/special3.swf" quality=high scale=noborder wmode=transparent WIDTH="306" HEIGHT="90" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" id="special" MAYSCRIPT></EMBED>';}
}


function showDoorin(){
var mdoor = document.getElementById('mdoor');
if (mdoor.IsPlaying()==false){
	mdoor.GotoFrame(1);
	mdoor.Play();
}
else{
	setTimeout("showDoorin()",300);
}
}

function showDoorin2(){
//if (navigator.appName.indexOf("Microsoft") != -1){document.all.special.movie="/banners/special2.swf";}
//else{document.all.mspecial.innerHTML = '<EMBED src="/banners/special2.swf" quality=high scale=noborder wmode=transparent WIDTH="306" HEIGHT="90" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" id="special" MAYSCRIPT></EMBED>';}
}

function showDoorout(){
var mdoor = document.getElementById('mdoor');
if (mdoor.IsPlaying()==false){
	mdoor.GotoFrame(9);
	mdoor.Play();
}
else{setTimeout("showDoorout()",900);}
}

function showSunout(){
	var mdoor = document.getElementById('mdoor');
	if (mdoor.IsPlaying()==false){
		mdoor.GotoFrame(32);
		mdoor.Play();
	}
	else{
		if (mdoor.CurrentFrame()>15){setTimeout("showSunout()",300);}
	}
}

function changeMleto(){
if (document.all.mleto.CurrentFrame()>15){document.write(3);}
}

function showSunin(){
var mdoor = document.getElementById('mdoor');
if (mdoor.IsPlaying()==false){
	mdoor.GotoFrame(16);
	mdoor.Play();
}
else{if (mdoor.CurrentFrame()>8){setTimeout("showSunin()",300);}}
}

function showSunin2(){
//if (navigator.appName.indexOf("Microsoft") != -1){document.all.special.movie="/banners/special4.swf";}
//else{document.all.mspecial.innerHTML = '<EMBED src="/banners/special4.swf" quality=high scale=noborder wmode=transparent WIDTH="306" HEIGHT="90" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" id="special" MAYSCRIPT></EMBED>';}
}

function show_big_item(pic,widt,heit,bro){
if (window.big_item){big_item.close();}
if (bro==0){hei=((screen.height-heit)/2-30);wid=((screen.width-widt)/2);big_item=window.open("/showpic/?pic="+pic,"mapp","width="+(widt-8)+",height="+(heit-8)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
if (bro==1){widt=widt+8;heit=heit+8;hei=((screen.height-heit)/4);wid=((screen.width-widt)/2);big_item=window.open("/showpic/?pic="+pic,"mapp","width="+(widt-8)+",height="+(heit-8)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
}

function ShowFoto(bro){
xp=xbb[Counter]/2;
yp=ybb[Counter]/2;
if (bro==0){hei=(screen.height/2-yp);wid=(screen.width/2-xp);big_item=window.open("/showfoto/"+picsb[Counter]+"/","mapp","width="+(xbb[Counter]-8)+",height="+(ybb[Counter]-8)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
if (bro==1){hei=(screen.height/2-yp);wid=(screen.width/2-xp);big_item=window.open("/showfoto/"+picsb[Counter]+"/","mapp","width="+xbb[Counter]+",height="+ybb[Counter]+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
}

function ChangeFotoZ(){
if (Counter<(pics.length-1)){Counter++;}
else{Counter=0;}
document.all["foto"].src="/photos/"+pics[Counter];
document.all["fototext"].innerHTML='<b>'+texts[Counter]+'</b>';
btns = document.getElementsByName('fotolenta'); 
for (i = 0; i < btns.length; i++){ 
if (i==Counter){btns[i].innerHTML='<table cellspacing=0 cellpadding=0 border=0 width=16><td height=16 style="border:solid 2px #5088D4;" bgcolor=white><img src=/img/null.gif width=12 height=12 style="cursor:hand;cursor:pointer;" alt="Фото '+(i+1)+'" onclick={Counter='+(i-1)+';ChangeFotoZ();}></td></table>';}
else{btns[i].innerHTML='<table cellspacing=0 cellpadding=0 border=0 width=10><td height=10 style="border:solid 1px #CACBCE;" bgcolor=white><img src=/img/null.gif width=8 height=8 style="cursor:hand;cursor:pointer;" alt="Фото '+(i+1)+'" onclick={Counter='+(i-1)+';ChangeFotoZ();}></td></table>';}
}
}

function ChangeFoto(){
if (Counter<(pics.length-1)){Counter++;}
else{Counter=0;}
document.all["foto"].src="/photos/"+pics[Counter];
btns = document.getElementsByName('fotolenta'); 
for (i = 0; i < btns.length; i++){ 
if (i==Counter){btns[i].innerHTML='<table cellspacing=0 cellpadding=0 border=0 width=16><td height=16 style="border:solid 2px #5088D4;" bgcolor=white><img src=/img/null.gif width=12 height=12 style="cursor:hand;cursor:pointer;" alt="Фото '+(i+1)+'" onclick={Counter='+(i-1)+';ChangeFoto();}></td></table>';}
else{btns[i].innerHTML='<table cellspacing=0 cellpadding=0 border=0 width=10><td height=10 style="border:solid 1px #CACBCE;" bgcolor=white><img src=/img/null.gif width=8 height=8 style="cursor:hand;cursor:pointer;" alt="Фото '+(i+1)+'" onclick={Counter='+(i-1)+';ChangeFoto();}></td></table>';}
}
}

function showBigPic(id,widt,heit,bro,isback){
if (window.big_item){big_item.close();}
if (bro==0){hei=((screen.height-heit)/2-30);wid=((screen.width-widt)/2);big_item=window.open("/license/"+id+"/"+isback+"/","mapp","width="+(widt-6)+",height="+(heit-6)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
if (bro==1){widt=widt+8;heit=heit+8;hei=((screen.height-heit)/4);wid=((screen.width-widt)/2);big_item=window.open("/license/"+id+"/"+isback+"/","mapp","width="+(widt-8)+",height="+(heit-8)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
}

function DoYouNeed(id,name){
if(eval("step3.doneed"+id).checked==true){
if (id==1){
eval("dotd"+id).innerHTML='<div style="padding-top:10;padding-bottom:20;padding-left:25;"><table cellspacing=0 cellpadding=0 border=0><tr><td class=txmx><input type=radio name=pvhtype value=1 checked> Подоконник ПВХ, &laquo;Витраж Пласт&raquo; (VPL) цвет белый</td></tr><tr><td class=txmx style="padding-top:5;"><input type=radio name=pvhtype value=2> Подоконник ПВХ, &laquo;Витраж Пласт&raquo; (VPL) цвет золотой дуб</td></tr><tr><td valign=top style="padding-top:10;padding-left:24;"><table cellspacing=0 cellpadding=0 border=0><td valign=center class=txmx>Ширина подоконника</td><td valign=center style="padding-left:10;"><input type=text name=pvhwidth class=tx style="width:40;"></td><td style="padding-left:10;" class=txmx>мм</td></tr></table></td></tr></table></div>';
}
if (id==3){
eval("dotd"+id).innerHTML='<div style="padding-top:10;padding-bottom:20;padding-left:25;"><table cellspacing=0 cellpadding=0 border=0><tr><td class=txmx><input type=radio name=otkostype value=1 checked> Пластиковыми панелями VENTA (Бельгия) с пароизоляцией и утеплением.</td></tr><tr><td class=txmx style="padding-top:5;"><input type=radio name=otkostype value=2> Сэндвич-панелями (Россия) с пароизоляцией и утеплением.</td></tr><tr><td class=txmx style="padding-top:5;"><input type=radio name=otkostype value=3> Пластиковыми панелями КО-ЭКС (Россия) с пароизоляцией и утеплением.</td></tr><tr><td valign=top style="padding-top:10;padding-left:24;"><table cellspacing=0 cellpadding=0 border=0><td valign=center class=txmx>Ширина откоса</td><td valign=center style="padding-left:10;"><input type=text name=otkoswidth class=tx style="width:40;"></td><td style="padding-left:10;" class=txmx>мм</td></tr></table></td></tr></table></div>';
}
if (id==4){
eval("dotd"+id).innerHTML='<div style="padding-top:10;padding-bottom:20;padding-left:25;"><table cellspacing=0 cellpadding=0 border=0><tr><td class=txmx><input type=radio name=shovtype value=1 checked> Герметиком без утепления.</td></tr><tr><td class=txmx style="padding-top:5;"><input type=radio name=shovtype value=2> До 50 мм с утеплением пенопластом.</td></tr><tr><td class=txmx style="padding-top:5;"><input type=radio name=shovtype value=3> До 100 мм с утеплением пенопластом.</td></tr></table></div>';
}
if (id==2){
eval("dotd"+id).innerHTML='<div style="padding-top:10;padding-bottom:20;padding-left:48;"><table cellspacing=0 cellpadding=0 border=0><tr><td valign=top><table cellspacing=0 cellpadding=0 border=0><td valign=center class=txmx>Ширина отлива</td><td valign=center style="padding-left:10;"><input type=text name=otlivtype class=tx style="width:40;"></td><td style="padding-left:10;" class=txmx>мм</td></tr></table></div>';
}
if (id==7){
eval("dotd"+id).innerHTML='<div style="padding-top:10;padding-bottom:20;padding-left:48;"><table cellspacing=0 cellpadding=0 border=0><tr><td valign=top><table cellspacing=0 cellpadding=0 border=0><td valign=center class=txmx>Ширина отлива-козырька</td><td valign=center style="padding-left:10;"><input type=text name=otlivtypex class=tx style="width:40;"></td><td style="padding-left:10;" class=txmx>мм</td></tr></table></div>';
}
}
else{
eval("dotd"+id).innerHTML='';
}
}

function FirstStep(){
if (step1.wtheight.value=="" && step1.wtwidth.value==""){sherr.innerHTML='Не указаны размеры оконного проема.';}
else if (step1.wtheight.value==""){sherr.innerHTML='Не указана высота оконного проема.';}
else if (step1.wtwidth.value==""){sherr.innerHTML='Не указана ширина оконного проема.';}
else step1.submit();
}

function ThirdStep(){
step3.submit();
}
