// JavaScript Document

//script for image loader
function loadimages() {
	if (document.images)
	{
	  pic1= new Image(1,144); 
	  pic1.src="images/01-02-middle1.gif"; 
	  pic2= new Image(223,144); 
	  pic2.src="images/01-01-logo.gif"; 
	  pic3= new Image(97,105); 
	  pic3.src="images/01-top_right.gif";
	  pic4= new Image(97,39);
	  pic4.src="images/01-10-portfolio_filler.gif"; 
	  pic5= new Image(954,57);
	  pic5.src="images/02-midsection.gif";
	  pic6= new Image(731,1);
	  pic6.src="images/03-01-left_column1.gif";
	}
}	

//script for random testimonial text
window.onload = function() {
	var rand=(Math.floor(Math.random() * 3) + 1);
	document.getElementById('ran'+rand).style.display='inline';
}


//script for contact page
function validate() {
     if (document.contactform.fullname.value == "")
		{
		alert ("Please enter your name.")
		return false
		}
	if (document.contactform.message.value == "")
		{
		alert ("Please enter a message.")
		return false
		}
	if(document.contactform.email.value.length == 0) { 
      document.contactform.email.focus(); 
      alert("Please enter your email."); 
      return false; 
      }
	  
	if(-1 == document.contactform.email.value.indexOf("@")) { 
       document.contactform.email.focus(); 
       alert("Your email must have a '@'."); 
       return false; 
       }
    if(-1 != document.contactform.email.value.indexOf(",")) { 
       document.contactform.email.focus(); 
       alert("Your email must not have a ',' in it"); 
       return false; 
       }
    if(-1 != document.contactform.email.value.indexOf("#")) { 
       document.contactform.email.focus(); 
       alert("Your email must not have an '#' in it." ); 
       return false; 
       }
    if(-1 != document.contactform.email.value.indexOf("!")) { 
       document.contactform.email.focus(); 
       alert("Your email must not have a '!' in it." ); 
       return false; 
       }
    if(-1 != document.contactform.email.value.indexOf(" ")) { 
       document.contactform.email.focus(); 
       alert("Your email must not have a space in it." ); 
       return false; 
       }
    if(document.contactform.email.value.length == (document.jsform.email.value.indexOf("@")+1) ) {
       document.contactform.email.focus();
       alert("Your email must have a domain name after the '@'.");
       return false;
       }
    return true;
  }
//-->