/**$(function() {
	$('#fan_birth_day').datepicker({
		yearRange: '1900:2100'  ,
		maxDate: '+0d',
	   changeMonth: true,
	   changeYear: true
	});
});

**/
function validateFormFields(){
	
	$('.txtboxcontrol').css('border-color','black');
	$('#td_genre').css('color','black');
	$('td').css('color','black');
	$('#captchaword').css('border-color','black');
	$('.selboxcontrol').css('color','black');
	var firstName = escape(document.getElementById('fan_first_name').value);
	var lastName = escape(document.getElementById('fan_last_name').value);
	var email = escape(document.getElementById('fan_email').value);
	var confirmEmail = escape(document.getElementById('fan_confirm_email').value);
	var userName = escape(document.getElementById('fan_user_name').value);
	var password = escape(document.getElementById('fan_password').value);
	var rePassword = escape(document.getElementById('fan_confirm_password').value);
	var birthDate = escape(document.getElementById('fan_birth_day').value);
	var genre = escape(document.getElementById('fan_genre[]').value);
	var captcha = escape(document.getElementById('captchaword').value);
	var errorIdArr = new Array();
	
	if(isRequired(firstName))
		errorIdArr.push('fan_first_name');
	
	if(isRequired(lastName))
		errorIdArr.push('fan_last_name');
	
	if(isRequired(email)  ||  (!isEmail(email) )){
		errorIdArr.push('fan_email');
	}
	
	if(isRequired(confirmEmail) || !isEmail(confirmEmail)){
		errorIdArr.push('fan_confirm_email');
	}
	
	if(email != confirmEmail){
		errorIdArr.push('fan_confirm_email');
	}
	/* 
   * // 05/03/2011 Remove Date validation
	if(isRequired(birthDate))
		errorIdArr.push('fan_birth_day');
	
	if (isDate(birthDate)==false){
		errorIdArr.push('fan_birth_day');
	}
	*/
	if(isRequired(userName))
		errorIdArr.push('fan_user_name');
	
	if(isSpclChar(userName) || containsSpace(userName)){
		errorIdArr.push('fan_user_name');
		alert("Username can only contain letters and numbers.");
	}
	
	if(isRequired(password)){
		errorIdArr.push('fan_password');
		
	}	
	
	if(isRequired(rePassword)){
		errorIdArr.push('fan_confirm_password');
	}
	
	if(isRequired(captcha)){
		errorIdArr.push('captchaword');
	}
	
	if(password != rePassword){
		errorIdArr.push('fan_confirm_password');
	}
	
	
	if(genre.length <= 0){
		//document.getElementById('td_genre').style.Class = '';
		$('#td_genre').css('color','red');
		$('.selboxcontrol').css('color','red');
		errorIdArr.push('fan_genre');
	}
	
	for(i=0;i<errorIdArr.length;i++){
		$('#'+errorIdArr[i]).css('border-color','red');
		$('#'+errorIdArr[i]).parents('tr').children('td:first').css('color','red');
	}
	
	$('#user_country').css('color','black');
	
	if(errorIdArr.length > 0)
		return false;
	else
		return true;
}

function termChecker() {
	if (!document.getElementById("fan_terms_con_check").checked) {
		document.getElementById("fan_register_button").disabled = true;
	} else {
		document.getElementById("fan_register_button").disabled = false;
	}
}
