	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 MM_findObj(n, d) { //v4.0
	  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 && document.getElementById) x=document.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];}
	}
	
	// assumes existence of a form 'select' element named SelectMenu
	function changePage(form, selectName) {
        i = form[selectName].selectedIndex;
		//z = form[selectName].selectedIndex.value;
		
        //alert ('Index is: ' + i);
		//if (z == 99 ) return;
        window.top.location.href = form[selectName].options[i].value;
		
	}

	function printThis() {
		var sVersion = navigator.appVersion;
		if (navigator.appName == "Microsoft Internet Explorer" && sVersion.substring(0, 3) <= "3.0" ) {
			alert("Your browser does not support this function. Please press CTRL+P to print the page");
		}
		else {
			window.focus();
			window.print();
		}
	}

	function NewWindow(mypage, myname, w, h, scroll,menu, resizable) {
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'menubar='+menu+',height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resizable+',status=0'
		win = window.open(mypage, myname, winprops);
		win.focus();
	}
		
	function privacyPolicy() {
		
		windowname = "privacypolicy";
		NewWindow("privacypolicy.html", windowname, 400, 420, 'yes', 'no',1);
	}
	
	function terms() {
		windowname = "terms";
		NewWindow("hdtermsconditions.html", windowname, 400, 420, 'yes', 'no',1);
	}
	
	function openWarranty(id) {
		
		windowname = "warranty";
		NewWindow("warranty.asp?top="+id, windowname, 500, 420, 'yes', 'no',1);
	}

	function DoorPopUp(CollId,Level1,ProdId) {
		windowname = "doorPopUp";
		NewWindow("door_style_preview.asp?ID=" + CollId + "&level1=" + Level1 + "&prodId=" + ProdId, windowname, 720, 410, 'yes', 'no',1);
	}
	
	
	function ColorPopUp(colorId) {
		windowname = "colorPopUp";
		NewWindow("color_style_preview.asp?ID=" + colorId , windowname, 635, 410, 'yes', 'no',1);
	}

	function DecorativeDoor(number) {
		windowname = "decorativeDoors";
		NewWindow("decorativedoor_preview.asp?ID=" + number, windowname, 375, 375, 'no', 'no',1);
	}

	function constructionPopUp(num) {
		windowname = "Images";
		NewWindow("construction_popup.asp?number="+num, windowname, 500, 500, 'no', 'no',1);
	}
	
	function interior(num) {
		windowname = "Images";
		NewWindow("functionalFeatures_popup.asp?number="+num, windowname, 500, 500, 'no', 'no',1);
	}
	
	function exterior(num) {
		windowname = "Images";
		NewWindow("functionalFeaturesExterior_popup.asp?number="+num, windowname, 500, 500, 'no', 'no',1);
	}
	
	function moldingPopUp(num) {
		windowname = "Images";
		NewWindow("molding_popup.asp?number="+num, windowname, 500, 500, 'no', 'no',1);
	}
	
	function emailPage(ID,lineID) {
		windowname = "email";
		NewWindow("emailPage.asp?ID="+ID+"&lineID="+lineID, windowname, 404, 400, 'no', 'no',1);
	}
	
	function enlargePhoto(ID, type) {
		windowname = "enlargePhoto";
		
		if(type == 1) //enlarge product photo
			NewWindow("enlargePhoto.asp?ID="+ID+"&type="+type, windowname, 788, 500, 'yes', 'no',1);
		else	//enlarged accessory photo
			NewWindow("enlargePhoto.asp?ID="+ID+"&type="+type, windowname, 439, 470, 'no', 'no',1);
	}
	
	function gallery() {
		windowname = "gallery";
		NewWindow("galleryLoad.htm", windowname, 670, 432, 'no', 'no',1);
	}
	
	
	function printable(ID) {
		windowname = "printableVersion";
		NewWindow("printable.asp?ID="+ID, windowname, 640, 590, 'yes', 'no',1);
	}
	
	