function toggle(id) {
	var inquestion = document.getElementById(id);
	if (inquestion.style.display == 'none') {
		inquestion.style.display = 'block';
	} else {
		inquestion.style.display = 'none';
	}
}
/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

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 Address")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail Address")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail Address")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail Address")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail Address")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail Address")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail Address")
		    return false
		 }

 		 return true					
	}

function ValidateForm(){
	var emailID=document.frmContact.email
	var nameID=document.frmContact.name
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please enter your e-mail address.")
		emailID.focus()
		return false
	}
	if ((nameID.value==null)||(nameID.value=="")){
		alert("Please enter your name.")
		nameID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }
function popUp(URL, width, height, arg) {
	var scroll = 0;
	if (arg == 'scroll') {
		scroll = 1;
	}
	window.self.name = "main";
	if (width > 800) {
		scroll = 1;
	}
	var remote = window.open(URL, "popup", "width=" + width + ",height=" + height + ",toolbar=0,location=0,directories=0,resizable=1,status=1,menubar=0,scrollbars=" + scroll);
}

// for the scrollbars
function scrollCheck() {
	var d = document.getElementById('div1');
	//offsetheight is the height of the div
	//scrollheight is the height of the content
	if (parseInt(d.scrollHeight) > parseInt(d.offsetHeight)) { // we need scrollbars
		document.getElementById('scrollbar_div').style.display = 'block';
	} else {
	//	alert('no scrollbar needed');
	}
	if (parseInt(d.scrollWidth) > parseInt(d.offsetWidth)) { // we need scrollbars
		document.getElementById('scrollhoz_div').style.display = 'block';
	} else {
	//	alert('no scrollbar needed');
	}
}

defaultStep=1
step=defaultStep
function scrollDivDown(id){
	document.getElementById(id).scrollTop+=step
	timerDown=setTimeout("scrollDivDown('"+id+"')",10)
}
function scrollDivUp(id){
document.getElementById(id).scrollTop-=step
timerUp=setTimeout("scrollDivUp('"+id+"')",10)
}
function scrollDivLeft(id){
document.getElementById(id).scrollLeft-=step
timerLeft=setTimeout("scrollDivLeft('"+id+"')",10)
}
function scrollDivRight(id){
document.getElementById(id).scrollLeft+=step
timerRight=setTimeout("scrollDivRight('"+id+"')",10)
}
