// Displaying message for Post Addvertisement form

	function check_category()
	{
		var category;
		category = (frmAdd.cmbCategory.value)

		if ((category == 0)||(category == "SC"))
		{
			alert ("Select a category...");
			document.frmAdd.cmbCategory.focus();
		}
		else
		{
		  if(category=="Online Registration")
		  {
		    var address;
		    address=(document.frmAdd.txtAddress.value)
		    if(address==0)
		    {
		      alert ("Plese enter your address.");
			  document.frmAdd.txtAddress.select();
			  document.frmAdd.txtAddress.focus();
		    }
		  }
		}
	}


	function check_name()
	{
		var name;
		name = (frmAdd.txtName.value)
		
		if (name == 0)
		{
			alert ("We need your name.");
			document.frmAdd.txtName.select();
			document.frmAdd.txtName.focus();
		}
	}

	function check_email()
	{
		var email;
		email= (frmAdd.txtEmail.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi));

		var good;
	
		if (email==0)
		{
			alert ("Email address can not be empty...");
			document.frmAdd.txtEmail.value='';
			document.frmAdd.txtEmail.select();
			document.frmAdd.txtEmail.focus();

		}
		else if (email)
		{	
			good = true;
			
		}
				else
		{
			alert('Please enter a valid e-mail address.');
			good = false;
			document.frmAdd.txtEmail.value='';
			document.frmAdd.txtEmail.select();
			document.frmAdd.txtEmail.focus();
		}
	}
	
	function check_company(field)
	{
		var company;
		company = (document.frmAdd.txtCompany.value)
		
		if (company == 0)
		{
			alert ("We need your company name.");
			document.frmAdd.txtCompany.select();
			document.frmAdd.txtCompany.focus();
		}
	}	
	
	function check_designation(field)
	{
		var designation;
		designation = (document.frmAdd.txtDesignation.value)
		
		if (designation == 0)
		{
			alert ("We need your designation.");
			document.frmAdd.txtDesignation.select();
			document.frmAdd.txtDesignation.focus();
		}
	}	
	

	
	function check_description()
	{
		var description;
		description = (frmAdd.txtDescription.value)

		if (description == 0)
		{
			alert ("Please type your message...!");
			document.frmAdd.txtDescription.select();
			document.frmAdd.txtDescription.focus();
		}
	}
	
	function extra_field()
	{
	    var category;
		category = (frmAdd.cmbCategory.value)

		if (category == "Online Registration")
		{
			my_div.innerHTML=my_div.innerHTML+"<table border='0' width='100%' id='table1' cellspacing='0' cellpadding='2' >"+
			                                    "<tr>"+
                                                  "<td width='38%'>"+
	                                              "<font color='#990000' size='1' face='Verdana, Arial, Helvetica, sans-serif'>"+
	                                                "Company (Required)</font></td>"+
                                                  "<td>"+
	                                                "<input type='text' name='txtCompany' size='30' tabindex='6' ></td>"+
                                                "</tr>"+
			                                    "<tr>"+
                                                  "<td>"+
	                                              "<font color='#990000' size='1' face='Verdana, Arial, Helvetica, sans-serif'>"+
	                                                "Designation (Required)</font></td>"+
                                                  "<td>"+
	                                                "<input type='text' name='txtDesignation' size='30' tabindex='7' onFocus=\"check_company()\"></td>"+
                                                "</tr>"+
			                                    "<tr>"+
                                                  "<td>"+
	                                              "<font color='#990000' size='1' face='Verdana, Arial, Helvetica, sans-serif'>"+
	                                                "Address (Required)</font></td>"+
                                                  "<td>"+
	                                                "<input type='text' name='txtAddress' size='30' tabindex='8' onFocus=\"check_designation()\"></td>"+
                                                "</tr>"+																								
											 "</table>"
          	document.frmAdd.txtCompany.select();
			document.frmAdd.txtCompany.focus(); 
		}
		else
		{
		   my_div.innerHTML="";
		}
		
	}
	  
	function reset_field()
	{
	  my_div.innerHTML="";
	}
	

// -->