function open_pop(theURL,winName,w,h,scroll,resize) { //v2.0
var winl = ((screen.width/2) - (w/2));
var wint = ((screen.height/2) - (h/2) - 10);
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(); }
}

function OthersOn() {
	
          document.registrations.Diet.checked = false;
     
}

function OthersOff() {
	
          document.registrations.Others.value = "";
     
}


function showId(id) {
	if (document.getElementById) {
		var divid = document.getElementById(id).style;
		divid.display = "inline";
	} else if (document.all) {
		var divid = document.all[id].style;
		divid.display = "inline";
	} else if (document.layers) {
		var divid = document.layers[id].style;
		divid.display = divid.display = "inline";
	}
}

function hideId(id) {
	if (document.getElementById) {
		var divid = document.getElementById(id).style;
		divid.display = "none";
	} else if (document.all) {
		var divid = document.all[id].style;
		divid.display = "none";
	} else if (document.layers) {
		var divid = document.layers[id].style;
		divid.display = divid.display = "none";
	}
}

function paymentOption(id) {
	hideId('TRANSFER');
	hideId('CREDIT_CARD');
	hideId('BANK_DRAFT');
	showId(id)
}

function externalLinks() { 
if (!document.getElementsByTagName) return; 
var anchors = document.getElementsByTagName("a"); 
for (var i=0; i<anchors.length; i++) { 
	var anchor = anchors[i]; 
	if (anchor.getAttribute("href") && 
		anchor.getAttribute("rel") == "external") 
		anchor.target = "_blank"; 
	} 
} 
window.onload = externalLinks;

if (document.images)
   {
     menu_homeon= new Image(108,27);
     menu_homeon.src="../2006/img/homeon.gif";
     menu_programmeon= new Image(104,27);
     menu_programmeon.src="../2006/img/programmeon.gif";
     menu_speakerson= new Image(86,27);
     menu_speakerson.src="../2006/img/speakerson.gif";
     menu_registrationon= new Image(159,27);
     menu_registrationon.src="../2006/img/registrationon.gif";
     menu_photoon= new Image(114,27);
     menu_photoon.src="../2006/img/photoon.gif";
     menu_accommodationon= new Image(123,27);
     menu_accommodationon.src="../2006/img/accommodationon.gif";
     menu_sponsoron= new Image(200,27);
     menu_sponsoron.src="../2006/img/sponsoron.gif";
     
     event_2004on= new Image(111,20);
     event_2004on.src="../2006/img/ps_2004on.jpg";
     event_2005on= new Image(111,20);
     event_2005on.src="../2006/img/ps_2005on.jpg";
    
     menu_homeoff= new Image(108,27);
     menu_homeoff.src="../2006/img/homeoff.gif";
     menu_programmeoff= new Image(104,27);
     menu_programmeoff.src="../2006/img/programmeoff.gif";
     menu_speakersoff= new Image(86,27);
     menu_speakersoff.src="../2006/img/speakersoff.gif";
     menu_registrationoff= new Image(159,27);
     menu_registrationoff.src="../2006/img/registrationoff.gif";
     menu_photooff= new Image(159,27);
     menu_photooff.src="../2006/img/photooff.gif";
     menu_accommodationoff= new Image(123,27);
     menu_accommodationoff.src="../2006/img/accommodationoff.gif";
     menu_sponsoroff= new Image(200,27);
     menu_sponsoroff.src="../2006/img/sponsoroff.gif";
     
     event_2004off= new Image(111,20);
     event_2004off.src="../2006/img/ps_2004off.jpg";
     event_2005off= new Image(111,20);
     event_2005off.src="../2006/img/ps_2005off.jpg";
   }
   
    function tron(imgName)
   {
    if (document.images)
     {
      imgOn=eval(imgName + "on.src");
      document.getElementById(imgName).src= imgOn;
     }
   }
   
function troff(imgName)
 {
   if (document.images)
    {
      imgOff=eval(imgName + "off.src");
      document.getElementById(imgName).src= imgOff;
    }
 }
 
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() {
var PaymentOption = false;

for (i=document.registrations.Payment.length-1; i > -1; i--) {
if (document.registrations.Payment[i].checked) {
PaymentOption = true;
}
}

  
  
 	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 (PaymentOption == false) {
 	alert("Please select your Payment method.")
 	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 ShowForm() {
					if (document.getElementById) {
					var divid = document.getElementById('GRANT_FORM').style;
						if (divid.display == "inline") {
						divid.display = "none";
						} else {
						divid.display = "inline";
						}
					} else if (document.all) {
					var divid = document.all['GRANT_FORM'].style;
					if (divid.display == "inline") {
						divid.display = "none";
						} else {
						divid.display = "inline";
						}
					} else if (document.layers) {
					var divid = document.layers['GRANT_FORM'].style;
					if (divid.display == "inline") {
						divid.display = "none";
						} else {
						divid.display = "inline";
						}
					}
				}
 	
function checkSearch() {
 
 	if (document.search.FName.value.length != 0) {
 		if (document.search.FName.value.length < 3) {
 		alert("Search Fields must contain alteast 3 characters minimum!")
 		return (false);
 		}
 	} 
 	
 	if (document.search.LName.value.length != 0) {
 		if (document.search.LName.value.length < 3) {
 		alert("Search Fields must contain alteast 3 characters minimum!")
 		return (false);
 		}
 	} 
 	
 	if (document.search.FName.value == 'First Name' && document.search.LName.value == 'Last Name') {
 		alert("Please fill in a First and/or Last Name to proceed with your search.")
 		return (false);
 	} 
 }
 
function confirming(url,message) {
	var confirmation=confirm(message); 
 	if (confirmation) {
 	window.location.href=url;
 	} 
}