<!--

function winOpen(loc)
{
	tempWinWidth = screen.width;
	tempWinHeight=screen.height;
	tempWinLeft = (tempWinWidth - 550) / 2;
	tempWinTop = (tempWinHeight - 700) / 2;
	tempData="'Where To Shop','width=550,height=700,top="+tempWinTop+",left="+tempWinLeft+"'";
	newWin = window.open(loc,"tempwin","width=550,height=700,location=no,menu=no");
	newWin.focus();
	
}
function showSubMenu(num)
{
	obj = "subnav"+num;
	
	submenuArray=new Array();
	submenuArray[0]="subnav0";
	submenuArray[1]="subnav1";
	submenuArray[2]="subnav2";
	submenuArray[3]="subnav3";
	submenuArray[4]="subnav4";
	submenuArray[5]="subnav5";

	
	
	//layer.visibility="visible";

	for(i=0;i<submenuArray.length;i++)
		{
			tempObj = submenuArray[i];
			//layer=document.getElementById(tempObj);
			offLayer = document.getElementById(tempObj).style;
			offLayer.visibility = "hidden";
			
		}
		
		layer=document.getElementById(obj).style;
		layer.visibility="visible";
				
		tempObj="";
		obj="";

}
function clearSubMenu(num)
{
	tempObj="subnav"+num;
	layer=document.getElementById(tempObj).style;
	layer.visibility = "hidden"
}


//--------------------------------------------------------------DROP DOWN MENU SCRIPT

/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/


//Contents for menu 2, and so on
//Contents for menu 2, and so on

if(language==1)
{
	
		var menu1=new Array()
		menu1[0]='<a href="new_products.php?lang=1">New Products</a>'
		menu1[1]='<a href="laundry.php?lang=1">Laundry</a>'
		menu1[2]='<a href="refrigeration.php?lang=1">Refrigeration</a>'
		menu1[3]='<a href="cooking.php?lang=1">Cooking</a>'
		//menu1[4]='<a href="model.php?model_id=125&lang=2&subtitle=Tous les Modèles&modeltitle=Lave-vaisselles">Lave-vaisselles</a>'
		menu1[4]='<a href="dish.php?lang=1">Dishwasher</a>'
		//dish.php?lang=1
		
		//Contents for menu 2
		var menu2=new Array()
		menu2[0]='<a href="gallery.php?lang=1&gallery=laundry">Laundry Gallery</a>'
		menu2[1]='<a href="gallery.php?lang=1&gallery=kitchen">Kitchen Gallery</a>'
		
		
		//Contents for menu 3
		var menu3=new Array()
		menu3[0]='<a href="https://registration.whirlpoolcorp.com/default.asp">Product Registration</a>' /* product_registration.php?lang=1 */
		menu3[1]='<a href="schedule_service.php?lang=1">Schedule Service</a>'
		menu3[2]='<a href="contact_us.php?lang=1">Contact Us</a>'
		menu3[3]='<a href="https://repair.maytag.com/repair/default.jsp?siteCd=MT_EN_CA">Recall Information</a>' /*recall_information.php?lang=1 */

		
}else{
	
	
	var menu1=new Array()
	menu1[0]='<a href="new_products.php?lang=2">Nouveau Produits</a>'
	menu1[1]='<a href="laundry.php?lang=2">Lessive</a>'
	menu1[2]='<a href="refrigeration.php?lang=2">Réfrigération</a>'
	menu1[3]='<a href="cooking.php?lang=2">Cuisson</a>'
	//menu1[4]='<a href="model.php?model_id=125&lang=2&subtitle=Tous les Modèles&modeltitle=Lave-vaisselles">Lave-vaisselles</a>'
	menu1[4]='<a href="dish.php?lang=2">Lave-vaisselles</a>'
	
	//Contents for menu 2
	var menu2=new Array()
		menu2[0]='<a href="gallery.php?lang=2&gallery=laundry">Galerie de Lessive</a>'
		menu2[1]='<a href="gallery.php?lang=2&gallery=kitchen">Galerie de Cuisson</a>'

	
	
	//Contents for menu 3
	var menu3=new Array()
	menu3[0]='<a href="https://registration.whirlpoolcorp.com/default.asp">Enregistrez un produit</a>'
	menu3[1]='<a href="schedule_service.php?lang=2">Prenez un rendez-vous de service d`entretien</a>'
	menu3[2]='<a href="contact_us.php?lang=2">Contactez-nous</a>'
	menu3[3]='<a href="https://repair.maytag.com/repair/default.jsp?siteCd=MT_FR_CA">Rappels de produits</a>' /*recall_information.php?lang=2*/


}
	
var menuwidth='255px' //default menu width
var menubgcolor='lightyellow'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null){
	totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
	parentEl=parentEl.offsetParent;
	}
	return totaloffset;
	}


function showhide(obj, e, visible, hidden, menuwidth){
	if (ie4||ns6)
	dropmenuobj.style.left=dropmenuobj.style.top="-500px"
	if (menuwidth!=""){
	dropmenuobj.widthobj=dropmenuobj.style
	dropmenuobj.widthobj.width=menuwidth
	}
	if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
	obj.visibility=visible
	else if (e.type=="click")
	obj.visibility=hidden
}

function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
	var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
	dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
	if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
	edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}else{
	var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
	var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
	dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
	if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
	edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
	if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
	edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what,menuwidth){
	if (ie4||ns6)
	dropmenuobj.innerHTML=what.join("")
	menuwidth = dropmenuobj.style.width;
	
	dropmenuobj.innerHTML+="<br />";
	dropmenuobj.innerHTML+="<img class='submenubottom' style='float:right;padding:0px' src='images/subnav_right.gif'  border='0' vspace='0' hspace='0' />";
	dropmenuobj.innerHTML+="<img class='submenubottom' style='float:left;padding:0px' src='images/subnav_left.gif'  border='0' vspace='0' hspace='0' />";
	dropmenuobj.innerHTML+="<img class='submenubottom' style='width:120px;display:inline;height:13px;;padding:0px' src='images/subnavbottombar.gif' border='0' vspace='0' hspace='0' />";

}


function dropdownmenu(obj, e, menucontents, menuwidth){
	if (window.event) event.cancelBubble=true
	else if (e.stopPropagation) e.stopPropagation()
	clearhidemenu()
	dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
	populatemenu(menucontents,menuwidth)
	
	if (ie4||ns6){
		
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var version=parseFloat(b_version);
	
		//alert("document is ie: "+version);
		showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
		dropmenuobj.x=getposOffset(obj, "left")
		dropmenuobj.y=getposOffset(obj, "top")
		dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
		dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
	}
	
	return clickreturnvalue()
}

function clickreturnvalue(){
	if (ie4||ns6) return false
	else return true
}

function contains_ns6(a, b) {
	while (b.parentNode)
	if ((b = b.parentNode) == a)
	return true;
	return false;
}

function dynamichide(e){
	if (ie4&&!dropmenuobj.contains(e.toElement))
	delayhidemenu()
	else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
	delayhidemenu()
}

function hidemenu(e){
	if (typeof dropmenuobj!="undefined"){
	if (ie4||ns6)
	dropmenuobj.style.visibility="hidden"
	}
}

function delayhidemenu(){
	if (ie4||ns6)
	delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
	if (typeof delayhide!="undefined")
	clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
	document.onclick=hidemenu







function placeTabs(id)
{
	//-----------------------------------center the container div
	tempWidth = screen.width;
	containerLeft = (tempWidth-995)/2;
	//document.getElementById("CONTAINER").style.marginLeft = containerLeft+"px";
	//alert(containerLeft);
	//-----------------------------------end container centering
	
var off=document.getElementById(id)
	if (off){
	if (off.offsetParent)
	{
	curleft = off.offsetLeft;
	curtop = off.offsetTop;
	while (off) 
		{
		curleft += off.offsetLeft;
		curtop += off.offsetTop;
		off=off.offsetParent;
		}
	}
	var tab1X="142px";
	var tab1Y="297px";
	document.getElementById("tab1").style.top=tab1Y;
	document.getElementById("tab1").style.left=tab1X;
	document.getElementById("tab1").style.visibility="visible";
	
	var tab2X="339px";
	var tab2Y="297px";
	document.getElementById("tab2").style.top=tab2Y;
	document.getElementById("tab2").style.left=tab2X;
	document.getElementById("tab2").style.visibility="visible";
	
	var tab3X="540px";
	var tab3Y="297px";
	document.getElementById("tab3").style.top=tab3Y;
	document.getElementById("tab3").style.left=tab3X;
	document.getElementById("tab3").style.visibility="visible";
	
	var tab4X="761px";
	var tab4Y="297px";
	document.getElementById("tab4").style.top=tab4Y;
	document.getElementById("tab4").style.left=tab4X;
	document.getElementById("tab4").style.visibility="visible";
	
 
	document.getElementById("leftarrow").style.top = "150px";
	document.getElementById("leftarrow").style.left = "5px";
	
	document.getElementById("rightarrow").style.top = "150px";
	document.getElementById("rightarrow").style.left = "957px";
	
	document.getElementById("rightarrow").style.visibility="visible";
	document.getElementById("leftarrow").style.visibility="visible";
}}

//#######################################################CAROUSELLE ANIMATIONS
count=1;
//###############################################################carouselle definitions
timer=false; //-------------------------used for animations
direction = "left";
jump=10;
carouselleABSLeft = -6000;
carouselleABSRight = 1000;
carouselleWidth = 6000;
padding=50;
function moveImageDir()
{
	
	imgobj = document.getElementById('image1').style;
	objectX = document.getElementById('image1').style.left;
	objectX = Number(objectX.replace("px",""));

	if(direction=="left" && objectX>=carouselleABSLeft)
		{
			
			if(objectX <=carouselleABSLeft)
				{
					document.getElementById('image1').style.left = carouselleABSLeft+"px";
					stopAnimation();
					}else{
					currentPix=objectX-jump;
					imgobj.left=currentPix+"px";
					count=count+10;
				}
		}else if(direction=="right" && objectX<=carouselleABSRight)
		{
			
			if(objectX >=carouselleABSRight )
			{
				document.getElementById('image1').style.left =carouselleABSRight+"px"; 
				stopAnimation();
				}else{
				currentPix=objectX+jump;
				imgobj.left=currentPix+"px";
				count=count+10;
			}
		}
		//tempCount = count * -1;
		if(count%1000==1){stopAnimation();}
		if(currentPix>0 && direction=="right")
			{
				document.getElementById('image1').style.left ="-5000px";
				stopAnimation();
				currentPix=-5999;
				count=count-10;
			}
		if(currentPix==-6000 && direction=="left")
			{
				document.getElementById('image1').style.left ="0px";
				stopAnimation();
				currentPix=5999;
				count=count+10;
			}
}



function startAnimation() {
  if (!timer) timer = setInterval("moveImageDir()",10);
}

function stopAnimation() {
  if (!timer) return false;
  clearInterval(timer);
  timer = null;
  obj = document.getElementById('image1').style.left;

}


function checkPos(id)
{
var off=document.getElementById(id)
	if (off.offsetParent)
	{
	curleft = off.offsetLeft;
	curtop = off.offsetTop;
	while (off) 
		{
		curleft += off.offsetLeft;
		curtop += off.offsetTop;
		off=off.offsetParent;
		}
	}
	return [curleft,curtop];
}
function init()
{
	objData=checkPos('image1');
	tempNum = Number(objData[0])/2;
	objData[0]=tempNum;
}

function setCarouselle(pos)
{
	document.getElementById("image1").style.left=pos+"px";	
}
function startCarouselle()
{
	//direction='right';startAnimation();moveImageDir();
	carouselleAnimation = setInterval("direction='right';startAnimation();moveImageDir();",8000);
	
}
function clearCarouselle()
{
	clearInterval(carouselleAnimation);
	carouselleAnimation= null;
}

//--------------------------------------------------scroll images in model_content.php page
function scrollGallery(dir)
{
	tempVar = document.getElementById('panel').style.left;
	tempVar = tempVar.replace("px","");
	if(dir=='left')
	{
		tempVar=parseInt(tempVar)-3;
	}else{
		tempVar=parseInt(tempVar)+3;	
	}
	
	tempWidth = document.getElementById('panel').style.width;
	tempWidth = tempWidth.replace("px","");
	tempWidth = tempWidth - 295;
	
	//--------------------logic to prevent overscrolling
	if(tempVar<0-tempWidth){tempVar = 0-tempWidth;}
	if(tempVar>0){tempVar = 0}
	//---------------------finally update the panel display
	document.getElementById('panel').style.left = tempVar + "px";
	
}

function stopScroll()
{
	clearInterval(scrolltimer);
	scrolltimer=null;
	
}
function startScroll(dir)
{
	
	
	if(dir=='left')
	{
	//alert(dir);	
		command="scrollGallery('left')";
	}else{
		command="scrollGallery('right')";
	}
	scrolltimer = setInterval(command,10);
}

setTimeout("placeTabs('carouselle')",100);
//-->