function IsAlpha(val) 
{
	if (val.value.length != 0)
    {
		if (val.value.length >= 3)
    	{ 
			   for (i = 0; i < val.value.length; i++)
			   {
				   var ch = val.value.charAt(i);
				   if ((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z") || (ch == " ") || (ch == ".") || (ch == "&")|| (ch == "/")|| (ch == "|")|| (ch == "\\")|| (ch == ",")) 
				  // if ((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z") || (ch == " ") || (ch == "&")) 
				   {
					  continue;
					} 
				   else
				   {
					val.value='';
					alert("Please enter only character value.");
	   			    //document.getElementById('message').innerHTML="<span class='border' style='width:320px; height:20px'>Please enter only character value.</span><br>";
					val.focus();
					return false;
				   }
			   }
		}
		else
		{
			val.value='';
			alert("Please enter atleast 3 characters.");
	   	  //  document.getElementById('message').innerHTML="<span class='border' style='width:300px; height:20px'>Please enter atleast 3 characters.</span><br>";
			val.focus();
			return false;
		}
    }
   document.getElementById('message').innerHTML="";
   return true;
}
function IsNum(val)
 {
   if (val.value.length != 0) 
    {
      for (i = 0; i < val.value.length; i++) 
	      {
              var ch = val.value.charAt(i);
              if ((ch >= "0" && ch <= "9") || (ch == ".") || (ch == "-")) 
		      {
                continue;
              } 
		      else
		      { 
		      val.value='';
              alert("Please enter numeric values.");
			  //document.getElementById('message').innerHTML="<span class='border' style='width:300px; height:20px'>Please enter numeric values.</span><br>";
			  val.focus();
              return false;
             }
         }
		 document.getElementById('message').innerHTML="";
   }
}
function tc(oform,fld)
{
  oform[fld].value = toTitleCase(oform[fld].value )
}
function toTitleCase(str)
{
    return str.replace(/\w+/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}
//===================function for mot leaving mandatory fields empty===========================
//..................used for mandatory fields validation.................................

 var PLSCAP = "Please ";
 var FULLSTOP = ".";
 var ENTER = "Enter ";

//***************************************************************************************
  
function IsNotEmpty(FormName, FieldNameArr, FieldCaptionArr, FieldActionArr)
{
	var Message = '';
	var FocusField = '';
	var Error = 0;
	var TotalFields = eval(FieldNameArr.length);
	//..........check for all mandatory fields....................
	for(var Counter = 0; Counter < TotalFields; Counter++)
	{
		if(document.getElementById(FieldNameArr[Counter]).value == '' || document.getElementById(FieldNameArr[Counter]).value == 0 || document.getElementById(FieldNameArr[Counter]).value =='null')
		{  
			Message+= PLSCAP + FieldActionArr[Counter] + " "+ FieldCaptionArr[Counter] + FULLSTOP + "\n";
			Error = 1;
			if(FocusField == '') 
			  {  
			   FocusField = document.getElementById(FieldNameArr[Counter]); 
			  }
	   }
  }
	if(Error == 1)
	{  
	   alert(Message);
		 //document.getElementById('message').innerHTML="<span>"+ Message + "</span><br><br>";
		FocusField.focus();
		return false;
	}
	 else
	 { 
	   return true;
	  
	 }
}
function CheckEmailId(val) {
// Check for a properly formatted email address
  if ((val.value.length == 0)) {
      return false;
   }
   if (val.value.length != 0) {
      var emailformat = /^[^@\s]+@([-a-z0-9]+\.)+([a-z]{2}|com|net|edu|org|gov|mil|int|biz|pro|info|arpa|aero|coop|name|museum|nic|in|co.in|co|inc)$/;
      if (!emailformat.test(val.value))
	   {
	     alert("Please enter valid email.");
		 //document.getElementById('message').innerHTML="<span  class='border' style='width:200px; height:20px'>Please enter valid email.</span><br><br>";
		 val.value="";
		 val.focus();
		 return false;
      }
   }
   document.getElementById('message').innerHTML='';
   return true;
}
function ImposeMaxLength(Object, MaxLen)
 {
    if(Object.value.length >= MaxLen)
	{
		alert("Maximum "+MaxLen+" characters are allowed.");
		//Object.value = Object.value.substring(0, MaxLen-1);
		return false;
	}
	return true;
 }

function showdiv(state,othertext)
{
		if(state.value=='Other')
				document.getElementById(othertext).style.display = 'inline';
		else
				document.getElementById(othertext).style.display = 'none';
}
function showmsg(val)
{
		var str="<table class='normtxt' style='bordercolor:black; border-style:groove; border-width:2px'><tr><td>";
		if(val=='divemail')
			str+=" A valid email address is required in order to receive all important communication.This email id is also used for login into your Pelagian softwares account."
		if(val=='divpassword')
			str+=" Your password must be of atleast 6 characters."	
		if(val=='divrepassword')
			str+=" Password and re-type password must be exactly same."		
		str+= '</td></tr></table>';	
		document.getElementById(val).innerHTML= str;	
			
}
function hidemsg(val)
{
			document.getElementById(val).innerHTML="&nbsp;"
}
function maxlength(val)
{
	if (val.value.length != 0 )
    {	
		if (val.value.length <= 5)
    	{
				 val.value="";
   			    document.getElementById('message').innerHTML="<span class='border' style='width:300px; height:20px'>Please enter atleast 6 characters in password field.</span><br>";
				//alert(document.getElementById('message').innerHTML);
				val.focus();
				return false;
		}
		document.getElementById('message').innerHTML="";
		return true;
	}
}
function minlength(val,num)
{
	alert(val.value.length);
		if(val.value.length <= num)
		{
				alert('Please enter at least '+num+ 'characters');
				val.focus();
				return false;
		}
		return true;
}
function checkduplicatepassword()
{
	    pass1 = document.getElementById('regpassword').value;
	    pass2 = document.getElementById('repassword');
		if(pass2.value != '')
		{
			if(pass1 != pass2.value)
			{
					pass2.value='';
					document.getElementById('message').innerHTML="<span class='border' style='width:300px; height:20px'>Password and re-type password are different.</span><br><br>";
					pass2.focus();
					return false;
			}
		}
		document.getElementById('message').innerHTML="";
		return true;
}
function showroster(e)
{
	var born = new Date();
	currentkey=born.getSeconds();
	lastkey=document.getElementById('lastkeytime').value;
	city=document.getElementById('city').value;
	state=document.getElementById('state').value;
	if(window.event) // IE
		keynum = e.keyCode
	else if(e.which) // Netscape/Firefox/Opera
		keynum = e.which
	if(keynum==38)rotateUp(document.getElementById('resultwords'),document.getElementById('city'));
	else if(keynum==40)rotateDown(document.getElementById('resultwords'),document.getElementById('city'));
	else if(keynum==13)submitform();
	else
	{
		keychar = String.fromCharCode(keynum);
		if(keynum==8)
		{
			city=city+'';
		}	
		else
		{
			city=city+keychar;
		}	
		if(currentkey!=lastkey)
		{
			xajax_showcity(city,state);
			document.getElementById('lastkeytime').value=currentkey;
		}
	}
}
function rotateUp(result,text)
{
	resultlength=result.length;
	var index=result.selectedIndex;
	if(index <= 0 )index=resultlength-1;
	else index--;
	result.selectedIndex=index;
	text.value=result.value;
}
function rotateDown(result,text)
{
	resultlength=result.length;
	var index=result.selectedIndex;
	if(index < 0 || index >= resultlength-1)index=0;
	else index++;
	result.selectedIndex=index;
	text.value=result.value;
}
function submitform()
{
	document.forms[0].submit();
}
function settextsubmitform()
{	
		var  e = window.event;
        document.getElementById('city').value=document.getElementById('resultwords').value;
		if(e.button=='0')
		{
				document.getElementById('divcity').innerHTML="&nbsp;";
		}
}	
function invisiblediv(val)
{
		 document.getElementById('city').value=document.getElementById('resultwords').value;
		  alert(val);
		// alert(document.getElementById('resultwords').value);
		document.getElementById('divcity').innerHTML="";
}
function DateComparision(Date1,Date2,Formname,Fields,Caption,Action,curdate)
{
		if(IsNotEmpty(Formname,Fields,Caption,Action))
		 {
			D1=new Date(Date1.value);
			D2=new Date(Date2.value);
			toDate=new Date(curdate);
			var val1=DaysDiff(D1,toDate);
			var val2=DaysDiff(D2,toDate);
			var val=DaysDiff(D2,D1);
			if(val1<0)
			{
				alert('Job start publish date must be greater than or equal to ' +curdate+'.');	
				return false;
			}
			else if(val2<1)
			{
				alert('Job end publish date must be greater than '+curdate+'.');	
				return false;
			}
			else if(val<1)
			{
				alert('Job end publish date must be at least one day greater than start publish');	
				return false;
			}
			else
			{
				return true;
			}	
 		}
		return false;
}
function DaysDiff(D1, D2) 
{
		  return Math.round((D1-D2)/864e5) 
}
function isDate(val) 
{
	var IsValid = 0;
	 if (val.value.length != 0) 
     {
        var longform =  /^[0-1][0-9]\/[0-9]{2}\/[1-9][0-9]{3}$/;
        if(longform.test(val.value))
		  {
		  		var DateArr = val.value.split("/");
				if(DateArr[1]> 31 || DateArr[0] >12)
					IsValid = 0;
				else
					IsValid = 1;
          }
		  if(IsValid == 0)
		  {
			
			  val.value='';
			  alert("Please enter date in mm/dd/yyyy format");
			 val.focus();
			 return false;
		  }
   }
   
   return true;
}
function AddDipElements(Obj,currDipCnt,maxDipCnt,field)
{
 document.getElementById(field+currDipCnt.value).style.display = "";
  document.getElementById(field+currDipCnt.value).focus();
  currDipCnt.value++;
  if ( currDipCnt.value >= maxDipCnt.value )
                Obj.style.display = "none";
  return false;
}
function visiblediv(field,hidefield)
{
		document.getElementById(field).style.display = "inline";
		document.getElementById(hidefield).style.display = "none";
}
function PrePage()
{
	document.getElementById('pageNumber').value = eval(document.getElementById('pageNumber').value) - 1  ;
	document.frmlist.submit();
}
function NextPage()
{	
   document.getElementById('pageNumber').value = eval(document.getElementById('pageNumber').value) + 1;
   document.frmlist.submit();
}
function setvalue(val)
{
	document.getElementById('pageNumber').value= val;
	document.frmlist.submit();
}
function OrderPage(OrderBy)
{
	document.frmlist.pageNumber.value = eval(document.frmlist.pageNumber.value);
	if(document.frmlist.orderby.value.search(OrderBy)<0)
		document.frmlist.orderby.value = OrderBy;
	else
	{
		if(document.frmlist.orderby.value.search(' desc')<0)
			document.frmlist.orderby.value = OrderBy +' desc';
		else
			document.frmlist.orderby.value = OrderBy;
	}
	document.frmlist.submit();
}
function changeproduct(totalproduct,postedby,$sign)
{
	if($sign=='1')
	{
		document.getElementById('startproduct').value=eval(document.getElementById('startproduct').value)+1;
		document.getElementById('endproduct').value=eval(document.getElementById('endproduct').value)+1;
	}
	else
	{
		document.getElementById('startproduct').value=eval(document.getElementById('startproduct').value)-1;
		document.getElementById('endproduct').value=eval(document.getElementById('endproduct').value)-1;
	}
	
	xajax_showproduct(document.getElementById('startproduct').value,document.getElementById('endproduct').value,totalproduct,postedby);
}
function compare(val1,val2)
{
		value1=eval(val1.value);
		value2=eval(val2.value);
		if(value1>value2)
		{
				val2.value='';
				alert("please select valid range");
				return false;
		}
}
function visible(field)
{
		document.getElementById(field).style.display = "inline";
}
function hide(hidefield)
{
		document.getElementById(hidefield).style.display = "none";
}
function CheckSelected(total,chk)
{
	if(total=='1')
	{
			if(chk.checked==true)
				return true;
	}
	else
	{
		for (i=0;i<chk.length;i++)
		{
			if(chk[i].checked==true)
				return true;
		}
	}
	alert("No Records Selected");
	return false;
}
function publishcomment(val,hiddenvar,type)
{
		document.getElementById(hiddenvar).value=val;
		return confirm("Are you sure you want to "+ type +" this comment? Click yes to "+ type +" and click no for cancel. ");
}
function Checkall(frmvalue,val)
{
			for(var nfi = 0; nfi < frmvalue.getElementsByTagName('input').length; nfi++) 
			{
				if(frmvalue.getElementsByTagName('input')[nfi].type=='checkbox')
				{
					frmvalue.getElementsByTagName('input')[nfi].checked=val;
				}
			}
		
}
function showstyp(param,state)
{
	if(param=='City')
	{
		document.getElementById('selectcat').style.display="none";
		document.getElementById('selectall').style.display="none";
		document.getElementById('noselectct').style.display="none";
		document.getElementById('noselectcat').style.display="inline";
		document.getElementById('noselectall').style.display="inline";
		document.getElementById('selectct').style.display="inline";
	}
	else
	{
		document.getElementById('selectcat').style.display="inline";
		document.getElementById('noselectall').style.display="inline";
		document.getElementById('noselectct').style.display="inline";
		document.getElementById('noselectcat').style.display="none";
		document.getElementById('selectall').style.display="none";
		document.getElementById('selectct').style.display="none";
	}
	document.getElementById('criteria').innerHTML = param + ' wise ';
	document.getElementById('yp').innerHTML = '<img src="../img/loading.gif" alt="loading">';
	xajax_showyp(param,state);

}
function setimg(var1)
{
		document.getElementById(var1).value=1;
		document.frmlist.submit();
}
/*function setsearch(var1,selected)
{
		if(var1=='yellowpages')
			document.getElementById('sc').innerHTML='<select name="subcriteria" id="subcriteria"><option value="Anywhere">Anywhere</option><option value="yp.name">Firm Name</option><option value="yp.contact">Contact Person</option><option value="yp.state">State</option><option value="ctg.CTGR_NAME">Category</option><option value="c.CITY_NAME">City</option><option value="yp.products">Products</option></select>';
		else if(var1=='product')
			document.getElementById('sc').innerHTML='<select name="subcriteria" id="subcriteria"><option value="Anywhere">Anywhere</option><option value="p.ProductName">Product Name</option><option value="ctg.CTGR_NAME">Category</option><option value="yp.name">Posted by</option><option value="p.keyword">keyword</option></select>';
		else if(var1=='classified' || var1=='tradeleads')	
			document.getElementById('sc').innerHTML='<select name="subcriteria" id="subcriteria"><option value="Anywhere">Anywhere</option><option value="Name">Name</option><option value="FirmName">Firm Name</option><option value="state">State</option><option value="City">City</option><option value="Category">Category</option></select>';
		else if(var1=='banks')
			document.getElementById('sc').innerHTML='<select name="subcriteria" id="subcriteria"><option value="Anywhere">Anywhere</option><option value="bank">Bank Name</option><option value="ctg.CTGR_NAME">Branch</option><option value="ifsc">IFSC Code</option><option value="micr">MICR</option><option value="state">State</option><option value="place">City</option></select>';
		else if(var1=='resume')
			document.getElementById('sc').innerHTML='<select name="subcriteria" id="subcriteria"><option value="Anywhere">Anywhere</option><option value="NAME">Name</option><option value="state">State</option><option value="CITY">City</option><option value="WORKAREA">Work Area</option><option value="EXPERIENCE">Experience</option></select>';
		else if(var1=='tender')
			document.getElementById('sc').innerHTML='<select name="subcriteria" id="subcriteria"><option value="Anywhere">Anywhere</option><option value="TEND_NAME">Tender Name</option><option value="WORK_NAME">Work Name</option><option value="TENDER_COS">Tender Cost</option><option value="EST_COST">Estimated Cost</option><option value="EARN_MONEY">Earn Money</option><option value="CITY">City</option><option value="state">State</option></select>';
		else if(var1=='job')
			document.getElementById('sc').innerHTML='<select name="subcriteria" id="subcriteria"><option value="Anywhere">Anywhere</option><option value="yp.name">Company Name</option><option value="j.Jobtitle">Job Title</option><option value="j.experience">Experience (In Years)</option><option value="salary">Salary (LPA)</option><option value="j.state">State</option><option value="c.CITY_NAME">City</option><option value="j.education">Education</option></select>';
		else
			document.getElementById('sc').innerHTML='';	
		for(i=0;i<document.getElementById('subcriteria').length;i++)
		{
			if(document.getElementById('subcriteria').options[i].value==selected)
				document.getElementById('subcriteria').selectedIndex=i
		}	
}*/
function setsearch(var1,selected)
{
		if(var1=='yellowpages')
			document.getElementById('sc').innerHTML='<select name="subcriteria" id="subcriteria"><option value="Anywhere">Anywhere</option><option value="name">Firm Name</option><option value="contact">Contact Person</option><option value="yp.state">State</option><option value="CTGR_NAME">Category</option><option value="CITY_NAME">City</option><option value="products">Products</option></select>';
		else if(var1=='product')
			document.getElementById('sc').innerHTML='<select name="subcriteria" id="subcriteria"><option value="Anywhere">Anywhere</option><option value="ProductName">Product Name</option><option value="CTGR_NAME">Category</option><option value="name">Posted by</option><option value="keyword">keyword</option></select>';
		else if(var1=='classified' || var1=='tradeleads')	
			document.getElementById('sc').innerHTML='<select name="subcriteria" id="subcriteria"><option value="Anywhere">Anywhere</option><option value="Name">Name</option><option value="FirmName">Firm Name</option><option value="state">State</option><option value="City">City</option><option value="Category">Category</option></select>';
		else if(var1=='banks')
			document.getElementById('sc').innerHTML='<select name="subcriteria" id="subcriteria"><option value="Anywhere">Anywhere</option><option value="bank">Bank Name</option><option value="CTGR_NAME">Branch</option><option value="ifsc">IFSC Code</option><option value="micr">MICR</option><option value="state">State</option><option value="place">City</option></select>';
		else if(var1=='resume')
			document.getElementById('sc').innerHTML='<select name="subcriteria" id="subcriteria"><option value="Anywhere">Anywhere</option><option value="name">Name</option><option value="city">City</option><option value="category">Work Area</option><option value="QUALI">Qualification</option><option value="EXPERIENCE">Experience</option></select>';
		else if(var1=='tender')
			document.getElementById('sc').innerHTML='<select name="subcriteria" id="subcriteria"><option value="Anywhere">Anywhere</option><option value="TEND_NAME">Tender Name</option><option value="WORK_NAME">Work Name</option><option value="TENDER_COS">Tender Cost</option><option value="EST_COST">Estimated Cost</option><option value="EARN_MONEY">Earn Money</option><option value="CITY">City</option><option value="state">State</option></select>';
		else if(var1=='job')
			document.getElementById('sc').innerHTML='<select name="subcriteria" id="subcriteria"><option value="Anywhere">Anywhere</option><option value="name">Company Name</option><option value="Jobtitle">Job Title</option><option value="experience">Experience (In Years)</option><option value="salary">Salary (LPA)</option><option value="j.state">State</option><option value="CITY_NAME">City</option><option value="education">Education</option></select>';
		else
			document.getElementById('sc').innerHTML='';	
		for(i=0;i<document.getElementById('subcriteria').length;i++)
		{
			if(document.getElementById('subcriteria').options[i].value==selected)
				document.getElementById('subcriteria').selectedIndex=i
		}	
}
var ids=new Array('srb2','syp2','sp2','scl2','stl2','sb2','sr2','st2','sj2');
var ids1=new Array('srb1','syp1','sp1','scl1','stl1','sb1','sr1','st1','sj1');
var imgs=new Array('rjimg','ypimg','pimg','climg','tlimg','bimg','rimg','timg','jimg');
function setheader(obj,inobj,img,criteria)
{
		for (var i=0;i<ids.length;i++)
			document.getElementById(ids[i]).style.display='none';
		for (var i=0;i<ids1.length;i++)
			document.getElementById(ids1[i]).style.display='inline';	
		for (var i=0;i<imgs.length;i++)
		{
			if(imgs[i]==img)	
				document.getElementById(imgs[i]).style.display='none';		
			else	
				document.getElementById(imgs[i]).style.display='inline';		
		}
		document.getElementById(inobj).style.display='none';
		document.getElementById(obj).style.display='inline';
		document.getElementById('criteria').value=criteria;
		setsearch(criteria,'')
}
function rotateDown(result,text)
{
	resultlength=result.length;
	var index=result.selectedIndex;
	if(index < 0 || index >= resultlength-1)index=0;
	else index++;
	result.selectedIndex=index;
	text.value=result.value;
}
function rotateUp(result,text)
{
	resultlength=result.length;
	var index=result.selectedIndex;
	if(index <= 0 )index=resultlength-1;
	else index--;
	result.selectedIndex=index;
	text.value=result.value;
}
function showroster(e)
{
	var born = new Date();
	currentkey=born.getSeconds();
	var lastkey=document.getElementById('lastkeytime').value;
	var searchtext=document.getElementById('keyword');
	var resultwords=document.getElementById('resultwords');
	var var1=document.getElementById('keyword').value;
	if(window.event) // IE
		keynum = e.keyCode
	else if(e.which) // Netscape/Firefox/Opera
		keynum = e.which
	if(keynum==38)rotateUp(document.getElementById('resultwords'),searchtext);
	else if(keynum==40)rotateDown(document.getElementById('resultwords'),searchtext);
	else if(keynum==13) document.srch.submit();
	else
	{
		keychar = String.fromCharCode(keynum);
		if(keynum==8)
		{
			var1=var1+'';
		}	
		else
		{
			var1=var1+keychar;
		}	
		if(currentkey!=lastkey)
		{
			xajax_showresult(var1);
			document.getElementById('lastkeytime').value=currentkey;
		}
	}
}
function settextsubmitform(searchval)
{	
   document.getElementById('keyword').value=searchval;
   seturl();
}	
function stateval(opt) 
{
      var selected = new Array();
      var index = 0;
	  var newvalue='';
      for (var intLoop=0; intLoop < opt.length; intLoop++) {
         if (opt[intLoop].selected) {
			newvalue=newvalue+'State="'+opt[intLoop].value+'" OR ';
         }
      }
	 return newvalue.substr(0,newvalue.length-3);
}
function CheckSubmit(RecordCount,Field)
{
		 var Flag = 0; //keeps track that atleast one record is selected to change the status
		 var Counter = 0; 
		 if(RecordCount == 1)
		 { 
		     if(Field.checked==true)
			 {
			    Flag = 1;
			  }
			 else
			 {
			    Flag = 0;
			  } 
		 }	  	
		 else
		 {
		  	for (Counter=0; Counter < RecordCount; Counter++) 
			{
			  if(Field[Counter].checked == true)
				{
				   Flag = 1;
				   break;
				 }    
			   else
			   {
				 Flag = 0;
				}
			}  	
		}
	     if(Flag == 0)
		 {
			alert("Please select atleast one record to delete.");
			return false;
		 }
		 else
		 	return true;	
}	 
function shdiv(id)
{
		if(document.getElementById(id).className == "none")
			document.getElementById(id).className="inline";
		else
			document.getElementById(id).className="none";
}
function textCounter(field,cntfield,maxlimit) {
	if(maxlimit!='')
	{
		if (field.value.length > maxlimit)
			field.value = field.value.substring(0, maxlimit);
		else
			cntfield.value = field.value.length + 1;
	}
	else
	{
			cntfield.value = field.value.length + 1;
	}
}
function buyPaypal(itemnumber,productname,price)
{
	document.write("<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" target=\"_blank\"><input type=\"hidden\" name=\"cmd\" value=\"_xclick\">");
	document.write("<input type=\"hidden\" name=\"business\" value=\"rishiacharya@pelagiansoftwares.com\">");
	document.write("<input type=\"hidden\" name=\"item_name\" value=\"" + productname + "\">");
	document.write("<input type=\"hidden\" name=\"item_number\" value=\"" + itemnumber + "\">");
	document.write("<input type=\"hidden\" name=\"amount\" value=\"" + price + "\">");
	document.write("<input type=\"hidden\" name=\"no_note\" value=\"1\">");
	document.write("<input type=\"hidden\" name=\"undefined_quantity\" value=\"1\">");
	document.write("<input type=\"hidden\" name=\"page_style\" value=\"Primary\">");
	document.write("<input type=\"hidden\" name=\"return\" value=\"http://www.pelagiansoftwares.com/Paypal-Receipt.shtml\"><input type=\"hidden\" name=\"cancel_return\" value=\"http://www.pelagiansoftwares.com/Paypal-Cancel.shtml\">");
	document.write("<input type=\"hidden\" name=\"currency_code\" value=\"USD\">");
	document.write("<input type=\"image\" src=\"http://www.pelagiansoftwares.com/image/pp.gif\" border=\"0\" name=\"submit\" alt=\"Purchase using PayPal\">");
	document.write("</form>");
//	<input type="hidden" name="no_note" value="1">

}
function textCounter(field,cntfield,maxlimit) {
	if(maxlimit!='')
	{
		if (field.value.length > maxlimit)
			field.value = field.value.substring(0, maxlimit);
		else
			cntfield.value = field.value.length + 1;
	}
	else
	{
			cntfield.value = field.value.length + 1;
	}
}
function passwordStrength(password)
{
	var desc = new Array();
	desc[0] = "Very Weak";
	desc[1] = "Weak";
	desc[2] = "Better";
	desc[3] = "Medium";
	desc[4] = "Strong";
	desc[5] = "Strongest";

	var score   = 0;

	//if password bigger than 6 give 1 point
	if (password.length > 6) score++;

	//if password has both lower and uppercase characters give 1 point	
	if ( ( password.match(/[a-z]/) ) && ( password.match(/[A-Z]/) ) ) score++;

	//if password has at least one number give 1 point
	if (password.match(/\d+/)) score++;

	//if password has at least one special caracther give 1 point
	if ( password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) )	score++;

	//if password bigger than 12 give another 1 point
	if (password.length > 12) score++;
	 document.getElementById("passwordDescription").innerHTML = desc[score];
	 document.getElementById("passwordStrength").className = "strength" + score;
}

