

	function validateJoinmailingListForm(frm)	{

		if (frm.fullName.value.length < 1) {
			alert("The  value of full name field is empty.  \rPlease type in a valid  full name value.");
			giveFocus(frm.fullName);
			return false;
		}



		if (frm.email.value.length < 1) {
			alert("The value of email is empty.  \rPlease type in a valid  email value.");
			giveFocus(frm.email);
			return false;
		}
		
		

		if (frm.email.value.length!=0 && ((frm.email.value.indexOf("@")==-1||frm.email.value.indexOf(".")==-1) || (frm.email.value.indexOf("@.")!=-1))) {
			alert("The value of email field is invalid. \rPlease type in a valid email value.");
			giveFocus(frm.email);
			return false;
		}

		if (frm.companyName.value.length < 1) {
			alert("The  value of company name field is empty.  \rPlease type in a valid  company name value.");
			giveFocus(frm.companyName);
			return false;
		}

		if (frm.designation.value.length < 1) {
			alert("The  value of designation field is empty.  \rPlease type in a valid  designation value.");
			giveFocus(frm.designation);
			return false;
		}

		confirmSubmit(frm,"Confirm submission now?");
		
		return true;
	}

	
	function validateUnsubscribeForm(frm)	{

		if (frm.fullName.value.length < 1) {
			alert("The  value of full name field is empty.  \rPlease type in a valid  full name value.");
			giveFocus(frm.fullName);
			return false;
		}

		if (frm.email.value.length < 1) {
			alert("The value of email is empty.  \rPlease type in a valid  email value.");
			giveFocus(frm.email);
			return false;
		}

		if (frm.email.value.length!=0 && ((frm.email.value.indexOf("@")==-1||frm.email.value.indexOf(".")==-1) || (frm.email.value.indexOf("@.")!=-1))) {
			alert("The value of email field is invalid. \rPlease type in a valid email value.");
			giveFocus(frm.email);
			return false;
		}

		confirmSubmit(frm,"Are you sure to unsubscribe from our mailing list?");
		
		return true;
	}


	function validatePollForm(frm,act)	{
		frm.action.value=act;
		frm.submit();

	}

	function validateEventRegForm(frm)	{

		if (frm.fullName.value.length < 1) {
			alert("The value of full name field is empty.  \rPlease type in a valid  full name value.");
			giveFocus(frm.fullName);
			return false;
		}

		if (frm.designation.value.length < 1) {
			alert("The value of designation field is empty.  \rPlease type in a valid  designation value.");
			giveFocus(frm.designation);
			return false;
		}

		if (frm.companyName.value.length < 1) {
			alert("The value of company name field is empty.  \rPlease type in a valid  company name value.");
			giveFocus(frm.companyName);
			return false;
		}

		if (frm.companyAddress.value.length < 1) {
			alert("The value of company address field is empty.  \rPlease type in a valid  company address value.");
			giveFocus(frm.companyAddress);
			return false;
		}

		if (frm.companyAddress.value.length < 1) {
			alert("The value of company address field is empty.  \rPlease type in a valid  company address value.");
			giveFocus(frm.companyAddress);
			return false;
		}

		if (frm.email.value.length < 1) {
			alert("The value of email is empty.  \rPlease type in a valid  email value.");
			giveFocus(frm.email);
			return false;
		}

		if (frm.email.value.length!=0 && ((frm.email.value.indexOf("@")==-1||frm.email.value.indexOf(".")==-1) || (frm.email.value.indexOf("@.")!=-1))) {
			alert("The value of email field is invalid. \rPlease type in a valid email value.");
			giveFocus(frm.email);
			return false;
		}

		confirmSubmit(frm,"Confirm submission now?");
		
		return true;
	}

	

	


	function confirmSubmit(frm, cfmText) {
		
		if(confirm(cfmText))
			frm.submit();
	}

	function getElementInFormByName(frm,eleName) {

		var numberElements = frm.length;
	    for (var i = 0; i < numberElements; i++) {
	          ele = frm.elements[i];
	          if(ele.name==eleName) {
	          	return ele;
	          }
          }
          
          return null;
	}


	function giveFocus(obj) {
	  obj.focus();
	  obj.select();
	}
	
