

/********************\
 )		subnav		(
\********************/
function toggle(id,left_px,type) {	
	//safe function to show an element with a specified id
	
	var x=document.getElementById(id+"_dd")
	
	if (document.getElementById) { // DOM3 = IE5, NS6
			x.style.left = left_px;
		} else {
			if (document.layers) { // Netscape 4

				document.id.left = left_px;
			}
			else { // IE 4
				document.all.id.style.left = left_px;
			}
		}
	highlight(id,type);
}


function toggleRO(imageName,myimage){
		document.images[imageName].src= myimage;
		
}
function highlight(lnk,type) {
		if(type == 1) document.getElementById(lnk).style.backgroundColor='transparent';
		else if(type == 2)  document.getElementById(lnk).style.backgroundColor='#FF6600';
}

/********************\
 )		/subnav		(
\********************/

/***** Date code

/******************* Homepage Date *************************/

var imgArray = new Array();

function getSubImage(imageName){
	var randomNumber;
	if(imageName == "rotate"){
		randomNumber = Math.floor((Math.random()*9) + 1);
	} else if(imageName == "deconstruction"){
		randomNumber = Math.floor((Math.random()*3) + 1);
	} else if(imageName == "custom_home"){
		randomNumber = Math.floor((Math.random()*4) + 1);
	} else if(imageName == "retail"){
		randomNumber = Math.floor((Math.random()*2) + 1);
	} else if(imageName == "custom_contract"){
		randomNumber = Math.floor((Math.random()*2) + 1);
	} else {
		randomNumber = '';
	}

	document.write('<img src="/images/subpages/'+imageName+randomNumber+'.jpg">');
}
		
		
		
		
		
		
		
function valid_form_full(){
	
	var firstname = document.contact_form.fullname;
	var phone = document.contact_form.phone;
	var outline = document.contact_form.outline;
	var company = document.contact_form.company;
	var email = document.contact_form.email;
	
	if(firstname.value==""){
			alert("Please Enter A Name");
			return false
		} 
	if(phone.value==""){
			alert("Please Enter A Phone Number");
			return false
	} 
	
	if(email.value != ""){
			
			if(!isValidEmail(email.value)){
				alert("Please Enter a Valid Email");
				return false
			}
		}
	else {
		alert("Please Enter a Valid Email");
		return false
	}
	return true;

};


function check_email(e) {
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	for(i=0; i < e.length ;i++){
		if(ok.indexOf(e.charAt(i))<0){ 
			return (false);
		}	
	} 
}

function isValidEmail(str) {

   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
 
}
