// JavaScript Document
  /*Feedback Validate */

function validate_feedback(thisform)
 {
	 //alert("form");
	with (thisform)
  {
	if(validate_email(feed_email,"Enter Valid Email!")==false)
    {//alert("ok3");
	feed_email.focus();return false;}
	
	else if(validate_zip(feed_bname,"Enter Company Name!")==false)
    {//alert("ok3");
	feed_bname.focus();return false;}
	
	 else if(validate_zip(feed_name,"Enter Your Name")==false)
    {feed_name.focus();return false;}
	
	else if(validate_zip(feed_phone,"Enter Your Phone Number")==false)
    {feed_phone.focus();return false;}
	
	else if(validate_zip(feed_mobile,"Enter Your Mobile Number")==false)
    {feed_mobile.focus();return false;}
	
	else if(validate_zip(feed_fax,"Enter Your Fax Number")==false)
    {feed_fax.focus();return false;}
	
	
	else if(validate_zip(feed_message,"Enter Message")==false)
    {feed_message.focus();return false;}

  }
 
 }
 
function validate_zip(field,alerttxt)
{
with (field)
  {
  if (value==null||value=="")
    {alert(alerttxt);return false;}
  else
    {return true;}
  }
}

function validate_email(field,alerttxt)
{
with (field)
  {
  apos=value.indexOf("@");
  dotpos=value.lastIndexOf(".");
  if (apos<1||dotpos-apos<2)
    {alert(alerttxt);return false;}
  else  {return true;}
  }
}

function remove_profile() {
	var r=confirm("Really u want remove the profile");
	if (r==true)
	  {
	  //alert("You pressed OK!");
	  window.location.href = "php/removeprofileconfirm.php";
	  }
	else
	  {
	  //alert("You pressed Cancel!");
	  window.location.href = "index.php?id=180";
	  }
	
}
