﻿
	function toggleLayer(whichLayer)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style2 = document.getElementById(whichLayer).style;
	style2.display = style2.display? "":"block";

	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style2 = document.all[whichLayer].style;
	style2.display = style2.display? "":"block";

	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style2 = document.layers[whichLayer].style;
	style2.display = style2.display? "":"block";
	}
	}


	function hide(object) {
	    if (document.getElementById && document.getElementById(object) != null)
	         node = document.getElementById(object).style.display='none';
	    else if (document.layers && document.layers[object] != null)
	        document.layers[object].display = 'none';
	    else if (document.all)
	         document.all[object].style.display = 'none';}


function emailvalidation(field, alertbox) {
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.sex)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\..{2,2}))$)\b/gi);
apos=field.value.indexOf("@");
dotpos=field.value.lastIndexOf(".");
lastpos=field.value.length-1;
var badEmail = (apos<1 || dotpos-apos<2 || lastpos-dotpos<2)
if (goodEmail && !badEmail) {
return true;
}
else {
alert(alertbox);
field.focus();
field.select();
return false;
   }
}
function emptyvalidation(entered, alertbox)
{
with (entered)
{
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}
function formvalidation(thisform)
{
with (thisform)
{

if (emptyvalidation(name,"Please fill your name")==false) {name.focus(); return false;};

if (emailvalidation(email,"PLease fill a valid email address")==false) {email.focus(); return false;};

}

}




function RunFoo()
{
   document.write('<object type="application/x-shockwave-flash" data="homepage.swf" width="280" height="280">\n');
   document.write(' <param name="movie" value="homepage.swf" />\n');
   document.write('</object>\n');
}
