			var divOpen;
			var divFT;
			var files='undefined';
			var modelid;
			var addzip;
			var modelname;
	function ShowHide(id){
	
		var d=document.getElementById(id);
		
		//var p=document.getElementById(pid);
		if(d.style.display=="block")
		{
			//tell the product it's closed
		
			SectClose(d);
			//hide the models
			
			d.style.display="none";
		}
		else
		{
			//open th product
		
			SectOpen(d);
			
			//check for an open product already, and close it
			if(divOpen){divOpen.style.display="none";}
			//show the models
			d.style.display="block";
			//set the vars for next click
			divOpen=d;
			//divFT=p;
			window.scrollTo(0,300);
		}
	
	}
	function SectOpen(div){
		//div.style.backgroundImage="url(/ecatalog/images/minus.gif)";
		div.style.color="#0000ff";
	}
	function SectClose(div){
		//div.style.backgroundImage="";
		div.style.color="#000000";	
	}
	function ClearZip()
	{
		addzip=false;
		Uncheckbox();
		files='undefined';
		alert('All documents have been removed from the zip file.');
	}
	
	function AddCheckbox()
		{
		var i;	
		var cntfiles=0;
		files='undefined';
	
		for (i=0;i<document.frmmodel.length;i++)
		{
			if (document.frmmodel[i].type=="checkbox")
			{
				var chk=document.frmmodel.elements[i] ; 
				if (chk.checked==true) 
					{					
					
					var ind=files.indexOf(chk.value);
					if (ind=-1)	
							{
							files=files + ','+ chk.value;
							cntfiles=cntfiles+1;
							
							}
					addzip=true;
					};
			}
		}
		if (cntfiles>0) 
		
		{alert(cntfiles + ' ' +'file(s) have been added to your zip file.');}
	  }
	function CheckZip()
	{
		if (addzip==true)
		{
			
			//newwindow=window.open("popupmessage.aspx");
		 //newwindow.focus;
		var	downloadzipconfirm =window.confirm ("You are about to lose the files in the zip folder. Do you want to download now?");
			if (downloadzipconfirm )
			{
				
				DownloadZip();
			}
		}
		
	}
	
	function DownloadZip()
	{
		if (files!='undefined')
			{
			
				wnd = window.open ('WINZip.aspx?ref=' + files + '&model=' + window.document.frmmodel.txtmodel_name.value ,'Zip','width=1,height=1,left=-100,top=-100');
			//	alert('WINZip.aspx?ref=' + files + '&model=' + window.document.frmmodel.txtmodel_name.value);
				//x.document.write('hello there');
				addzip=false;
				Uncheckbox();
				files='undefined';
				wnd.close;
			}
		else
			{
				alert('There are no current documents to download. Click on a checkbox to add a document to the zip file.');

 

			}	
	}
	function Uncheckbox()
	{
		var i;	
		for (i=0;i<document.frmmodel.length;i++)
		 {
			if (document.frmmodel[i].type=="checkbox")
			{
				var chk=document.frmmodel.elements[i] ; 
				if (chk.checked==true) 
					{					
						chk.checked=false;
					}
			}
		}	
			
	}
function ModelGetDetails()
{
		var newwindow;
		if (addzip==true)
		{
			
			//newwindow=window.open("popupmessage.aspx");
		 //newwindow.focus;
		var	downloadzipconfirm =window.confirm ("You are about to lose the files in the zip folder. Do you want to download now?");
			if (downloadzipconfirm )
			{
				
				DownloadZip();
			}
			else
			{
				addzip=false;
				Uncheckbox();
				files='undefined';
			}	
		}
		//alert('hi');
		//parent.document.getElementById("Crumbs").innerHTML='aaaa';
		//document.frmmodel.txtmodel_id.value = modelid;
		//document.frmmodel.submit();
		
		window.location='model.aspx?refid=' + modelid;
}
	

function mailThisUrl() {
var b='';
var schar=String.fromCharCode(10) + String.fromCharCode(13) ;
u = window.location;
m = "Information from Krueger-hvac.com";
b="Greetings,%0A%0A" 
b=b+  "The link below has been sent to you from the Krueger website, inviting you to visit a page from our on-line e-catalog.%0A" +u;
b=b + "%0A%0AIf you have any questions regarding product, pricing, or availability, contact your local Krueger representative. If you are not familiar with your local representative, simply click on the link below to find the one nearest you.";
b=b + "%0A%0Ahttp://www.krueger-hvac.com/repfind/";
b=b + "%0A%0AThank you,";
b=b + "%0AKrueger Sales and Marketing";






window.location = "mailto:" + "?subject="+m+"&body="+ b;

}
	
