function TakeAssessment(){
MyWindow=window.open('http://www.eatracker.ca/EATracker.asp?fn=assessment&lc=fr','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=777,height=532, top=0, left=0;'); 
return false;
}

	var notvalidcolor = '#F4E4BE';
	var validcolor = 'transparent';	

	function ValdidateProfile(){
		
		// all fields are required.
		var blnReturn = true;
		
		if(getObjectByID('txtEmail').value=='' || !isValidEmail('txtEmail')){
			//getObjectByID('Email').style.background=notvalidcolor;
			showMsg('EmailMsg');
			blnReturn = false;
		}
		else{
			//getObjectByID('Email').style.background=validcolor;		
		}
		if(getObjectByID('txtEmailConfirm').value!=getObjectByID('txtEmail').value){
			//getObjectByID('EmailConfirm').style.background=notvalidcolor;
			showMsg('EmailConfirmMsg');
			blnReturn = false;
		}
		else{
			//getObjectByID('EmailConfirm').style.background=validcolor;		
		}
		if(getObjectByID('txtPassword').value==''){
			//getObjectByID('Password').style.background=notvalidcolor;
			showMsg('EmailMsg');
			blnReturn = false;
		}
		else{
			//getObjectByID('Password').style.background=validcolor;		
		}
		if(getObjectByID('txtPasswordConfirm').value!=getObjectByID('txtPassword').value){
			//getObjectByID('PasswordConfirm').style.background=notvalidcolor;
			showMsg('PasswordConfirmMsg');
			blnReturn = false;
		}
		else{
			//getObjectByID('PasswordConfirm').style.background=validcolor;		
		}
		if(getObjectByID('cboProvince').value==''){
			//getObjectByID('Province').style.background=notvalidcolor;
			showMsg('ProvinceMsg');
			blnReturn = false;
		}
		else{
			//getObjectByID('Province').style.background=validcolor;		
		}
		if(getObjectByID('cboBirthdayday').selectedIndex==0 || getObjectByID('cboBirthdaymonth').selectedIndex==0||getObjectByID('cboBirthdayyear').selectedIndex==0||!checkDate()){
			//getObjectByID('Birthdate').style.background=notvalidcolor;
			showMsg('BirthdateMsg');
			blnReturn = false;
		}
		else{
			//getObjectByID('Birthdate').style.background=validcolor;	
		}

		/*if (getObjectByID('chkPrivacy').checked ==false)
		{
			//getObjectByID('Privacy').style.background=notvalidcolor;
			showMsg('PrivacyMsg');
			blnReturn = false;
		}else{
			//getObjectByID('Privacy').style.background=validcolor;	
		}*/
		
		if (!blnReturn){
			var elem_msg = document.getElementById('alertmsg');
			elem_msg.style.display='';
		}
			
		return blnReturn;
		
	}
	
	function getObjectByID(sid){
		
		var elem_x =  document.getElementById(sid);
		return elem_x;
	}
	function showMsg(sID)
	{
		var elem_msg = document.getElementById(sID);
		elem_msg.style.display='';
	}
	function isValidEmail(elemEmail) {

		var emailstring = document.getElementById(elemEmail).value;
		return (emailstring.indexOf(".") > 0) && (emailstring.indexOf("@") > 0);
	}
	function GetValueFromInput(sID){
		var elem_text = document.getElementById(sID);
		GetValueFromInput = elem_text.value;
	}


	function IsrdoAnswered(sname){
		var elem_rdoY = document.getElementById(sname+'y')
		var elem_rdoN = document.getElementById(sname+'n')
		
		if (elem_rdoY.checked || elem_rdoN.checked){
			return true;
		}
		else{
			return  false;
		}
	}
	function SubmitProfileForm(sID)
	{
		if (ValdidateProfile())
		{
			getObjectByID(sID).submit()
		}
	
	}
	function checkDate() {
           		 var myDay = getObjectByID('cboBirthdayday').value;
           		 var myMonth = getObjectByID('cboBirthdaymonth').value;
		var myMonthStrTemp = "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec";
            		var myMonthStr = myMonthStrTemp.split(',');
           		 var myYear= getObjectByID('cboBirthdayyear').value;
          		 var myDateStr =  myMonth + '/' + myDay + '/' + myYear;

 
       		  /* Using form values, in the format m/d/yyyy to create a new date object
       		  which looks like "Wed Jan 1 00:00:00 EST 1975". */
        		  var myDate = new Date( myDateStr );

       		 // Convert the date to a string so we can parse it.
         		 var myDate_string = myDate.toGMTString();

            		/* Split the string at every space and put the values into an array so,
            		using the previous example, the first element in the array is "Wed", the
            		second element is "Jan", the third element is "1", etc. */
            		var myDate_array = myDate_string.split( ' ' );

           		/* If we entered "Feb 31, 1975" in the form, the "new Date()" function
            		converts the value to "Mar 3, 1975". Therefore, we compare the month
            		in the array with the month we entered into the form. If they match,
            		then the date is valid, otherwise, the date is NOT valid. */
            		if ( myMonthStr[myMonth-1]  != myDate_array[2] ) {
              			return false;
           		} else {
              			return true;
            		}
	}