	/************************************************************************************************************************
	Function : validateUserDetails
	Params   : String
	Logic	 : If string contains only A-Z or a-z or 0-9 alpha-character then it will return true. Else it will return false.
	**************************************************************************************************************************/
	function validateUserDetails(){
		var sFirstName = document.forms['myForm'].elements['myForm:fname'];
			if(!alphaCharWithSpace(trimValue(sFirstName.value))){
				setErrorInCss(sFirstName,i18n("Please_enter_valid_name"));
				sFirstName.focus();
				return false;
			}

		var sLastName = document.forms['myForm'].elements['myForm:lname'];
			if(!alphaCharWithoutSpace(sLastName.value)){
				setErrorInCss(sLastName,i18n("Please_Enter_Valid_Last_Name"));
				sLastName.focus();
				return false;
			}
		var sysTime = new Date();
		var sysDate = sysTime.getDate();
		var sysMon = sysTime.getMonth();
		var sysYr = sysTime.getFullYear();
		
		var date = document.forms['myForm'].elements['myForm:date'];
			if(date!=undefined && date.value==''){
				setErrorInCss(date,i18n("Please_select_date"));
				date.focus();
				return false;
			}

		var month = document.forms['myForm'].elements['myForm:month'];
			if(month!=undefined && month.value==''){
				setErrorInCss(month,i18n("Please_select_month"));
				month.focus();
				return false;
			}

		var year = document.forms['myForm'].elements['myForm:year'];
			if(year!=undefined){
				if(year.value==''){
					setErrorInCss(year,i18n("Please_select_year"));
					year.focus();
					return false;
				}else if(year.value > sysYr){
					setErrorInCss(year,i18n("Please_select_year"));
					year.focus();
					return false;
				 }else if(year.value == sysYr && month.value > (sysMon+1)){
					setErrorInCss(month,i18n("Please_select_valid_month"));
					year.focus();
					return false;
				 }else if(date.value > sysDate && year.value == sysYr && month.value == (sysMon+1)){
					setErrorInCss(date,i18n("Please_select_valid_date"));
					year.focus();
					return false;
				 }
			}
		var address1 = document.forms['myForm'].elements['myForm:address1'];
			if(trimValue(address1.value)==''){
			   setErrorInCss(address1,i18n("Please_enter_your_address"));
			   address1.focus();
			   return false;
			}
		
		var country = document.forms['myForm'].elements['myForm:country'];
			if(country.value==''){
				setErrorInCss(country,i18n("Please_select_country"));
				country.focus();
				return false;
			}
		
		var state = document.forms['myForm'].elements['myForm:state'];
			if(state.value==''){
				setErrorInCss(state,i18n("Please_select_state"));
				state.focus();
				return false;
			}

		var city = document.forms['myForm'].elements['myForm:city'];
			if(city.value==''){
				setErrorInCss(city,i18n("Please_select_city"));
				city.focus();
				return false;
			}
		
		var pin = document.forms['myForm'].elements['myForm:zip'];
			if((!alphaNumericCharWithoutSpace(pin.value)) || pin.value.length<5 || pin.value.length>6){
					setErrorInCss(pin,i18n("Please_enter_valid_zip_code"));
					pin.focus();
					return false;
			 }


		var dayPhone = document.forms['myForm'].elements['myForm:phoneNumber'];
		if(dayPhone.value == '' || (!numericCharWithoutSpace(dayPhone.value) || dayPhone.value.length < 10)){
				setErrorInCss(dayPhone,i18n("Please_enter_valid_telephone_number"));
				dayPhone.focus();
				return false;
		}
	 
		var mobileNumber = document.forms['myForm'].elements['myForm:mobilephoneNumber'];
		if(mobileNumber.value == '' || (!numericCharWithoutSpace(mobileNumber.value) || mobileNumber.value.length!=10)){
				setErrorInCss(mobileNumber,i18n("Please_enter_valid_mobile_number"));
				mobileNumber.focus();
				return false;
		}
		/*	Added New code to put only one number need to be compulsory...
		*/
		/*	CODE START */
		/*var dayPhone = document.forms['myForm'].elements['myForm:phoneNumber'];
		contactObj = dayPhone;
		if(dayPhone.value != '' && (!numericCharWithoutSpace(dayPhone.value) || dayPhone.value.length>15)) {
			alert('Please Enter Valid Telephone Number.');
            contactObj.focus();
            return false;
		}

		var mobile = document.forms['myForm'].elements['myForm:mobilephoneNumber'];
		if(mobile.value != '' && (!numericCharWithoutSpace(mobile.value) || mobile.value.length>15)) {
			alert('Please Enter Valid Mobile Number.');
			contactObj.focus();
			return false;
		}
		
		if(dayPhone.value == '' && mobile.value == '' ) {
			alert('Please Enter Either of Phone No. or Mobile No.');
			contactObj.focus();
			return false;
		}*/
		/*	CODE END */

		var sEmail = document.forms['myForm'].elements['myForm:emailId'];
			if(sEmail != undefined && !checkEmail(sEmail.value)){
				setErrorInCss(sEmail,i18n("Please_enter_valid_email_id"));
				sEmail.focus();
				return false;
			}
		
		var currency = document.forms['myForm'].elements['myForm:currency'];
			if(currency!=undefined && currency.value==''){
				setErrorInCss(currency,i18n("Please_Select_Currency"));
				currency.focus();
				return false;
			}
		
		var sex = document.forms['myForm'].elements['myForm:sex'];
			if(sex.value==''){
				setErrorInCss(sex,i18n("Please_select_gender"));
				sex.focus();
				return false;
			}
		
		return true;
	}
	
	function isShippingAddressValid(){
		/*var sEmail = $('shipEmail').value;
		if(!checkEmail(sEmail)){
			setErrorInCss($('shipEmail'),i18n("Please_Enter_Valid_Email_ID"));
			$('shipEmail').focus();
			return false;
		}*/
		var name = $('shipFname').value;
		if(!alphaCharWithSpace(trimValue(name))){
			setErrorInCss($('shipFname'),i18n("Please_Enter_Valid_Shipping_Name"));
			$('shipFname').focus();
			return false;
		}
		var address1 = trimValue($('shipAddress1').value);
		if(address1==''){
			setErrorInCss($('shipAddress1'),i18n("Please_Enter_Your_Shipping_Address"));
			$('shipAddress1').focus();
			return false;
		}else if(address1.length > 100){
			setErrorInCss($('shipAddress1'),i18n("Shipping_Address_Must_Have_Less_Than_100_Character"));
			$('shipAddress1').focus();
			return false;
		}	
		var cnt = $('shipCountryValue').value;
		countryCode = cnt;
		if(cnt==''){
			setErrorInCss($('shipCountryValue'),i18n("Please_Select_Shipping_Country"));
			$('shipCountryValue').focus();
			return false;
		}
	
		var st = $('shipStateValue').value;
		if(st==''){
			setErrorInCss($('shipStateValue'),i18n("Please_Select_Shipping_State"));
			$('shipStateValue').focus();
			return false;
		}
	
		var ct = $('shipCityValue').value;
		if(ct==''){
			setErrorInCss($('shipCityValue'),i18n("Please_Select_Shipping_City"));
			$('shipCityValue').focus();
			return false;
		}
		/*var name = $('shipOtherCity').value;
		if(name!='' && !alphaCharWithSpace(trimValue(name))){
			setErrorInCss($('shipOtherCity'),i18n("Please_Enter_Valid_Other_Shipping_City"));
			$('shipOtherCity').focus();
			return false;
		}*/

		var pin = $('shipZip').value;
		if((!alphaNumericCharWithoutSpace(pin)) || pin.length<5 || pin.length>6){
			setErrorInCss($('shipZip'),i18n("Please_Enter_Valid_Shipping_Zip_Code"));
			$('shipZip').focus();
			return false;
		}

		if($('shipTelephoneNumber')){
			var dayPhone =$('shipTelephoneNumber').value;
			if(!numericCharWithoutSpace(dayPhone) || dayPhone.length<2){
				setErrorInCss($('shipTelephoneNumber'),i18n("Please_Enter_Valid_Telephone_Number"));
				$('shipTelephoneNumber').focus();
				return false;
			}
		}
		
		if($('shipMobileNumber')){
			var mobile =$('shipMobileNumber').value;
			if(!numericCharWithoutSpace(mobile) || mobile.length<10){
				setErrorInCss($('shipMobileNumber'),i18n("Please_Enter_Valid_Mobile_Number"));
				$('shipMobileNumber').focus();
				return false;
			}
		}
		/*	Added New code to put only one number need to be compulsory...
		*/
		/*	CODE START */
		/*var dayPhone = $('shipTelephoneNumber').value;
		contactObj = $('shipTelephoneNumber');
		if(dayPhone != '' && (!numericCharWithoutSpace(dayPhone) || dayPhone.length>15)) {
			alert('Please Enter Valid Shipping Telephone Number.');
			contactObj.focus();
			return false;
		}
		
		var mobile = $('shipMobileNumber').value;
		if(mobile != '' && (!numericCharWithoutSpace(mobile) || mobile.length>15)) {
			alert('Please Enter Valid Shipping Mobile Number.');
			contactObj.focus();
			return false;
		}

        if(dayPhone == '' && mobile == '' ) {
			alert('Please Enter Either of Phone No. or Mobile No. in Shipping Address.');
			contactObj.focus();
			return false;
		}*/
		/*	CODE END */

		return true;
	}
	function isBillingAddressValid(){
		var name = $('billFname').value;
		if(!alphaCharWithSpace(trimValue(name))){
			setErrorInCss($('billFname'),i18n("Please_Enter_Valid_Billing_Name"));
			$('billFname').focus();
			return false;
		}
		var address1 = trimValue($('billAddress1').value);
		if(address1==''){
			setErrorInCss($('billAddress1'),i18n("Please_Enter_Your_Billing_Address"));
			$('billAddress1').focus();
			return false;
		}else if(address1.length > 100){
			setErrorInCss($('billAddress1'),i18n("Billinging_Address_Must_Have_Less_Than_100_Character"));
			$('billAddress1').focus();
			return false;
			
		}	
		var cnt = $('billCountryValue').value;
		countryCode = cnt;
		if(cnt==''){
			setErrorInCss($('billCountryValue'),i18n("Please_Select_Billing_Country"));
			$('billCountryValue').focus();
			return false;
		}
	
		var st = $('billStateValue').value;
		if(st==''){
			setErrorInCss($('billStateValue'),i18n("Please_Select_Billing_State"));
			$('billStateValue').focus();
			return false;
		}
	
		var ct = $('billCityValue').value;
		if(ct==''){
			setErrorInCss($('billCityValue'),i18n("Please_Select_Billing_City"));
			$('billCityValue').focus();
			return false;
		}
		
		/*var name = $('billOtherCity').value;
		if(name!='' && !alphaCharWithSpace(trimValue(name))){
			setErrorInCss($('billOtherCity'),i18n("Please_Enter_Valid_Other_Billing_City"));
			$('billOtherCity').focus();
			return false;
		}*/

		var pin = $('billZip').value;
		if((!alphaNumericCharWithoutSpace(pin)) || pin.length<5 || pin.length>6){
			setErrorInCss($('billZip'),i18n("Please_Enter_Valid_Billing_Zip_Code"));
			$('billZip').focus();
			return false;
		}

		if($('billTelephoneNumber')){
			var dayPhone =$('billTelephoneNumber').value;
			if(!numericCharWithoutSpace(dayPhone) || dayPhone.length<2){
				setErrorInCss($('billTelephoneNumber'),i18n("Please_Enter_Valid_Telephone_Number"));
				$('billTelephoneNumber').focus();
				return false;
			}
		}
		if($('billMobileNumber')){
			var mobile =$('billMobileNumber').value;
			if(!numericCharWithoutSpace(mobile) || mobile.length<10){
				setErrorInCss($('billMobileNumber'),i18n("Please_Enter_Valid_Mobile_Number"));
				$('billMobileNumber').focus();
				return false;
			}
		}
		/*	Added New code to put only one number need to be compulsory...
		*/
		/*	CODE START */
		/*var dayPhone = $('billTelephoneNumber').value;
		contactObj = $('billTelephoneNumber');
		if(dayPhone != '' && (!numericCharWithoutSpace(dayPhone) || dayPhone.length>15)) {
			alert('Please Enter Valid Billing Telephone Number.');
			contactObj.focus();
			return false;
		}

		var mobile = $('billMobileNumber').value;
		if(mobile != '' && (!numericCharWithoutSpace(mobile) || mobile.length>15)) {
			alert('Please Enter Valid Billing Mobile Number.');
			$('billMobileNumber').focus();
			return false;
		}

		if(dayPhone == '' && mobile == '' ) {
			alert('Please Enter Either of Phone No. or Mobile No. in Billing Address.');
			contactObj.focus();
			return false;
		}*/
		/*	CODE END */
		
		/*var sEmail = $('billEmail').value;
		if(!checkEmail(sEmail)){
			setErrorInCss($('billEmail'),i18n("Please_Enter_Valid_Email_ID"));
			$('billEmail').focus();
			return false;
		}*/
		return true;
	}
