// JavaScript Document
String.prototype.trim = function() {
	var a = this.replace(/^\s+/, '');
    return a.replace(/\s+$/, '');
};
function getFileName(filePath){
	//return the length of file name from given path
	fPath= new String(filePath);
	fileName= fPath.substring(fPath.lastIndexOf('\\')+1);
	return fileName;
}
function chkValidationLogin()
{
	if(document.frmLogin.txtLogin.value == "")
		{
			alert("Please enter Login ID");
			document.frmLogin.txtLogin.focus();
			return false;
		}

	if(document.frmLogin.txtPassword.value == "")
		{
			alert("Please enter Password");
			document.frmLogin.txtPassword.focus();
			return false;
			}
}



function leadenqvalidate()
{
	

	if(document.enquiryfrm.subject.value == "")
		{
			alert("Please enter subject");
			document.enquiryfrm.subject.focus();
			return false;
		}
		
		
		if(document.enquiryfrm.mesg.value == "")
		{
			alert("Please enter message");
			document.enquiryfrm.mesg.focus();
			return false;
		}
		
}


function checkall(objForm){
	len = objForm.elements.length;
	var i=0;
	for( i=0 ; i<len ; i++) {
		if (objForm.elements[i].type=='checkbox') {
			objForm.elements[i].checked=objForm.check_all.checked;
		}
	}
}


function selectall(objForm)
{
	//alert( "sasasjaks");
	len = objForm.elements.length;
	var i=0;
	for( i=0 ; i<len ; i++) {
		if (objForm.elements[i].type=='checkbox' &&  objForm.elements[i].name=='arr_id[]') {
			objForm.elements[i].checked=true;
		}
	}
}

function unchkall(objForm)
{
	//alert( "sasasjaks");
	len = objForm.elements.length;
	var i=0;
	for( i=0 ; i<len ; i++) {
		if (objForm.elements[i].type=='checkbox' &&  objForm.elements[i].name=='arr_id[]') {
			objForm.elements[i].checked=false;
		}
	}
}



function chkValidationLogin2()
{
	if(document.frmLogin2.txtLogin.value == "")
		{
			alert("Please enter Login ID");
			document.frmLogin2.txtLogin.focus();
			return false;
		}

	if(document.frmLogin2.txtPassword.value == "")
		{
			alert("Please enter Password");
			document.frmLogin2.txtPassword.focus();
			return false;
			}
}


function checkout()
{
	
	if(document.registration.vFirstName.value==''){
	alert("Billing name should not be blank.");
	document.registration.vFirstName.focus();
	return false;	
	}
	if(document.registration.vFirstName.value!=''){
		if(document.registration.vFirstName.value.search(/\b[A-Za-z\s]+\b$/)){
			alert("Number and special characters are not allowed.");
			document.registration.vFirstName.focus();
			return false;		
		}	
	}
	if(document.registration.vAddress.value==''){
	alert("Billing address should not be blank.");
	document.registration.vAddress.focus();
	return false;	
	}
	
	if(document.registration.vCity.value==''){
	alert("Billing city should not be blank.");
	document.registration.vCity.focus();
	return false;	
	}
	if(document.registration.vCity.value!=''){
		if(document.registration.vCity.value.search(/\b[A-Za-z\s]+\b$/)){
			alert("Number and special characters are not allowed.");
			document.registration.vCity.focus();
			return false;		
		}	
	}
	
	if(document.registration.vState.value==''){
	alert("Billing state should not be blank.");
	document.registration.vState.focus();
	return false;	
	}
	if(document.registration.vCountry.value==''){
	alert("Billing country should not be blank.");
	document.registration.vCountry.focus();
	return false;	
	}
	if(document.registration.iZipCode.value==''){
	alert("Billing zipcode should not be blank.");
	document.registration.iZipCode.focus();
	return false;	
	}
	if(document.registration.iPhoneNo.value==''){
	alert("Billing phone number should not be blank.");
	document.registration.iPhoneNo.focus();
	return false;	
	}
	
	
	if(document.registration.vFirstName1.value==''){
	alert("Shipping name should not be blank.");
	document.registration.vFirstName1.focus();
	return false;	
	}
	if(document.registration.vFirstName1.value!=''){
		if(document.registration.vFirstName1.value.search(/\b[A-Za-z\s]+\b$/)){
			alert("Number and special characters are not allowed.");
			document.registration.vFirstName1.focus();
			return false;		
		}	
	}
	if(document.registration.vAddress1.value==''){
	alert("Shipping address should not be blank.");
	document.registration.vAddress1.focus();
	return false;	
	}
	
	if(document.registration.vCity1.value==''){
	alert("Shipping city should not be blank.");
	document.registration.vCity1.focus();
	return false;	
	}
	
	if(document.registration.vState1.value==''){
	alert("Shipping state should not be blank.");
	document.registration.vState1.focus();
	return false;	
	}
	if(document.registration.vCountry1.value==''){
	alert("Shipping country should not be blank.");
	document.registration.vCountry1.focus();
	return false;	
	}
	if(document.registration.iZipCode1.value==''){
	alert("Shipping zipcode should not be blank.");
	document.registration.iZipCode1.focus();
	return false;	
	}
	

}


function checkRegistration()
{
		if(document.frmRegister.txtEmail.value == "")
		{
			alert('Please Enter your Email Address');
			document.frmRegister.txtEmail.focus();
			return false;
		}
		if(document.frmRegister.txtEmail.value.indexOf("@") == -1 || document.frmRegister.txtEmail.value.indexOf(".") == -1)
		{
			alert("Please Enter Valid Email Address!!!");
			document.frmRegister.txtEmail.focus();
			return false;
		}

		if(document.frmRegister.txtPassword.value == "")
		{
			alert('Please enter the Password');
			document.frmRegister.txtPassword.focus();
			return false;
		}


		if(document.frmRegister.txtRePassword.value == "")
		{
			alert('Please retype the Password');
			document.frmRegister.txtRePassword.focus();
			return false;
		}

		if(document.frmRegister.txtPassword.value != document.frmRegister.txtRePassword.value)
		{

			alert('Password and repassword should be same');
			document.frmRegister.txtRePassword.focus();
			return false;
		}

		/*if(document.frmRegister.txtFName.value == "")
		{



			alert('Please enter your name');



			document.frmRegister.txtFName.focus();



			return false;



		}

		if(document.frmRegister.txtPhoneNo.value == "")



		{



			alert('Please enter the Phone Number');



			document.frmRegister.txtPhoneNo.focus();



			return false;



		}



		if(!IsNumericforReg(document.frmRegister.txtPhoneNo.value))



		{



			alert('Please enter the Phone Number');



			document.frmRegister.txtPhoneNo.focus();



			return false;



		}*/


		
		document.frmRegister.action = "register.php";



		document.frmRegister.submit();



}

function chkValidationLoginadmin()
{
	if(document.frmLogin.txtLogin.value == "")
	{
		alert("Please enter Login ID");
		document.frmLogin.txtLogin.focus();
		return false;
	}
	if(document.frmLogin.txtPassword.value == "")
	{
		alert("Please enter Password");
		document.frmLogin.txtPassword.focus();
		return false;
	}
	document.frmLogin.action = "index.php";
	document.frmLogin.submit();	
}

function checkProfile()



{



		if(document.frmProfile.txtEmail.value == "")



		{



			alert('Please Enter your Email Address');



			document.frmProfile.txtEmail.focus();



			return false;



		}



		if(document.frmProfile.txtEmail.value.indexOf("@") == -1 || document.frmProfile.txtEmail.value.indexOf(".") == -1)



		{



			alert("Please Enter Valid Email Address!!!");



			document.frmProfile.txtEmail.focus();



			return false;



		}



		if(document.frmProfile.txtPassword.value == "")



		{



			alert('Please enter the Password');



			document.frmProfile.txtPassword.focus();



			return false;



		}



		if(document.frmProfile.txtRePassword.value == "")



		{



			alert('Please retype the Password');



			document.frmProfile.txtRePassword.focus();



			return false;



		}



		if(document.frmProfile.txtPassword.value != document.frmProfile.txtRePassword.value)



		{



			alert('Password and repassword should be same dffd');



			document.frmProfile.txtRePassword.focus();



			return false;



		}

		if(document.frmProfile.txtFName.value == "")



		{



			alert('Please enter your name');



			document.frmProfile.txtFName.focus();



			return false;



		}

		/*if(document.frmRegister.txtPhoneNo.value == "")



		{



			alert('Please enter the Phone Number');



			document.frmRegister.txtPhoneNo.focus();



			return false;



		}



		if(!IsNumericforReg(document.frmRegister.txtPhoneNo.value))



		{



			alert('Please enter the Phone Number');



			document.frmRegister.txtPhoneNo.focus();



			return false;



		}*/



		document.frmProfile.action = "yourprofile.php";



		document.frmProfile.submit();



}



function closewindow()



{



	opener.location.reload(true);



      window.close();



}



function chkValidationLogin1()



{



	if(document.frmLogin1.txtLogin.value == "")



	{



		alert("Please enter Login ID");



		document.frmLogin1.txtLogin.focus();



		return false;



	}



	if(document.frmLogin1.txtPassword.value == "")



	{



		alert("Please enter Password");



		document.frmLogin1.txtPassword.focus();



		return false;



	}



	document.frmLogin1.action = "login.php";



	document.frmLogin1.submit();	



}



function checkBAddress()



{



	//alert(frmpara);



	document.frmOrder.txtBillingAddress.disabled=false;



	document.frmOrder.txtbCity.disabled=false;



	document.frmOrder.txtbState.disabled=false;



	document.frmOrder.txtbCountry.disabled=false;



	document.frmOrder.action = "order.php";



	//document.frmOrder.submit();



}



function checkSAddress()



{



	//alert(frmpara);



	document.frmOrder.txtShippingAddress.disabled=false;



	document.frmOrder.txtsCity.disabled=false;



	document.frmOrder.txtsState.disabled=false;



	document.frmOrder.txtsCountry.disabled=false;



	document.frmOrder.action = "order.php";



	//document.frmOrder.submit();



}



function chkLoginClient()



{



	if(document.frmLogin.txtLogin.value == "")



	{



		alert("Please enter Login ID");



		document.frmLogin.txtLogin.focus();



		return false;



	}



	if(document.frmLogin.txtPassword.value == "")



	{



		alert("Please enter Password");



		document.frmLogin.txtPassword.focus();



		return false;



	}



	document.frmLogin.action = "login.php";



	document.frmLogin.submit();



}



function changePassword(password, user_id, session)



{



	if(document.frmEditPass.txtOld.value == "")



	{



		alert('Enter Value in Old Password');



		document.frmEditPass.txtOld.focus();



		return false;



	}



	if(document.frmEditPass.txtNew.value == "")



	{



		alert('Enter Value in New Password');



		document.frmEditPass.txtNew.focus();



		return false;



	}



	if(document.frmEditPass.txtConfirm.value == "")



	{



		alert('Enter Value in New Password Again');



		document.frmEditPass.txtConfirm.focus();



		return false;



	}



	if(document.frmEditPass.txtOld.value != password)



	{



		alert('Your Old Password not match with your Entered Password');



		document.frmEditPass.txtOld.focus();



		return false;



	}



	if(document.frmEditPass.txtNew.value != document.frmEditPass.txtConfirm.value)



	{



		alert('Please Enter Same password In both Field');



		document.frmEditPass.txtConfirm.focus();



		return false;		



	}



	return true;



	



}



function changePasswordcli(password, user_id, session)



{



	if(document.frmEditcliPass.txtOld.value == "")



	{



		alert('Enter Value in Old Password');



		document.frmEditcliPass.txtOld.focus();



		return false;



	}



	if(document.frmEditcliPass.txtNew.value == "")



	{



		alert('Enter Value in New Password');



		document.frmEditcliPass.txtNew.focus();



		return false;



	}



	if(document.frmEditcliPass.txtConfirm.value == "")



	{



		alert('Enter Value in New Password Again');



		document.frmEditcliPass.txtConfirm.focus();



		return false;



	}



	if(document.frmEditcliPass.txtOld.value != password)



	{



		alert('Your Old Password not match with your Entered Password');



		document.frmEditcliPass.txtOld.focus();



		return false;



	}



	if(document.frmEditcliPass.txtNew.value != document.frmEditcliPass.txtConfirm.value)



	{



		alert('Please Enter Same password In both Field');



		document.frmEditcliPass.txtConfirm.focus();



		return false;		



	}



	return true;



	



}



//For User



function InsertUser(FrmPara)



{



	document.frmUserMgmt.action = FrmPara;



	document.frmUserMgmt.submit();



}



function InsertSeller(FrmPara)



{



	document.frmSellerMgmt.action = FrmPara;



	document.frmSellerMgmt.submit();



}



function InsertCustomer(FrmPara)



{



	document.frmCustomerMgmt.action = FrmPara;



	document.frmCustomerMgmt.submit();



}



function InsertCategory(FrmPara)



{



	document.frmCategoryMgmt.action = FrmPara;



	document.frmCategoryMgmt.submit();



}



function InsertSubCategory(FrmPara)



{



	document.frmSubCategoryMgmt.action = FrmPara;



	document.frmSubCategoryMgmt.submit();



}



function InsertOrder(FrmPara)



{



	document.frmOrderMgmt.action = FrmPara;



	document.frmOrderMgmt.submit();



}



function InsertProduct(FrmPara)


{
	document.frmProductMgmt.action = FrmPara;

	document.frmProductMgmt.submit();

}



function InsertReview(FrmPara)



{



	document.frmReviewMgmt.action = FrmPara;



	document.frmReviewMgmt.submit();



}



function InsertSuccess(FrmPara)



{



	document.frmSuccessMgmt.action = FrmPara;



	document.frmSuccessMgmt.submit();



}



function InsertComment(FrmPara)



{



	document.frmCommentMgmt.action = FrmPara;



	document.frmCommentMgmt.submit();



}



function deleteUser(FrmPara)



{



	//alert("hi");



	var ans = confirm("Would you like to  Delete User?");



	if(ans==true)



	{



		document.frmUserMgmt.hidFrmVal.value = "Delete";



		document.frmUserMgmt.action = FrmPara;



		document.frmUserMgmt.submit();



	}



	else



	{



		document.frmUserMgmt.action = FrmPara;



	}



	



}



function deleteSeller(FrmPara)



{



	//alert("hi");



	var ans = confirm("Would you like to  Delete seller?");



	if(ans==true)



	{



		document.frmSellerMgmt.hidFrmVal.value = "Delete";



		document.frmSellerMgmt.action = FrmPara;



		document.frmSellerMgmt.submit();



	}
else

	{
		document.frmSellerMgmt.action = FrmPara;
	}
}



function deleteCustomer(FrmPara){
	//alert("hi");
	var ans = confirm("Would you like to  Delete seller?");
	if(ans){
		document.frmCustomerMgmt.hidFrmVal.value = "Delete";
		document.frmCustomerMgmt.action = FrmPara;
		document.frmCustomerMgmt.submit();
	}
	else{
		document.frmCustomerMgmt.action = FrmPara;
	}
}

function deleteReview(FrmPara)
{
	//alert("hi");
	var ans = confirm("Would you like to  Delete review?");
	if(ans==true)
	{
		document.frmReviewMgmt.hidFrmVal.value = "Delete";
		document.frmReviewMgmt.action = FrmPara;
		document.frmReviewMgmt.submit();
	}
	else

	{
		document.frmReviewMgmt.action = FrmPara;
	}
}

function deletetestimonial(FrmPara)
{
	//alert("hi");
	var ans = confirm("Would you like to  Delete testimonial?");
	if(ans==true)
	{
		document.frmCategoryMgmt.hidFrmVal.value = "Delete";
		document.frmCategoryMgmt.action = FrmPara;
		document.frmCategoryMgmt.submit();
	}
	else
	{
		document.frmReviewMgmt.action = FrmPara;
	}
}


function deletetesfaq(FrmPara)
{
	//alert("hi");
	var ans = confirm("Would you like to  Delete FAQ?");
	if(ans==true)
	{
		document.frmCategoryMgmt.hidFrmVal.value = "Delete";
		document.frmCategoryMgmt.action = FrmPara;
		document.frmCategoryMgmt.submit();
	}
	else
	{
		document.frmReviewMgmt.action = FrmPara;
	}
}




function deleteSuccess(FrmPara)



{



	//alert("hi");



	var ans = confirm("Would you like to  Delete success story?");



	if(ans==true)



	{



		document.frmSuccessMgmt.hidFrmVal.value = "Delete";



		document.frmSuccessMgmt.action = FrmPara;



		document.frmSuccessMgmt.submit();



	}



	else



	{



		document.frmSuccessMgmt.action = FrmPara;



	}



	



}



function displayHomePage1(FrmPara1)



{



	var ans = confirm("Are you shore u want to display on home page?");



	if(ans==true)



	{



		for( var i=0;i<document.frm.Chk.length;i++)



		{



		document.frmCategoryMgmt.ChkHome.value+=","+document.frmCategoryMgmt.Chk[i];



		}



		document.frmCategoryMgmt.action = FrmPara;



		document.frmCategoryMgmt.submit();



	}



	else



	{



		document.frmCategoryMgmt.action = "category_mgmt.php";



	}



	



}



function displayHomePage(FrmPara)



{



	var ans = confirm("Are you shore u want to display on home page?");



	if(ans==true)



	{



		document.frmCategoryMgmt.action = FrmPara;



		document.frmCategoryMgmt.submit();



	}



	else



	{



		document.frmCategoryMgmt.action = "category_mgmt.php";



	}



	



}



function displayProductOnHomePage(FrmPara)



{



	var ans = confirm("Are you sure want to display selected product(s) on home page?");



	//alert(document.frmProductMgmt.ChkProductHome.value);



	if(ans==true)



	{



		document.frmProductMgmt.action = FrmPara;



		document.frmProductMgmt.submit();



	}



	else



	{



		document.frmProductMgmt.action = "product_mgmt.php";



	}



	



}







function displaySubOnHomePage(FrmPara)



{



	var ans = confirm("Are you shore u want to display on home page?");



	if(ans==true)



	{



		document.frmSubCategoryMgmt.action = FrmPara;



		document.frmSubCategoryMgmt.submit();



	}



	else



	{



		document.frmSubCategoryMgmt.action = "category_mgmt.php";



	}



	



}



function deleteAllCatagory(FrmPara)



{



	//alert("hi");



	var ans = confirm("All the Product Under This Category will Also Deleted.\n Would you like to Delete Catagory?");



	if(ans==true)



	{



		document.frmCategoryMgmt.action = FrmPara;



		document.frmCategoryMgmt.submit();



	}



	else



	{



		document.frmCategoryMgmt.action = "category_mgmt.php";



	}



	



}

function deleteCatagoryNew(FrmPara)



{



	//alert("hi");



	var ans = confirm("Would you like to Delete Catagory?");



	if(ans==true)



	{



		document.frmCategoryMgmt.hidFrmVal.value = "Delete";



		document.frmCategoryMgmt.action = FrmPara;



		document.frmCategoryMgmt.submit();



	}



	else



	{



		document.frmCategoryMgmt.action = FrmPara;



	}



	



}

function deleteCatagory(FrmPara)



{



	//alert("hi");



	var ans = confirm("All the Child Under This Record will Also Deleted.\n Would you like to Delete ?");



	if(ans==true)



	{



		document.frmCategoryMgmt.hidFrmVal.value = "Delete";



		document.frmCategoryMgmt.action = FrmPara;



		document.frmCategoryMgmt.submit();



	}



	else



	{



		document.frmCategoryMgmt.action = FrmPara;



	}



	



}



function deleteSubCatagory(FrmPara){
	//alert("hi");
	var ans = confirm("All the Record Under This Category will Also Deleted.\n Would you like to Delete Catagory?");
	if(ans){
		
		document.frmCatagoryMgmt.hidFrmVal.value = "Delete";
		document.frmCatagoryMgmt.action = FrmPara;
		document.frmCatagoryMgmt.submit();
	}
	else{
		document.frmSubCategoryMgmt.action = FrmPara;
	}
}



function deleteComment(FrmPara)



{



	//alert("hi");



	var ans = confirm("Would you like to Delete Comment?");



	if(ans==true)



	{



		document.frmCommentMgmt.hidFrmVal.value = "Delete";



		document.frmCommentMgmt.action = FrmPara;



		document.frmCommentMgmt.submit();



	}



	else



	{



		document.frmCommentMgmt.action = FrmPara;



	}



	



}



function deleteList(FrmPara)



{



	//alert("hi");



	var ans = confirm("Would you like to Delete List?");



	if(ans==true)



	{



		document.frnViewlist.hidFrmVal.value = "Delete";



		document.frnViewlist.action = FrmPara;



		document.frnViewlist.submit();



	}



	else



	{



		document.frnViewlist.action = FrmPara;



	}



	



}



function deleteOrder(FrmPara)



{



	//alert("hi");



	var ans = confirm("Would you like to  Delete Order?");



	if(ans==true)



	{



		document.frmOrderMgmt.hidFrmVal.value = "Delete";



		document.frmOrderMgmt.action = FrmPara;



		document.frmOrderMgmt.submit();



	}



	else



	{



		document.frmOrderMgmt.action = FrmPara;



	}



}







function deleteSellerOrder(FrmPara)
{
	//alert("hi");
	var ans = confirm("Would you like to  Delete Order?");
	if(ans==true)
	{
		document.frmSellerOrderMgmt.hidFrmVal.value = "Delete";
		document.frmSellerOrderMgmt.action = FrmPara;
		document.frmSellerOrderMgmt.submit();
	}
	else
	{
		document.frmSellerOrderMgmt.action = FrmPara;
	}
}

function deletelead(FrmPara)
{
	var ans = confirm("Would you like to  Delete Lead?");
	if(ans==true)
	{
		document.frmlead.hidFrmVal.value = "Delete";
		document.frmlead.action = FrmPara;
		document.frmlead.submit();
	}
	else
	{
		document.frmlead.action = FrmPara;
	}
}






function deleteProduct(FrmPara)

{

	var ans = confirm("All the Order Under This Product will Also Deleted.\n Would you like to Delete Product?");
	if(ans==true)

	{
		document.frmProductMgmt.hidFrmVal.value = "Delete";
		document.frmProductMgmt.action = FrmPara;
		document.frmProductMgmt.submit();
	}
	else
	{
		document.frmProductMgmt.action = FrmPara;
	}
}



function deleteReview(FrmPara)

{

	var ans = confirm("Are you sure you want to delete the review?");
	if(ans==true)
	{
		document.frmReviewMgmt.hidFrmVal.value = "Delete";
		document.frmReviewMgmt.action = FrmPara;
		document.frmReviewMgmt.submit();
	}
	else
		{
		document.frmReviewMgmt.action = FrmPara;
		}
	}



function editReg()

{
		if(document.frmRegister.txtEmail.value == "")

		{

			alert('Please Enter your Email Address');
			document.frmRegister.txtEmail.focus();
			return false;
		}
		if(document.frmRegister.txtEmail.value.indexOf("@") == -1 || document.frmRegister.txtEmail.value.indexOf(".") == -1)
		{
			alert("Please Enter Valid Email Address!!!");
			document.frmRegister.txtEmail.focus();
			return false;
		}
		if(document.frmRegister.txtPhone.value == "")
		{
			alert('Please enter the Phone Number');
			document.frmRegister.txtPhone.focus();
			return false;
		}

		if(document.frmRegister.txtScreen.value.indexOf("@") == -1 || document.frmRegister.txtScreen.value.indexOf(".") == -1)
		{
			alert("Please Enter Valid Screen Name!!!");
			document.frmRegister.txtScreen.focus();
			return false;

		}



		if(!IsNumericforReg(document.frmRegister.txtPhone.value))
		{
			return false;
		}

		document.frmRegister.action = "register.php";
		document.frmRegister.submit();
}



function chkCategoryValidation(val){
	if(document.frmCategory.txtCategoryName.value==""){
		alert("Catagory Name should not be blank");
		document.frmCategory.txtCategoryName.focus();
		return false;
	}

	document.frmCategory.action ="category.php";
	document.frmCategory.submit();	
}



function chkSubCategoryValidation(val){
	/*if(document.frmSubCategory.txtCategoryName.value==""){
		alert("Please Select the category");
		document.frmSubCategory.txtCategoryName.focus();
		return false;
	}*/
	if(document.frmSubCategory.txtSubCategoryName.value=="")
	{
		alert("SubCategory Name should not be blank");
		document.frmSubCategory.txtSubCategoryName.focus();
		return false;
	}
	document.frmSubCategory.action ="subcategory.php";
	document.frmSubCategory.submit();	
}

function chkbuylingInfo()
{
	var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
	if(document.frmSell.lead_head_line.value==""){
		alert("Please enter Lead head line");
		document.frmSell.lead_head_line.focus();
		return false;
	}
	if(document.frmSell.pkeyword.value==""){
		alert("Please select the product keyword");
		document.frmSell.pkeyword.focus();
		return false;
	}
	if(document.frmSell.category.value==""){
		alert("Please enter the category");
		document.frmSell.category.focus();
		return false;
	}
	if(document.frmSell.subcategory.value==""){
		alert("Please enter your sub category");
		document.frmSell.subcategory.focus();
		return false;
	}
	if(document.frmSell.sort_desc.value==""){
		alert("Please enter brief description");
		document.frmSell.sort_desc.focus();
		return false;
	}
/*	if(document.frmSell.photo_image1){
		if(document.frmSell.photo_image1.value!=''){
			if(getFileName(document.frmSell.photo_image1.value).search(/^[0-9A-Za-z\s_ -\[\]]+(.[jJ][pP][gG]|.[gG][iI][fF]|.[bB][mM][pP]|.[jJ][pP][eE][gG]|.[pP][nN][gG])$/)==-1){
				alert("Please upload only jpg or jpeg or png or gif or bmp format of images");
				return false;
			}
		}
	}
	if(document.frmSell.photo_image2){
		if(document.frmSell.photo_image2.value!=''){
			if(getFileName(document.frmSell.photo_image2.value).search(/^[0-9A-Za-z\s_ -\[\]]+(.[jJ][pP][gG]|.[gG][iI][fF]|.[bB][mM][pP]|.[jJ][pP][eE][gG]|.[pP][nN][gG])$/)==-1){
				alert("Please upload only jpg or jpeg or png or gif or bmp format of images");
				return false;
			}
		}
	}
	if(document.frmSell.photo_image3){
		if(document.frmSell.photo_image3.value!=''){
			if(getFileName(document.frmSell.photo_image3.value).search(/^[0-9A-Za-z\s_ -\[\]]+(.[jJ][pP][gG]|.[gG][iI][fF]|.[bB][mM][pP]|.[jJ][pP][eE][gG]|.[pP][nN][gG])$/)==-1){
				alert("Please upload only jpg or jpeg or png or gif or bmp format of images");
				return false;
			}
		}
	}
	if(document.frmSell.photo_image4){
		if(document.frmSell.photo_image4.value!=''){
			if(getFileName(document.frmSell.photo_image4.value).search(/^[0-9A-Za-z\s_ -\[\]]+(.[jJ][pP][gG]|.[gG][iI][fF]|.[bB][mM][pP]|.[jJ][pP][eE][gG]|.[pP][nN][gG])$/)==-1){
				alert("Please upload only jpg or jpeg or png or gif or bmp format of images");
				return false;
			}
		}
	}*/

		if(document.frmSell.type.value==""){
			alert("Please enter your Type");
			document.frmSell.type.focus();
			return false;
		}

	if(document.frmSell.m_qty.value==""){
			alert("Please enter your monthly quantity");
			document.frmSell.m_qty.focus();
			return false;
		}
		
		
	
		if(document.frmSell.Buyer_name.value==""){
			alert("Please enter your Buyer Name");
			document.frmSell.Buyer_name.focus();
			return false;
		}
		
		
		if(document.frmSell.phone.value==""){
			alert("Please enter your phone number");
			document.frmSell.phone.focus();
			return false;
		}
			if(document.frmSell.address.value==""){
			alert("Please enter your address");
			document.frmSell.address.focus();
			return false;
		}
	
	if(document.frmSell.country){
		if(document.frmSell.country.value==""){
			alert("Please enter your country");
			document.frmSell.country.focus();
			return false;
		}
	}
	
	if(document.frmSell.state){
	if(document.frmSell.state.value==""){
		alert("Please enter your state");
		document.frmSell.state.focus();
		return false;
		}
	}
		if(document.frmSell.city){
		if(document.frmSell.city.value==""){
			alert("Please enter your city");
			document.frmSell.city.focus();
			return false;
		}
	}
	
	if(document.frmSell.zipcode){
		if(document.frmSell.zipcode.value==""){
			alert("Please enter your zipcode");
			document.frmSell.zipcode.focus();
			return false;
		}
	}
	//document.frmSell.action ="add-seller-product.php";
	//document.frmSell.submit();	
}



function chksellleadingInfo()
{
	
	var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
	if(document.frmSell.category.value==""){
		alert("Please enter Category");
		document.frmSell.category.focus();
		return false;
	}
	if(document.frmSell.subcategory.value==""){
		alert("Please select the sub category");
		document.frmSell.subcategory.focus();
		return false;
	}
	if(document.frmSell.pname.value==""){
		alert("Please enter the product name");
		document.frmSell.pname.focus();
		return false;
	}
	if(document.frmSell.price.value==""){
		alert("Please enter the price");
		document.frmSell.price.focus();
		return false;
	}

	
	if(document.frmSell.photo_image1){
		if(document.frmSell.photo_image1.value!=''){
			if(getFileName(document.frmSell.photo_image1.value).search(/^[0-9A-Za-z\s_ -\[\]]+(.[jJ][pP][gG]|.[gG][iI][fF]|.[bB][mM][pP]|.[jJ][pP][eE][gG]|.[pP][nN][gG])$/)==-1){
				alert("Please upload only jpg or jpeg or png or gif or bmp format of images");
				return false;
			}
		}
	}
	if(document.frmSell.photo_image2){
		if(document.frmSell.photo_image2.value!=''){
			if(getFileName(document.frmSell.photo_image2.value).search(/^[0-9A-Za-z\s_ -\[\]]+(.[jJ][pP][gG]|.[gG][iI][fF]|.[bB][mM][pP]|.[jJ][pP][eE][gG]|.[pP][nN][gG])$/)==-1){
				alert("Please upload only jpg or jpeg or png or gif or bmp format of images");
				return false;
			}
		}
	}
	if(document.frmSell.photo_image3){
		if(document.frmSell.photo_image3.value!=''){
			if(getFileName(document.frmSell.photo_image3.value).search(/^[0-9A-Za-z\s_ -\[\]]+(.[jJ][pP][gG]|.[gG][iI][fF]|.[bB][mM][pP]|.[jJ][pP][eE][gG]|.[pP][nN][gG])$/)==-1){
				alert("Please upload only jpg or jpeg or png or gif or bmp format of images");
				return false;
			}
		}
	}
	if(document.frmSell.photo_image4){
		if(document.frmSell.photo_image4.value!=''){
			if(getFileName(document.frmSell.photo_image4.value).search(/^[0-9A-Za-z\s_ -\[\]]+(.[jJ][pP][gG]|.[gG][iI][fF]|.[bB][mM][pP]|.[jJ][pP][eE][gG]|.[pP][nN][gG])$/)==-1){
				alert("Please upload only jpg or jpeg or png or gif or bmp format of images");
				return false;
			}
		}
	}
	
		if(document.frmSell.location.value==""){
		alert("Please enter location");
		document.frmSell.location.focus();
		return false;
	}
	
if(document.frmSell.min_order.value=="")
{
	alert("Please enter your minimum order");
	document.frmSell.min_order.focus();
	return false;
}

if(document.frmSell.sort_desc.value=="")
{
	alert("Please enter your sort description");
	document.frmSell.sort_desc.focus();
	return false;
}

/*if(document.frmSell.min_order_qty.value=="")
{
	alert("Please enter your minimum order quantity.");
	document.frmSell.min_order_qty.focus();
	return false;
}
if(document.frmSell.min_order_unit.value=="")
{
	alert("Please enter your minimum order unit.");
	document.frmSell.min_order_unit.focus();
	return false;
}*/

if(document.frmSell.port.value=="")
{
	alert("Please enter your port.");
	document.frmSell.port.focus();
	return false;
}
	

if(document.frmSell.comp_name.value==""){
	alert("Please enter your Company Name");
	document.frmSell.comp_name.focus();
	return false;
}
	
if(document.frmSell.country)
{
		if(document.frmSell.country.value==""){
			alert("Please enter your country");
			document.frmSell.country.focus();
			return false;
		}
}

if(document.frmSell.state.value=="")
	{
		alert("Please enter your state");
		document.frmSell.state.focus();
		return false;
	}


if(document.frmSell.city.value=="")
{
	alert("Please enter your city");
	document.frmSell.city.focus();
	return false;
}

if(document.frmSell.zip_code.value==""){
	alert("Please enter your zipcode");
	document.frmSell.zip_code.focus();
	return false;
}

}





function chkSellingInfo()
{
		var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
	if(document.frmSell.category.value==""){
		alert("Please enter Category");
		document.frmSell.category.focus();
		return false;
	}
	if(document.frmSell.subcategory.value==""){
		alert("Please select the sub category");
		document.frmSell.subcategory.focus();
		return false;
	}
	if(document.frmSell.txtProduct.value==""){
		alert("Please enter product name");
		document.frmSell.txtProduct.focus();
		return false;
	}
	if(document.frmSell.condition.value==""){
		alert("Please select the condition");
		document.frmSell.condition.focus();
		return false;
	}
	if(document.frmSell.txtpcode.value==""){
		alert("Please select the product code");
		document.frmSell.txtpcode.focus();
		return false;
	}
	
	if(document.frmSell.txtOPrice.value==""){
		alert("Please enter the original price");
		document.frmSell.txtOPrice.focus();
		return false;
	}
	
	if(document.frmSell.txtPrice.value==""){
		alert("Please enter your discounted price");
		document.frmSell.txtPrice.focus();
		return false;
	}
	
	if(document.frmSell.sellertype.value==""){
		alert("Please enter your Type of Seller.");
		document.frmSell.sellertype.focus();
		return false;
	}
	
	if(document.frmSell.vLocation.value==""){
		alert("Please enter your product location.");
		document.frmSell.vLocation.focus();
		return false;
	}
	
	
	if(document.frmSell.txtComments.value==""){
		alert("Please enter your brief description.");
		document.frmSell.txtComments.focus();
		return false;
	}
	
	
	if(document.frmSell.photo_image1){
		if(document.frmSell.photo_image1.value!=''){
			if(getFileName(document.frmSell.photo_image1.value).search(/^[0-9A-Za-z\s_ -\[\]]+(.[jJ][pP][gG]|.[gG][iI][fF]|.[bB][mM][pP]|.[jJ][pP][eE][gG]|.[pP][nN][gG])$/)==-1){
				alert("Please upload only jpg or jpeg or png or gif or bmp format of images");
				return false;
			}
		}
	}
	if(document.frmSell.photo_image2){
		if(document.frmSell.photo_image2.value!=''){
			if(getFileName(document.frmSell.photo_image2.value).search(/^[0-9A-Za-z\s_ -\[\]]+(.[jJ][pP][gG]|.[gG][iI][fF]|.[bB][mM][pP]|.[jJ][pP][eE][gG]|.[pP][nN][gG])$/)==-1){
				alert("Please upload only jpg or jpeg or png or gif or bmp format of images");
				return false;
			}
		}
	}
	if(document.frmSell.photo_image3){
		if(document.frmSell.photo_image3.value!=''){
			if(getFileName(document.frmSell.photo_image3.value).search(/^[0-9A-Za-z\s_ -\[\]]+(.[jJ][pP][gG]|.[gG][iI][fF]|.[bB][mM][pP]|.[jJ][pP][eE][gG]|.[pP][nN][gG])$/)==-1){
				alert("Please upload only jpg or jpeg or png or gif or bmp format of images");
				return false;
			}
		}
	}
	if(document.frmSell.photo_image4){
		if(document.frmSell.photo_image4.value!=''){
			if(getFileName(document.frmSell.photo_image4.value).search(/^[0-9A-Za-z\s_ -\[\]]+(.[jJ][pP][gG]|.[gG][iI][fF]|.[bB][mM][pP]|.[jJ][pP][eE][gG]|.[pP][nN][gG])$/)==-1){
				alert("Please upload only jpg or jpeg or png or gif or bmp format of images");
				return false;
			}
		}
	}
	if(document.frmSell.txtFName){
		if(document.frmSell.txtFName.value==""){
			alert("Please enter your First Name");
			document.frmSell.txtFName.focus();
			return false;
		}
	}
	if(document.frmSell.txtLName){
		if(document.frmSell.txtLName.value==""){
			alert("Please enter your Last Name");
			document.frmSell.txtLName.focus();
			return false;
		}
	}
	if(document.frmSell.txtEmail){
		if(document.frmSell.txtEmail.value==""){
			alert("Please enter your email");
			document.frmSell.txtEmail.focus();
			return false;
		}
		if(!re_mail.test(document.frmSell.txtEmail.value)){
			alert("Please enter a valid email-id");
			document.frmSell.txtEmail.focus();
			return false;
		}
	}
	if(document.frmSell.country){
		if(document.frmSell.country.value==""){
			alert("Please enter your country");
			document.frmSell.country.focus();
			return false;
		}
	}
	if(document.frmSell.txtState){
		if(document.frmSell.txtState.value==""){
			alert("Please enter your state");
			document.frmSell.txtState.focus();
			return false;
		}
	}
	if(document.frmSell.txtCity){
		if(document.frmSell.txtCity.value==""){
			alert("Please enter your city");
			document.frmSell.txtCity.focus();
			return false;
		}
	}
	if(document.frmSell.txtAddress){
		if(document.frmSell.txtAddress.value==""){
			alert("Please enter your address");
			document.frmSell.txtAddress.focus();
			return false;
		}
	}
	if(document.frmSell.txtZip){
		if(document.frmSell.txtZip.value==""){
			alert("Please enter your zipcode");
			document.frmSell.txtZip.focus();
			return false;
		}
	}
	
	//document.frmSell.action ="add-seller-product.php";
	//document.frmSell.submit();	
}



function validatesearch()
	{
		if(document.keysearch.searchkey.value==''){
			alert("Please enter keyword");
			document.keysearch.searchkey.focus();
			return false;
	} 
	
	if(document.keysearch.start_date.value==''){
			alert("Please enter start date");
			document.keysearch.start_date.focus();
			return false;
	} 
	
	if(document.keysearch.end_date.value==''){
			alert("Please enter end date");
			document.keysearch.end_date.focus();
			return false;
	} 
}



function chkReviewInfo()
{
	if(document.frmReview.txtName.value=="")
	{
		alert("Please give your Name");
		document.frmReview.txtName.focus();
		return false;
	}

	if(document.frmReview.txtEmailID.value=="")
	{
		alert("Please enter your email id");
		document.frmSell.txtEmailID.focus();
		return false;
	}

	if(document.frmReview.txtReview.value=="")
	{
		alert("Please enter your review");
		document.frmSell.txtReview.focus();
		return false;
	}
	document.frmReview.action ="review_save.php?flg=1";
	document.frmReview.submit();	
}



function chkProductValidation(val){

	if(document.frmProduct.sel.value==""){



		alert("Please Select the Catagory Name");



		document.frmProduct.sel.focus();



		return false;



	}



	if(document.frmProduct.txtProductName.value==""){



		alert("Product Name should not be blank");



		document.frmProduct.txtProductName.focus();



		return false;



	}
	
	if(document.frmProduct.vLocation.value==""){



		alert("Location should not be blank");



		document.frmProduct.vLocation.focus();



		return false;



	}
  
	

  




	if(document.frmProduct.txtProductPrice.value==""){



		alert("Product Price should not be blank");



		document.frmProduct.txtProductPrice.focus();



		return false;



	}



	if(!IsNumericforReg(document.frmProduct.txtProductPrice.value))



		{



			alert("Please Enter Valid Price");



			document.frmProduct.txtProductPrice.focus();



			return false;



		}



	document.frmProduct.action ="product.php";



	document.frmProduct.submit();	



}



function getcategoryid(){	



var str="";







			//alert(document.frmProduct.txtCategoryName.length);



			//if(document.frmProduct.ch.length > 1){



			for(var i=0;i<document.frmProduct.sel.length ;i++)



			{



					if(document.frmProduct.sel[i].selected)



					{



					  



					 str+=","+document.frmProduct.sel[i].value;



					 



					  



					  }



			}



		document.frmProduct.iChk.value=str;



	//alert(str);	



}



function cSubmit(){



	if(document.frmClient1.txtOrderNo.value==""){



		alert("Please Enter OrderNo");



		document.frmClient1.txtOrderNo.focus();



		return false;



	}



	document.frmClient1.action ="index.php";



	document.frmClient1.submit();



}



function chkUserValidation(val){



	if(document.frmUser.txtUName.value == ""){



		alert(" User Name should not be blank");



		document.frmUser.txtUName.focus();



		return false;



	}



	if(document.frmUser.txtUName.value.indexOf("@") == -1){



		alert("Please enter valid Email");



		document.frmUser.txtUName.focus();



		return false;



	}



	if(document.frmUser.txtUName.value.indexOf(".") == -1){



		alert("Please enter valid Email");



		document.frmUser.txtUName.focus();



		return false;



	}



	if(document.frmUser.txtFName.value == ""){



		alert("First Name should not be blank");



		document.frmUser.txtFName.focus();



		return false;



	}	



	if(document.frmUser.txtLName.value == ""){



		alert("Last Name should not be blank");



		document.frmUser.txtLName.focus();



		return false;



	}



	if(document.frmUser.txtPhone.value == ""){



		alert("Phone no should not be blank");



		document.frmUser.txtPhone.focus();



		return false;



	}



	if(!IsNumericforReg(document.frmUser.txtPhone.value))



		{



			alert("Please Enter Valid Phone Number");



			document.frmUser.txtPhone.focus();



			return false;



		}



	if(document.frmUser.selStatus.value==""){



		alert("Please Select the User Status");



		document.frmUser.selStatus.focus();



		return false;



	}	



	document.frmUser.action ="user.php";



	document.frmUser.submit();	



}



function chkCustValidation(val){



	



	if(document.frmCustomer.txtUName.value == ""){



		alert("Email should not be blank");



		document.frmCustomer.txtUName.focus();



		return false;



	}			



	if(document.frmCustomer.txtUName.value.indexOf("@") == -1){



		alert("Please enter valid Email");



		document.frmCustomer.txtUName.focus();



		return false;



	}



	if(document.frmCustomer.txtUName.value.indexOf(".") == -1){



		alert("Please enter valid Email");



		document.frmCustomer.txtUName.focus();



		return false;



	}



	



	if(document.frmCustomer.txtUpassword.value == ""){



		alert("Password should not be blank");



		document.frmCustomer.txtUpassword.focus();



		return false;



	}	



	if(document.frmCustomer.txtFName.value == ""){



		alert("First Name should not be blank");



		document.frmCustomer.txtFName.focus();



		return false;



	}	



	if(document.frmCustomer.txtLName.value == ""){



		alert("Last Name should not be blank");



		document.frmCustomer.txtLName.focus();



		return false;



	}



	if(document.frmCustomer.txtAddress.value ==""){



		alert("Address should not be blank");



		document.frmCustomer.txtAddress.focus();



		return false;



	}



	



	if(document.frmCustomer.txtCity.value == ""){



		alert("City should not be blank");



		document.frmCustomer.txtCity.focus();



		return false;



	}	



	if(document.frmCustomer.txtState.value == ""){



		alert("State should not be blank");



		document.frmCustomer.txtState.focus();



		return false;



	}



	



	if(document.frmCustomer.txtCountry.value == ""){



		alert("Country should not be blank");



		document.frmCustomer.txtCountry.focus();



		return false;



	}



	if(document.frmCustomer.txtPhoneNo.value == ""){



		alert("Phone should not be blank");



		document.frmCustomer.txtPhoneNo.focus();



		return false;



	}



	if(!IsNumericforReg(document.frmCustomer.txtPhoneNo.value))



		{



			alert("Please Enter Valid Phone Number");



			document.frmCustomer.txtPhoneNo.focus();



			return false;



		}



	document.frmCustomer.action ="user.php";



	document.frmCustomer.submit();				



}











function chkValidation(val){



	



	if(document.frmSeller.txtUName.value == ""){



		alert("Email should not be blank");



		document.frmSeller.txtUName.focus();



		return false;



	}			



	if(document.frmSeller.txtUName.value.indexOf("@") == -1){



		alert("Please enter valid Email");



		document.frmSeller.txtUName.focus();



		return false;



	}



	if(document.frmSeller.txtUName.value.indexOf(".") == -1){



		alert("Please enter valid Email");



		document.frmSeller.txtUName.focus();



		return false;



	}



	if(document.frmSeller.txtUpassword.value == ""){



		alert("Password should not be blank");



		document.frmSeller.txtUpassword.focus();



		return false;



	}	



	if(document.frmSeller.txtFName.value == ""){



		alert("First Name should not be blank");



		document.frmSeller.txtFName.focus();



		return false;



	}	



	if(document.frmSeller.txtLName.value == ""){



		alert("Last Name should not be blank");



		document.frmSeller.txtLName.focus();



		return false;



	}



	if(document.frmSeller.txtAddress.value ==""){



		alert("Address should not be blank");



		document.frmSeller.txtAddress.focus();



		return false;



	}



	



	if(document.frmSeller.txtCity.value == ""){



		alert("City should not be blank");



		document.frmSeller.txtCity.focus();



		return false;



	}	



	if(document.frmSeller.txtState.value == ""){



		alert("State should not be blank");



		document.frmSeller.txtState.focus();



		return false;




	}



	



	if(document.frmSeller.txtCountry.value == ""){



		alert("Country should not be blank");



		document.frmSeller.txtCountry.focus();



		return false;



	}



	if(document.frmSeller.txtPhoneNo.value == ""){



		alert("Phone should not be blank");



		document.frmSeller.txtPhoneNo.focus();



		return false;



	}



	if(!IsNumericforReg(document.frmSeller.txtPhoneNo.value))



		{



			alert("Please Enter Valid Phone Number");



			document.frmSeller.txtPhoneNo.focus();



			return false;



		}



	document.frmSeller.action ="seller.php";



	document.frmSeller.submit();				



}



function addReg()



{







		///alert("hi");



		if(document.frmRegister.txtEmailID.value == "")



		{



			alert('Please Enter your Email Address');



			document.frmRegister.txtEmailID.focus();



			return false;



		}



		if(document.frmRegister.txtEmailID.value.indexOf("@") == -1 || document.frmRegister.txtEmail.value.indexOf(".") == -1)



		{



			alert("Please Enter Valid Email Address!!!");



			document.frmRegister.txtEmailID.focus();



			return false;



		}



		/*if(document.frmRegister.txtPassword.value == "")



		{



			alert('Please Enter your Password');



			document.frmRegister.txtPassword.focus();



			return false;



		}



		if(document.frmRegister.txtConfPassword.value == "")



		{



			alert('Please Enter your Email Address');



			document.frmRegister.txtConfPassword.focus();



			return false;



		}



		if(document.frmRegister.txtPassword.value != document.frmRegister.txtConfPassword.value)



		{



			alert('password and confirm password are not same');



			document.frmRegister.txtPassword.focus();



			return false;



		}*/



		if(document.frmRegister.txtPhoneNo.value == "")



		{



			alert('Please enter the Phone Number');



			document.frmRegister.txtPhoneNo.focus();



			return false;



		}



	/*	if(document.frmRegister.txtScreen.value.indexOf("@") == -1 || document.frmRegister.txtScreen.value.indexOf(".") == -1)



		{



			alert("Please Enter Valid Screen Name!!!");



			document.frmRegister.txtScreen.focus();



			return false;



		}*/



		if(!IsNumericforReg(document.frmRegister.txtPhoneNo.value))



		{



			return false;



		}



		document.frmRegister.action = "client.php";



		document.frmRegister.submit();







}







function IsNumericforReg(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;   



 }



 



function deletePhoto(id,photo_id)



{



	



	var ans = confirm("Are you sure want to Delete Photo?");



	if(ans==true)



	{



		document.frmShowPhoto.action = "photo_mgmt.php?do=delete&id="+id+"&photo_id="+photo_id;



		document.frmShowPhoto.submit();



	}



}







function editPhoto(type,FrmPara)



{







	document.frmPhotoAdd.action = FrmPara;



	document.frmPhotoAdd.submit();



}



function editPhotoclient(type,FrmPara)



{



	document.frmPhotoAdd.action = FrmPara;



	document.frmPhotoAdd.submit();



}



function deletePhotoClient(id,photo_id)



{



	



	var ans = confirm("Are you sure want to Delete Photo?");



	if(ans==true)



	{



		document.frmShowPhoto.action = "show_photo.php?do=delete&id="+id+"&photo_id="+photo_id;



		document.frmShowPhoto.submit();



	}



}



function chk1()



	{



			var str="";



			//alert(document.form1.ch.length);



			if(document.form1.ch.length > 1){



			for(var i=0;i<document.form1.ch.length ;i++)



			{



					if(document.form1.ch[i].checked)



					{



					  document.form1.ch[i].checked=true;



					 //alert(document.form1.ch[i].value);



					 str+=document.form1.ch[i].value;



					 // alert(str);



					  document.form1.iChk.value=str;



					}



			}



		//alert(str);	



			}



			else



			{



			if(document.form1.ch.checked){



			document.form1.ch.checked=true;



            //alert(document.form1.ch[i].value);



			 str=document.form1.ch.value;



			 //alert(str);



			 document.form1.iChk.value=str;



			 }



		}



		



	}



function  checkall()



{



	var iChk=new Array();



	//alert(document.frmCategoryMgmt.ch.length);



	if(document.frmCategoryMgmt.ch.length>1)



	{



		if(document.frmCategoryMgmt.chkall.checked)



		{



				



				for(var i=0;i<document.frmCategoryMgmt.ch.length;i++)



				{



						  document.frmCategoryMgmt.ch[i].checked=true;



							iChk[i]=document.frmCategoryMgmt.ch[i].value;



						  //alert(iChk[i]);



				}



		}



		else{



			for(var i=0;i<document.frmCategoryMgmt.ch.length;i++)



				{



						  document.frmCategoryMgmt.ch[i].checked=false;



				}



		}



	}



	else



	{



		if(document.frmCategoryMgmt.chkall.checked)



		{



					  document.frmCategoryMgmt.ch.checked=true;



							iChk[0]=document.frmCategoryMgmt.ch.value;



						  //alert(iChk[i]);



		}



		else{



				 document.frmCategoryMgmt.ch.checked=false;



		}



	}



	document.frmCategoryMgmt.iChk.value=iChk;



	//alert(document.frmCategoryMgmt.iChk.value=iChk);



}



function checkchk()



{



		var iChk=new Array();



		var j=0;



		if(document.frmCategoryMgmt.ch.length>1)



		{



			for(var i=0;i<document.frmCategoryMgmt.ch.length;i++)



			{



					if(document.frmCategoryMgmt.ch[i].checked)



					{



					  	document.frmCategoryMgmt.ch[i].checked=true;



					 	iChk[j]=document.frmCategoryMgmt.ch[i].value;



					 // document.form1.iChk.value=str;



					 	j+=1;



					 	//alert(iChk[i]);



					 }



			}	



			document.frmCategoryMgmt.iChk.value=iChk;



	    	//alert(document.frmCategoryMgmt.iChk.value=iChk);



		}



		else



		{



			if(document.frmCategoryMgmt.ch.checked)



			{



				document.frmCategoryMgmt.iChk.value=document.frmCategoryMgmt.ch.value;	



			}



			else



			{



				document.frmCategoryMgmt.iChk.value="";



			}



			//alert(document.frmCategoryMgmt.iChk.value);



		}



}



function chkcheckhome2(frmpara,url)



{



		var index;



		for(var i=0;i<document.frmCategoryMgmt.chhome.length;i++)



		{



			if(document.frmCategoryMgmt.chhome[i].value==frmpara.value)



			{



				index=i;



			}



		}	



		if(document.frmCategoryMgmt.chhome[index].checked)



		{



			var ans = confirm("Are you sure you want to display on home page");



			if(ans==true)



			{



					document.frmCategoryMgmt.action=url+"&flg=add&id="+frmpara.value;



					document.frmCategoryMgmt.submit();



			}else{



				document.frmCategoryMgmt.chhome[index].checked=false	



			}



		}else{



			var ans = confirm("Are you sure you don't want to display on home page");



			if(ans==true)



			{



				document.frmCategoryMgmt.action=url+"&flg=delete&id="+frmpara.value;



				document.frmCategoryMgmt.submit();



			}else{



				document.frmCategoryMgmt.chhome[index].checked=true;



			}	



		}



	



}



function chkcheckhome1(frmpara)



{



	var index;



	for(var i=0;i<document.frmCategoryMgmt.chhome.length;i++)



	{



		if(document.frmCategoryMgmt.chhome[i].value==frmpara.value)



		{



			index=i;



		}



	}	



	if(document.frmCategoryMgmt.chhome[index].checked)



	{



		//alert(frmpara.value);



		if(document.frmCategoryMgmt.Chk.length>0)



		{



			j=document.frmCategoryMgmt.Chk.length;



		}



		else



		{



			j=0;



		}



		document.frmCategoryMgmt.Chk[j]=frmpara.value;



		document.frmCategoryMgmt.Chk.length=j+1;



		//alert(document.frmCategoryMgmt.Chk[j]);



	}else{



		var temp=new Array();



		var k=0;



		for(var i=0;i<document.frmCategoryMgmt.Chk.length;i++)



		{



			if(document.frmCategoryMgmt.Chk[i]!=frmpara.value)



			{



				temp[k]=document.frmCategoryMgmt.Chk[i];



				k+=1;



			}



		}



		for(var i=0;i<temp.length;i++)



		{



			document.frmCategoryMgmt.Chk[i]=temp[i];



		}



		document.frmCategoryMgmt.Chk.length=temp.length;



	}



}



function chkcheckhome()



{



	var iChk=new Array();



	var f=0;



		var j=0;



			for(var i=0;i<document.frmCategoryMgmt.chhome.length ;i++)



			{



					if(document.frmCategoryMgmt.chhome[i].checked)



					{



					  	



						if(iChk.length>=3)



						{



							f=1;



							alert('U can Select Maximum Three Category');



						}	



						if(f==0)



						{



						document.frmCategoryMgmt.chhome[i].checked=true;



					 	iChk[j]=document.frmCategoryMgmt.chhome[i].value;



					 // document.form1.iChk.value=str;



					 	



					 	j+=1;



					 	//alert(iChk[i]);



						}else{ document.frmCategoryMgmt.chhome[i].checked=false; }



					 }



			}	



			



			document.frmCategoryMgmt.ChkHome.value=iChk;



			//alert(document.frmCategoryMgmt.ChkHome.value=iChk);



}



function chkSubCategoryHomeFlg()



{



	var iChk=new Array();



		var j=0;



			for(var i=0;i<document.frmSubCategoryMgmt.chhome.length ;i++)



			{



					if(document.frmSubCategoryMgmt.chhome[i].checked)



					{



					  	document.frmSubCategoryMgmt.chhome[i].checked=true;



					 	iChk[j]=document.frmSubCategoryMgmt.chhome[i].value;



					 // document.form1.iChk.value=str;



					 	j+=1;



					 	//alert(iChk[i]);



					 }



			}	



			document.frmSubCategoryMgmt.ChkHome.value=iChk;



			alert(document.frmSubCategoryMgmt.ChkHome.value=iChk);



}



function chkchk1(FrmPara)



{



	for(var i=0;i<document.frmProductMgmt.chhome.length ;i++)



			{



					if(document.frmProductMgmt.chhome[i].checked==false && document.frmProductMgmt.chhome[i].value==FrmPara )



					{



						



					  	//alert(document.frmProductMgmt.chhome[i].value);



					 	document.frmProductMgmt.action="updateprocount.php?iProductID="+document.frmProductMgmt.chhome[i].value;



						document.frmProductMgmt.submit();



					 }



			}	



}



function chkProductOnHomePage()
{
//alert ("Hiiiii");
	var iChk=new Array();
		var j=0;
		if(document.frmProductMgmt.chhome.length>0)
		{
			for(var i=0;i<document.frmProductMgmt.chhome.length ;i++)
			{
				if(document.frmProductMgmt.chhome[i].checked)
					{
						document.frmProductMgmt.chhome[i].checked=true;
					 	iChk[j]=document.frmProductMgmt.chhome[i].value;
					 // document.form1.iChk.value=str;
					 	//alert(iChk[j]);
					 	j+=1;
					 }
			}
		}else{
				if(document.frmProductMgmt.chhome.checked)
					{

					  	document.frmProductMgmt.chhome.checked=true;
					 	iChk[j]=document.frmProductMgmt.chhome.value;
							 // document.form1.iChk.value=str;
							 	//alert(iChk[j]);
					 	j+=1;
					 }
				}

				document.frmProductMgmt.ChkProductHome.value=iChk;
			//alert(document.frmProductMgmt.ChkProductHome.value=iChk);	
		}



function displayReviewOnHomePage(FrmPara)
{ 

	var ans = confirm("Are you sure u want to display on front-end?");

	if(ans==true)
		{
			document.frmReviewMgmt.action = FrmPara;
			document.frmReviewMgmt.submit();
		}
			else
					{
						document.frmReviewMgmt.action = "review_mgmt.php";
					}
}


function chkReviewOnHomePage()

{
		var iChk=new Array();
		var j=0;
		if(document.frmReviewMgmt.chhome.length>0)
		{
			for(var i=0;i<document.frmReviewMgmt.chhome.length ;i++)
			{
				if(document.frmReviewMgmt.chhome[i].checked)
					{
					  	document.frmReviewMgmt.chhome[i].checked=true;
					 	iChk[j]=document.frmReviewMgmt.chhome[i].value;
					 	j+=1;
					 }

			}
		}else{
				if(document.frmReviewMgmt.chhome.checked)
					{
					  	document.frmReviewMgmt.chhome.checked=true;
					 	iChk[j]=document.frmReviewMgmt.chhome.value;
					 	j+=1;
				}
		}
			document.frmReviewMgmt.ChkReviewHome.value=iChk;
}



function chkchk_review(FrmPara,pagenumber,iProductID)
{
	for(var i=0;i<document.frmReviewMgmt.chhome.length ;i++)
			{
				if(document.frmReviewMgmt.chhome[i].checked==false && document.frmReviewMgmt.chhome[i].value==FrmPara )
					{
						var ans = confirm("Are you sure you don't want to display on home page");
						if(ans==true)
						{
							document.frmReviewMgmt.action="updaterevcount.php?page="+pagenumber+"&review_id="+document.frmReviewMgmt.chhome[i].value+"&iProductID="+iProductID;
							document.frmReviewMgmt.submit();
						}else{
							document.frmReviewMgmt.chhome[i].checked=true;
						}
					}
			}	
}







function displaySuccessOnHomePage(FrmPara)
{
	var ans = confirm("Are you sure u want to display on front-end?");
	if(ans==true)
	{
		document.frmSuccessMgmt.action = FrmPara;
		document.frmSuccessMgmt.submit();
	}
	else
	{
		document.frmSuccessMgmt.action = "success_story_mgmt.php";

	}

}


function chkSuccessOnHomePage()
{

	var iChk=new Array();
	var j=0;
	if(document.frmSuccessMgmt.chhome.length>0)
	{
		for(var i=0;i<document.frmSuccessMgmt.chhome.length ;i++)
		{
			if(document.frmSuccessMgmt.chhome[i].checked)
				{
				  	document.frmSuccessMgmt.chhome[i].checked=true;
					iChk[j]=document.frmSuccessMgmt.chhome[i].value;
				 	j+=1;
				 }

			}
		}else{
			if(document.frmSuccessMgmt.chhome.checked)
					{
					  	document.frmSuccessMgmt.chhome.checked=true;
					 	iChk[j]=document.frmSuccessMgmt.chhome.value;
					 	j+=1;
					 }
		}
			document.frmSuccessMgmt.ChkSuccessHome.value=iChk;
}



function chkchk_success(FrmPara,pagenumber)
{
	for(var i=0;i<document.frmSuccessMgmt.chhome.length ;i++)
	{
		if(document.frmSuccessMgmt.chhome[i].checked==false && document.frmSuccessMgmt.chhome[i].value==FrmPara )
			{
				var ans = confirm("Are you sure you don't want to display on front-end");
				if(ans==true)
				{
				document.frmSuccessMgmt.action="updatesuccount.php?page="+pagenumber+"&success_story_id="+document.frmSuccessMgmt.chhome[i].value;
				document.frmSuccessMgmt.submit();
				}else{
						document.frmSuccessMgmt.chhome[i].checked=true;
						}

					}

			}	
}


function chkchk(FrmPara,pagenumber)
{
	for(var i=0;i<document.frmProductMgmt.chhome.length ;i++)
	{
		if(document.frmProductMgmt.chhome[i].checked==false && document.frmProductMgmt.chhome[i].value==FrmPara )
				{
						var ans = confirm("Are you sure you don't want to display on home page");
						if(ans==true)
						{
							document.frmProductMgmt.action="updateprocount.php?page="+pagenumber+"&iProductID="+document.frmProductMgmt.chhome[i].value;
							document.frmProductMgmt.submit();
						}else{
							document.frmProductMgmt.chhome[i].checked=true;
						}
					  	//alert(document.frmProductMgmt.chhome[i].value);
					 }
			}	
}



function chkListValidation(val)
{
	if(document.frmAddlist.txtName.value == ""){
		alert("Listname should not be blank");
		document.frmAddlist.txtName.focus();
		return false;
	}			
	document.frmAddlist.action ="add-wish-list.php";
	document.frmAddlist.submit();				
}



function AddItemToList(id)
	{
	document.frmViewDetail.iListID.value=id;
	document.frmViewDetail.action="viewdetail.php?FrmPara=Add";
	document.frmViewDetail.submit();
	}



function getProductid()
{
	var iChk=new Array();
	var j=0;
	if(document.frmSelectList.chk.length>1)
		{
			for(var i=0;i<document.frmSelectList.chk.length;i++)
			{
					if(document.frmSelectList.chk[i].checked)
						{
					  	document.frmSelectList.chk[i].checked=true;
					 	iChk[j]=document.frmSelectList.chk[i].value;
					 // document.form1.iChk.value=str;
					 	j+=1;
					 	//alert(iChk[i]);
					 }
			}	
			document.frmSelectList.iChk.value=iChk;
	    	//alert(document.frmCategoryMgmt.iChk.value=iChk);
		}
		else
		{
			if(document.frmSelectList.chk.checked)
			{
				document.frmSelectList.iChk.value=document.frmSelectList.chk.value;	
			}
			else
			{
				document.frmSelectList.iChk.value="";
			}
//alert(document.frmCategoryMgmt.iChk.value);
			}
}



function HomePageLink()



{



	document.frmViewCart.action="index.php";



	document.frmViewCart.submit();



}







function UpdateCart()
{
	document.frmViewCart.action="update_cart.php";
	document.frmViewCart.submit();
}

function clearCart()
{
	var m=confirm('Are you sure to clear the cart');
	if(m){
		document.frmViewCart.action="cart.php";
		document.frmViewCart.submit();
	}else
	{
		return true
	}
}


function checkShipping1()
{
	if(document.frmSAddress1.txtAddress1.value ==""){
	alert("Address should not be blank");
	document.frmSAddress1.txtAddress1.focus();
	return false;
	}

	if(document.frmSAddress1.txtCity1.value == ""){
	alert("City should not be blank");
	document.frmSAddress1.txtCity1.focus();
	return false;
	}	



	if(document.frmSAddress1.txtState1.value == ""){



		alert("State should not be blank");



		document.frmSAddress1.txtState1.focus();



		return false;



	}



	



	if(document.frmSAddress1.txtCountry1.value == ""){



		alert("Country should not be blank");



		document.frmSAddress1.txtCountry1.focus();



		return false;



	}



	document.frmSAddress1.action="addAddress.php?frmPara=Add&f=1";



	document.frmSAddress1.submit();



}



function checkBilling1()



{



	if(document.frmBAddress1.txtAddress1.value ==""){



		alert("Address should not be blank");



		document.frmBAddress1.txtAddress1.focus();



		return false;



	}


	if(document.frmBAddress1.txtCity1.value == ""){



		alert("City should not be blank");



		document.frmBAddress1.txtCity1.focus();



		return false;



	}	


	if(document.frmBAddress1.txtState1.value == ""){



		alert("State should not be blank");



		document.frmBAddress1.txtState1.focus();

		return false;

	}


	if(document.frmBAddress1.txtCountry1.value == ""){



		alert("Country should not be blank");



		document.frmBAddress1.txtCountry1.focus();



		return false;



	}



	if(document.frmBAddress1.txtArea1.value == ""){



		alert("Area Code should not be blank");



		document.frmBAddress1.txtArea1.focus();



		return false;



	}



	if(!IsNumericforReg(document.frmBAddress1.txtArea1.value))



		{



			alert("Please Enter Valid Area Code");



			document.frmBAddress1.txtArea1.focus();



			return false;



		}



	if(document.frmBAddress1.txtPhoneNo1.value == ""){



		alert("Phone should not be blank");



		document.frmBAddress1.txtPhoneNo1.focus();



		return false;



	}



	if(!IsNumericforReg(document.frmBAddress1.txtPhoneNo1.value))



		{



			alert("Please Enter Valid Phone Number");



			document.frmBAddress1.txtPhoneNo1.focus();



			return false;



		}



	document.frmBAddress1.action="add_billing_address.php?frmPara=Add&f=1";



	document.frmBAddress1.submit();



}



function chkOrderValidation(Frmpara)



{



	if(document.frmOrderedit.txtAddress.value ==""){



		alert("Address should not be blank");



		document.frmOrderedit.txtAddress.focus();



		return false;



	}



	if(document.frmOrderedit.txtCity.value == ""){



		alert("City should not be blank");



		document.frmOrderedit.txtCity.focus();



		return false;



	}	



	if(document.frmOrderedit.txtState.value == ""){



		alert("State should not be blank");



		document.frmOrderedit.txtState.focus();



		return false;



	}



	if(document.frmOrderedit.txtCountry.value == ""){



		alert("Country should not be blank");



		document.frmOrderedit.txtCountry.focus();



		return false;



	}



	document.frmOrderedit.action="order.php";



	document.frmOrderedit.submit();



}



function chkSellerOrderValidation()



{



	if(document.frmOrderedit.txtAddress.value ==""){



		alert("Address should not be blank");



		document.frmOrderedit.txtAddress.focus();



		return false;



	}



	if(document.frmOrderedit.txtCity.value == ""){



		alert("City should not be blank");



		document.frmOrderedit.txtCity.focus();



		return false;



	}	



	if(document.frmOrderedit.txtState.value == ""){



		alert("State should not be blank");



		document.frmOrderedit.txtState.focus();



		return false;



	}



	if(document.frmOrderedit.txtCountry.value == ""){



		alert("Country should not be blank");



		document.frmOrderedit.txtCountry.focus();



		return false;



	}



	document.frmOrderedit.action="seller_order.php";



	document.frmOrderedit.submit();



}



function chkSellerOrderValidation1()



{



	if(document.frmEditYourSell.txtAddress.value ==""){



		alert("Address should not be blank");



		document.frmEditYourSell.txtAddress.focus();



		return false;



	}



	if(document.frmEditYourSell.txtCity.value == ""){



		alert("City should not be blank");



		document.frmEditYourSell.txtCity.focus();



		return false;



	}	



	if(document.frmEditYourSell.txtState.value == ""){



		alert("State should not be blank");



		document.frmEditYourSell.txtState.focus();



		return false;



	}



	if(document.frmEditYourSell.txtCountry.value == ""){



		alert("Country should not be blank");



		document.frmEditYourSell.txtCountry.focus();



		return false;



	}



	document.frmEditYourSell.action="myaccount.php?f=4&FrmPara=Update";



	document.frmEditYourSell.submit();



}



function checkShipping()



{




	if(document.frmSAddress.txtAddress.value ==""){



		alert("Address should not be blank");



		document.frmSAddress.txtAddress.focus();



		return false;



	}



	



	if(document.frmSAddress.txtCity.value == ""){



		alert("City should not be blank");



		document.frmSAddress.txtCity.focus();



		return false;



	}	



	if(document.frmSAddress.txtState.value == ""){



		alert("State should not be blank");



		document.frmSAddress.txtState.focus();



		return false;



	}



	



	if(document.frmSAddress.txtCountry.value == ""){



		alert("Country should not be blank");



		document.frmSAddress.txtCountry.focus();



		return false;



	}



	document.frmSAddress.action="addAddress.php?frmPara=Add";



	document.frmSAddress.submit();



}



function checkBilling()



{



	if(document.frmBAddress.txtAddress.value ==""){



		alert("Address should not be blank");



		document.frmBAddress.txtAddress.focus();



		return false;



	}



	



	if(document.frmBAddress.txtCity.value == ""){



		alert("City should not be blank");



		document.frmBAddress.txtCity.focus();



		return false;



	}	



	if(document.frmBAddress.txtState.value == ""){



		alert("State should not be blank");



		document.frmBAddress.txtState.focus();



		return false;



	}



	



	if(document.frmBAddress.txtCountry.value == ""){



		alert("Country should not be blank");



		document.frmBAddress.txtCountry.focus();



		return false;



	}



	if(document.frmBAddress.txtArea.value == ""){



		alert("Area Code should not be blank");



		document.frmBAddress.txtArea.focus();



		return false;



	}



	if(!IsNumericforReg(document.frmBAddress.txtArea.value))



		{



			alert("Please Enter Valid Area Code");



			document.frmBAddress.txtArea.focus();



			return false;



		}



	if(document.frmBAddress.txtPhoneNo.value == ""){



		alert("Phone should not be blank");



		document.frmBAddress.txtPhoneNo.focus();



		return false;



	}



	if(!IsNumericforReg(document.frmBAddress.txtPhoneNo.value))



		{



			alert("Please Enter Valid Phone Number");



			document.frmBAddress.txtPhoneNo.focus();



			return false;



		}



	document.frmBAddress.action="add_billing_address.php?frmPara=Add";



	document.frmBAddress.submit();



}



function checkYesNo(frmpara)



{



	alert(frmpara.value);



	if(frmpara.value=="Yes")



	{



		document.frmAddress.action="addAddress.php?frmPara=Add&f=Y";



		document.frmAddress.submit();	



	}



	else



	{



		document.frmAddress.action="addAddress.php?frmPara=AddNew";



		document.frmAddress.submit();	



	}



}



function checkYesNo1(frmpara)



{



 	if(frmpara.value=="Yes")



	{



		document.frmAddress.action="add_billing_address.php?frmPara=Add&f=Y";



		document.frmAddress.submit();	



	}



	else



	{



		document.frmAddress.action="add_billing_address.php?frmPara=AddNew";



		document.frmAddress.submit();	



	}



}



function forget_pass()
{
	if(document.frmPassword.txtEmail.value == "")
		{
			alert('Please Enter your Email Address');
			document.frmPassword.txtEmail.focus();
			return false;
		}
		if(document.frmPassword.txtEmail.value.indexOf("@") == -1 || document.frmPassword.txtEmail.value.indexOf(".") == -1)
		{
			alert("Please Enter Valid Email Address!!!");
			document.frmPassword.txtEmail.focus();
			return false;
		}
		
}



function serch(val)



{



	document.frmSearchtext.action="search.php?page="+val;



	document.frmSearchtext.submit();




}



function RemoveItem()



{



	document.frmViewCart.action="cart.php";



	document.frmViewCart.submit();



}



function InsertBanner(FrmPara)



{

 //  alert(FrmPara);

	document.frmBannerMgmt.action = FrmPara;



	document.frmBannerMgmt.submit();



}

function InsertBanner1(FrmPara)



{

   //alert(FrmPara);

	document.frmLinkMgmt.action = FrmPara;



	document.frmLinkMgmt.submit();



}

function deleteBanner(FrmPara)



{



	//alert("hi");



	var ans = confirm("Would you like to Delete banner?");



	if(ans==true)



	{



		document.frmBannerMgmt.hidFrmVal.value = "Delete";



		document.frmBannerMgmt.action = FrmPara;



		document.frmBannerMgmt.submit();



	}



	else



	{



		document.frmBannerMgmt.action = FrmPara;



	}



	



}
function deleteCoupon(FrmPara)



{



	//alert("hi");



	var ans = confirm("Would you like to Delete coupon?");



	if(ans==true)



	{



		document.frmLinkMgmt.hidFrmVal.value = "Delete";



		document.frmLinkMgmt.action = FrmPara;



		document.frmLinkMgmt.submit();



	}



	else



	{



		document.frmLinkMgmt.action = FrmPara;



	}



	



}

function deleteLink(FrmPara)



{



	//alert("hi");



	var ans = confirm("Would you like to Delete link?");



	if(ans==true)



	{



		document.frmLinkMgmt.hidFrmVal.value = "Delete";



		document.frmLinkMgmt.action = FrmPara;



		document.frmLinkMgmt.submit();



	}



	else



	{



		document.frmLinkMgmt.action = FrmPara;



	}



	



}

function chkBannerValidation(val){



	if(document.frmBanner.txtUrl.value==""){



		alert("Banner Url should not be blank");



		document.frmBanner.txtUrl.focus();



		return false;



	}



	



	document.frmBanner.action ="banner.php";



	document.frmBanner.submit();	



}



function chkBannerCost(val){
	if(document.frmcostBanner.banner_cost.value==""){
		alert("Banner cost should not be blank");
		document.frmcostBanner.banner_cost.focus();
		return false;
	}
	if(document.frmcostBanner.banner_cost.value==0){
		alert("Banner cost should be greater than zero(0)");
		document.frmcostBanner.banner_cost.focus();
		return false;
	}
	if(document.frmcostBanner.banner_cost.value<0){
		alert("Banner cost should not be -Ve");
		document.frmcostBanner.banner_cost.focus();
		return false;
	}
	document.frmcostBanner.action ="banner_cost_edit.php";
	document.frmcostBanner.submit();
}






function chkCouponValidation(val){
	var pat=/^[0-9]*(\.)?[0-9]+$/;
	var obj=document.frmLinkMgmt;
	var len=obj.elements.length;
	for(var i=0;obj.elements[i];i++){
		obj.elements[i].value=obj.elements[i].value.trim();
		fldval=obj.elements[i].value;
		if(fldval==""){
			if(obj.elements[i].name=="coup_code"){
				alert("Coupon code should not be blank");
				obj.elements[i].focus();
				return false;
			}
			if(obj.elements[i].name=="coup_disc"){
				alert("Discount should not be blank");
				obj.elements[i].focus();
				return false;
			}
		}else{
			if(obj.elements[i].name=="coup_disc"){
				if(!pat.test(fldval)){
					alert("Discount value should be positive numeric or in 0.00 foramt");
					obj.elements[i].focus();
					return false;	
				}
				fldval=fldval.replace(/^[0]+/,"");
				var fldext=fldval.indexOf(".")!=-1 || false;
				if(fldext){
					fldval=fldval.substring(0,fldval.lastIndexOf("."));
				}
				if(fldval.length>2){
					alert("Discount value should be less than 100");
					obj.elements[i].focus();
					return false;	
				}else{
					if(fldval==0){
						alert("Discount value should be greater than zero");
						obj.elements[i].focus();
						return false;
					}
				}
			}
		}
	}
	document.frmLinkMgmt.action ="coupon.php";
	document.frmLinkMgmt.submit();	
}


function chklinkValidation(val){


if(document.frmLinkMgmt.txttitle.value==""){

		alert("Title should not be blank");

		document.frmLinkMgmt.txttitle.focus();

		return false;

	}

	if(document.frmLinkMgmt.linkdiscription.value==""){

		alert("Description should not be blank");

		document.frmLinkMgmt.linkdiscription.focus();

		return false;

	}

	if(document.frmLinkMgmt.txturl.value==""){



		alert("Link url should not be blank");



		document.frmLinkMgmt.txturl.focus();



		return false;



	}
	if(document.frmLinkMgmt.category_id.value=="0")
	{

		alert("Please Select a category");

		document.frmLinkMgmt.category_id.focus();

		return false;

	}



	



	document.frmLinkMgmt.action ="link.php";



	document.frmLinkMgmt.submit();	



}

function ViewBanner(pagenumb)



{



	var temp=new Array();



	var j=0;



	if(document.frmBannerMgmt.chHome.length > 0)



	{



		for(var i=0;i<document.frmBannerMgmt.chHome.length;i++)



		{



			//alert(document.frmascammgmt.chHome[i].value);



			if(document.frmBannerMgmt.chHome[i].checked)



			{



				temp[j++]=document.frmBannerMgmt.chHome[i].value;



			}



		}



	}



	else



	{



		if(document.frmBannerMgmt.chHome.checked)



		{



			temp[j++]=document.frmBannerMgmt.chHome.value;



		}



	}



	j--;



	document.frmBannerMgmt.ChkHome.value=temp;



	document.frmBannerMgmt.action="viewbanner.php?page="+pagenumb;



	document.frmBannerMgmt.submit();



	



}







function friend_mail(urlname)



{	



	window.open("friend.php?url_name="+urlname,'name','width='+545+',height='+300+',center, middle,resizable,autoSize=yes');



}

function chklinkValidationn(val){

	if(document.frmLinkMgmt.txttitle.value==""){
		alert("Title should not be blank");
		document.frmLinkMgmt.txttitle.focus();
		return false;
	}

	if(document.frmLinkMgmt.linkdiscription.value==""){
		alert("Description should not be blank");
		document.frmLinkMgmt.linkdiscription.focus();
		return false;
	}

	if(document.frmLinkMgmt.txturl.value==""){
		alert("Link url should not be blank");
		document.frmLinkMgmt.txturl.focus();
		return false;
	}
	if(document.frmLinkMgmt.category_id.value=="0")
	{
		alert("Please Select a category");
		document.frmLinkMgmt.category_id.focus();
		return false;
	}
	
	if(document.frmLinkMgmt.name.value==''){
		alert("Name should not be blank.");
		document.frmLinkMgmt.name.focus();
		return false;	
	}
	if(document.frmLinkMgmt.name.value!=''){
		if(document.frmLinkMgmt.name.value.search(/\b[A-Za-z\s]+\b$/)){
			alert("Number and special characters are not allowed.");
			document.frmLinkMgmt.name.focus();
			return false;		
		}	
	}
	if(document.frmLinkMgmt.email.value==''){
		alert("Email address should not be blank.");
		document.frmLinkMgmt.email.focus();
		return false;	
	}
	if(document.frmLinkMgmt.email.value!=''){
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.frmLinkMgmt.email.value)){
			}else{
				alert("Invalid Email Address!");
				document.frmLinkMgmt.email.focus();
				return false;
			}
	}
	if(document.frmLinkMgmt.raciprocal_url.value==''){
		alert("Raciprocal url should not be blank.");
		document.frmLinkMgmt.raciprocal_url.focus();
		return false;	
	}
	///document.frmLinkMgmt.action ="add_link.php";

	//document.frmLinkMgmt.submit();	
}


function CheckCoupon(){
	document.frmViewCart.coupcode.value=document.frmViewCart.coupcode.value.trim();
	var val=document.frmViewCart.coupcode.value;
	if(val==""){
			alert("Please enter coupon code");
			document.frmViewCart.coupcode.focus();
			return false;
	}
	document.frmViewCart.rfaction.value='getDiscount';
	document.frmViewCart.action ="cart.php";
	document.frmViewCart.submit();
}
function Check_Bill_Ship(chk){
	if(chk.ck_add.checked){
			chk.vAddress1.value= chk.vAddress.value;
			chk.iZipCode1.value= chk.iZipCode.value;
		  chk.vCity1.value= chk.vCity.value;
		  chk.vState1.value= chk.vState.value;
		  chk.vCountry1.value= chk.vCountry.value;
		}   
	 if(!chk.ck_add.checked){
		 	chk.vAddress1.value= '';
			chk.iZipCode1.value= '';
		  chk.vCity1.value= '';
		  chk.vState1.value= '';
		  chk.vCountry1.value= '';
		}   
}
function validateRegisterForm(obj){
	var len=obj.elements.length;
	for(var i=0;obj.elements[i];i++){
		obj.elements[i].value=obj.elements[i].value.trim();
		fldval=obj.elements[i].value;
		fldname=obj.elements[i].name;
		if(fldval==""){
			if(fldname=="vFirstName"){
				alert("Please enter your first name");
				obj.elements[i].focus();
				return false;
			}	
			if(fldname=="vLastName"){
				alert("Please enter your last name");
				obj.elements[i].focus();
				return false;
			}
			if(fldname=="iPhoneNo"){
				alert("Please enter your telephone number");
				obj.elements[i].focus();
				return false;
			}
			if(fldname=="vAddress"){
				alert("Please enter your shipping street address");
				obj.elements[i].focus();
				return false;
			}
			if(fldname=="iZipCode"){
				alert("Please enter your shipping zipcode");
				obj.elements[i].focus();
				return false;
			}
			if(fldname=="vCity"){
				alert("Please enter your shipping city");
				obj.elements[i].focus();
				return false;
			}
			if(fldname=="vState"){
				alert("Please enter your shipping state");
				obj.elements[i].focus();
				return false;
			}
			if(fldname=="vCountry"){
				alert("Please enter your shipping country");
				obj.elements[i].focus();
				return false;
			}
			if(fldname=="vAddress1"){
				alert("Please enter your billing street address");
				obj.elements[i].focus();
				return false;
			}
			if(fldname=="iZipCode1"){
				alert("Please enter your billing zipcode");
				obj.elements[i].focus();
				return false;
			}
			if(fldname=="vCity1"){
				alert("Please enter your billing city");
				obj.elements[i].focus();
				return false;
			}
			if(fldname=="vState1"){
				alert("Please enter your billing state");
				obj.elements[i].focus();
				return false;
			}
			if(fldname=="vCountry1"){
				alert("Please enter your billing country");
				obj.elements[i].focus();
				return false;
			}
			
		}
	}
}
function CheckAllMine(f1,f2){
	var len=f1.elements.length;
	var c=0;
	for(var i=0;i<len;i++){
		if(f1.elements[i].type=="checkbox" && document.getElementById(f2).checked==1){
			f1.elements[i].checked=1;
			var c=1;
		}else{
				f1.elements[i].checked=0;
			}
	}
	if(document.getElementById('change_box')){
		if(c==1){
			document.getElementById('change_box').value='UncheckAll';
		}else{
			document.getElementById('change_box').value='Check All';
		}
	}
}
function chkNewsletterValidation(fm2,f2){
	var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
	var f1=document.getElementById(""+fm2+"");
	count = f1.elements.length;
	var c=0;
	var arr_chk=Array();
	var j=0;
	for (i=0; i < count; i++){
		if(f1.elements[i].checked == 1  && i>0){
			c = 1;
			arr_chk[j]=f1.elements[i].value;
			j++;
		}
	}
	if(c == 0){
		alert('First, select the record');
		return false;
	}else{
		var chkval=arr_chk.join(",");
		if(document.getElementById("chk_user")){
			document.getElementById("chk_user").value=chkval;
		}
		var m=f2.elements.length;
		for(var i=0;i<m;i++){
			if(f2.elements[i].type=="text"){//Type Text
				if(f2.elements[i].value=='' && f2.elements[i].name=='mail_subject'){
					alert("Please Enter Subject");
					f2.elements[i].focus();
					return false;
				}
		
				if(f2.elements[i].value=='' && f2.elements[i].name=='email'){
					alert('Please enter Sender mail.');
					f2.elements[i].focus();
					return false;
				}
		
				if(f2.elements[i].value!='' && f2.elements[i].name=='email'){
					if(!re_mail.test(f2.elements[i].value)){
						alert('Please enter Sender mail correctly.');
						f2.elements[i].focus();
						return false;
					}
				}
			}
			if(f2.elements[i].type=="select-one"){//Type Text
				if(f2.elements[i].value=='' && f2.elements[i].name=='templ'){
					alert('Please select Template.');
					f2.elements[i].focus();
					return false;
				}
			}
			if(f2.elements[i].type=="textarea"){//Type Text
				if(f2.elements[i].value=='' && f2.elements[i].name=='message'){
					alert('Please enter Your Message.');
					f2.elements[i].focus();
					return false;
				}
			}
		}
	}
}

function chkEnqValidation(fm2,f2){
	var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
	var f1=document.getElementById(""+fm2+"");
	count = f1.elements.length;
	var c=0;
	var arr_chk=Array();
	var j=0;
	for (i=0; i < count; i++){
		if(f1.elements[i].checked == 1  && i>0){
			c = 1;
			arr_chk[j]=f1.elements[i].value;
			j++;
		}
	}
	if(c == 0){
		alert('First, select the record');
		return false;
	}else{
		if(document.nfrm1.mail_subject.value==""){
		alert("Please enter the subject");
		document.nfrm1.mail_subject.focus();
		return false;
		}
		if(document.nfrm1.news_message.value==""){
			alert("Please enter the message");
			document.nfrm1.news_message.focus();
			return false;
		}
		return true;
	}
}


function validateNewsletter(obj){
			var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
			var vldname=/^[ a-zA-Z]+$/;
			for(var i=0;obj.elements[i];i++){
				obj.elements[i].value=obj.elements[i].value.trim();
				fldval=obj.elements[i].value;
				fldname=obj.elements[i].name;
				if(obj.elements[i].type=="text"){
					if(fldval==""){
						if(fldname=="myname"){
							alert("Please enter your name");
							obj.elements[i].focus();
							return false;	
						}
						if(fldname=="mymail"){
							alert("Please enter your email");
							obj.elements[i].focus();
							return false;	
						}
					}else{
						if(fldname=="myname"){
							if(!vldname.test(fldval)){
								alert('Name must contain only albhabets and a space if it has subname');
								obj.elements[i].focus();
								return false;
							}	
						}
						if(fldname=="mymail"){
							if(!re_mail.test(fldval)){
								alert("Please enter a valid email-id");
								obj.elements[i].focus();
								return false;
							}	
						}
					}
				}
				if(obj.elements[i].type=="radio"){
					if(fldname=="sub_type"){
						if(!obj.sub_type[0].checked && !obj.sub_type[1].checked){
							alert("Do you want to subscribe or unsubscribe?");
							obj.elements[i].focus();
							return false;
						}
					}
				}
			}
		}


function checkall_san(objForm){
	len = objForm.elements.length;
	var i=0;
	for( i=0 ; i<len ; i++) {
		if (objForm.elements[i].type=='checkbox') {
			objForm.elements[i].checked=objForm.check_all.checked;
		}
	}
}

function validcheck(name,action,text){
	var chObj	=	document.getElementsByName(name);
	var result	=	false;	
	for(var i=0;i<chObj.length;i++){
	
		if(chObj[i].checked){
		  result=true;
		  break;
		}
	}

	if(!result){
		 alert("Please select atleast one "+text+" to "+action+".");
		 return false;
	}else if(action=='delete'){
			 if(!confirm("Are you sure you want to delete this.")){
			   return false;
			 }else{
				return true;
			 }
	}else{
		return true;
	}
}


function admin_banner_validate(val){
	var frm1;
	frm1=document.frmBanner;
	var mov1=/^(\+)?[0-9]*(\.)?[0-9]+$/; 
	if(frm1.mID.value!=""){
		if(frm1.banner_duration.selectedIndex== "0"){
				alert('Please select banner duration');
				frm1.banner_duration.focus();
				return false;
		}
		if(frm1.banner_cost.value == ''){
			alert('Please select banner cost');
			frm1.banner_cost.focus();
			return false;
		}
		if(frm1.banner_cost.value!= ''){
			if(!mov1.test(frm1.banner_cost.value)){
				alert("Not a valid number.try again.");
				frm1.banner_cost.focus();
				return false;
			}
		}
	}
	if(val=="Add"){
		if(frm1.photo_image.value == ""){
			alert('Please browse banner');
			frm1.photo_image.focus();
			return false;
		}
	}
	if(frm1.vBannerPOS.selectedIndex == 0){
		alert('Please select banner position');
		frm1.vBannerPOS.focus();
		return false;
	}
	if(document.getElementById('chkvalidate').value=='y'){
		if(frm1.cat_id.selectedIndex == 0){
			alert('Please select banner category');
			frm1.cat_id.focus();
			return false;
		}
	}
	frm1.action ="banner.php";
	frm1.submit();		
}


function checkBannerForm(){
	var mov1=/^(\+)?[0-9]*(\.)?[0-9]+$/; 
	
	if(document.advt.vCompanyname.value == ""){
		alert('Please enter company name');
		document.advt.vCompanyname.focus();
		return false;
	}	
	if(document.advt.vContactPerson.value == ""){
		alert('Please enter contact name');
		document.advt.vContactPerson.focus();
		return false;
	}
	if(document.advt.vContactPerson.value.search(/\b[A-Za-z\s]+\b$/)){
		alert('Number and special characters are not allowed');
		document.advt.vContactPerson.focus();
		return false;
	}
	if(document.advt.vPhoneNo.value == ""){
		alert('Please Enter your Phone No.');
		document.advt.vPhoneNo.focus();
		return false;
	}
	if(document.advt.vEmail.value == ""){
		alert('Please Enter your Email Address');
		document.advt.vEmail.focus();
		return false;
	}
	if(document.advt.vEmail.value.indexOf("@") == -1 || document.advt.vEmail.value.indexOf(".") == -1){
		alert("Please Enter Valid Email Address!!!");
		document.advt.vEmail.focus();
		return false;
	}
	
	if(document.advt.BannerImage.value == ""){
		alert('Please browse banner');
		document.advt.BannerImage.focus();
		return false;
	}
	if(document.advt.banner_duration.selectedIndex == 0){
		alert('Please select banner duration');
		document.advt.banner_duration.focus();
		return false;
	}
	if(document.advt.banner_cost.value == ''){
		alert('Please select banner cost');
		document.advt.banner_cost.focus();
		return false;
	}
	/*
	if(document.advt.page_name.value == ''){
		alert('Please select page name');
		document.advt.page_name.focus();
		return false;
	} */
	
	
	if(document.advt.banner_cost.value!= ''){
		if(!mov1.test(document.advt.banner_cost.value)){
			alert("Not a valid number.try again.");
			document.advt.banner_cost.focus();
			return false;
		}
	}
	if(document.advt.vBannerPOS.selectedIndex == 0){
		alert('Please select banner position');
		document.advt.vBannerPOS.focus();
		return false;
	}
	if(document.advt.cat_id.selectedIndex == 0){
		alert('Please select banner category');
		document.advt.cat_id.focus();
		return false;
	}
}

function translator(pattern) {
	var open_in_same_window = 1;
	var my_location = unescape(document.location.toString());
	var new_location ='';
	var new_pattern = '';
	if (my_location.indexOf('translate_c?') != -1) {
		/// From google...
		var indexof_u = my_location.indexOf('u=');
		if (indexof_u == -1) {
			new_location = document.location;
		}
		else {
			var subs = my_location.substring(indexof_u, my_location.length);
			var ss = subs.split('&');
			new_location = ss[0].substring(2, ss[0].length);
		}
	}
	else {
		new_location = document.location;
	}

	indexof_p = pattern.indexOf('|');

	var isen = '';
	if (indexof_p == -1) {
		indexof_p1 = pattern.indexOf('><');
		if (indexof_p1 == -1) {
			new_pattern = pattern;
			if (pattern == 'en') {
				isen = 1;
			}
		}
		else {
			var psplit =pattern.split('><');
			new_pattern = psplit[0]+'|'+psplit[1];
			if (psplit[1] == 'en') {
				isen = 1;
			}
		}
	}
	else {
		var psplit = pattern.split('|');
		new_pattern = psplit[0]+'|'+psplit[1];
		if (psplit[1] == 'en') {
			isen = 1;
		}
	}

	var thisurl = '';
	if (isen == 1) {
		thisurl = new_location;
	}
	else {
		thisurl = 'http://translate.google.com/translate_c?langpair=' + new_pattern + "&u=" + new_location;
	}

	if (open_in_same_window == 1) {
		window.location.href = thisurl;
	}
	else {
		if (CanAnimate ){
			msgWindow=window.open('' ,'subwindow','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0');
			msgWindow.focus();
			msgWindow.location.href = thisurl;
		}
		else {
			msgWindow=window.open(thisurl,'subwindow','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0');
		}
	}
}


function contact_frm(frm){
	
	if(frm.txtName.value==''){
		alert("Please enter your name.");
		frm.txtName.focus();
		return false;	
	}
	if(frm.txtName.value!=''){
		if(frm.txtName.value.search(/\b[A-Za-z\s]+\b$/)){
			alert("Number and special characters are not allowed.");
			frm.txtName.focus();
			return false;		
		}	
	}
	if(frm.txtLogin.value==''){
		alert("Please enter email address.");
		frm.txtLogin.focus();
		return false;	
	}
	if(frm.txtLogin.value!=''){
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frm.txtLogin.value)){
			}else{
				alert("Invalid Email Address!");
				frm.txtLogin.focus();
				return false;
			}
	}
	if(frm.txtComment.value==''){
		alert("Please enter your comments.");
		frm.txtComment.focus();
		return false;	
	}
}

function sendfrnd(frm){
	
	if(frm.name.value==''){
		alert("Please enter name.");
		frm.name.focus();
		return false;	
	}
	if(frm.fname.value!=''){
		if(frm.name.value.search(/\b[A-Za-z\s]+\b$/)){
			alert("Number and special characters are not allowed.");
			frm.name.focus();
			return false;		
		}	
	}
	
	
	if(frm.email.value==''){
		alert("Please enter email address.");
		frm.email.focus();
		return false;	
	}
	if(frm.email.value!=''){
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frm.email.value)){
			}else{
				alert("Invalid Email Address!");
				frm.email.focus();
				return false;
			}
	}
	if(frm.fname.value==''){
		alert("Please enter friend name.");
		frm.fname.focus();
		return false;	
	}
	if(frm.fname.value!=''){
		if(frm.fname.value.search(/\b[A-Za-z\s]+\b$/)){
			alert("Number and special characters are not allowed.");
			frm.fname.focus();
			return false;		
		}	
	}
	if(frm.femail.value==''){
		alert("Please enter friend email address.");
		frm.femail.focus();
		return false;	
	}
	if(frm.femail.value!=''){
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frm.femail.value)){
			}else{
				alert("Invalid Email Address!");
				frm.femail.focus();
				return false;
			}
	}
	
}

function review_add(frm){
	if(frm.txtName.value=='Name'){
		alert("Please enter you name.");
		frm.txtName.focus();
		return false;	
	}
	if(frm.txtName.value!=''){
		if(frm.txtName.value.search(/\b[A-Za-z\s]+\b$/)){
			alert("Number and special characters are not allowed.");
			frm.txtName.focus();
			return false;		
		}	
	}
	if(frm.txtEmailID.value=='Your Email'){
		alert("Please enter email id.");
		frm.txtEmailID.focus();
		return false;	
	}
	if(frm.txtEmailID.value!=''){
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frm.txtEmailID.value)){
			}else{
				alert("Invalid Email Id!");
				frm.txtEmailID.focus();
				return false;
			}
	}
	if(frm.txtReview.value==''){
		alert("Please enter you review.");
		frm.txtReview.focus();
		return false;	
	}
	
	
}



function deleteReview(FrmPara){
	var ans = confirm("Product Review will Deleted.\n Would you like to Delete Review?");
	if(ans==true){
		document.frmCategoryMgmt.hidFrmVal.value = "Delete";
		document.frmCategoryMgmt.action = FrmPara;
		document.frmCategoryMgmt.submit();
	}
	else{
		document.frmCategoryMgmt.action = FrmPara;
	}
}

function deleteComment(FrmPara){
	var ans = confirm("Comment will Deleted.\n Would you like to Delete comment?");
	if(ans==true){
		document.frmCategoryMgmt.hidFrmVal.value = "Delete";
		document.frmCategoryMgmt.action = FrmPara;
		document.frmCategoryMgmt.submit();
	}
	else{
		document.frmCategoryMgmt.action = FrmPara;
	}
}

function validateQuestionForm(){
var txtName = document.getElementById('txtName').value;
var txtEmailID = document.getElementById('txtEmailID').value;
var txtQuestion = document.getElementById('txtQuestion').value;
	if(txtName ==''){
		alert('Please enter your name.');
		document.getElementById('txtName').focus();
		return false;
	}
	/*if(txtEmailID ==''){
	alert('Please enter your email address.');
	document.getElementById('txtEmailID').focus();
	return false;
	}*/
	if(txtQuestion ==''){document.getElementById('txtQuestion').focus();
		alert('Please enter Your Message.');return false;
	}
	//var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	//if (filter.test(txtEmailID)){return true}
	//else{ alert('Please enter your valid email address.');document.getElementById('txtEmailID').focus();return false;	}
}



function validateDiscountForm()
{
	
	if(document.coupen.name.value==''){
		alert("Please enter name");
		document.coupen.name.focus();
		return false;
	} 
	if(!isNaN(document.coupen.name.value)){
		alert("Please enter alphabetic value in  name.")
		document.coupen.name.focus()
		return false;
	}
	
	 if(document.coupen.email.value==''){
		alert("Please enter email");
		document.coupen.email.focus();
		return false;
	}	
	var email = document.coupen.email.value;
	if(!email.match(/^[A-Za-z0-9\._\-+]+@[A-Za-z0-9_\-+]+(\.[A-Za-z0-9_\-+]+)+$/)){
		alert("This is not a valid email id! Please fill a valid Email ID.");
		document.coupen.email.focus();
		return false;
	}
	
	if(document.coupen.phone.value==''){
		alert("Please enter phone");
		document.coupen.phone.focus();
		return false;
	}	
	
	if(document.coupen.product_name.value==''){
		alert("Please enter product name");
		document.coupen.product_name.focus();
		return false;
	}	
	
}




function validatetestimonial(){
	
if(frm.txtName.value==''){
		alert("Please enter you name.");
		frm.txtName.focus();
		return false;	
	}
	if(frm.txtName.value!=''){
		if(frm.txtName.value.search(/\b[A-Za-z\s]+\b$/)){
			alert("Number and special characters are not allowed.");
			frm.txtName.focus();
			return false;		
		}	
	}

	if(frm.txtEmailID.value==''){
		alert("Please enter email id.");
		frm.txtEmailID.focus();
		return false;	
	}
	if(frm.txtEmailID.value!=''){
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frm.txtEmailID.value)){
			}else{
				alert("Invalid Email Id!");
				frm.txtEmailID.focus();
				return false;
			}
	}
		if(frm.txtTitle.value==''){
		alert("Please enter you title.");
		frm.txtTitle.focus();
		return false;	
	}
	if(frm.txtReview.value==''){
		alert("Please enter you comment.");
		frm.txtReview.focus();
		return false;	
	}
}


function validateFAq(){

	if(frm.txtfaq.value==''){
		alert("Please enter you question.");
		frm.txtfaq.focus();
		return false;	
	}
	if(frm.txtans.value==''){
		alert("Please enter you answer.");
		frm.txtans.focus();
		return false;	
	}
}

function successstory_add(frm){
   if(frm.txtFirstName.value==''){
      alert("Please enter first name"); 
      frm.txtFirstName.focus();
      return false;
   }
   
   if(frm.txtLastName.value==''){
      alert("Please enter last name"); 
      frm.txtLastName.focus();
      return false;
   }
   
  if(frm.txtLocation.value==''){
    alert("Please enter location"); 
    frm.txtLocation.focus();
    return false;
 }
   if(frm.txtareaDetail.value==''){
    alert("Please enter details"); 
    frm.txtareaDetail.focus();
    return false;
 }

}
