//javascript library file
function resizeWin(x,y) {

	window.resizeTo(x,y)

}

function EraseText(){
	document.form1.searchWhat.value = '';
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function toggle(o)
{
var e = document.getElementById(o);
e.style.display = (e.style.display == 'none') ? 'block' : 'none';
}

function openW(mypage,myname,w,h,features) {
if(screen.width){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
}else{winl = 0;wint =0;}
if (winl < 0) winl = 0;
if (wint < 0) wint = 0;
var settings = 'height=' + h + ',';
settings += 'width=' + w + ',';
settings += 'top=' + wint + ',';
settings += 'left=' + winl + ',';
settings += features;
win = window.open(mypage,myname,settings);
win.window.focus();
}

function verifyData()
		{
		
		var errmsg = '';
		if ((document.ContactForm.fullname.value == "") || (document.ContactForm.fullname.value == null))
			errmsg = 'Please Specify Your Full Name.\n';
		if ((document.ContactForm.phone.value == "") || (document.ContactForm.phone.value == null))
			errmsg = errmsg + 'Please Enter Your Complete Phone Number.\n';
		if (!validEmail(document.ContactForm.email.value))
			errmsg = errmsg + 'Please Enter Your verifiable email address.\n';
		if ((document.ContactForm.comments.value == "") || (document.ContactForm.comments.value == null))
			errmsg = errmsg + 'Please Enter a comment or question.\n';
		if (errmsg != '')
		{
			alert(errmsg);
		}
		else
		{
			document.ContactForm.submit();
		}	
	}

function validEmail(email) {
	invalidChars="/:,;";
	for (i=0; i<invalidChars.length;i++) {
		badChar = invalidChars.charAt(i);
		if (email.indexOf(badChar,0)>-1) {
			return false;
		}
	}
	atPos=email.indexOf("@",1);
	if(atPos==-1) {
		return false;
	}
	if (email.indexOf("@",atPos+1)>-1) {
		return false;
	}
	periodPos= email.indexOf(".",atPos);
	if (periodPos==-1) {
		return false;
	}
	if (periodPos+3 > email.length) {
		return false;
	}
	return true;
}


