// OPEN POP UP
function open_pop(theURL,winName,w,h,scroll,resize) { //v2.0
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resize+''
win=window.open(theURL,winName,winprops);
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

var da = (document.all) ? 1:0;
var pr = (window.print) ? 1:0;
var mac = (navigator.userAgent.indexOf( "Mac" ) != - 1); 


function checkAccomodation() {
 	if (document.accomodations.FirstName.value == "") {
 	alert("Please enter your First Name.")
 	return (false)
 	} else if (document.accomodations.LastName.value == "") {
 	alert("Please enter your Last Name.")
 	return (false)
 	} else if (document.accomodations.Organisation.value == "") {
 	alert("Please enter your Organisation.")
 	return (false)
 	} else if (document.accomodations.Address.value == "") {
 	alert("Please enter your Address.")
 	return (false)
 	} else if (document.accomodations.PostalCode.value == "") {
 	alert("Please enter your Postal Code.")
 	return (false)
 	} else if (document.accomodations.City.value == "") {
 	alert("Please enter your City.")
 	return (false)
 	} else if (document.accomodations.Country.value == "") {
 	alert("Please enter your Country.")
 	return (false)
 	} else if (document.accomodations.Phone.value == "") {
 	alert("Please enter your Phone No.")
 	return (false)
 	} else if (document.accomodations.Room.value == "") {
 	alert("Please select your Room preference.")
 	return (false)
 	} else if (document.accomodations.checkin.value == "") {
 	alert("Please enter your Arrival date.")
 	return (false)
 	} else if (document.accomodations.checkout.value == "") {
 	alert("Please select your Check-out date.")
 	return (false)
 	} else if (document.accomodations.eta.value == "") {
 	alert("Please enter your Flight/ETA.")
 	return (false)
 	} else if (document.accomodations.etd.value == "") {
 	alert("Please enter your Flight/ETD.")
 	return (false)
 	}
 	document.accomodations.submit();
  	return true;
 }
 	
 function checkGrant(){
var maxwords=200
if (document.images){
var temp=document.registrations.EGrant.value.split(" ")
if (temp.length>maxwords){
alert("Please reduce your application to 200 words or less.")
return false
}
}
}
 	
 function checkSubmission() {
 
 	if (document.registrations.Title.value == "") {
 	alert("Please enter your Title.")
 	return (false)
 	} else if (document.registrations.LastName.value == "") {
 	alert("Please enter your Last Name.")
 	return (false)
 	} else if (document.registrations.FirstName.value == "") {
 	alert("Please enter your First Name.")
 	return (false)
 	} else if (document.registrations.Position.value == "") {
 	alert("Please enter your Position.")
 	return (false)
 	} else if (document.registrations.Organisation.value == "") {
 	alert("Please enter your Organisation.")
 	return (false)
 	} else if (document.registrations.Address.value == "") {
 	alert("Please enter your Address.")
 	return (false)
 	} else if (document.registrations.Country.value == "") {
 	alert("Please enter your Country.")
 	return (false)
 	} else if (document.registrations.Phone.value == "") {
 	alert("Please enter your Phone No.")
 	return (false)
 	}  else if (document.registrations.Fax.value == "") {
 	alert("Please enter your Fax No.")
 	return (false)
 	} else if (document.registrations.Diet.value == "") {
 	alert("Please select your Diet preference.")
 	return (false)
 	} else if (document.registrations.Email.value == "") {
 	alert("Please enter your Email Address.")
 	return (false)
 	} else if (document.registrations.Email.value != "") {
 		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.registrations.Email.value)) {
			document.registrations.submit();
  			return true;
  		} else { 
 		 alert("Invalid E-mail Address! Please re-enter.")
		return (false)
		}
 	}
}

function printPage() {
if (pr) 
// NS4, IE5 
window.print()
else if (da && !mac) 
// IE4 (Windows) 
vbPrintPage()  
else 
// other browsers 
alert( "Please print this page manually." ); 
return false; }

if (da && !pr && !mac) with (document) {writeln( '<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>' );
  writeln( '<' +'SCRIPT LANGUAGE="VBScript">' );
  writeln( 'Sub window_onunload' );
  writeln( '  On Error Resume Next' );
  writeln( '  Set WB = nothing' );
  writeln( 'End Sub' );
  writeln( 'Sub vbPrintPage' );
  writeln( '  OLECMDID_PRINT = 6' );
  writeln( '  OLECMDEXECOPT_DONTPROMPTUSER = 2' );
  writeln( '  OLECMDEXECOPT_PROMPTUSER = 1' );
  writeln( '  On Error Resume Next' );
  writeln( '  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER' );
  writeln( 'End Sub' );
  writeln( '<' +'/SCRIPT>' ); }