function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function NewsletterSubmit() {
	var txtEmail = document.getElementById("newsletter_signup");
	var reEmail = /^[\w-\.]+\@[\w\.-]+\.[a-z]{2,4}$/;
	if (!(reEmail.test(txtEmail.value))) {
		alert ("Please enter a valid e-mail address.");
		return false;
	}
	else {
		txtEmail.form.submit();
	}
}

function mmLoadMenus() {
	if (window.mm_menu_1002162234_0) return;
	// Services
	window.mm_menu_1002162234_0 = new Menu("root",185,20,"Arial, Verdana, Helvetica, sans-serif",11,"#ffffff","#ffffff","#56b2de","#329dd1","left","middle",3,0,250,-5,7,true,true,true,0,true,true);
	mm_menu_1002162234_0.addMenuItem("Parts&nbsp;Counter","location='/services/partscounter.asp'");
	mm_menu_1002162234_0.addMenuItem("Service&nbsp;Department","location='/services/servicedept.asp'");
	mm_menu_1002162234_0.addMenuItem("Water&nbsp;Testing","location='/services/watertesting.asp'");
	mm_menu_1002162234_0.addMenuItem("Pool&nbsp;&amp;&nbsp;Spa&nbsp;Help&nbsp;Centre","location='/maintenance/default.asp'");
	mm_menu_1002162234_0.hideOnMouseOut=true;
	mm_menu_1002162234_0.menuBorder=1;
	mm_menu_1002162234_0.menuLiteBgColor='#ffffff';
	mm_menu_1002162234_0.menuBorderBgColor='#ffffff';
	mm_menu_1002162234_0.bgColor='#ffffff';
	mm_menu_1002162234_0.fontWeight="normal";
	
	
	// Products -> Pools submenu
	window.mm_menu_1002162234_2 = new Menu("Pools",110,0,"Arial, Verdana, Helvetica, sans-serif",11,"#ffffff","#ffffff","#56b2de","#329dd1","left","middle",3,0,250,-5,7,true,true,true,0,true,true);
	mm_menu_1002162234_2.addMenuItem("Aboveground","location='/products/pools_aboveground.asp'");
	mm_menu_1002162234_2.addMenuItem("Onground","location='/products/pools_onground.asp'");
	mm_menu_1002162234_2.addMenuItem("Inground","location='/products/pools_inground.asp'");
	mm_menu_1002162234_2.addMenuItem("Pool&nbsp;Gallery","location='/poolgallery/default.asp'");
	mm_menu_1002162234_2.hideOnMouseOut=true;
	mm_menu_1002162234_2.menuBorder=1;
	mm_menu_1002162234_2.menuLiteBgColor='#ffffff';
	mm_menu_1002162234_2.menuBorderBgColor='#ffffff';
	mm_menu_1002162234_2.bgColor='#ffffff';
	mm_menu_1002162234_2.fontWeight="normal";
	
		// Products -> Pool Equipment submenu
	window.mm_menu_1002162234_3 = new Menu("Pool&nbsp;Equipment",110,0,"Arial, Verdana, Helvetica, sans-serif",11,"#ffffff","#ffffff","#56b2de","#329dd1","left","middle",3,0,250,-5,7,true,true,true,0,true,true);
	mm_menu_1002162234_3.addMenuItem("Auto&nbsp;Chlorinators","location='/products/autochlorinators.asp'");
	mm_menu_1002162234_3.addMenuItem("Auto&nbsp;Cleaners ","location='/products/autocleaners.asp'");
	mm_menu_1002162234_3.addMenuItem("Filters","location='/products/filters.asp'");
	mm_menu_1002162234_3.addMenuItem("Heaters&nbsp;Gallery","location='/products/heaters.asp'");
	mm_menu_1002162234_3.addMenuItem("Ozone&nbsp;Generators","location='/products/ozonegenerators.asp'");
	mm_menu_1002162234_3.addMenuItem("Pumps","location='/products/pumps.asp'");
	mm_menu_1002162234_3.addMenuItem("Salt&nbsp;Water&nbsp;Systems","location='/products/saltgenerators.asp'");
	mm_menu_1002162234_3.addMenuItem("Solar&nbsp;Heating","location='/products/solarheating.asp'");
	mm_menu_1002162234_3.hideOnMouseOut=true;
	mm_menu_1002162234_3.menuBorder=1;
	mm_menu_1002162234_3.menuLiteBgColor='#ffffff';
	mm_menu_1002162234_3.menuBorderBgColor='#ffffff';
	mm_menu_1002162234_3.bgColor='#ffffff';
	mm_menu_1002162234_3.fontWeight="normal";
	
	// Spas -> Spas submenu
	window.mm_menu_1002162234_4 = new Menu("Spas",110,0,"Arial, Verdana, Helvetica, sans-serif",11,"#ffffff","#ffffff","#56b2de","#329dd1","left","middle",3,0,250,-5,7,true,true,true,0,true,true);
	mm_menu_1002162234_4.addMenuItem("Spas","location='/products/spas.asp'");
	mm_menu_1002162234_4.addMenuItem("Spa&nbsp;Accesories","location='/products/spa-accesories.asp'");
	mm_menu_1002162234_4.hideOnMouseOut=true;
	mm_menu_1002162234_4.menuBorder=1;
	mm_menu_1002162234_4.menuLiteBgColor='#ffffff';
	mm_menu_1002162234_4.menuBorderBgColor='#ffffff';
	mm_menu_1002162234_4.bgColor='#ffffff';
	mm_menu_1002162234_4.fontWeight="normal";
	
	// Products
	window.mm_menu_1002162234_1 = new Menu("root",160,20,"Arial, Verdana, Helvetica, sans-serif",11,"#ffffff","#ffffff","#56b2de","#329dd1","left","middle",3,0,250,0,0,true,true,true,0,true,true);
	mm_menu_1002162234_1.addMenuItem(mm_menu_1002162234_2,"location='/products/pools.asp'");	
	mm_menu_1002162234_1.addMenuItem(mm_menu_1002162234_4,"location='/products/spas.asp'");
	mm_menu_1002162234_1.addMenuItem(mm_menu_1002162234_3,"location='/products/poolequipment.asp'");
	mm_menu_1002162234_1.addMenuItem("Pool&nbsp;Liners","location='/products/liners.asp'");
	mm_menu_1002162234_1.addMenuItem("Pool&nbsp;Ladders","location='/products/ladders.asp'");
	mm_menu_1002162234_1.addMenuItem("Fencing","location='/products/fencing.asp'");
	mm_menu_1002162234_1.addMenuItem("Chemicals","location='/products/chemicals.asp'");
	mm_menu_1002162234_1.addMenuItem("Accessories","location='/products/accessories.asp'");
	mm_menu_1002162234_1.addMenuItem("Billiards","location='/products/billiards.asp'");
	mm_menu_1002162234_1.addMenuItem("The&nbsp;Games&nbsp;Room","location='/products/gamesroom.asp'");
	mm_menu_1002162234_1.addMenuItem("Far-Infrared&nbsp;Saunas","location='/products/saunas.asp'");
	mm_menu_1002162234_1.addMenuItem("Universal&nbsp;Rocks","location='/products/universalrocks.asp'");	
	mm_menu_1002162234_1.hideOnMouseOut=true;
	mm_menu_1002162234_1.menuBorder=1;
	mm_menu_1002162234_1.menuLiteBgColor='#ffffff';
	mm_menu_1002162234_1.menuBorderBgColor='#ffffff';
	mm_menu_1002162234_1.bgColor='#ffffff';
	mm_menu_1002162234_1.fontWeight="normal";
			
	mm_menu_1002162234_0.writeMenus();
}












function closeWin(){
	grayOut(false);
	var winDiv=document.getElementById('winDiv');
	winDiv.style.display='none';                      // Start out Hidden
	
	
}


//onClick="popImageURL('http://www.sundancespas.com/images/780-series/chelsee-thm2.gif',400, 300,'test top','test bottom');"
function popImageURL(imgURL,Xwidth, Yheight,top_descrip,bottom_descrip){
		grayOut(true);
		var newWin=document.getElementById('winDiv');
		if(!newWin){
  		var tbody = document.getElementsByTagName("body")[0];
	    var tnode = document.createElement('div');           // Create the layer.
	        
	        tnode.style.position='absolute';   
	        tnode.style.zIndex=10000;
	        tnode.style.display='none';                      // Start out Hidden
	        tnode.id='winDiv';                   // Name it so we can find it later
	    	tbody.appendChild(tnode);                            // Add it to the web page
	    	newWin=document.getElementById('winDiv');  // Get the object.
	  }

		newWin.innerHTML="<table cellspacing=0 border=0 cellpadding=0><tr valign=top><td style='padding-right:20px;padding-left:20px;padding-top:20px;'>" + top_descrip + "</td><td width=150 align=right style='padding-right:20px;padding-left:20px;padding-top:20px;'><span onClick='closeWin();' style='cursor:pointer;'>Close Window [x]</span></td></tr><tr><td style='padding:20px;' colspan=2><img  width='" + Xwidth + "' height='" + Yheight + "' src='" + imgURL + "' style='padding-bottom:10px;'><br>" + bottom_descrip + "</td></tr></table>";
		
		var scrolledX, scrolledY;
		if( self.pageYOffset ) {
			scrolledX = self.pageXOffset;
			scrolledY = self.pageYOffset;
		} else if( document.documentElement && document.documentElement.scrollTop ) {
			scrolledX = document.documentElement.scrollLeft;
			scrolledY = document.documentElement.scrollTop;
		} else if( document.body ) {
			scrolledX = document.body.scrollLeft;
			scrolledY = document.body.scrollTop;
		}

		// Next, determine the coordinates of the center of browser's window

		var centerX, centerY;
		if( self.innerHeight ) {
			centerX = self.innerWidth;
			centerY = self.innerHeight;
		} else if( document.documentElement && document.documentElement.clientHeight ) {
			centerX = document.documentElement.clientWidth;
			centerY = document.documentElement.clientHeight;
		} else if( document.body ) {
			centerX = document.body.clientWidth;
			centerY = document.body.clientHeight;
		}

		// Xwidth is the width of the div, Yheight is the height of the
		// div passed as arguments to the function:
		var leftOffset = scrolledX + (centerX - Xwidth) / 2;
		var topOffset = scrolledY + (centerY - Yheight) / 2;
		// The initial width and height of the div can be set in the
		// style sheet with display:none; divid is passed as an argument to // the function
		
		var r=newWin.style;
		r.top = '50' + 'px';
		r.left = leftOffset + 'px';
		r.display = "block"; 
		
		
		newWin.style.border='1px solid #000000';
	}
		

		
	function grayOut(vis){
		var opaque=(70/100);
		  var dark=document.getElementById('darkenScreenObject');
		  if(!dark){
    		var tbody = document.getElementsByTagName("body")[0];
		    var tnode = document.createElement('div');           // Create the layer.
		        tnode.style.position='absolute';                 // Position absolutely
		        tnode.style.top='0px';                           // In the top
		        tnode.style.left='0px';                          // Left corner of the page
		        tnode.style.overflow='hidden';                   // Try to avoid making scroll bars            
		        tnode.style.display='none';                      // Start out Hidden
		        tnode.id='darkenScreenObject';                   // Name it so we can find it later
		    tbody.appendChild(tnode);                            // Add it to the web page
		    dark=document.getElementById('darkenScreenObject');  // Get the object.
		  }
  		if (vis) {
		    // Calculate the page width and height 
		    if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
		        var pageWidth = document.body.scrollWidth+'px';
		        var pageHeight = document.body.scrollHeight+'px';
		    } else if( document.body.offsetWidth ) {
		      var pageWidth = document.body.offsetWidth+'px';
		      var pageHeight = document.body.offsetHeight+'px';
		    } else {
		       var pageWidth='100%';
		       var pageHeight='100%';
		    }   
		    //set the shader to cover the entire page and make it visible.
		    dark.style.opacity=opaque;                      
		    dark.style.MozOpacity=opaque;                   
		    dark.style.filter='alpha(opacity=70)'; 
		    dark.style.zIndex=50;        
		    dark.style.backgroundColor='#333333';  
		    dark.style.width= pageWidth;
		    dark.style.height= pageHeight;
		    dark.style.display='block';                          
		  } else {
		     dark.style.display='none';
		  }
		  delete opaque;
		  delete dark;
	}