function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

	function verifyLogon()
	{
		var var1 = document.logon.v1;
		var var2 = document.logon.v2;
		var result = true;
		if (var1.value == "") 
		{
			result = false;
			alert("Please enter a username");
			var1.focus();
		}
		else if (var2.value == "")
		{
			result = false;
			alert("Your password cannot be blank.\nPlease try again.");
			var2.focus();
		}
		return result;
	}
	
// ** start window functions **
	function windowOpen(URL)
	{
		var wHeigth = screen.availHeight-200;
		var wWidth = 580; //screen.availWidth-200;
		var xLoc = 50;
		var yLoc = 50;
		var newWin=window.open(URL, "mediaWindow", "scrollbars=yes,width=" + wWidth +",height="+wHeigth+",left="+xLoc+",top="+yLoc+",screenY="+yLoc+",screenX="+xLoc);
		newWin.focus();
	}
	function pwdOpen(URL)
	{
		var wHeigth = 400; //screen.availHeight-300;
		var wWidth = 450; //screen.availWidth-200;
		var xLoc = (screen.width-wWidth)/2;
		var yLoc = (screen.height-wHeigth)/2;
		var newWin=window.open(URL, "pwdWindow", "width=" + wWidth +",height="+wHeigth+",left="+xLoc+",top="+yLoc+",screenY="+yLoc+",screenX="+xLoc);
		newWin.focus();
	}
	function faceOpen(URL)
	{
		var wHeigth = 450; //screen.availHeight-300;
		var wWidth = 450; //screen.availWidth-200;
		var xLoc = (screen.width-wWidth)/2;
		var yLoc = (screen.height-wHeigth)/2;
		var newWin=window.open(URL, "pwdWindow", "width=" + wWidth +",height="+wHeigth+",left="+xLoc+",top="+yLoc+",screenY="+yLoc+",screenX="+xLoc);
		newWin.focus();
	}
	
	function openParent(URL)
	{
		opener.location.href = URL;
		window.close();
	}


// ** end window functions **
	function shrinktofitimage () {
	var image = document.images.FullImage;
	window.resizeTo(image.width+70,image.height+95);
	if(document.body && document.body.clientWidth+30)
		window.resizeBy(
		image.width - document.body.clientWidth+70,
		image.height - document.body.clientHeight+95
		)
	}
	
	function shrinktofitvideo () {
//	var image = document.ImageWindow.size;
/*	window.resizeTo(window.width,gMediaHeight+150);
	if(document.body && document.body.clientWidth+30)
		window.resizeBy(
		image.width - document.body.clientWidth+70,
		image.height - document.body.gMediaHeight+150
		)
*/	}

	function checkRadio(radioGrp)
	{
		var tempresult = false;
		for (var i=0; i< radioGrp.length;i++)
		{
			//alert("value" + i + "= " + radioGrp[i].checked);
			if(radioGrp[i].checked == true)
			{
				tempresult = true;
			}
		}
		return tempresult;
	}
	
		function windowOpen2(URL)
	{
		var wHeigth = 280; //screen.availHeight-200;
		var wWidth = 450; //screen.availWidth-200;
		var xLoc = 150;
		var yLoc = 150;
		var newWin=window.open(URL, "bookmarkWindow", "width=" + wWidth +",height="+wHeigth+",left="+xLoc+",top="+yLoc+",screenY="+yLoc+",screenX="+xLoc);
		newWin.focus();
	}


// ** START VERIFY FORM FUNCTIONS
	function saveBookmark()
	{
		var bookmarkname = document.bookmark.bookmarkname;
		var result = true;
		if (bookmarkname.value == "")
		{
			result = false;
			alert("Please Enter a name for your bookmark before clicking the 'Save' button.\nOr choose 'Close window' to close this window without saving a bookmark.");
			bookmarkname.focus();
		}
		return result;
	}
	function saveNote()
	{
		var notename = document.note.notename;
		var result = true;
		if (notename.value == "")
		{
			result = false;
			alert("Please enter a note before clicking the 'Save' button.\nOr choose 'Close window' to close this window without saving a note.");
			notename.focus();
		}
		return result;
	}


	function verifyRegister()
	{
		var name = document.register.NAME;
		var surname = document.register.SURNAME;
		var username = document.register.USERNAME;
		var password = document.register.PASSWORD;
		var email = document.register.EMAIL;
		var secretquestion = document.register.SECRETQUESTION;
		var secretanswer = document.register.SECRETANSWER;
		var result = true;
		
		if (name.value == "" )
		{
			result = false;
			alert("Please enter your name");
			name.focus();
		}
		else if (surname.value == "" )
		{
			result = false;
			alert("Please enter your surname");
			surname.focus();
		}
		else if (username.value == "" )
		{
			result = false;
			alert("Please enter a username");
			usernamename.focus();
		}
		else if (password.value == "" )
		{
			result = false;
			alert("Please enter a password");
			password.focus();
		}
		else if (email.value == "" )
		{
			result = false;
			alert("Please enter a valid email address");
			email.focus();
		}
		return result;
	}

	function verifyRegisterCME()
	{
		var title = document.register.IDtitle;
		var degree = document.register.IDdegree;
		var name = document.register.name;
		var surname = document.register.surname;
		var speciality = document.register.IDspeciality;
		var organization = document.register.organization;
		var address1 = document.register.address_1;
		var city = document.register.city;
		var country = document.register.IDcountry;
		var postalcode = document.register.postalcode;
		var email = document.register.email;
		var password = document.register.PASSWORD;
		var secretquestion = document.register.SECRETQUESTION;
		var secretanswer = document.register.SECRETANSWER;
		var result = true;
		if (title.value == "none")
		{
			result = false;
			alert("Please select a title before continuing.");
			title.focus();
		}
		else if (degree.value == "none")
		{
			result = false;
			alert("Please specify a degree.");
			degree.focus();
		}
		else if (name.value == "")
		{
			result = false;
			alert("Please enter your first name");
			name.focus();
		}
		else if (surname.value == "")
		{
			result = false;
			alert("Please enter your last name");
			surname.focus();
		}
		else if (speciality.value == "none")
		{
			result = false;
			alert("Please specify a speciality.");
			speciality.focus();
		}
		else if (organization.value == "")
		{
			result = false;
			alert("Please enter an organization, affiliation or institute.");
			organization.focus();
		}
		else if (address1.value == "")
		{
			result = false;
			alert("You forgot your address!");
			address1.focus();
		}
		else if (city.value == "")
		{
			result = false;
			alert("Please indicate the city you live in");
			city.focus();
		}
		else if (country.value == "none")
		{
			result = false;
			alert("Please select a country from the list");
			country.focus();
		}
		else if (postalcode.value == "")
		{
			result = false;
			alert("Please enter your postal code.");
			postalcode.focus();
		}
		else if (email.value == "")
		{
			result = false;
			alert("Please enter a valid e-mail address.");
			email.focus();
		}
		else if (password.value == "")
		{
			result = false;
			alert("Your password may not be blank.\nPlease enter a password.");
			password.focus();
		}
		else if (secretquestion.value == "")
		{
			result = false;
			alert("A secret question allows you to retrieve your password should you forget it.\nIt should not be blank.\nPlease specify a question.");
			secretquestion.focus();
		}
		else if (secretanswer.value == "")
		{
			result = false;
			alert("Your secret answer may not be blank.\nPlease specify an answer.");
			secretanswer.focus();
		}
		return result;
	}
	
	function verify_pwd()
	{
		var currentpwd = document.forms[0].currentpwd;
		var newpwd = document.forms[0].newpwd;
		var verifypwd = document.forms[0].confirmpwd;
		var result = true;
		if (currentpwd.value == ""){
			result = false;
			alert("You forgot to enter your current password.\nPlease do so before submitting this form.");
			currentpwd.focus();
		}
		else if (newpwd.value == ""){
			result = false;
			alert("Your new password cannot be blank.\nPlease enter a new password.");
			newpwd.focus();
		}
		else if (newpwd.value != verifypwd.value) {
			result = false;
			alert("Please enter the same password in \'new password\' and \'verify new password\'");
			newpwd.value = "";
			verifypwd.value = "";
			newpwd.focus();
		}
		return result;
	}
// ** END VERIFY FORM FUNCTIONS