function validate() {

var theMessage = "Please complete the following: \n-----------------------------------\n";
var noErrors = theMessage

//alert(theMessage);

if (document.myForm.Name.value=="") {
theMessage = theMessage + "\n --> Your Name";
}
if (document.myForm.Email.value=="") {
theMessage = theMessage + "\n --> Your E-mail";
}

if (document.myForm.emailAddress.value=="") {
} else {
	var emailID=document.myForm.emailAddress
	if (echeck(emailID.value)==false){
		theMessage = theMessage + "\n --> Invalid Email Address";
	}
}

if (document.myForm.Contact.value=="") {
theMessage = theMessage + "\n --> Your Contact Number";
}

// If no errors, submit the form
if (theMessage == noErrors) {
return true;
} else {
// If errors were found, show alert message
alert(theMessage);
return false;
}
}

function initRollovers() {
    if (!document.getElementById) return
      
    var aPreLoad = new Array();
    var sTempSrc;
    var aImages = document.getElementsByTagName('img');
    for (var i = 0; i < aImages.length; i++) {
	if (aImages[i].className == 'rollover') {
	    var src = aImages[i].getAttribute('src');
	    var ftype = src.substring(src.lastIndexOf('.'), src.length);
	    var hsrc = src.replace(ftype, '_over'+ftype);

	    aImages[i].setAttribute('hsrc', hsrc);
	    
	    aPreLoad[i] = new Image();
	    aPreLoad[i].src = hsrc;
	    
	    aImages[i].onmouseover = function() {
		sTempSrc = this.getAttribute('src');
		this.setAttribute('src', this.getAttribute('hsrc'));
	    }
	    aImages[i].onmouseout = function() {
		if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_over'+ftype, ftype);
		this.setAttribute('src', sTempSrc);
	    }
	}
    }
}

function noSpam(user,domain) {
		locationstring = "mailto:" + user + "@" + domain;
		window.location = locationstring;
}

function mailfriend() { window.open("mailfriend.html","mailfriend","width=400,height=400,left=140,top=275,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no"); }


function createWindow(cUrl,cName,cFeatures) {
var xWin = window.open(cUrl,cName,cFeatures)
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function PrinterFriendlyContent() 
{ 
var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
sOption+="scrollbars=yes,resizable=yes"; 

var sWinHTML = document.getElementById('contentstart').innerHTML; 

var winprint=window.open("","",sOption); 
winprint.document.open(); 
winprint.document.write('<html><link href=print.css rel=Stylesheet><body onload=window.print()>');
winprint.document.write(sWinHTML);
winprint.document.write('</body></html>'); 
winprint.document.close(); 
winprint.focus(); 
}

function validatenews() {

var theMessage = "Please complete the following: \n-----------------------------------\n";
var noErrors = theMessage

if (document.NewsletterForm.emailAddress.value=="") {
theMessage = theMessage + "\n --> Your E-mail";
}

if (document.NewsletterForm.emailAddress.value=="") {
} else {
	var emailID=document.NewsletterForm.emailAddress
	if (echeck(emailID.value)==false){
		theMessage = theMessage + "\n --> Invalid Email Address";
	}
}

// If no errors, submit the form
if (theMessage == noErrors) {
return true;
} else {
// If errors were found, show alert message
alert(theMessage);
return false;
}
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   //alert("Invalid E-mail")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   //alert("Invalid E-mail")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   // alert("Invalid E-mail")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    //alert("Invalid E-mail")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    //alert("Invalid E-mail")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    //alert("Invalid E-mail")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    //alert("Invalid E-mail")
		    return false
		 }

 		// return true					
	}

