function parentBrowse(url){
	window.opener.location=url;
	window.opener.focus();
	}
function openClean(url,name){
	window.open(url,name,'toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, directories=no, status=no');
	}

	
function openSub(url,h,w){
	lilWin=window.open(url, 'lilWin', 'height=' + h + ', width=' + w +', noscrollbars');
	lilWin.resizeTo(w,h);
	lilWin.focus();
	}
	
function validateForm()
    {
	formObj = document.contactform;
	if (formObj.fname.value == "") {
	    alert("Please enter your first name");
	    formObj.fname.focus();
	    return false;
	}
	else if (formObj.lname.value == "") {
	    alert("Please enter your last name");
	    formObj.lname.focus();
	    return false;
	}
	else if (formObj.addr1.value == "") {
	    alert("Please enter your address");
	    formObj.addr1.focus();
	    return false;
	}
	else if (formObj.city.value == "") {
	    alert("Please enter your city");
	    formObj.city.focus();
	    return false;
	}
	else if (formObj.state.options[0].selected){
	    alert("Please choose your state");
	    formObj.state.focus();
	    return false;
	}
	else if (formObj.zip.value == "") {
	    alert("Please enter your zip");
	    formObj.zip.focus();
	    return false;
	}
	else if (formObj.emailadd.value.indexOf("@")<3){
		 alert("Please enter a valid email address!");
		 formObj.email.focus();
		 return false;
	}
	else if (formObj.phone.value == "") {
	    alert("Please enter you phone number");
	    formObj.phone.focus();
	    return false;
	}
	else if ((formObj.emailadd.value.indexOf(".com")<5)&&(formObj.emailadd.value.indexOf(".org")<5)
		&&(formObj.emailadd.value.indexOf(".gov")<5)&&(formObj.emailadd.value.indexOf(".net")<5)
		&&(formObj.emailadd.value.indexOf(".mil")<5)&&(formObj.emailadd.value.indexOf(".edu")<5)){
		alert("Please enter a valid email address! (It should include a "
		+".com,.net,.org,.gov,.edu or .mil)");
		formObj.emailadd.focus();
		return false;
		}
	}
	
	function validateForm2()
    {
	formObj = document.contactform;
	if (formObj.fname.value == "") {
	    alert("Please enter a first name");
	    formObj.fname.focus();
	    return false;
	}
	else if (formObj.lname.value == "") {
	    alert("Please enter a last name");
	    formObj.lname.focus();
	    return false;
		}
	}	
	
//code for showing larger pictures

function ShowLarge(y){
var x = 1;
	while(x <= 4){
		bob = x+'pic';
		if(x == y){
			document.all[bob].style.visibility = 'visible';
			}
		else{
			document.all[bob].style.visibility = 'hidden';
			}
		x++;
		}
	}
	
//SkimStone Calculator Code
// this calculator determines the amount of SkimStone needed for x square feet
// of a substrate of condition x for a standard 3 coat trowel applied floor 
// application. March 7, 2003 R. Reinking

function wizard(form) {
				 function clearform()  {
				 					form.type1.value = "";
				 					form.type2.value = "";
  			 					form.type3.value = "";
				 					form.powder1.value = "";
				 					form.powder2.value = "";
				 					form.powder3.value = "";
				 					form.strength1Out.value = "";
				 					form.strength2Out.value = "";
				 					form.strength3Out.value = "";
				 					form.color1Out.value = "";
				 					form.color2Out.value = "";
				 					form.color3Out.value = "";
				 					form.solutionPails.value = "";
				 					form.powderPails.value = "";
				 					form.matListColOne.value = "";
				 					form.matListColTwo.value = "";
				 					form.matListColThree.value = "";
				 					form.sealer.value = "";
				 					form.colorpaks1.value = "";
				 					form.colorpaks2.value = "";
				 					form.colorpaks3.value = "";
			  }
				 


//variable assignments...	 
var substrate = form.substrate.value; //gets multiplied to calculate 1st coat   
var powdervar = 12; //fixed variable; gets reduced by 1 oz for each coat   
var coats = 0; //gets augmented as colors are chosen
var i = 0; //used in for loop
var length = form.length.value;
var width = form.width.value;
var area = form.inputArea.value;
var solution = new Array(form.type1.value, form.type2.value, form.type3.value);
var powder = new Array(form.powder1.value, form.powder2.value, form.powder3.value);
var strengthIn = new Array(form.strength1In.value, form.strength2In.value, form.strength3In.value);
var strengthOut = new Array(form.strength1Out.value, form.strength2Out.value, form.strength3Out.value);
var colorIn = new Array(form.color1In.value, form.color2In.value, form.color3In.value); 
var colorOut = new Array(form.color1Out.value, form.color2Out.value, form.color3Out.value);

//determines if entry is in inches or feet; converts to feet...
if (form.lengthUnits.value != 1) {
   form.length.value = form.length.value / 12;
   form.lengthUnits.value = 1;}
if (form.widthUnits.value != 1) {
   form.width.value = form.width.value / 12;
   form.widthUnits.value = 1;}
	 
// form validations ///////////////////////////////////////////////////////////
if (isNaN(substrate)){
	alert ("Please enter a numerical value for the substrate rating");
				form.substrate.value="";
			  clearform();
				return;}
if (substrate > 5){
	alert ("Please enter a numerical value from 1 to 5 for the substrate rating");
				form.substrate.value="";
			  clearform();
			  return;}
if (substrate < 1){
	alert ("Please enter a numerical value from 1 to 5 for the substrate rating");
				form.substrate.value="";
			  clearform();
			  return;}
if (isNaN(length)){
	alert ("Please enter a numerical value for the length");
				form.length.value="";
			  form.width.value="";
			  form.inputArea.value="";
			  clearform();
			  return;}
if (isNaN(width)){
	      alert ("Please enter a numerical value for the width");
				form.length.value="";
			  form.width.value="";
			  form.inputArea.value="";
			  clearform();
			  return;}
if (isNaN(area)){
	      alert ("Please enter a numerical value for the area");
				form.length.value="";
			  form.width.value="";
			  form.inputArea.value="";
			  clearform();
			  return;} 
if (length!="" && area!="" && width=="") {
   			alert ("Please enter either the dimensions OR the square footage.");
				form.length.value="";
			  form.width.value="";
			  form.inputArea.value="";
			  clearform();
			  return;}
if (width!="" && area!="") {
   			alert ("Please enter either the dimensions OR the square footage.");
				form.length.value="";
			  form.width.value="";
			  form.inputArea.value="";
			  clearform();
			  return;}
if (length!="" && width!="" && area!="") {
   			alert ("Please enter either the dimensions OR the square footage.");
				form.length.value="";
			  form.width.value="";
			  form.inputArea.value="";
			  clearform();
			  return;}
if (length=="" && width!="" && area=="") {
   			alert ("Please enter the length AND width.");
				form.length.value="";
			  form.width.value="";
			  form.inputArea.value="";
			  clearform();
			  return;}
if (length!="" && width=="" && area=="") {
   			alert ("Please enter the length AND width.");
				form.length.value="";
			  form.width.value="";
			  form.inputArea.value="";
			  clearform();
			  return;}
if (length=="" && width=="" && area=="") {
   			alert ("Dimensions or a square footage entry are needed to proceed.");
				form.length.value="";
			  form.width.value="";
			  form.inputArea.value="";
				clearform();
			  return;}

// figures area based on dimensions or user entry /////////////////////////////			   
if (length=="" && width=="" && area!="") {
   			   form.area.value = (Math.ceil(area*10))/10;}
if (length!="" && width!="" && area=="") {
   			   form.area.value = (Math.ceil(form.length.value * form.width.value *10))/10;
			   }

// color / strength validation ////////////////////////////////////////////////			   
if (form.color1In.value != 0 && strengthIn[0] != 0) {
   			   coats++;}			   
if (form.color1In.value == 0 && strengthIn[0] != 0) {
   			   alert ("Please select a color for the first coat.");
			   return;}
if (form.color1In.value != 0 && strengthIn[0] == 0) {
   			   alert ("Please select a color strength for the first coat.");
			   return;}
if (form.color2In.value != 0 && strengthIn[1] != 0) {
   			   coats++;}
if (form.color2In.value == 0 && strengthIn[1] != 0) {
   			   alert ("Please select a color for the second coat.");
			   return;}
if (form.color2In.value != 0 && strengthIn[1] == 0) {
   			   alert ("Please select a color strength for the second coat.");
			   return;}
if (form.color3In.value != 0 && strengthIn[2] != 0) {
   			   coats++;}
if (form.color3In.value == 0 && strengthIn[2] != 0) {
   			   alert ("Please select a color for the third coat.");
			   return;}
if (form.color3In.value != 0 && strengthIn[2] == 0) {
   			   alert ("Please select a color strength for the third coat.");
			   return;}
if (form.color1In.value == 0 && strengthIn[0] == 0
	&& form.color2In.value == 0 && strengthIn[1] == 0
	&& form.color3In.value == 0 && strengthIn[2] == 0) {
   			 alert ("Please specify the color(s) and color strength(s) you would like to use");
				 clearform();
			   return;}
if (form.color1In.value == 0 && strengthIn[0] == 0
	&& form.color2In.value == 0 && strengthIn[1] == 0
	&& form.color3In.value != 0 && strengthIn[2] != 0){
			   alert ("Please specify the color(s) and color strength(s) you would like to use for the first and second coats.");
			   clearform();
				 return;}
if (form.color1In.value != 0 && strengthIn[0] != 0
	&& form.color2In.value == 0 && strengthIn[1] == 0
	&& form.color3In.value != 0 && strengthIn[2] != 0){
			   alert ("Please specify the color and color strength you would like to use for the second coat.");
			   clearform();
				 return;}
if (form.color1In.value == 0 && strengthIn[0] == 0
	&& form.color2In.value != 0 && strengthIn[1] != 0
	&& form.color3In.value == 0 && strengthIn[2] == 0){
			   alert ("Please specify the color(s) and color strength(s) you would like to use for the first and third coats.");
			   clearform();
				 return;}
if (form.color1In.value == 0 && strengthIn[0] == 0
	&& form.color2In.value != 0 && strengthIn[1] != 0
	&& form.color3In.value != 0 && strengthIn[2] != 0){
			   alert ("Please specify the color and color strength you would like to use for the first coat.");
			   clearform();
				 return;}
if (form.color1In.value != 0 && strengthIn[0] != 0
	&& form.color2In.value != 0 && strengthIn[1] != 0
	&& form.color3In.value == 0 && strengthIn[2] == 0){
			   alert ("Please specify the color and color strength you would like to use for the third coat.");
				 clearform();
			   return;}
if (form.color1In.value != 0 && strengthIn[0] != 0
	&& form.color2In.value == 0 && strengthIn[1] == 0
	&& form.color3In.value == 0 && strengthIn[2] == 0){
			   alert ("Please specify the color(s) and color strength(s) you would like to use for the second and third coats.");
			   clearform();
				 return;}
				 
// calculations ///////////////////////////////////////////////////////////////	
var rawArea = form.area.value;
	
if (substrate == 1){substrate = 1}
if (substrate == 2){substrate = 3.99;
	 powdervar = powdervar +2;
	 }
if (substrate == 3){substrate = 10;
	 powdervar = powdervar +4;
	 }
if (substrate == 4){substrate = 22.22;
	 powdervar = powdervar +6;
	 }
if (substrate == 5){substrate = 46.67;
	 powdervar = powdervar +6;
	 }

			   
for (i=0; i<coats; i++){
if (i == 0){
	 solution[i] = (form.area.value * .09);
	 solution[i] = Math.round(solution[i] * substrate);
	 powder[i] = ((form.area.value * substrate) * powdervar)/100;
	 powder[i] = Math.round (powder[i]);
	 strengthOut[i] = (Math.round((solution[i]/128)*strengthIn[i]*100))/100;
	 powdervar = 10;
	 }
	 else {
	 solution[i] = Math.round(rawArea * .09);
	 powder[i] = Math.round((rawArea * powdervar)/100);
	 strengthOut[i] = (Math.round((solution[i]/128)*strengthIn[i]*100))/100;
	 } 
}
form.type1.value = solution[0];
form.type2.value = solution[1];
form.type3.value = solution[2];
form.powder1.value = powder[0];
form.powder2.value = powder[1];
form.powder3.value = powder[2];
form.strength1Out.value = strengthOut[0];
form.strength2Out.value = strengthOut[1];
form.strength3Out.value = strengthOut[2];

for (i=0; i<3; i++){
if(colorIn[i] == 0)
		colorOut[i] = "";
if(colorIn[i] == 1)
		colorOut[i] = "Oystershell";
if(colorIn[i] == 2)
		colorOut[i] = "Rainy Day Blue";
if(colorIn[i] == 3)
		colorOut[i] = "Yellowstone";
if(colorIn[i] == 4)
		colorOut[i] = "Forest Fern";
if(colorIn[i] == 5)
		colorOut[i] = "Winter Olive";
if(colorIn[i] == 6)
		colorOut[i] = "Mocha";
if(colorIn[i] == 7)
		colorOut[i] = "Florentine Clay";
if(colorIn[i] == 8)
		colorOut[i] = "Minoan Red";
if(colorIn[i] == 9)
		colorOut[i] = "Eggplant";
if(colorIn[i] == 10)
		colorOut[i] = "Deep Slate";
}
form.color1Out.value = colorOut[0];
form.color2Out.value = colorOut[1];
form.color3Out.value = colorOut[2];
		
//begin materials list code....////////////////////////////////////////////////

var typeiTotal = solution[0] + solution[1] + solution[2];
var powderTotal = powder[0] + powder[1] + powder[2];
var gallon = 116; // gallon short filled to 116 ounces
var pail = 21.62; // based on average of 21.62 oz / lb
form.solutionPails.value = Math.ceil(typeiTotal/gallon);
form.powderPails.value = Math.ceil(powderTotal/pail);


form.matListColOne.value = form.color1Out.value;
form.matListColTwo.value = form.color2Out.value;
form.matListColThree.value = form.color3Out.value;

if (form.color1Out.value == form.color2Out.value && form.color1Out.value != form.color3Out.value){
   strengthOut[0] =  strengthOut[0] +  strengthOut[1];
   strengthOut[1] = strengthOut[2];
   form.matListColTwo.value = form.color3Out.value;
	 form.matListColThree.value = "";
	 strengthOut[2] = 0;
   }
if (form.color1Out.value == form.color2Out.value && form.color1Out.value == form.color3Out.value){
   strengthOut[0] =  strengthOut[0] +  strengthOut[1] + strengthOut[2];
   strengthOut[1] = 0;
   form.matListColTwo.value = "";
	 form.matListColThree.value = "";
	 strengthOut[2] = 0;
   }
if (form.color1Out.value == form.color3Out.value){
   strengthOut[0] = strengthOut[0] + strengthOut[2];
   strengthOut[2] = 0;
   form.matListColThree.value = "";
   }
if (form.color2Out.value == form.color3Out.value){
   strengthOut[1] = strengthOut[1] + strengthOut[2];
   strengthOut[2] = 0;
   form.matListColThree.value = "";
   }


form.colorpaks1.value = Math.ceil( strengthOut[0]/4);

if ( strengthOut[1] > 0){
   form.colorpaks2.value = Math.ceil( strengthOut[1]/4);
   }
   else{form.colorpaks2.value = "";
   }
if ( strengthOut[2] > 0){
   form.colorpaks3.value = Math.ceil( strengthOut[2]/4);
   }
   else{form.colorpaks3.value = "";
   }
form.sealer.value = Math.ceil((rawArea/400)); //based on 3-4 coats sealer
form.area.value = rawArea;
}

//copyright, line 1 & line 3 alignment
function moveStuff(){
var pHg = window.pageYOffset || document.body.scrollHeight || document.documentElement.scrollHeight;
  myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
	layerRef="document.layers";
	styleSwitch="";	
  } else {
	layerRef="document.all";
	styleSwitch=".style";
    if( document.documentElement &&
        ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      myHeight = document.documentElement.clientHeight;
    } else {
      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
      }
    }
  }
  //alert(pHg);
  //eval(layerRef+'["Line3"]'+styleSwitch+'.height="'+(pHg-100)+'"');
  eval(layerRef+'["Copyright"]'+styleSwitch+'.top="'+(pHg-0)+'"');
  //eval(layerRef+'["Line1"]'+styleSwitch+'.height="'+(pHg-100)+'"');
  }

function imgResize()
{
	var count = 6;

	for(var i = 0; i < count; i++)
	{
		var img = document.getElementById("img" + i);
		
		if (img) {
			img.style.display = "none";
		
			if(img.width > 250 || img.height > 250)
			{
				if(img.width > img.height)
				{
					var ratio = 250 / img.width;
					img.width = 250;
					img.height = img.height * ratio;
				}
				
				if(img.height > img.width)
				{
					var ratio = 250 / img.height;
					img.height = 250;
					img.width = img.width * ratio;
				}
			}
			
			img.style.display = "inline";
		
		}
	}
}
