<!--//--><![CDATA[//><!--
	
	function checkChecked(theChk,theElem){
		if (document.getElementById(theChk).checked) {
			dojo.lfx.html.wipeIn(theElem, 400).play()
		} else {
			dojo.lfx.html.wipeOut(theElem, 400).play()
		}
	}
	var x=1;
	function addDiv() {
		if (x>99){
			alert('Orders that contain more than 100 items will need to be placed by phone. Please use the contact information at the top of the page to add additional items.');
			return false;
		}
		x++;
		// create an empty element node
		 // without an ID, any attributes, or any content
		 var sp1 = document.createElement("div");
		
		 var newId = "specRow"+x;
		 sp1.setAttribute("id", newId);
		 sp1.setAttribute("class", "specRow");
		 
		 // create some content for the newly created element.
		var theHtml ='<div class="c1 left"><input type="text" name="quantity'+x+'" id="quantity'+x+'" class="inputText" size="3" maxlength="3" value="" /></div>';
		theHtml +='<div class="c2 left"><input type="text" name="dimensions'+x+'" id="dimensions'+x+'" class="inputText" size="10" maxlength="100" value="" /></div>';
		theHtml +='<div class="c3 left">';
		theHtml +='				<select hidefocus="true" size="1" name="frame'+x+'" id="frame'+x+'" class="inputText">';
		theHtml +='					<option></option>';
		theHtml +='					<option>White</option>';
		theHtml +='					<option>Desert Tan</option>';
		theHtml +='					<option>Anodized Bronze</option>';
		theHtml +='					<option>Sand</option>';
		theHtml +='					<option>Brownstone</option>';
		theHtml +='					<option>Sandstone</option>';
		theHtml +='					<option>Hunter Green</option>';
		theHtml +='					<option>Custom Color</option>';
		theHtml +='					<option>4 9/16 jamb-FJ</option>';
		theHtml +='					<option>5 3/8 jamb-FJ</option>';
		theHtml +='					<option>6 9/16 jamb-FJ</option>';
		theHtml +='					<option>7 1/2-FJ</option>';
		theHtml +='					<option>4 9/16-Solid</option>';
		theHtml +='					<option>5 3/8-Solid</option>';
		theHtml +='					<option>6 9/16-Solid</option>';
		theHtml +='					<option>7 1/2-Solid</option>';
	theHtml +='					</select>';					
theHtml +='					</div>';
theHtml +='					<div class="c4 left">';
	theHtml +='					<select hidefocus="true" size="1" name="hanging-type'+x+'" id="hanging-type'+x+'" class="inputText">';
		theHtml +='					<option></option>';
		theHtml +='					<option>Slider XO</option>';
		theHtml +='					<option>Slider OX</option>';
		theHtml +='					<option>Slider XOX</option>';
		theHtml +='					<option>Double Slider</option>';
		theHtml +='					<option>Single Hung</option>';
		theHtml +='					<option>Double Hung</option>';
		theHtml +='					<option>Casement</option>';
		theHtml +='					<option>Double Casement</option>';
		theHtml +='					<option>Triple Casement</option>';
		theHtml +='					<option>CAS/PIC/CAS</option>';
		theHtml +='					<option>Awning</option>';
		theHtml +='					<option>Double Awning</option>';
		theHtml +='					<option>Picture Window</option>';
		theHtml +='					<option>Patio Slider XO</option>';
		theHtml +='					<option>Patio Slider OX</option>';
		theHtml +='					<option>Patio Slider OXO</option>';
		theHtml +='					<option>Patio Slider OXXO</option>';
		theHtml +='					<option>French Door IS-AP</option>';
		theHtml +='					<option>French Door IS-PA</option>';
		theHtml +='					<option>French Door OS-AP</option>';
		theHtml +='					<option>French Door OS-PA</option>';
		theHtml +='					<option>French Door Sidelite</option>';
	theHtml +='					</select>	';				
theHtml +='					</div>';
theHtml +='					<div class="c5 left">';
	theHtml +='					<select hidefocus="true" size="1" name="glass-type'+x+'" id="glass-type'+x+'" class="inputText">';
		theHtml +='					<option></option>';
		theHtml +='					<option>LOE Standard</option>';
		theHtml +='					<option>LOE Tempered</option>';
		theHtml +='					<option>Obscure</option>';
		theHtml +='					<option>Obscure Tempered</option>';
		theHtml +='					<option>Bronze Tint</option>';
		theHtml +='					<option>Bronze Tint Tempered</option>';
		theHtml +='					<option>Grey Tint</option>';
		theHtml +='					<option>Grey Tint Tempered</option>';
		theHtml +='					<option>Rain Glass</option>';
		theHtml +='					<option>Rain Glass Tempered</option>';
		theHtml +='					<option>Glue Chip Glass</option>';
		theHtml +='					<option>Glue Chip Tempered</option>';
		theHtml +='					<option>Delta Frost</option>';
		theHtml +='					<option>Delta Frost Tempered</option>';
		theHtml +='					<option>Laminated LOE</option>';
		theHtml +='					<option>Laminated</option>';
		theHtml +='					<option>LOE - 3/16</option>';
		theHtml +='					<option>LOE - 3/16 Tempered</option>';
		theHtml +='					<option>1/4  Clear</option>';
		theHtml +='					<option>LOE - 140</option>';
		theHtml +='					<option>LOE - 336</option>';
		theHtml +='					<option>Clear Insulated</option>';
	theHtml +='					</select>';					
theHtml +='					</div>';
		 
		 
		 sp1.innerHTML = theHtml;
		/* var sp1_content = document.createTextNode("This is a new div element. ");
		
		 // apply that content to the new element
		 sp1.appendChild(sp1_content);*/
		
		 var sp2 = document.getElementById("addRow");
		 var parentDiv = sp2.parentNode;
		
		 // insert the new element into the DOM before sp2
		 parentDiv.insertBefore(sp1, sp2);	
		 //addLabel(newId);
		 fadeInThis(newId);
		}
	
	
	function addLabel(thisParentDiv) {
		 var newLabel = document.createElement("label");
		 var newId = "newLbl"+x;
		 newLabel.setAttribute("id", newId);
		 newLabel.setAttribute("class", "newLbl");
		 var newLabel_content = document.createTextNode("This is a new new label element. ");
		 newLabel.appendChild(newLabel_content);
		 var par = document.getElementById(thisParentDiv);
		 par.appendChild(newLabel);	
		}
		
		
		function fadeInThis(theID) {
			dojo.lfx.html.wipeIn(theID, 300).play()
			/*dojo.lfx.html.fadeShow(theID, 1000).play()*/
		}

function validateOnSubmit(theForm) {
	var errs = 0;
	var err_string = "";
//check required fields	

	if (document.getElementById('name').value == '') {
			document.getElementById('lblName').style.color = "#ff0000";
			document.getElementById('name').focus();
			alert('Name is a required field');
			return false;
	}
	var strEmail = document.getElementById('email').value;
	if (document.getElementById('email').value == '') {
			document.getElementById('lblEmail').style.color = "#ff0000";
			document.getElementById('email').focus();
			alert('Email is a required field');
			return false;
	}

	//validate email the data provided
	var emailFilter=/^.+@.+\..{2,3}$/;
	var strEmail = document.getElementById('email').value;
	if (!(emailFilter.test(strEmail))) { 
		document.getElementById('lblEmail').style.color = "#ff0000";
		document.getElementById('email').focus();
		alert('Please enter a valid email address');
		return false;
	}
	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/
	if (strEmail.match(illegalChars)) {
		document.getElementById('lblEmail').style.color = "#ff0000";
		document.getElementById('email').focus();
		alert('The email address contains illegal characters');
		return false;
	}
	
	if (theForm=='contact'){
		if (document.getElementById('message').value == '') {
				document.getElementById('lblMessage').style.color = "#ff0000";
				document.getElementById('message').focus();
				alert('Please enter your message');
				return false;
		}
	}
	return true;
}
//--><!]]>