
//--------------------------------------------------minimum requirement
function newWin(url){
	
	var dw=800;// new window width
 	var dh=770;// new window height
	
	var newwindow=window.open(url,'news','width='+dw+',height='+dh+',top=0,left=0,toolbar=no, scrollbars=no, menubar=no, status=no, resizable=no, directories=no');
	
	if (window.focus){
	newwindow.focus()
	}
	return false;
}

//--------------------------------------------------minimum requirement
function newWin2(url){
	
	var sw=screen.availWidth; // screen width
 	var sh=screen.availHeight; // screen height
	
	var nw=420;// new window width
 	var nh=520;// new window height
	
	var ml=(sw-nw)/2; // x position
 	var mt=(sh-nh)/2; // y position
	
	var newwindow=window.open(url,'name','width='+nw+',height='+nh+',top='+mt+',left='+ml+',toolbar=no, scrollbars=no, menubar=no, status=no, resizable=no, directories=no');
	
	if (window.focus){
	newwindow.focus()
	}
	return false;
}


//--------------------------------------------------rollover_info
function course1(target){
	if (document.getElementById){
		var showlist = document.getElementById(target).style;
		if(showlist.display=="block"){
			showlist.display="none";
		}else{
			document.getElementById('course1sub').style.display="none";
			showlist.display="block";
		}
		return false;
	}else{
		return true;
	}
}

function course2(target){
	if (document.getElementById){
		var showlist = document.getElementById(target).style;
		if(showlist.display=="block"){
			showlist.display="none";
		}else{
			document.getElementById('course2sub').style.display="none";	
			showlist.display="block";
		}
		return false;
	}else{
		return true;
	}
}

function course3(target){
	if (document.getElementById){
		var showlist = document.getElementById(target).style;
		if(showlist.display=="block"){
			showlist.display="none";
		}else{
			document.getElementById('course3sub').style.display="none";	
			showlist.display="block";
		}
		return false;
	}else{
		return true;
	}
}

function course4(target){
	if (document.getElementById){
		var showlist = document.getElementById(target).style;
		if(showlist.display=="block"){
			showlist.display="none";
		}else{
			document.getElementById('course4sub').style.display="none";	
			showlist.display="block";
		}
		return false;
	}else{
		return true;
	}
}

//--------------------------------------------------validate terms and conditions
function validate(){
	if(document.equip_form.fname.value==""){
		alert("Enter a First Name")
		document.myform.fname.focus()
		return false;
	}else if(document.equip_form.lname.value==""){
		alert("Enter a Last Name")
		document.myform.lname.focus()
		return false;
	}else if ((document.equip_form.email.value.indexOf("@") == -1)||(document.myform.email.value.indexOf(".") == -1)){
		alert("Not a valid e-mail")
		document.myform.email.focus()
		return false;
	}else if(document.equip_form.vemail.value!=document.myform.email.value){
		alert("Check your email address again")
		document.myform.vemail.focus()
		return false;
	}
	return true;
}


//--------------------------------------------------validate form
function validate2(){
	if(document.equip_form.EquipUsername.value==""){
		alert("Enter a username")
		document.equip_form.EquipUsername.focus()
		return false;
	}else if(document.equip_form.EquipPassword.value==""){
		alert("Enter a password")
		document.equip_form.EquipUsername.focus()
		return false;
	}
	return true;
}
