// JavaScript Document


function mouseOver1stv()
{

var eee1=document.getElementById("img1stvor");
eee1.style.visibility="visible"

var eee2=document.getElementById("img2stvor");
eee2.style.visibility="hidden"

var eee3=document.getElementById("img3stvor");
eee3.style.visibility="hidden"

var eee4=document.getElementById("img4stvor");
eee4.style.visibility="hidden"


 
}



function mouseOver2stv()
{
var eee2=document.getElementById("img2stvor");
eee2.style.visibility="visible"

var eee3=document.getElementById("img3stvor");
eee3.style.visibility="hidden"

var eee4=document.getElementById("img4stvor");
eee4.style.visibility="hidden"


var eee1=document.getElementById("img1stvor");
eee1.style.visibility="hidden"

}






function mouseOver3stv()
{
var eee3=document.getElementById("img3stvor");
eee3.style.visibility="visible"

var eee4=document.getElementById("img4stvor");
eee4.style.visibility="hidden"

var eee2=document.getElementById("img2stvor");
eee2.style.visibility="hidden"

var eee1=document.getElementById("img1stvor");
eee1.style.visibility="hidden"
}






function mouseOver4stv()
{
var eee4=document.getElementById("img4stvor");
eee4.style.visibility="visible"

var eee3=document.getElementById("img3stvor");
eee3.style.visibility="hidden"

var eee2=document.getElementById("img2stvor");
eee2.style.visibility="hidden"

var eee1=document.getElementById("img1stvor");
eee1.style.visibility="hidden"
}









                    


function FunImgWin1Stvbig(a,b,c,d,e,f,t,w,r,y,x,Prisefor1KvMUnic,KonstantUnic,from0000,to0000,from1111,to1111,valuecountSetfromHtml)
{
 VarImgWin1Stvbig=document.getElementById(a);
 VarImgWin1StvbigVis=VarImgWin1Stvbig.style.visibility // Начальная координата X
if (VarImgWin1StvbigVis=='hidden')
{VarImgWin1Stvbig.style.visibility='visible';}


VarImgWin3Stvbig=document.getElementById(b);
VarImgWin3Stvbig.style.visibility='hidden';

VarImgWin3Stvbig=document.getElementById(c);
VarImgWin3Stvbig.style.visibility='hidden';    


VarImgWin3Stvbig=document.getElementById(d);
VarImgWin3Stvbig.style.visibility='hidden';    

VarImgWin3Stvbig=document.getElementById(e);
VarImgWin3Stvbig.style.visibility='hidden'; 

VarImgWin3Stvbig=document.getElementById(f);
VarImgWin3Stvbig.style.visibility='hidden'; 





VarImgWin3Stvbig=document.getElementById(t);
VarImgWin3Stvbig.style.visibility='hidden';

VarImgWin3Stvbig=document.getElementById(w);
VarImgWin3Stvbig.style.visibility='hidden';    


VarImgWin3Stvbig=document.getElementById(r);
VarImgWin3Stvbig.style.visibility='hidden';    

VarImgWin3Stvbig=document.getElementById(y);
VarImgWin3Stvbig.style.visibility='hidden'; 

VarImgWin3Stvbig=document.getElementById(x);
VarImgWin3Stvbig.style.visibility='hidden'; 





Prisefor1KvMVar=Prisefor1KvMUnic
KonstantVar=KonstantUnic




from00get = document.getElementById("id0");	
from00get.setAttribute("from", from0000);
from00get.setAttribute("to", to0000);

from11get = document.getElementById("id1");	
from11get.setAttribute("from", from1111);
from11get.setAttribute("to", to1111);





valuecountSet = document.getElementById("id1");	
valuecountSet.setAttribute("valuecount", valuecountSetfromHtml);


if (typeof glassPaket!='number' )
{glassPaket=1;}	 
if (typeof glassPaketForKonstant!='number' )
{glassPaketForKonstant=1.1;}	 
if (typeof REHAUProf!='number' )
{REHAUProf=1;}	 
if (typeof REHAUProfForKonstant!='number' )
{REHAUProfForKonstant=1;}	






PriseAll =((carpedisplays[0].value*carpedisplays[1].value/1000000*(Prisefor1KvMVar*glassPaket*REHAUProf))+(KonstantVar*glassPaketForKonstant*REHAUProfForKonstant))*35;

if (a=='ImgWin1Stvbig' ||a=='ImgWin2Stvbig'||a=='ImgWin2StvbigOp'||a=='ImgWin2StvbigOpFlap2Stv'     )/*двухствор*/
{ 


 if (carpedisplays[1].value==1100){
                            carpeLeft('slider1', 127.77)
							PriseFunc() 
           	 }
			 
if (carpedisplays[1].value>2000){
                            carpedisplays[1].value=2000 
                            
                             carpeLeft('slider1', 230)
                             PriseFunc() 
							 }




else{
                           chengePosOfSlidOnClikWin()
							PriseFunc() 
           	 }
 }


if (a=='ImgWin3Stvbig1Op'||a=='ImgWin3Stvbig1OpFlap'||a=='ImgWin3Stvbig1Op1Flap')/*трехствор*/
{
if (carpedisplays[1].value==1100){
                            carpeLeft('slider1', 47)
							PriseFunc() 
           	 }	
	
		
	else{
                           chengePosOfSlidOnClikWin()
							PriseFunc() 
           	 }
	
		}






if (a=='ImgWin1StvbigOp'||a=='ImgWin1StvbigOpFlap'         ||a=='dorsm1'||a=='dorsm2' )/*одноствор*/

{




                           ChangeSizeOfSkiderOnDor()
 
 
}







AnimationMPrise()

} /*при клике на боковую картинку окни. большая картинка меняется */




if (typeof x!='number' )
{x=180;}
if (typeof y!='number' )
{y=145;}	
if (typeof z!='number' )
{z=0;}
if (typeof t!='number' )
{t=0;}

function glassSelectFunc()
{
glassSelectIdVar=document.getElementById("glassSelectId");
glassSelectIdVal=glassSelectIdVar.selectedIndex





if (glassSelectIdVal==0)
{
glassPaket=1
glassPaketForKonstant=1.1
x=180
y=145	
AllStrip("Warm",x,z)
AllStrip("Silence",y,t)
}

if (glassSelectIdVal==1)
{
glassPaket=1.1
glassPaketForKonstant=1.1	
x=200
y=160	
AllStrip("Warm",x,z)
AllStrip("Silence",y,t)
}

if (glassSelectIdVal==2)
{
glassPaket=1.2
glassPaketForKonstant=1.1	
x=210
y=170

AllStrip("Warm",x,z)
AllStrip("Silence",y,t)
}


if (glassSelectIdVal==3)
{
glassPaket=1.25
glassPaketForKonstant=1.2	
	x=215
	y=175
AllStrip("Warm",x,z)
AllStrip("Silence",y,t)
}


ForPrise2StvBegin()
PriseFunc()
AnimationMPrise() 


}








function REHAUSelectFunc()
{
 REHAUSelectIdVar=document.getElementById("REHAUSelectId");
REHAUSelectIdVal=REHAUSelectIdVar.selectedIndex
 

if (REHAUSelectIdVal==0 )
{
 REHAUProf=1
 REHAUProfForKonstant=1
 
 z=0
 t=0
 
AllStrip("Warm",x,z )
AllStrip("Silence",y,t)
AllStrip("Design",0,150)
}

if (REHAUSelectIdVal==1 )
{
	
	 REHAUProf=1.07
 REHAUProfForKonstant=1.44
	
	z=5
    t=8
AllStrip("Warm",x,z)
AllStrip("Silence",y,t)
AllStrip("Design",0,170)
}

if (REHAUSelectIdVal==2 )
{
	 REHAUProf=1.4161
 REHAUProfForKonstant=1.9058
	z=9
    t=12
AllStrip("Warm",x,z)
AllStrip("Silence",y,t)
AllStrip("Design",0,180)
}


ForPrise2StvBegin()
PriseFunc()

AnimationMPrise() 

}

 










function AllStrip(a,b,c) 
{
foo = document.getElementById(a); 



d=b+c


    if (!foo.currentWidth) foo.currentWidth = 150; 
	//if no memory is set, set it first; 
    doWidthChangeMem(foo,foo.currentWidth,d,70,10,0.5); 
  
function widthRestore() { 
    if (!foo.currentWidth) return; 
    doWidthChangeMem(foo,foo.currentWidth,150,100,10,0.5); 
    }
	
	function doWidthChangeMem(elem,startWidth,endWidth,steps,intervals,powr) { 
//Width changer with Memory 
    if (elem.widthChangeMemInt)
	window.clearInterval(elem.widthChangeMemInt);
    var actStep = 0;
    elem.widthChangeMemInt = window.setInterval(
	function() { 
	  elem.currentWidth = easeInOut(startWidth,endWidth,steps,actStep,powr);
	  elem.style.width = elem.currentWidth + "px"; 
	  actStep++;
	  if (actStep > steps) window.clearInterval(elem.widthChangeMemInt);
	} 
	,intervals)
}
	
	function easeInOut(minValue,maxValue,totalSteps,actualStep,powr) { 
//Generic Animation Step Value Generator 
    var delta = maxValue - minValue; 
    var stepp = minValue+(Math.pow(((1 / totalSteps) * actualStep), powr) * delta); 
    return Math.ceil(stepp) 
    } 
	
}	









function AnimationMPrise() 
{
var element1 = document.getElementById("888");	
	var from1 = 600; // Начальная координата X




var to1 = PriseAll; // Конечная координата X
var duration = 360; // Длительность - 1 секунда
var start = new Date().getTime(); // Время старта
 
setTimeout(function() {
    var now = (new Date().getTime()) - start; // Текущее время
    var progress = now / duration; // Прогресс анимации
 
    var result = (to1 - from1) * delta(progress) + from1;
 var vip = Math.round(result);
    element1.value = vip ;
 
    if (progress < 1) // Если анимация не закончилась, продолжаем
        setTimeout(arguments.callee, 10);
}, 10);

}


function delta(progress) {

 return progress;


}





function chengePosOfSlidOnClikWin() 
{
		
from332222 = parseFloat(from11get.getAttribute('from'))
to332222 = parseFloat(from11get.getAttribute('to')) 


rtrtrryrure = (to332222 - from332222) / 230

werterwert = (carpedisplays[1].value - from332222)/(rtrtrryrure)

carpeLeft('slider1', werterwert);
}




function PriseFunc() 
{
PriseAll =((carpedisplays[0].value*carpedisplays[1].value/1000000*(Prisefor1KvMVar*glassPaket*REHAUProf))+(KonstantVar*glassPaketForKonstant*REHAUProfForKonstant))*35;
}






function ChangeSizeOfSkiderOnDor() 
{
if (carpedisplays[1].value>1100){
                            carpedisplays[1].value=1100 
                            
                             carpeLeft('slider1', 230)
                             PriseFunc() 
							 }
							 else if  (carpedisplays[1].value==1100){
                             carpeLeft('slider1', 230)
                              PriseFunc() 
							  }
							 
                             else if  (carpedisplays[1].value<1100){
                              chengePosOfSlidOnClikWin()
                              PriseFunc() 
							  }

}





function ForPrise2StvBegin() 
{
if (typeof Prisefor1KvMVar!='number' )
{Prisefor1KvMVar=49;}
if (typeof glassPaket!='number' )
{glassPaket=1;}	 
if (typeof KonstantVar!='number' )
{KonstantVar=33;}
if (typeof glassPaketForKonstant!='number' )
{glassPaketForKonstant=1.1;}	
if (typeof REHAUProf!='number' )
{REHAUProf=1;}	 
if (typeof REHAUProfForKonstant!='number' )
{REHAUProfForKonstant=1;}
}