﻿// JScript File
// JScript File
var xmlHttp;
function SendQuerySubmit(txtName,divName,txtEmail,divEmail)
{
	var check=true;
		if(!notBlank(txtName,divName))
			{
				check=false;
			}
			if(!checkEmail(txtEmail,divEmail))
			{
				check=false;
			}
			if(check)
	 return true;
	 else
	 return false;
}

function ContactSubmit(txtName,divName,txtEmail,divEmail,txtRemark,divRemark)
{
	var check=true;
		if(!notBlank(txtName,divName))
			{
				check=false;
			}
			if(!checkEmail(txtEmail,divEmail))
			{
				check=false;
			}
			
			if(!notBlank(txtRemark,divRemark))
			{
				check=false;
			}
			if(check)
	 return true;
	 else
	 return false;
}

function EventEntrySubmit(txtName,divName,txtDate,divDate)
{
	
		var check=true;
		if(!notBlank(txtName,divName))
			{
				check=false;
			}
			
			if(!checkDate(txtDate,divDate))
			{
				check=false;
			}
			if(check)
	 return true;
	 else
	 return false;
}


function checkProductID(txtShipmentNo,objDiv,objTxt)
{
	if(txtShipmentNo=="" || txtShipmentNo.length<4 )
	{
		document.getElementById(objDiv).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> <span class='Content'>Less than 4 Character</span> ";
		document.getElementById(objTxt).innerHTML="";
		return  false;
	}
	
	 
	 else
	 {
	 
    	document.getElementById(objDiv).innerHTML="<img src='corr/correct.gif' width='13' height='14' /> ";
	    xmlHttp=GetXmlHttpObject();
	    if(xmlHttp==null)
	    {
		    alert("Your browser does not support AJAX!");
		    return;
	    }
	var url="checkProductId.aspx";
	url=url+"?userName="+txtShipmentNo;
	
	xmlHttp.onreadystatechange=function() 
			{ 
				if (xmlHttp.readyState==1)
					{ 
						document.getElementById(objTxt).innerHTML="Processing.";
					}
					if (xmlHttp.readyState==2)
					{ 
						document.getElementById(objTxt).innerHTML="Processing...";
					}
					if (xmlHttp.readyState==3)
					{ 
						document.getElementById(objTxt).innerHTML="Processing.....";
					}
				if (xmlHttp.readyState==4)
					{ 
						document.getElementById(objTxt).innerHTML=xmlHttp.responseText;
						if(xmlHttp.responseText=="Already Exists")
				        document.getElementById(objDiv).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> ";
						return (xmlHttp.responseText);
					}
				
			}
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
	}
	}



function BtnEnable(chkOk,btnSubmit)
{
	if(chkOk.checked)
	{
		btnSubmit.disabled="";
	}
	else
	{
		btnSubmit.disabled="disabled";
	}
}

function AddressDetailsSubmit(Radio1,Radio2,Radio3,txtOtherFname,divTxtOtherFName,txtOtherLastName,divLastName,txtOtherAddress,divAddresses,txtOtherCity,divCity,txtOtherState,divState,txtOtherCountry,divCountry,txtOtherPinCode,divPinCode,txtOtherMobile,divMob,txtDeliveryDate,divDeliveryDate,drpOccassion,divOccassion,txtMessage,divMessage,chkTermCondition,btnSubmit)
{
	var check=true;
	
	if(Radio1.checked)
	{
		
	}
	else
	{
		if(!notBlank(txtOtherFname,divTxtOtherFName))
			{
				check=false;
			}
			
			if(!notBlank(txtOtherLastName,divLastName))
			{
				check=false;
			}
			if(!notBlank(txtOtherAddress,divAddresses))
			{
				check=false;
			}
			if(!notBlank(txtOtherCity,divCity))
			{
				check=false;
			}
			if(!notBlank(txtOtherState,divState))
			{
				check=false;
			}
			if(!notBlankDrp(txtOtherCountry,divCountry))
			{
				check=false;
			}
			if(!PinCode(txtOtherPinCode,divPinCode))
			{
				check=false;
			}
			if(!digitOnlyMobile(txtOtherMobile,divMob))
			{
				check=false;
			}
			
			if(Radio3.checked)
			{
			if(!checkDate(txtDeliveryDate,divDeliveryDate))
			{
				check=false;
			}
			if(!notBlankDrp(drpOccassion,divOccassion))
			{
				check=false;
			}
			}
	}
	
		
			
			
	
	
	if(chkTermCondition.checked)
	{

		btnSubmit.disabled="";
	}
	else
	{
				alert("false");
		btnSubmit.disabled="disabled";
		alert("Please check Term & Condition");
		check=false;
	}
	
	
	
	if(check)
	 return true;
	 else
	 return false;
}


function VisibleTDDAdd(rdButton,tdDelivery,tdOcassion)
{
	if(rdButton.checked)
	{
		tdDelivery.style.display="inline";
				tdOcassion.style.display="none";
	}
	else
	{
		tdDelivery.style.display="none";
				tdOcassion.style.display="none";
	}
	
}
function checkDate(str,objTxt)
{
  
    var CheckDatePattern=/^(0[1-9]|[12][0-9]|[3][0-1])[-/](jan|feb|mar|apr|may|jun|jul|aug|sep|nov|dec|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Nov|Dec|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|NOV|DEC)[-/](18|19|20|21|22)\d\d$/;
	if(str.search(CheckDatePattern)!=-1)
	 {
	   document.getElementById(objTxt).innerHTML="<img src='corr/correct.gif' width='13' height='14' />"
     return true;
   }
   else
   {
	   document.getElementById(objTxt).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> "
     return false;
   }
		
}

function VisibleTDSpecificDate(rdButton,tdDelivery,tdOcassion)
{
	if(rdButton.checked)
	{
		tdDelivery.style.display="inline";
				tdOcassion.style.display="inline";
	}
	else
	{
		tdDelivery.style.display="none";
				tdOcassion.style.display="none";
	}
	
}


function VisibleTD(rdButton,tdDelivery,tdOcassion)
{
	if(rdButton.checked)
	{
		tdDelivery.style.display="none";
				tdOcassion.style.display="none";
	}
	else
	{
		tdDelivery.style.display="inline";
				tdOcassion.style.display="inline";
	}
	
}


function InviteFriendSubmit(txtmail,divmail,txtName,divName)
{
	 var check=true;
	if(!notBlank(txtName,divName))
			{
				check=false;
			}
			
			    if(!checkEmail(txtmail,divmail))
	{
		check=false;
	}
	     if(check)
	 return true;
	 else
	 return false;
			
}

function EditProfileSubmit(txtName,divName,txtEmail,divEmail,txtMobile,divMobile,btnSubmit,txtLastName,divLastName,txtCity,divCity,txtState,divState,txtOtherCountry,divCountry,txtPinCode,divPinCode,txtPhoneNo,divPhoneNo,txtAddress,divAddresses)
{
	var check=true;
	if(!notBlank(txtName,divName))
			{
				check=false;
			}
	
			if(!notBlank(txtAddress,divAddresses))
			{
				check=false;
			}
			
				if(!notBlank(txtCity,divCity))
			{
				check=false;
			}
				if(!notBlank(txtState,divState))
			{
				check=false;
			}
				if(!notBlankDrp(txtOtherCountry,divCountry))
			{
				check=false;
			}
				if(!PinCode(txtPinCode,divPinCode))
			{
				check=false;
			}
				
	
	
	
	
		
	    if(!checkEmail(txtEmail,divEmail))
	{
		check=false;
		document.getElementById(divEmail).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' />"
	
	}

	if(!digitOnlyMobile(txtMobile,divMobile))
	{
	check=false;
	document.getElementById(divMobile).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' />"
	}
	

						
     if(check)
	 return true;
	 else
	 return false;
}


function ChangePasswordSubmit(txtOldPassword,divOldPasswod,txtPassword,txtConfirmPassword,divPassword)
{
	var check=true;
	
		if(!notBlank(txtOldPassword,divOldPasswod))
			{
				check=false;
			}
		    if(txtPassword =="" || txtPassword.length<6)
    {
    
        document.getElementById(divPassword).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /><span class='WriteError'>&nbsp;Not Blank</span>";
        check=false;
	}
	
		
    if(!CheckPass(txtPassword,divPassword))
    {
	    check=false;
	}
	
	 if(txtPassword!=txtConfirmPassword)
	 {
	   document.getElementById(divPassword).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /><span class='WriteError'>&nbsp; Password Mismatch</span>";
	   check=false;
	 }
	 
	 					     if(check)
	 return true;
	 else
	 return false;	
	 
}

function SubCategoryEntrySubmit(drp,divDrp,txtName,divName)
{
		var check=true;
	
			if(!notBlankDrp(drp,divDrp))
			{
				check=false;
			}
			
				if(!notBlank(txtName,divName))
			{
				check=false;
			}
						   if(check)
	 return true;
	 else
	 return false;
}

function ProductEntrySubmit(txtProductId,divProductID,txtProductName,divProductName,txtProductSize,divProductSize,txtDesign,divDesign,txtKnots,divKnots,txtDescription,divDescription,DropDownList1,divCategory,drpSubCategory,divSubCategory,txtPrice,divPrice)
{
	
	var check=true;
	
			if(!notBlank(txtProductId,divProductID))
			{
				check=false;
			}
			
				if(!notBlank(txtProductName,divProductName))
			{
				check=false;
			}
				if(!notBlank(txtProductSize,divProductSize))
			{
				check=false;
			}
				if(!notBlank(txtDesign,divDesign))
			{
				check=false;
			}
					if(!notBlank(txtDescription,divDescription))
			{
				check=false;
			}
				if(!notBlank(txtKnots,divKnots))
			{
				check=false;
			}
					if(!notBlankDrp(DropDownList1,divCategory))
			{
				check=false;
			}
				if(!notBlankDrp(drpSubCategory,divSubCategory))
			{
				check=false;
			}
					if(!digitOnly(txtPrice,divPrice))
			{
				check=false;
			}
			
			   if(check)
	 return true;
	 else
	 return false;
	
}

function Disable(drp1,drp2)
{
	 if(drp1.value==0)
	 {
		 drp2.disabled=true;
		
		
	 }
	 else
	 {
		 		 drp2.disabled=false;
				
	 }
	
}

function RegiseterSubmit(txtCheckUserName,divShowMsg,divUserName,txtPassword,txtConfirmPassword,divPassword,txtName,divName,txtMobile,divMobile,txtEmail,divEmail,txtAddress,divAddresses,txtCity,divCity,txtState,divState,country,divCountry,txtPinCode,divPinCode)
{
	var check=true;
	
			if(!notBlank(txtAddress,divAddresses))
			{
				check=false;
			}
			
				if(!notBlank(txtCity,divCity))
			{
				check=false;
			}
				if(!notBlank(txtState,divState))
			{
				check=false;
			}
				if(!notBlankDrp(country,divCountry))
			{
				check=false;
			}
				if(!PinCode(txtPinCode,divPinCode))
			{
				check=false;
			}
				
	
	
	
	
		if(!notBlank(txtName,divName))
			{
				check=false;
			}
			
		 
			if(txtCheckUserName<4)
	{
	  check=false;
	  document.getElementById(divUserName).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /><span class='WriteError'>&nbsp;Less than 4</span>";
	}
	else
	if (validateEmail(txtCheckUserName)==false)
{	
		document.getElementById(objDiv).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> <span class='WriteError'>Enter Email Address</span> ";
check=false;
}
	
	    if(txtPassword =="" || txtPassword.length<6)
    {
    
        document.getElementById(divPassword).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /><span class='WriteError'>&nbsp;Not Blank</span>";
        check=false;
	}
	
		
    if(!CheckPass(txtPassword,divPassword))
    {
	    check=false;
	}
	
	 if(txtPassword!=txtConfirmPassword)
	 {
	   document.getElementById(divPassword).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /><span class='WriteError'>&nbsp; Password Mismatch</span>";
	   check=false;
	 }
	 
	    if(!checkEmail(txtEmail,divEmail))
	{
		check=false;
		document.getElementById(divEmail).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /><span class='WriteError'>&nbsp;Invalid Email</span>"
	
	}

	if(!digitOnlyMobile(txtMobile,divMobile))
	{
	check=false;
	document.getElementById(divMobile).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /><span class='WriteError'>&nbsp;Enter 10 Digit</span>"
	}
	
				
     if(check)
	 return true;
	 else
	 return false;
}
function checkUserNameCharacter(str)
{

  if(str.length>0)
  {
 
     for(var i=0;i < str.length; ++i)
          {
          
               var new_key = str.charAt(i); //cycle through characters
               
               if(!(((new_key >= "0") && (new_key <="9"))||((new_key>="a")&&(new_key<="z"))||((new_key>="A")&&(new_key<="Z"))||(new_key="_"))) 
               {
                   return false;
               }
               
          }
          return true;
  }
  else
  {
    return false;
  }
}

function ForgotSubmit(txtUserName,divUserName)
{
	var check=true;
		if(!notBlank(txtUserName,divUserName))
			{
				check=false;
			}
					     if(check)
	 return true;
	 else
	 return false;	
}

function checkUserName(txtShipmentNo,objTxt,objDiv)
{
	if(txtShipmentNo=="" || txtShipmentNo.length<4 )
	{
		document.getElementById(objDiv).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> <span class='WriteError'>Less than 4 Character</span> ";
		document.getElementById(objTxt).innerHTML="";
		return  false;
	}
	else
	if (validateEmail(txtShipmentNo)==false)
{	
		document.getElementById(objDiv).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> <span class='WriteError'>Enter Email Address</span> ";
	return false;
}
		
	
		
	else
	{
	 if(checkUserNameCharacter(txtShipmentNo)==false)
	 {
	     document.getElementById(objDiv).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> <span class='WriteError'>Some illegal Character</span> ";
	     document.getElementById(objTxt).innerHTML="";
		return  false;
	 }
	 
	 else
	 {
	 
    	document.getElementById(objDiv).innerHTML="<img src='corr/correct.gif' width='13' height='14' /> ";
	    xmlHttp=GetXmlHttpObject();
	    if(xmlHttp==null)
	    {
		    alert("Your browser does not support AJAX!");
		    return;
	    }
	var url="checkUserName.aspx";
	url=url+"?userName="+txtShipmentNo;
	
	xmlHttp.onreadystatechange=function() 
			{ 
				if (xmlHttp.readyState==1)
					{ 
						document.getElementById(objTxt).innerHTML="Processing.";
					}
					if (xmlHttp.readyState==2)
					{ 
						document.getElementById(objTxt).innerHTML="Processing...";
					}
					if (xmlHttp.readyState==3)
					{ 
						document.getElementById(objTxt).innerHTML="Processing.....";
					}
				if (xmlHttp.readyState==4)
					{ 
						document.getElementById(objTxt).innerHTML=xmlHttp.responseText;
						if(xmlHttp.responseText=="Already Exists")
				        document.getElementById(objDiv).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> ";
						return (xmlHttp.responseText);
					}
				
			}
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
	}
	}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}


function LoginSubmitOnly(txtUserName,txtPassword)
{
	var check=true;
	
		if(!checkEmailOnly(txtUserName))
			{
				
				return false;
				check=false;
			}
			
					
					if(!notBlankOnly(txtPassword))
			{
				check=false;
			}
			
		     if(check)
	 return true;
	 else
	 {
	 alert("Please Enter UserName and Password");
	 return false;	
	 }
			
}
function LoginSubmit(txtUserName,txtPassword)
{
	var check=true;
		if(!notBlank(txtUserName,divUserName))
			{
				check=false;
			}
			
					if(!notBlank(txtPassword,divPassword))
			{
				check=false;
			}
		     if(check)
	 return true;
	 else
	 return false;	
			
}



function digitOnlyMinus(field,objTxt)
{
  var check =true;
	 var pinPattern= /^-{0,1}\d{1,3}$/;
	 if(field.value.search(pinPattern)==-1)
	  
//   var ptr="/^\d$/";
//   if(field.value.search(ptr)==-1)
   {
    document.getElementById(objTxt).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> "
	return false;
   }
   else
   {
    document.getElementById(objTxt).innerHTML="<img src='corr/correct.gif' width='13' height='14' />"
		  return true;
   }

}

function digitOnly100(field,objTxt)
{
   var check =true;
		  if(field.value.length>0)
		  {
          for(var i=0;i < field.value.length; ++i)
          {
               var new_key = field.value.charAt(i); //cycle through characters
               if(((new_key < "0") || (new_key > "9")) && 
                    !(new_key == ""))
               {
                    check = false;
                    break;
               }
          }
		  }
		  else
		  check=false;
		  
		  if(check)
		  {
		    if(field.value>100)
		    {
		      check = false;
		    }
		  }

		  if(!check)
		  {
		  field.value="";
		  document.getElementById(objTxt).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> "
	return false;
		  }
		  else
		  {
		  document.getElementById(objTxt).innerHTML="<img src='corr/correct.gif' width='13' height='14' />"
		  return true;
		  
		  }

}
function CheckPass(str,objTxt)
	{
		
		if (str.length == 0 || str.length==null)
			{
				
				document.getElementById(objTxt).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /><span class='WriteError'> &nbsp;[ Password only consists of <br/>a-z, 0-9, (_) ] [ Min. 6 char ]</span>"
				
				return  false;
			}
	   else	if (str.length < 6 )
			{
				
				document.getElementById(objTxt).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /><span class='WriteError'> &nbsp; Password should be at least<br/> 6 char length</span>"
				return false;
			}
			
			
	else
	{
		
		document.getElementById(objTxt).innerHTML="<img src='corr/correct.gif' width='13' height='14' />"
         return true;
	}
	}
	
	function MatchPass(str,str1,objTxt)
	{
		//alert (str);
		//alert (str1);
		if (str.length <6)
			{
				document.getElementById(objTxt).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /><span class='WriteError'> &nbsp;[ Password only  consists of  <br/>a-z, 0-9,(_) ][ Min. 6 char]</span>"
				return false;
			}
		if (str != str1)
			{
				document.getElementById(objTxt).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /><span class='WriteError'> &nbsp; Password Mismatch</span>"
				return false;
			}
		document.getElementById(objTxt).innerHTML="<img src='corr/correct.gif' width='13' height='14' />"
		return true;
	}

function notBlankDrp(str,objTxt)
{

  if(str==0 || str==null)
  {
    document.getElementById(objTxt).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> "
	return false;
  }
  else
  {
    document.getElementById(objTxt).innerHTML="<img src='corr/correct.gif' width='13' height='14' />"
	return true;
  }
  
}

 function digitOnlyType()
	  {
	    //alert(event.keyCode);
	      if((event.keyCode>=96 &&  event.keyCode<=105)|| (event.keyCode>=48 &&  event.keyCode<=57) || event.keyCode==8 || event.keyCode==9 || (event.keyCode>=37 &&  event.keyCode<=40)  ||  event.keyCode==46)
		  {
		     return true;
		  }
		  else
		  {
		  return false;
		  }
	  }
	  function digitOnly(field,objTxt)
{
	
		   var check =true;
		  if(field.value.length>0)
		  {
          for(var i=0;i < field.value.length; ++i)
          {
               var new_key = field.value.charAt(i); //cycle through characters
               if(((new_key < "0") || (new_key > "9")) && 
                    !(new_key == ""))
               {
                    check = false;
                    break;
               }
          }
		  }
		  else
		  check=false;

		  if(!check)
		  {
		  field.value="";
		  document.getElementById(objTxt).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> "
	return false;
		  }
		  else
		  {
		  document.getElementById(objTxt).innerHTML="<img src='corr/correct.gif' width='13' height='14' />"
		  return true;
		  
		  }

}

function digitOnlyMobile(field,objTxt)
{
  if( digitOnly(field,objTxt)==false || field.value.length!=10)
  {
  document.getElementById(objTxt).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14'  />"
  return false;
  }
  else
  {
  document.getElementById(objTxt).innerHTML="<img src='corr/correct.gif' width='13' height='14' /> "
  return true;
  }
}

function PinCode(txtPinCode,divPinCode)
{
	 var check =true;
	 var pinPattern= /^\d\d\d\d\d\d$/;
	 if(txtPinCode.search(pinPattern)==-1)
	 {
		 check=false;
	 }
	 else
	 {
		 check=true;
	 }
				
				 if(check)
   {
	   document.getElementById(divPinCode).innerHTML="<img src='corr/correct.gif' width='13' height='14' />"
     return true;
   }
   else
   {
	   document.getElementById(divPinCode).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> "
     return false;
   }
}

function UserType(rbIndividual,rbConsultants,divtype)
{


 if(!(rbIndividual.checked) && !(rbConsultants.checked))
{
	 document.getElementById(divtype).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' />";
	
	 return false;
}
 else
 {
	document.getElementById(divtype).innerHTML="<img src='corr/correct.gif' width='13' height='14' />"
	return true;
 }
 }

function radioButtonCheck(txtvalue,txtvalue1,divtax)
{

if(!txtvalue.checked) 
 {
	 if(!txtvalue1.checked)
	 {
	     document.getElementById(divtax).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' />";
	     check=false;
	 }
	 else
        {
	        document.getElementById(divtax).innerHTML="<img src='corr/correct.gif' width='13' height='14' />"
        }
 }
 else
 {
	  document.getElementById(divtax).innerHTML="<img src='corr/correct.gif' width='13' height='14' />"
 }
	 
}

function btnEnable(chk,btn)
{

if(chk.checked)
{
 btn.disabled=false;
 }
 else
 {
 btn.disabled=true;
 }
}
function digitOnly(field,objTxt)
{
	
		   var check =true;
		  if(field.value.length>0)
		  {
          for(var i=0;i < field.value.length; ++i)
          {
               var new_key = field.value.charAt(i); //cycle through characters
               if(((new_key < "0") || (new_key > "9")) && 
                    !(new_key == ""))
               {
                    check = false;
                    break;
               }
          }
		  }
		  else
		  check=false;

		  if(!check)
		  {
		  field.value="";
		  document.getElementById(objTxt).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> "
	return false;
		  }
		  else
		  {
		  document.getElementById(objTxt).innerHTML="<img src='corr/correct.gif' width='13' height='14' />"
		  return true;
		  
		  }

}

function checkEmailOnly(str)
{

if (validateEmail(str)==false)
{	
	alert("Enter valid Email Address");
	return false;
}
else
{

return true;
}
}

function checkEmail(str,objTxt)
{
if (validateEmail(str)==false)
{	
	document.getElementById(objTxt).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> ";
	return false;
}
else
{
document.getElementById(objTxt).innerHTML="<img src='corr/correct.gif' width='13' height='14' />"
return true;
}
}



	
	function validateEmail(strEmail)
{
     var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
     var emailid=strEmail;
     var matchArray = emailid.match(emailPat);
     if (matchArray == null)
        {
            return false;
        }
    else
        {
            return true;
        }
}
	
function CheckPa(str,objTxt)
{
		if (str.length == 0 || str.length==null)
			{
				
				document.getElementById(objTxt).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> ";
				
				return  false;
			}
	   else	if (str.length < 6)
			{
				
				document.getElementById(objTxt).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> ";
				return false;
			}
	else
	{
		
		document.getElementById(objTxt).innerHTML="<img src='corr/correct.gif' width='13' height='14' />"
         return true;
	}
}

function notBlankOnly(str)
{

  if(str=="" || str==null)
  {
 
   
	return false;
   
    
  }
  else
  {
 
  
		  return true;
  }
  
}

function notBlank(str,objTxt)
{

  if(str.length==0 || str==null)
  {
 
   document.getElementById(objTxt).innerHTML="<img src='corr/erroricon1.gif' width='13' height='14' /> "
	return false;
   
    
  }
  else
  {
 
  document.getElementById(objTxt).innerHTML="<img src='corr/correct.gif' width='13' height='14' />"
		  return true;
  }
  
}
function DigitOnlyIfNotBlank(txtObj)
{
	
	if(txtObj!=null )
	{
		
	if(isNaN(txtObj.value)==true)
	{
		txtObj.value="";
	}
	}
}


