		var leftpos=0;
		var leftpos2 = 1809;
		var timer;
		var stopper=0;
		var pos=0;
		var popup='';
		function initpic() {
		 timer=setTimeout("movepic()", 2000);
		}
		function openquotes() {	
		    var path = "quotes.html"
			if (!popup.closed && popup.location)
			{
				popup.location.href = path
			}
			else
			{
				popup=window.open(path, "", 'height=525,width=550,top=50,left=200,status=no')
				if (!popup.opener) {popup.opener = self;}
			}
			if (window.focus) {popup.focus()}
			return false;
		}
		function movepic() {		
			if (leftpos>=-1809) {	
				leftpos = leftpos - 1;
				leftpos2 = leftpos2 - 1
				window.document.getElementById("movepic").style.left = leftpos + "px"; 
				window.document.getElementById("movepic2").style.left = leftpos2 + "px";
				window.document.getElementById("movecap").style.left = leftpos + "px"; 
				window.document.getElementById("movecap2").style.left = leftpos2 + "px"; 
				if (leftpos2==0) {leftpos=0; leftpos2=1809;}
            } else {leftpos=0; leftpos2=1809;}
			timer=setTimeout("movepic()", 10)
		}
		function stopit() {
			if (stopper==0) { stopper=1; window.clearTimeout(timer);} else {stopper=0; timer=setTimeout("movepic()", 10);}
		}
		function repos(pos) {
			var xpos = 0;
			stopper=1; window.clearTimeout(timer);
			switch (pos) {
				case 1: xpos = 0; break;
				case 2: xpos = -225; break;
				case 3: xpos = -735; break;
				case 4: xpos = -1000; break;
				case 5: xpos = -650; break;
				case 6: xpos = -1460; break;
			}
			window.document.getElementById("movepic").style.left = xpos + "px"; 
			window.document.getElementById("movecap").style.left = xpos + "px"; 
			window.document.getElementById("movepic2").style.left = (1809 + xpos) + "px"; 
			window.document.getElementById("movecap2").style.left = (1809 + xpos) + "px"; 
		}
		function openquotes() {	
		    var path = "quotes.html"
			if (!popup.closed && popup.location)
			{
				popup.location.href = path
			}
			else
			{
				popup=window.open(path, "", 'height=525,width=550,top=50,left=200,status=no')
				if (!popup.opener) {popup.opener = self;}
			}
			if (window.focus) {popup.focus()}
			return false;
		}
		function openeoe() {	
		    var path = "eoe.html"
			if (!popup.closed && popup.location)
			{
				popup.location.href = path
			}
			else
			{
				popup=window.open(path, "", 'height=380,width=450,top=50,left=200,status=no')
				if (!popup.opener) {popup.opener = self;}
			}
			if (window.focus) {popup.focus()}
			return false;
		}
		function openiso() {	
		    var path = "iso.html"
			if (!popup.closed && popup.location)
			{
				popup.location.href = path
			}
			else
			{
				popup=window.open(path, "", 'height=300,width=300,top=50,left=200,status=no')
				if (!popup.opener) {popup.opener = self;}
			}
			if (window.focus) {popup.focus()}
			return false;
		}
		function opensurvey() {	
		    var path = "survey.html"
			if (!popup.closed && popup.location)
			{
				popup.location.href = path
			}
			else
			{
				popup=window.open(path, "", 'height=750,width=630,top=50,left=200,status=no')
				if (!popup.opener) {popup.opener = self;}
			}
			if (window.focus) {popup.focus()}
			return false;
		}
		function opencert() {	
		    var path = "cert.html"
			if (!popup.closed && popup.location)
			{
				popup.location.href = path
			}
			else
			{
				popup=window.open(path, "", 'height=700,width=430,top=50,left=200,status=no')
				if (!popup.opener) {popup.opener = self;}
			}
			if (window.focus) {popup.focus()}
			return false;
		}
		function openmap() {	
		    var path = "map.html"
			if (!popup.closed && popup.location)
			{
				popup.location.href = path
			}
			else
			{
				popup=window.open(path, "", 'height=590,width=600,top=50,left=200,status=no')
				if (!popup.opener) {popup.opener = self;}
			}
			if (window.focus) {popup.focus()}
			return false;
		}
		function unloadpopup() {
			if(!popup.closed && popup.location) {popup.close();}
		}
		var photono=1;
	    var popup='';
		function opengallery(photono) {	
		    var photopath = "photogallery.html?photo=" + photono
			if (!popup.closed && popup.location)
			{
				popup.location.href = photopath
			}
			else
			{
				popup=window.open(photopath, "", 'height=450,width=450,top=50,left=200,status=no')
				if (!popup.opener) {popup.opener = self;}
			}
			if (window.focus) {popup.focus()}
			return false;
		}
		function unloadpopup() {
			if(!popup.closed && popup.location) {popup.close();}
		}

			function clearIt() {
						window.document.email.first.value=""; 
						window.document.email.last.value=""; 
						window.document.email.name.value=""; 
						window.document.email.subject.value="";
						window.document.email.company.value=""; 
						window.document.email.email.value="";
						window.document.email.phone.value="xxx-xxx-xxxx";
						window.document.email.comments.value=""; 
						window.document.sendit.contactname.value="";  
						//window.document.email.emailto.options[0].selected = true;
					  }
					  
			  function mailIt() {
					var is = new Is();
					var error="";
					var opterr = 0; 
					var em = new Array("cjolly@advancedplastiform.com","dbarlow@advancedplastiform.com")
					var emvalue="";
					//for (var x=0; x<7; x++) {
					//	if(window.document.email.emailto.options[x].selected == true) {emvalue=em[x]; x=8;} 
					//}
					
			
					if(is.ie || is.ns6) { 
					        var error2=0;

					       	//if(window.document.email.first.value=="") {error=error + "First Name is blank\r\n";}
							if(window.document.email.last.value=="") {error=error + "Last Name is blank\r\n";}
							if(window.document.email.subject.value=="") {error=error + "Subject is blank\r\n";}
							if(window.document.email.company.value=="") {error=error + "Company is blank\r\n";}
							if(window.document.email.comments.value=="") {error=error + "Message is blank\r\n";}
							if(checkemail()==false) {error=error + "eMail z...z@z...z.zzz is invalid or blank\r\n";}
							if(checkphone()==false) {error=error + "Phone number 999-999-9999 is invalid or blank\r\n";}
					 } 
					 
					  if(error=="" ) { 
						  var mess = "\n\nADVANCED PLASTIFORM INC. INFORMATION REQUEST"
						  mess = mess + "\n\nCONTACT INFORMATION:"
						  mess = mess + "\n--------------------------------------------------------"
						  mess = mess + "\nCONTACT: " + window.document.email.first.value + " " + window.document.email.last.value
						  mess = mess + "\nEMAIL: " + window.document.email.email.value 
						  mess = mess + "\nPHONE: " + window.document.email.phone.value 
						  mess = mess + "\nCOMPANY: " + window.document.email.company.value 
						  mess = mess + "\n--------------------------------------------------------"
						  mess = mess + "\nMESSAGE: " + window.document.email.comments.value  

						 window.document.sendit.emailto.value = emvalue;
						 window.document.sendit.contactname.value = window.document.email.first.value + " " + window.document.email.last.value;	 
						 window.document.sendit.emailmess.value = mess;
						 window.document.sendit.emailfrom.value = window.document.email.email.value;
						 window.document.sendit.emailsubject.value = window.document.email.subject.value;
						 window.document.sendit.cntl.value = 1;
						 window.document.sendit.submit();
						 clearIt();
						 return true;
					       } else {alert("We COULD NOT SEND your request\n\rto Advanced PlastiForm.\n\r\n\rReasons:\r\n\r\n" + error); return false;}
					  }
					   
					   function checkbrowser() {
						  var is = new Is();
						  if(!is.ie && !is.ns6) {self.href="badbrowser.html"; return false;}
						  return true;
					  }
					  
					  function Is() {
						  agent       = navigator.userAgent.toLowerCase();
						  this.major  = parseInt(navigator.appVersion);
						  this.minor  = parseFloat(navigator.appVersion);
						  this.ns     = ((agent.indexOf('mozilla')   != -1) &&
						                (agent.indexOf('spoofer')    == -1) &&
						                (agent.indexOf('compatible') == -1) &&
						                (agent.indexOf('opera')      == -1) &&
						                (agent.indexOf('webtv')      == -1) &&
						                (agent.indexOf('hotjava')    == -1) &&
						      			(agent.indexOf("msie")  == -1));
						  this.ns2    = (this.ns && (this.major      ==  2));
						  this.ns3    = (this.ns && (this.major      ==  3));
						  this.ns4    = (this.ns && (this.major      ==  4));
						  this.ns6    = (this.ns && (this.major      >=  5));
						  this.ie     = ((agent.indexOf("msie")      != -1) &&
						                (agent.indexOf("opera")      == -1));
						  this.ie3    = (this.ie && (this.major      <   4));
						  this.ie4    = (this.ie && (this.major      ==  4) &&
						                (agent.indexOf("msie 4")     != -1));
						  this.ie5    = (this.ie && (this.major      ==  4) &&
						                (agent.indexOf("msie 5")     != -1) &&
						                (agent.indexOf("msie 5.5")   == -1) &&
						                (agent.indexOf("mac")        == -1));
						  this.iem5   = (this.ie && (this.major      ==  4) &&
						                (agent.indexOf("msie 5.")    != -1) &&
						               	(agent.indexOf("mac")        != -1));
						  this.ie55   = (this.ie && (this.major      ==  4) &&
						                (agent.indexOf("msie 5.5")   != -1));
						  this.ie6    = (this.ie && (this.major      ==  4) &&
						                (agent.indexOf("msie 6")     != -1));
						  this.moz = (agent.indexOf("gecko")!= -1)
						  this.nsdom  = (this.ns4  || this.ns6);
						  this.win = (agent.indexOf("win") != -1);
						  this.iestrict = (this.win && this.ie6 && window.document.compatMode == "CSS1Compat");
						  this.macstrict = (this.ie5 && this.iemac && window.document.doctype && window.document.doctype.name.indexOf(".dtd") != -1);
						  this.strict = (this.iestrict || this.macstrict);
						  this.iemac =(this.iem5);
						  this.iewin = ((this.ie5 && !this.iemac || this.ie55 || this.ie6) && this.win);
						  this.dom = (this.iewin || this.ns6 || this.moz);
					}
					
			 var testresults;
			 function checkemail(){
					var str=window.document.email.email.value;
					var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
					if (filter.test(str))
					testresults=true
					else{
					testresults=false
					}
					return (testresults)
			 }
			 
			   function checkphone(){
					var str=window.document.email.phone.value;
					var filter=/^[0-9]{3,3}[-]*[0-9]{3,3}[ ]*[-]{0,1}[ ]*[0-9]{4,4}[ ]*$/
					if (filter.test(str))
					testresults=true;
					else{
					testresults=false;
					}
					return (testresults)
			 }
			
			 
			function IsNumeric(sText) { 
			   var ValidChars = "0123456789."; 
			   var Char;
			   for (i = 0; i < sText.length; i++) {
			       Char = sText.charAt(i);
			       if (ValidChars.indexOf(Char) == -1) {
			          return false;
			       }
			    }
			   return true;
			}