// JavaScript Document
function popup1(url) 
{
 params  = 'width='+screen.width;
 params += ', height='+screen.height;
 params += ', top=0, left=0'
 params += ', fullscreen=no';
 params += ', toolbar=yes';

 newwin=window.open(url,'windowname4', params);
 if (window.focus) {newwin.focus()}
 return false;
}
	function popup(url){
		wid=850;//screen.width-100;
		heit=screen.height-400;
		fList ="toolbar=0";
		fList+=",location=0";
		fList+=",menubar=0";
		fList+=",scrollbars=1";
		fList+=",status=0";
		fList+=",resizable=1";
		fList+=",width="+wid+",height="+heit;
		myWindow = open(url,"myWindow",fList);
		myWindow.moveTo((screen.width/2)-(wid/2),(screen.height/2)-(heit/2));
		myWindow.focus();
	}

	function validate(Form)
		{
			if (Form.email.value == '')
			{
				alert('Please enter a value for the Email field.');
				Form.email.focus();
				return false;
			}
			if (Form.email.value.indexOf('@')== '-1' && Form.email.value.length>0)
			{
				alert('Please enter valid Email.');
				Form.email.focus();
				return (false);
			}
			if (Form.email.value.indexOf('.')== '-1' && Form.email.value.length>0)
			{
				alert('Please enter valid Email.');
				Form.email.focus();
				return (false);
			}
			if (Form.first_name.value=='')
			{
				alert ('Please, Complete the required fields!');
				//Form.password.focus();
				return false;
			}
			if (Form.last_name.value=='')
			{
				alert ('Please, Complete the required fields!');
				//Form.password.focus();
				return false;
			}
			if (Form.birthdate.value=='')
			{
				alert ('Please, Complete the required fields!');
				//Form.birthdate.focus();
				return false;
			}
			if (!IsNumeric(Form.birthdate.value))
			{
				alert ('Please, Enter a valid Birthdate! (DD/MM/YYYY) or (DD-MM-YYYY)');
				Form.birthdate.focus();
				return false;
			}
			if (Form.phone.value=='')
			{
				alert ('Please, Complete the required fields!');
				//Form.password.focus();
				return false;
			}
			if (!IsNumeric(Form.phone.value))
			{
				alert ('Please, Enter a valid phone number!');
				Form.phone.focus();
				return false;
			}
			// page 2
			if (Form.uni_name.value=='' && Form.formPage.value=='3')
			{
				alert ('Please, Complete the University Name!');
				Form.uni_name.focus();
				return false;
			}
			if (Form.uni_major.value=='' && Form.formPage.value=='3')
			{
				alert ('Please, Complete the Major!');
				Form.uni_major.focus();
				return false;
			}
			
			// page 3
			
			// page 4
			if (Form.job1.value=='' && Form.formPage.value=='5')
			{
				alert ('Please, Complete your preferred jobs!');
				Form.job1.focus();
				return false;
			}
			
		return true;
		}

	function IsNumeric(sText)
	{
	   var ValidChars = "0123456789-+/";
	   var IsNumber=true;
	   var Char;
	
	 
	   for (i = 0; i < sText.length && IsNumber == true; i++) 
		  { 
		  Char = sText.charAt(i); 
		  if (ValidChars.indexOf(Char) == -1) 
			 {
			 IsNumber = false;
			 }
		  }
	   return IsNumber;
	   
	}
