function validateContactForm(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.txtName.value)=="")
		{
			alert("Please Enter Name.");
			thisForm.txtName.focus();
			return false;
		}
		if(trim(thisForm.txtName.value)!="")
		{
			if(!checkCompanyName(trim(thisForm.txtName.value)))
			{
				return false;
			}
		}

		if(trim(thisForm.txtAddress.value)=="")
		{
			alert("Please Enter Address.");
			thisForm.txtAddress.focus();
			return false;
		}
		
		if(trim(thisForm.txtCode.value)=="")
		{
			alert("Please Enter Code.");
			thisForm.txtCode.focus();
			return false;
		}

		if(trim(thisForm.txtCode.value)!="")
		{
			if(!checkNumeric(trim(thisForm.txtCode.value)))
			{
				alert("Invalid Code.");
				thisForm.txtCode.focus();
				return false;
			}
		}

		if(thisForm.ddlCountry.value=="0")
		{
			alert("Please Select Country.");
			thisForm.ddlCountry.focus();
			return false;
		}

		if(trim(thisForm.txtPhone.value)=="")
		{
			alert("Please Enter Phone Number.");
			thisForm.txtPhone.focus();
			return false;
		}

		if(trim(thisForm.txtPhone.value)!="")
		{
			if(!checkNumeric(trim(thisForm.txtPhone.value)))
			{
				alert("Invalid Phone Number.");
				thisForm.txtPhone.focus();
				return false;
			}
		}
		
		if(trim(thisForm.txtEmail.value)=="")
		{
			alert("Please Enter Email-Id.");
			thisForm.txtEmail.focus();
			return false;
		}

		if(trim(thisForm.txtEmail.value)!="")
		{
			if(!emailValidation(trim(thisForm.txtEmail.value)))
			{
				thisForm.txtEmail.focus();
				return false;
			}
		}

		if(trim(thisForm.txtSubject.value)=="")
		{
			alert("Please Enter Subject.");
			thisForm.txtSubject.focus();
			return false;
		}
	}
}

function AdvertiseForm(thisForm)
{
	with(thisForm)
	{
		if((trim(thisForm.bannerCode.value)=="")&&(trim(thisForm.imageFile.value)==""))
		{
			alert("Please Enter Banner Code/Banner Image.");
			thisForm.bannerCode.focus();
			return false;
		}
		if(trim(thisForm.imageFile.value)!="")
		{
			if(trim(thisForm.adUrl.value)=="")
			{
				alert("Please Enter Url.");
				thisForm.adUrl.focus();
				return false;
			}
		}
	}
}

function alertBankSuccsess()
{
	alert("Bank Successfully Submitted.");
}

function alertBankFail()
{
	alert("Bank Information Already Submitted");
}
function bankInfoValidate(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.bankName.value)=="")
		{
			alert("Please Enter Bank Name.");
			thisForm.bankName.focus();
			return false;
		}
		if(trim(thisForm.officerName.value)=="")
		{
			alert("Please Enter Officer Name.");
			thisForm.officerName.focus();
			return false;
		}
		else
		{
			if(!checkCompanyName(trim(thisForm.officerName.value)))
			{
				alert("Invalid Officer Name.");
				thisForm.officerName.focus();
				return false;
			}
		}
		if(trim(thisForm.branch.value)=="")
		{
			alert("Please Enter Branch Name.");
			thisForm.branch.focus();
			return false;
		}
		if(trim(thisForm.state.value)=="")
		{
			alert("Please Enter State.");
			thisForm.state.focus();
			return false;
		}
		if(trim(thisForm.country.value)=="0")
		{
			alert("Please Select Country.");
			thisForm.country.focus();
			return false;
		}
		if(trim(thisForm.phone.value)=="")
		{
			alert("Please Enter Phone Number.");
			thisForm.phone.focus();
			return false;
		}
		else
		{
			if(!checkNumeric(trim(thisForm.phone.value)))
			{
				alert("Invalid Phone Number.");
				thisForm.phone.focus();
				return false;
			}
		}
		if(trim(thisForm.fax.value)!="")
		{
			if(!checkNumeric(trim(thisForm.fax.value)))
			{
				alert("Invalid Fax Number.");
				thisForm.fax.focus();
				return false;
			}
		}
	}
}
function validateTrust(thisForm)
{
	with(thisForm)
	{
		if((thisForm.authentication.checked==false)&&(thisForm.bank.checked==true))
		{
			alert("This member must be authenticated and verified first");
			return false;
		}
	}
}

function successAddContactMessage()
{
	alert("Offer Added Successfully Into Basket.");
}
function failAddContactMessage()
{
	alert("You Are Not Subscribed For This Category.");
}
function basketOfferForm(thisForm)
{	
	total=document.getElementById("totalBasketOffer").value;
	with(thisForm)
	{
		flag=false;
		for(i=1;i<=total;i++)
		{
			obj=document.getElementById("offerCheck"+i);
			if(obj.checked)
			{
				flag=true;
			}
		}
		if(!flag)
		{
			alert("Please Select Offer");
			return false;
		}
		if(trim(thisForm.details.value)=="")
		{
			alert("Please Enter Details.");
			thisForm.details.focus();
			return false;
		}
	}
}

function validateTradeEventForm(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.eventName.value)=="")
		{
			alert("Please Enter Event Name.");
			thisForm.eventName.focus();
			return false;
		}
		if(thisForm.fromDate.value=="")
		{
			alert("Please Enter Start Date.");
			thisForm.fromDate.focus();
			return false;
		}
		else
	   {
   	       var textdate1 = thisForm.fromDate.value;
           var myArray1= textdate1.split('-');
           var input1= myArray1[0] + ' ' + myArray1[1] + ' ' + myArray1[2];
	       var output1= Date.parse(input1);
	       var mydate1 = new Date(output1) ;
	       var mydate=new Date();
       }

		if(thisForm.endDate.value=="")
		{
			alert("Please Enter End Date.");
			thisForm.endDate.focus();
			return false;
		}
		else
	   {
   	        var textdate2 = thisForm.endDate.value;
            var myArray2= textdate2.split('-');
            var input2= myArray2[0] + ' ' + myArray2[1] + ' ' + myArray2[2];
	        var output2= Date.parse(input2);
	        var mydate2 = new Date(output2) ;
	    }

		if(mydate1<mydate)
	     {
	         alert("invalid date");
			 thisForm.fromDate.focus();
			return false;
	      }

	    if(mydate1>mydate2)
	      {
	         alert("From date is after End date.");
			 thisForm.fromDate.focus();
			return false;
	      }
        
		if(trim(thisForm.venue.value)=="")
		{
			alert("Please Enter Venue.");
			thisForm.venue.focus();
			return false;
		}
		if(trim(thisForm.city.value)=="")
		{
			alert("Please Enter City.");
			thisForm.city.focus();
			return false;
		}
		if(trim(thisForm.state.value)=="")
		{
			alert("Please Enter State.");
			thisForm.state.focus();
			return false;
		}
		if(trim(thisForm.zip.value)=="")
		{
			alert("Please Enter Zip Code.");
			thisForm.zip.focus();
			return false;
		}
		else if(!checkNumeric(thisForm.zip.value))
		{
			alert("Invalid Zip.");
			thisForm.zip.focus();
			return false;
		}
		if(thisForm.category.value.length==0)
		{
			alert("Please select category.");
			thisForm.category.focus();
			return false;
		}
		if(trim(thisForm.floorSize.value)=="")
		{
			alert("Please Enter Floor Size.");
			thisForm.floorSize.focus();
			return false;
		}
		if(trim(thisForm.exhibitors.value)=="")
		{
			alert("Please Enter Number Of Exhibitor.");
			thisForm.exhibitors.focus();
			return false;
		}
		if(trim(thisForm.attendees.value)=="")
		{
			alert("Please Enter Number Of Attendees.");
			thisForm.attendees.focus();
			return false;
		}
		if(trim(thisForm.eventTel.value)=="")
		{
			alert("Please Enter Phone Number.");
			thisForm.eventTel.focus();
			return false;
		}
		else
		{
			if(!checkNumeric(trim(thisForm.eventTel.value)))
			{
				alert("Invalid Phone Number.");
				thisForm.eventTel.focus();
				return false;
			}
		}
		
	}
}


function validateeditTradeEventForm(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.eventName.value)=="")
		{
			alert("Please Enter Event Name.");
			thisForm.eventName.focus();
			return false;
		}
		if(thisForm.fromDate.value=="")
		{
			alert("Please Enter Start Date.");
			thisForm.fromDate.focus();
			return false;
		}
		else
	   {
   	       var textdate1 = thisForm.fromDate.value;
           var myArray1= textdate1.split('-');
           var input1= myArray1[0] + ' ' + myArray1[1] + ' ' + myArray1[2];
	       var output1= Date.parse(input1);
	       var mydate1 = new Date(output1) ;
	       var mydate=new Date();
       }

		if(thisForm.endDate.value=="")
		{
			alert("Please Enter End Date.");
			thisForm.endDate.focus();
			return false;
		}
		else
	   {
   	        var textdate2 = thisForm.endDate.value;
            var myArray2= textdate2.split('-');
            var input2= myArray2[0] + ' ' + myArray2[1] + ' ' + myArray2[2];
	        var output2= Date.parse(input2);
	        var mydate2 = new Date(output2) ;
	    }

		if(mydate1<mydate)
	     {
	         alert("invalid date");
			 thisForm.fromDate.focus();
			return false;
	      }

	    if(mydate1>mydate2)
	      {
	         alert("From date is after End date.");
			 thisForm.fromDate.focus();
			return false;
	      }
        
		if(trim(thisForm.venue.value)=="")
		{
			alert("Please Enter Venue.");
			thisForm.venue.focus();
			return false;
		}
		if(trim(thisForm.city.value)=="")
		{
			alert("Please Enter City.");
			thisForm.city.focus();
			return false;
		}
		if(trim(thisForm.state.value)=="")
		{
			alert("Please Enter State.");
			thisForm.state.focus();
			return false;
		}
		if(trim(thisForm.zip.value)=="")
		{
			alert("Please Enter Zip Code.");
			thisForm.zip.focus();
			return false;
		}
		else 
		{
			if(!checkNumeric(thisForm.zip.value))
			{
				alert("Invalid Zip.");
				thisForm.zip.focus();
				return false;
			}
		}
		if(trim(thisForm.organiser.value)=="")
		{
			alert("Please Enter Organiser.");
			thisForm.organiser.focus();
			return false;
		}
		if(trim(thisForm.floorsize.value)=="")
		{
			alert("Please Enter Floor Size.");
			thisForm.floorsize.focus();
			return false;
		}
		if(trim(thisForm.exhibitort.value)=="")
		{
			alert("Please Enter Number Of Exhibitor.");
			thisForm.exhibitort.focus();
			return false;
		}
		if(trim(thisForm.attendeet.value)=="")
		{
			alert("Please Enter Number Of Attendees.");
			thisForm.attendeet.focus();
			return false;
		}
		if(trim(thisForm.eventTel.value)=="")
		{
			alert("Please Enter Phone Number.");
			thisForm.eventTel.focus();
			return false;
		}
		else
		{
			if(!checkNumeric(trim(thisForm.eventTel.value)))
			{
				alert("Invalid Phone Number.");
				thisForm.eventTel.focus();
				return false;
			}
		}
		if(thisForm.category.value.length==0)
		{
			alert("Please select Industry.");
			thisForm.category.focus();
			return false;
		}
		
	}
}




function searcFormValidation(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.keyword.value)=="")
		{
			alert("Please Enter Keyword For Search.");
			thisForm.keyword.focus();
			return false;
		}
	}
}
function validateRequestForm(thisForm)
{
	
	with(thisForm)
	{
		if(thisForm.deliveryDate.value=="")
		{
			alert("Please Select Date.");
			thisForm.deliveryDate.focus();
			return false;
		}
		if(thisForm.quantity.value=="")
		{
			alert("Please Select Quantity.");
			thisForm.quantity.focus();
			return false;
		}
		if(thisForm.paymentMethod.value=="0")
		{
			alert("Please Select Payment Method.");
			thisForm.paymentMethod.focus();
			return false;
		}
		if(thisForm.country.value=="0")
		{
			alert("Please Select Country.");
			thisForm.country.focus();
			return false;
		}
		if(thisForm.shippingTerms.value=="0")
		{
			alert("Please Select Shipping Terms.");
			thisForm.shippingTerms.focus();
			return false;
		}
	}
}

function validateGroupForm(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.groupName.value)=="")
		{
			alert("Please Enter Group Name.");
			thisForm.groupName.focus();
			return false;
		}
	}
}
function broadcastMailFormValidation(thisForm)
{
	with(thisForm)
	{
		if(thisForm.toId.value=="0")
		{
			alert("Please Select Group.");
			thisForm.toId.focus();
			return false;
		}
	}
}
function validateDeleteListForm(thisForm)
{
	with(thisForm)
	{
		total=document.getElementById("totalList").value;
		var flag=false;
		for(i=1;i<=total;i++)
		{
			if(document.getElementById("listId"+i).checked)
			{
				flag=true;
			}
		}
		if(!flag)
		{
			alert("Please Select Company.");
			return false;
		}
	}
}

function validateLoginForm(thisForm)
{
	with(thisForm)
	{
		if(!emailValidation(thisForm.email.value))
		{
			thisForm.email.focus();
			return false;
		}
		if(thisForm.password.value=="")
		{
			alert("Please Enter Password");
			thisForm.password.focus();
			return false;
		}
	}
}
function emailSubscriptionFormValidation(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.Email.value)=="")
		{
			alert("Please Enter Email-Id");
			thisForm.Email.focus();
			return false;
		}
		else 
		{
			if(echeck(trim(thisForm.Email.value),'Email-Id'))
			{
				return true;
			}
			else
			{
				return false;
			}
		}
	}
}
function validateDeleteUserNewsletterForm(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.email.value)=="")
		{
			alert("Please Enter Email-Id");
			thisForm.email.focus();
			return false;
		}
		else
		{
			if(echeck(trim(thisForm.email.value),"Email-Id"))
			{
				return true;
			}
			else
			{
				return false;
			}
		}
	}
}
function sendInviteFormValidation(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.email.value)=="")
		{
			alert("Please Enter value for To Field.");
			thisForm.email.focus();
			return false;
		}
	}
}
function validateRegisterForm(thisForm)
{
	with(thisForm)
	{
		if(!emailValidation(thisForm.email.value))
		{
			thisForm.email.focus();
			return false;
		}
		if(thisForm.password.value == "")
		{
			alert("Please Enter Password.");
			thisForm.password.focus();
			return false;
		}
		if(thisForm.Repassword.value=="")
		{
			alert("Please Enter Password Again.");
			thisForm.Repassword.focus();
			return false;
		}
		else if(thisForm.password.value != thisForm.Repassword.value)
		{
			alert("Retype Password Doesn't Match.");
			thisForm.Repassword.focus();
			return false;
		}
		if(trim(thisForm.name.value)=="")
		{
			alert("Please Enter Name.");
			thisForm.name.focus();
			return false;
		}
		else if(!checkAlpha(trim(thisForm.name.value)))
		{
			alert("Invalid Name.");
			thisForm.name.focus();
			return false;
		}
		if(trim(thisForm.companyName.value)=="")
		{
			alert("Please Enter Company Name.");
			thisForm.companyName.focus();
			return false;
		}
		else if(!checkCompanyName(trim(thisForm.companyName.value)))
		{
			alert("Invalid Company Name.");
			thisForm.companyName.focus();
			return false;
		}
		if ((trim(thisForm.alternateEmail.value) != ""))
		{
				if(!echeck(trim(thisForm.alternateEmail.value),'Alternate Email'))
					{
						//alert("Invalid Alternate Email.");
						thisForm.alternateEmail.focus();
						return false;
					}
		}

		if((trim(thisForm.PhoneCountry.value)=="")||(trim(thisForm.PhoneArea.value)=="")||(trim(thisForm.PhoneNumber.value)==""))
		{
			alert("Please Enter Phone Number.");
			thisForm.PhoneCountry.focus();
			return false;
		}
		else if((!checkNumeric(trim(thisForm.PhoneCountry.value)))||(!checkNumeric(trim(thisForm.PhoneArea.value)))||(!checkNumeric(trim(thisForm.PhoneNumber.value))))
		{
			alert("Invalid Phone Number.");
			thisForm.PhoneCountry.focus();
			return false;
		}
		if((trim(thisForm.FaxCountry.value)!="")||(trim(thisForm.FaxArea.value)!="")||(trim(thisForm.FaxNumber.value)!=""))
		{
			if((!checkNumeric(trim(thisForm.FaxCountry.value)))||(!checkNumeric(trim(thisForm.FaxArea.value)))||(!checkNumeric(trim(thisForm.FaxNumber.value))))
			{
				alert("Invalid Fax Number.");
				thisForm.FaxCountry.focus();
				return false;
			}
		}
		if (trim(thisForm.mobileNo.value) != "")
		{
			if (!checkNumeric(trim(thisForm.mobileNo.value)))
			{
				alert("Invalid Mobile No.");
				thisForm.mobileNo.focus();
				return false;
			}
		}
		if(trim(thisForm.street.value)=="")
		{
			alert("Please Enter Street.");
			thisForm.street.focus();
			return false;
		}
		if(trim(thisForm.city.value)=="")
		{
			alert("Please Enter City.");
			thisForm.city.focus();
			return false;
		}
		if(trim(thisForm.state.value)=="")
		{
			alert("Please Enter State.");
			thisForm.state.focus();
			return false;
		}
		if(trim(thisForm.code.value)=="")
		{
			alert("Please Enter Zip/Postal Code.");
			thisForm.code.focus();
			return false;
		}
		else if(!checkNumeric(trim(thisForm.code.value)))
		{
			alert("Invalid Zip/Postal Code.");
			thisForm.code.focus();
			return false;
		}
		if(thisForm.country.value=="0")
		{
			alert("Please Select Country.");
			thisForm.country.focus();
			return false;
		}
		if(trim(thisForm.products.value)=="")
		{
			alert("Please Enters Products Offer.");
			thisForm.products.focus();
			return false;
		}
		if(!thisForm.acceptLicense.checked)
		{
			alert("Please Accept Terms And Conditions.");
			thisForm.acceptLicense.focus();
			return false;
		}		
	}
}

function validateForgotPasswordForm(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.email.value)=="")
		{
			alert("Please Enter Email-Id");
			thisForm.email.focus();
			return false;
		}
		else if(!echeck(trim(thisForm.email.value),"Email-Id"))
		{
			thisForm.email.focus();
			return false;
		}
	}
}

function validatePostOfferForm(thisForm)
{
	with(thisForm)
	{
		
		if(thisForm.parentCategory.value=="-1")
		{
			alert("Please Select Category");
			thisForm.parentCategory.focus();
			return false;
		}
		/*if(thisForm.subCategories.value.length==0)
		{
			alert("Please Select Sub-Category");
			thisForm.subCategories.focus();
			return false;
		}*/
		if(trim(thisForm.subject.value)=="")
		{
			alert("Please Enter Subject");
			thisForm.subject.focus();
			return false;
		}
		if(thisForm.usertype.value.length==0)
		{
			alert("Please Select Offer Type");
			thisForm.usertype.focus();
			return false;
		}
		if(trim(thisForm.details.value)=="")
		{
			alert("Please Enter Details");
			thisForm.details.focus();
			return false;
		}
	}
}

function validateUpdateForm(thisForm)
{
	with(thisForm)
	{
		if(!emailValidation(thisForm.email.value))
		{
			thisForm.email.focus();
			return false;
		}
		if(thisForm.password.value == "")
		{
			alert("Please Enter Password.");
			thisForm.password.focus();
			return false;
		}
		if(thisForm.Repassword.value=="")
		{
			alert("Please Enter Password Again.");
			thisForm.Repassword.focus();
			return false;
		}
		else if(thisForm.password.value != thisForm.Repassword.value)
		{
			alert("Retype Password Doesn't Match.");
			thisForm.Repassword.focus();
			return false;
		}
		if(trim(thisForm.name.value)=="")
		{
			alert("Please Enter Name.");
			thisForm.name.focus();
			return false;
		}
		else if(!checkAlpha(trim(thisForm.name.value)))
		{
			alert("Invalid Name.");
			thisForm.name.focus();
			return false;
		}
		if(trim(thisForm.companyName.value)=="")
		{
			alert("Please Enter Company Name.");
			thisForm.companyName.focus();
			return false;
		}
		else if(!checkCompanyName(trim(thisForm.companyName.value)))
		{
			alert("Invalid Company Name.");
			thisForm.companyName.focus();
			return false;
		}
		if ((trim(thisForm.alternateEmail.value) != ""))
		{
				if(!echeck(trim(thisForm.alternateEmail.value),'Alternate Email'))
					{
						//alert("Invalid Alternate Email.");
						thisForm.alternateEmail.focus();
						return false;
					}
		}

		if((trim(thisForm.PhoneCountry.value)=="")||(trim(thisForm.PhoneArea.value)=="")||(trim(thisForm.PhoneNumber.value)==""))
		{
			alert("Please Enter Phone Number.");
			thisForm.PhoneCountry.focus();
			return false;
		}
		else if((!checkNumeric(trim(thisForm.PhoneCountry.value)))||(!checkNumeric(trim(thisForm.PhoneArea.value)))||(!checkNumeric(trim(thisForm.PhoneNumber.value))))
		{
			alert("Invalid Phone Number.");
			thisForm.PhoneCountry.focus();
			return false;
		}
		if((trim(thisForm.FaxCountry.value)!="")||(trim(thisForm.FaxArea.value)!="")||(trim(thisForm.FaxNumber.value)!=""))
		{
			if((!checkNumeric(trim(thisForm.FaxCountry.value)))||(!checkNumeric(trim(thisForm.FaxArea.value)))||(!checkNumeric(trim(thisForm.FaxNumber.value))))
			{
				alert("Invalid Fax Number.");
				thisForm.FaxCountry.focus();
				return false;
			}
		}
		if (trim(thisForm.mobileNo.value) != "")
		{
			if (!checkNumeric(trim(thisForm.mobileNo.value)))
			{
				alert("Invalid Mobile No.");
				thisForm.mobileNo.focus();
				return false;
			}
		}
		if(trim(thisForm.street.value)=="")
		{
			alert("Please Enter Street.");
			thisForm.street.focus();
			return false;
		}
		if(trim(thisForm.city.value)=="")
		{
			alert("Please Enter City.");
			thisForm.city.focus();
			return false;
		}
		if(trim(thisForm.state.value)=="")
		{
			alert("Please Enter State.");
			thisForm.state.focus();
			return false;
		}
		if(trim(thisForm.code.value)=="")
		{
			alert("Please Enter Zip/Postal Code.");
			thisForm.code.focus();
			return false;
		}
		else if(!checkNumeric(trim(thisForm.code.value)))
		{
			alert("Invalid Zip/Postal Code.");
			thisForm.code.focus();
			return false;
		}
		if(thisForm.country.value=="0")
		{
			alert("Please Select Country.");
			thisForm.country.focus();
			return false;
		}
		if(trim(thisForm.products.value)=="")
		{
			alert("Please Enters Products Offer.");
			thisForm.products.focus();
			return false;
		}
		
	}
}

function validatePostForumForm(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.subject.value)=="")
		{
			alert("Please Enter Subject.");
			thisForm.subject.focus();
			return false;
		}
		if(trim(thisForm.name.value)=="")
		{
			alert("Please Enter Name.");
			thisForm.name.focus();
			return false;
		}
		else if(!checkAlpha(trim(thisForm.name.value)))
		{
			alert("Invalid Name.");
			thisForm.name.focus();
			return false;
		}
		if(trim(thisForm.email.value)=="")
		{
			alert("Please Enter Email.");
			thisForm.email.focus();
			return false;
		}
		else if(!echeck(trim(thisForm.email.value),"Email"))
		{
			thisForm.email.focus();
			return false;
		}
		
	}
}
function validatePostForumReplyForm(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.name.value)=="")
		{
			alert("Please Enter Name.");
			thisForm.name.focus();
			return false;
		}
		else if(!checkAlpha(trim(thisForm.name.value)))
		{
			alert("Invalid Name.");
			thisForm.name.focus();
			return false;
		}
		if(trim(thisForm.email.value)=="")
		{
			alert("Please Enter Email.");
			thisForm.email.focus();
			return false;
		}
		else if(!echeck(trim(thisForm.email.value),"Email"))
		{
			alert("Invalid Email.");
			thisForm.email.focus();
			return false;
		}
		
	}
}

function validateFileDisputeForm(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.mid.value)=="")
		{
			alert("Please Enter The Opposite Party's Id.");
			thisForm.mid.focus();
			return false;
		}

		else if(checkNumeric(trim(thisForm.mid.value))!=1 && checkAlpha(trim(thisForm.mid.value))!=1)
        {
            alert("Please Enter A Valid Party's Id.");
			thisForm.mid.focus();
			return false;
		}

		if(trim(thisForm.tid.value)=="")
		{
			alert("Please Enter The Transaction Id.");
			thisForm.tid.focus();
			return false;
		}
		else if(checkNumeric(trim(thisForm.tid.value))!=1 && checkAlpha(trim(thisForm.tid.value))!=1)
        {
            alert("Please Enter A Valid Transaction Id.");
			thisForm.tid.focus();
			return false;
		}
		if(trim(thisForm.details.value)=="")
		{
			alert("Please Enter Details");
			thisForm.details.focus();
			return false;
		}
		return true;
	}
}

function validatePostRfqForm(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.productName.value)=="")
		{
			alert("Please Enter Product Title.");
			thisForm.productName.focus();
			return false;
		}
		if(thisForm.parentCategory.value=="0")
		{
			alert("Please Select Broad Category.");
			thisForm.parentCategory.focus();
			return false;
		}
		/*if(thisForm.subCategory.value=="0")
		{
			alert("Please Select Sub Category.");
			thisForm.subCategory.focus();
			return false;
		}*/
		if(trim(thisForm.quantity.value)=="")
		{
			alert("Please Enter Quantity.");
			thisForm.quantity.focus();
			return false;
		}
		else if(!checkNumeric(trim(thisForm.quantity.value)))
		{
			alert("Invalid Quantity.");
			thisForm.quantity.focus();
			return false;
		}
		if(thisForm.unit.value=="0")
		{
			alert("Please Select Unit.");
			thisForm.unit.focus();
			return false;
		}
		if(trim(thisForm.price.value)=="")
		{
			alert("Please Enter Price.");
			thisForm.price.focus();
			return false;
		}
		if(!checkFloat(trim(thisForm.price.value)))
		{
			alert("Invalid Price.");
			thisForm.price.focus();
			return false;
		}
		if(thisForm.paymentMethod.value=="0")
		{
			alert("Please Select Payment Method.");
			thisForm.paymentMethod.focus();
			return false;
		}
		if(thisForm.country.value=="0")
		{
			alert("Please Select Delivery Location.");
			thisForm.country.focus();
			return false;
		}
		if(thisForm.delivery_time.value=="0")
		{
			alert("Please Select Delivery Time.");
			thisForm.delivery_time.focus();
			return false;
		}
		if(thisForm.shippingTerms.value=="0")
		{
			alert("Please Select Shipping Terms.");
			thisForm.shippingTerms.focus();
			return false;
		}
	}
}

function start_tran2(thisForm)
{
	with(thisForm)
	{
       if(trim(thisForm.item1.value)=="")
		{
			alert("Please Enter the Item name.");
			thisForm.item1.focus();
			return false;
		}

      if(trim(thisForm.Qty1.value)=="")
		{
			alert("Please Enter Quantity.");
			thisForm.Qty1.focus();
			return false;
		}
		else if(checkNumeric(trim(thisForm.Qty1.value))==0)
		{
			alert("Invalid Quantity.");
			thisForm.Qty1.focus();
			return false;
		}

		 if(trim(thisForm.amount1.value)=="")
		{
			alert("Please Enter the Amount.");
			thisForm.amount1.focus();
			return false;
		}
		else if(checkNumeric(trim(thisForm.amount1.value))==0)
		{
			alert("Invalid Amount.");
			thisForm.amount1.focus();
			return false;
		}
	}
}
function validateSendQuotationForm(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.quantity.value)=="")
		{
			alert("Please Enter Quantity.");
			thisForm.quantity.focus();
			return false;
		}
		else if(!checkNumeric(trim(thisForm.quantity.value)))
		{
			alert("Invalid Quantity.");
			thisForm.quantity.focus();
			return false;
		}
		if(thisForm.unit.value=="0")
		{
			alert("Please Select Unit.");
			thisForm.unit.focus();
			return false;
		}
		if(trim(thisForm.price.value)=="")
		{
			alert("Please Enter Price.");
			thisForm.price.focus();
			return false;
		}
		if(!checkFloat(trim(thisForm.price.value)))
		{
			alert("Invalid Price.");
			thisForm.price.focus();
			return false;
		}
		if(thisForm.paymentMethod.value=="0")
		{
			alert("Please Select Payment Method.");
			thisForm.paymentMethod.focus();
			return false;
		}
		if(thisForm.country.value=="0")
		{
			alert("Please Select Delivery Location.");
			thisForm.country.focus();
			return false;
		}
		if(thisForm.delivery_time.value=="0")
		{
			alert("Please Select Delivery Time.");
			thisForm.delivery_time.focus();
			return false;
		}
		if(thisForm.shippingTerms.value=="0")
		{
			alert("Please Select Shipping Terms.");
			thisForm.shippingTerms.focus();
			return false;
		}
		if(thisForm.expiry_time.value=="0")
		{
			alert("Please Select Expiry Date.");
			thisForm.delivery_time.focus();
			return false;
		}
	}
}

function validateTestimonialForm(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.title.value)=="")
		{
			alert("Please Enter Title.");
			thisForm.title.focus();
			return false;
		}
		
		if(trim(thisForm.fname.value)=="")
		{
			alert("Please Enter Your Name.");
			thisForm.fname.focus();
			return false;
		}
		if(trim(thisForm.email.value)=="")
		{
			alert("Please Enter Email.");
			thisForm.email.focus();
			return false;
		}
		else if(!echeck(trim(thisForm.email.value),"Email"))
		{
			//alert("Invalid Email.");
			thisForm.email.focus();
			return false;
		}
		if(trim(thisForm.message.value)=="")
		{
			alert("Please Enter Message.");
			thisForm.message.focus();
			return false;
		}
		if(trim(thisForm.userfile.value)=="")
		{
			alert("Please Select File.");
			thisForm.userfile.focus();
			return false;
		}
	}
}

function validateTransactionForm(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.title.value)=="")
		{
			alert("Please Enter Title.");
			thisForm.title.focus();
			return false;
		}
		
		
	if(thisForm.Id.value=="")
	  {
			alert("Please Enter Email.");
			thisForm.Id.focus();
			return false;
		}
	
	 if(!echeck(trim(thisForm.Id.value),"Email Id"))
		{
		   thisForm.Id.focus();
	       return false;
	    }
			

	if(trim(thisForm.role[thisForm.role.selectedIndex].text)=="Select")
		{
			alert("Please Select Your Role.");
			thisForm.role.focus();
			return false;
		}
	if(trim(thisForm.pay_method[thisForm.pay_method.selectedIndex].value)=="")
		{
			alert("Please Select Payment Method.");
			thisForm.pay_method.focus();
			return false;
		}
		
	if(trim(thisForm.ship_payer[thisForm.ship_payer.selectedIndex].value)=="")
		{
			alert("Please Select The Person Who will pay The Shipping Fees.");
			thisForm.ship_payer.focus();
			return false;
		}
	if(trim(thisForm.address.value)=="")
		{
			alert("Please Enter Address.");
			thisForm.address.focus();
			return false;
		}
	if(trim(thisForm.country[thisForm.country.selectedIndex].value)=="")
		{
			alert("Please Select Country.");
			thisForm.ship_payer.focus();
			return false;
		}
	if(trim(thisForm.inspection_period[thisForm.inspection_period.selectedIndex].value)=="")
		{
			alert("Please Select Inspection Period.");
			thisForm.inspection_period.focus();
			return false;
		}
	}
}

function radio_button_checker(radiovalue)
{
alert(radiovalue)
	var radio_choice = false;

	for (counter = 0; counter < radiovalue.length; counter++)
	{
	if (radiovalue[counter].checked)
	radio_choice = true; 
	}

	if (!radio_choice)
	{
	alert("Please select Shipping Mode.")
	return (false);
	}
return (true);
}

function validatePostProductForm(thisForm)
{
	with(thisForm)
	{
		if(trim(thisForm.productName.value)=="")
		{
			alert("Please Enter Product Name.");
			thisForm.productName.focus();
			return false;
		}
		if(thisForm.category.value=="0")
		{
			alert("Please Select Product Category.");
			thisForm.category.focus();
			return false;
		}
		if(trim(thisForm.price.value)=="")
		{
			alert("Please Enter Price.");
			thisForm.price.focus();
			return false;
		}
		else if(!checkFloat(trim(thisForm.price.value)))
		{
			alert("Invalid Price.");
			thisForm.price.focus();
			return false;
		}
		if(trim(thisForm.quantity.value)=="")
		{
			alert("Please Enter Quantity.");
			thisForm.quantity.focus();
			return false;
		}
		else if(!checkNumeric(trim(thisForm.quantity.value)))
		{
			alert("Invalid Quantity.");
			thisForm.quantity.focus();
			return false;
		}
		if(thisForm.unit_price.value=="0")
		{
			alert("Please Select Unit.");
			thisForm.unit_price.focus();
			return false;
		}
		if(trim(thisForm.Min_quantity.value)=="")
		{
			alert("Please Enter Minimum Quantity.");
			thisForm.Min_quantity.focus();
			return false;
		}
		else if(!checkNumeric(trim(thisForm.Min_quantity.value)))
		{
			alert("Invalid Minimum Quantity.");
			thisForm.Min_quantity.focus();
			return false;
		}
		if(thisForm.paymentMethod.value=="0")
		{
			alert("Please Select Payment Method.");
			thisForm.paymentMethod.focus();
			return false;
		}
		if(thisForm.stock_location.value=="0")
		{
			alert("Please Select Stock Location.");
			thisForm.stock_location.focus();
			return false;
		}
		if(thisForm.delivery_time.value=="0")
		{
			alert("Please Select Delivery Time.");
			thisForm.delivery_time.focus();
			return false;
		}
		if(thisForm.shiping_terms.value=="0")
		{
			alert("Please Select Shipping Terms.");
			thisForm.shiping_terms.focus();
			return false;
		}
		if(thisForm.expiry_time.value=="0")
		{
			alert("Please Select Expiry Date.");
			thisForm.expiry_time.focus();
			return false;
		}
	}
}
function creditCardInfo(thisForm)
{
  with(thisForm)
	{
	   if(trim(thisForm.holdname.value)=="")
		{
			alert("Please Enter the Card-Holder's Name.");
			thisForm.holdname.focus();
			return false;
		}
  
      if(trim(thisForm.bankname.value)=="")
		{
			alert("Please Enter Bank Name.");
			thisForm.bankname.focus();
			return false;
		}

	if(trim(thisForm.creditcard.value)=="")
		{
			alert("Please Enter Credit Card Number.");
			thisForm.creditcard.focus();
			return false;
		}
     else if(thisForm.creditcard.value.length<16)
		{
		   alert("Please Enter Valid Credit Card Number.");
		   thisForm.creditcard.focus();
		   return false;
	    }
   else if (((thisForm.creditcard.value / thisForm.creditcard.value) != 1) && (thisForm.creditcard.value != 0)) 
	   {
	   alert(' This text box accepts only digits');
       thisForm.creditcard.focus();
	   return false;
	   }

	if(trim(thisForm.billingaddress.value)=="")
		{
			alert("Please Enter Billling Address.");
			thisForm.billingaddress.focus();
			return false;
		}

	if(trim(thisForm.expDate.value)=="")
		{
			alert("Please Enter Expiry Date.");
			thisForm.expDate.focus();
			return false;
		}

     }
}

function regAdmin(thisForm)
{
	with(thisForm)
	{
	  if(trim(thisForm.name.value)=="")
		{
			alert("Please Enter Your Name.");
			thisForm.name.focus();
			return false;
		}
	  if(trim(thisForm.email.value)=="")
		{
			alert("Please Enter Your Email-Id.");
			thisForm.email.focus();
			return false;
		}
		 if(!echeck(trim(thisForm.email.value),"Email Id"))
		{
		   thisForm.email.focus();
	       return false;
	     }
      if(trim(thisForm.username.value)=="")
		{
			alert("Please Enter Your User Name.");
			thisForm.username.focus();
			return false;
		}
     if(trim(thisForm.password.value)=="")
		{
			alert("Please Enter a Password for Your User Name.");
			thisForm.password.focus();
			return false;
		}
	}
}
function alertImageMessage()
{

	alert("Image Uploaded");
	
}
function alertAddGroup()
{
	alert("Contact Added Successfully.");
}
function alertMessage()
{
	alert("Category Edited Successfully.");
}
function checkNumeric(value)
{
	if(!value.match(/^[0-9]+/))
	{
		return false;
	}
	return true;
}
function checkFloat(value)
{
	if(!value.match(/([0-9]+[.][0-9][0-9])|[0-9]+$/))
	{
		return false;
	}
	return true;
}
function checkAlpha(charfield)
{
	if (!charfield.match(/^[a-zA-Z\s]+$/))
	{
		return false;
	}
	return true;
}

function checkCompanyName(value)
{
	if(!value.match(/^[a-zA-Z&\(\)\s.-]+$/))
	{
		return false;
	}
	return true;	
}
function emailValidation(value)
{
	if(trim(value)=="")
	{
		alert("Please Enter Email-Id.");
		return false;
	}
	else
	{
		if (echeck(trim(value),'Email Id')==false)
		{
			return false;
		}
		else
		{
			return true;
		}
	}
}
function echeck(str,name) 
{
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   alert("Invalid "+name)
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Invalid "+name)
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert("Invalid "+name)
		return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		alert("Invalid "+name)
		return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert("Invalid "+name)
		return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		alert("Invalid "+name)
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		alert("Invalid "+name)
		return false
	 }

	 return true					
}
function LTrim( value ) 
{
	
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
	
}

// Removes ending whitespaces
function RTrim( value ) 
{
	
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
	
}

// Removes leading and ending whitespaces
function trim( value ) 
{
	
	return LTrim(RTrim(value));
	
}


//function use to visible or invisible the Div 
function divVisibility(divName)
{
	divObj=document.getElementById(divName);
	if(divObj.style.visibility=="visible")
	{
		divObj.style.visibility = 'hidden';
		divObj.style.display = 'none';
		imgObj=document.getElementById("img"+divName);
		imgObj.src="images/plus.gif";
	}
	else
	{
		imgObj=document.getElementById("img"+divName);
		divObj.style.visibility="visible";
		divObj.style.display="block";
		imgObj.src="images/minus.gif";
	}
}
