function isEmailId(tmp_str)
{
  // Name      : isEmailId.
  // Purpose   : allow user to enter value in email id format(xxx@kk.com).
  // Inputs    : tmp_str -> string for validation.
  // Outputs   : return 1 -> if form field is as email id format.
  //		 return -1 -> if form field is not as email id format.


//ignore validation if tmp_str is blank.

if(tmp_str != "")
 {
    // searching whole string word by word

      if (tmp_str.search)
       {
         //checking the words in string.
         //  if given string is not in email id format(xxx@zzz.com), return -1.
         //  else return 1.

           if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(tmp_str)))
	    {
	      return -1;
            }
       }
 }
 return 1;
}

function isPhoneNo(tmp_str)
{
  // Name      : isPhoneNo
  // Purpose   : allow user to enter value in phone numbers with only "-" and "." .
  // Inputs    : tmp_str -> string for validation.
  // Outputs   : return 1 -> if form field is as phone no format.
  //		 return -1 -> if form field is not as phone no format.

 Chars = "0123456789+-.";
 flag=0;

      for (i = 0; i < tmp_str.length; i++)
      {
          // Check that current character is number.
          var c = tmp_str.charAt(i);

          if (Chars.indexOf(c) == -1)
          	flag = 1;
      }
      if(flag)
      {
	  return true;
      }
      
return false;      
}

      function submitFrm(isRedirect,sForm, planId, plan_name, price, planCode, period) {
        sForm.plan_id.value = planId;
        sForm.plan_name.value = plan_name;
        sForm.price.value = price;
        sForm.plan_code.value = planCode;
        sForm.plan_period.value = period;
        sForm.customize.value = isRedirect;
        
        sForm.submit();
      }

