	
var MONTH_NAMES = new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');

function isDigit(num) {
	var string="1234567890";
	if (string.indexOf(num) != -1) {
		return true;
		}
	return false;
	}

function isNumeric(val) {
	var dp = false;	
	for (var i=0; i < val.length; i++) {
		if (!isDigit(val.charAt(i))) {
 			if (val.charAt(i) == '.') {
				if (dp == true) { return false; }

 // already saw a decimal point
				else { dp = true; }
				}
			else {
				return false;
 				}
			}
		}
	return true;
	}
	
	
function isInteger(val) {
	for (var i=0; i < val.length; i++) {
		if (!isDigit(val.charAt(i))) {
 return false; }
		}
	return true;
	}


function _getInt(str,i,minlength,maxlength) {
	for (var x=maxlength; x>=minlength; x--) {
		var token = str.substring(i,i+x);
		if (token.length < minlength) {
			return null;
			}
		if (isInteger(token)) {
 			return token;
			}
		}
	return null;
	}

function isEmail(Obj)
{
	var x;
	var y;
	var str = Obj.value;
	var msg;
	var InvalidChars='@';
	var invChars='';
	var a=0;
	/*Iterate over the target and source strings to check if the source string is present in 				the target. If an invalid character from target string is present in the source string, 	add the character to the invChars variable.*/

	for (x=0; x<=(str.length-1); x++)
	{
		for (y=0; y<=(InvalidChars.length-1); y++)
		{
			if (str.charCodeAt(x)==InvalidChars.charCodeAt(y))
			{
				a=a+1;
			}
		}
	}
	
	if(Obj.value!='')
	if (a < 1)
	{
		alert("Not a valid EmailAddress");
		Obj.focus();
		return false;
	}
	//return true;
}	

function getDateFromFormat(val,format)
{
	val = val+"";	
	format = format+"";
	var i_val = 0;
	var i_format = 0;
	var c = "";
	var token = "";
	var token2= "";
	var x,y;
	var now   = new Date();

	var year  = now.getYear();
	var month = now.getMonth()+1;

	var date  = now.getDate();
	var hh    = now.getHours();
	var mm    = now.getMinutes();
	var ss    = now.getSeconds();
	var ampm  = "";
	while (i_format < format.length) {
		// Get next token from format string
		c = format.charAt(i_format);

		token = "";
		while ((format.charAt(i_format) == c) && (i_format < format.length)) {
			token += format.charAt(i_format);
			i_format++;
			}
		// Extract contents of value based on format token
		if (token=="yyyy" || token=="yy" || token=="y") {
			if (token=="yyyy") { x=4;y=4; }     // 4-digit year
			if (token=="yy")   { x=2;y=2; }     // 2-digit year
			if (token=="y")    { x=2;y=4; }     // 2-or-4-digit year

			year = _getInt(val,i_val,x,y);
			if (year == null) { return 0; }
			i_val += year.length;
			if (year.length == 2) {
				if (year > 70) {
					year = 1900+(year-0);
					}
				else {
					year = 2000+(year-0);
					}
				}
			}
		else if (token=="MMM"){    // Month name
			month = 0;
			for (var i=0; i<MONTH_NAMES.length; i++) {
				var month_name = MONTH_NAMES[i];
				if (val.substring(i_val,i_val+month_name.length).toLowerCase() == month_name.toLowerCase()) {
					month = i+1;
					if (month>12) { month -= 12; }
					i_val += month_name.length;
					break;
					}
				}
			if (month == 0) { return 0; }
			if ((month < 1) || (month>12)) { return 0; }
			// TODO: Process Month Name
			}
		else if (token=="MM" || token=="M") {
			x=token.length; y=2;
			month = _getInt(val,i_val,x,y);
			if (month == null) { return 0; }
			if ((month < 1) || (month > 12)) { return 0; }
			i_val += month.length;
			}
		else if (token=="dd" || token=="d") {
			x=token.length; y=2;
			date = _getInt(val,i_val,x,y);
			if (date == null) { return 0; }
			if ((date < 1) || (date>31)) { return 0; }
			i_val += date.length;
			}
		else if (token=="hh" || token=="h") {
			x=token.length; y=2;
			hh = _getInt(val,i_val,x,y);
			if (hh == null) { return 0; }
			if ((hh < 1) || (hh > 12)) { return 0; }
			i_val += hh.length;
			hh--;
			}
		else if (token=="HH" || token=="H") {
			x=token.length; y=2;
			hh = _getInt(val,i_val,x,y);
			if (hh == null) { return 0; }
			if ((hh < 0) || (hh > 23)) { return 0; }
			i_val += hh.length;
			}
		else if (token=="KK" || token=="K") {
			x=token.length; y=2;
			hh = _getInt(val,i_val,x,y);
			if (hh == null) { return 0; }
			if ((hh < 0) || (hh > 11)) { return 0; }
			i_val += hh.length;
			}
		else if (token=="kk" || token=="k") {
			x=token.length; y=2;
			hh = _getInt(val,i_val,x,y);
			if (hh == null) { return 0; }
			if ((hh < 1) || (hh > 24)) { return 0; }
			i_val += hh.length;
			h--;
			}
		else if (token=="mm" || token=="m") {
			x=token.length; y=2;
			mm = _getInt(val,i_val,x,y);
			if (mm == null) { return 0; }
			if ((mm < 0) || (mm > 59)) { return 0; }
			i_val += mm.length;
			}
		else if (token=="ss" || token=="s") {
			x=token.length; y=2;
			ss = _getInt(val,i_val,x,y);
			if (ss == null) { return 0; }
			if ((ss < 0) || (ss > 59)) { return 0; }
			i_val += ss.length;
			}
		else if (token=="a") {
			if (val.substring(i_val,i_val+2).toLowerCase() == "am") {
				ampm = "AM";
				}
			else if (val.substring(i_val,i_val+2).toLowerCase() == "pm") {
				ampm = "PM";
				}
			else {
				return 0;
				}
			}
		else {
			if (val.substring(i_val,i_val+token.length) != token) {
				return 0;
				}	
		else {
			i_val += token.length;
				}
			}
		}
	// If there are any trailing characters left in the value, it doesn't match
	if (i_val != val.length) {
		return 0;
		}

	// Is date valid for month?
	if (month == 2) {
		// Check for leap year
		if ( ( (year%4 == 0)&&(year%100 != 0) ) || (year%400 == 0) ) { // leap year
			if (date > 29){ return false; }
			}
		else {
			if (date > 28) { return false; }
			}
		}
	if ((month==4)||(month==6)||(month==9)||(month==11)) {
		if (date > 30) { return false; }
		}
	// Correct hours value
	if (hh<12 && ampm=="PM") {
		hh+=12;
		}
	else if (hh>11 && ampm=="AM") {
		hh-=12;
		}
	var newdate = new Date(year,month-1,date,hh,mm,ss);
	return newdate.getTime();
}



function isDate(DateField)
{	
	var val = DateField.value;
	var vdate = getDateFromFormat(val,"d/M/yyyy");
	if (vdate == 0) 
	{
		alert("Invalid date in d/M/yyyy format!");
		DateField.focus();
		return false;
	}
	return true;
}

function isNull(val)
{
	if (val == null) {
 return true; }
	for (var i=0; i < val.length; i++) {
		if ((val.charAt(i) != ' ') && (val.charAt(i) != "\t") && (val.charAt(i) != "\n")) {
 return false; }
		}
	return true;
}

function RTrim(str)
// str - the string we want to RTrim
{
    // We don't want to trim JUST spaces, but also tabs,
    // line feeds, etc.  Add anything else you want to
    // "trim" here in Whitespace

    var whitespace = new String(" \t\n\r");

    var s = new String(str);

    if (whitespace.indexOf(s.charAt(s.length-1)) != -1)
       {

        // We have a string with trailing blank(s)...

        var i = s.length - 1;       // Get length of string

        // Iterate from the far right of string until we
        // don't have any more whitespace...

        while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
            i--;

        // Get the substring from the front of the string to
        // where the last non-whitespace character is...

        s = s.substring(0, i+1);
    }
    return s;
}


// Trim functions
//   Returns string with whitespace trimmed
//-------------------------------------------------------------------
//LTrim(string) : Returns a copy of a string without leading spaces.
//==================================================================
function LTrim(str)
/***
	str         : the string we want to LTrim
	RETURN VALUE: An LTrimmed string!
***/
{
    // We don't want to trip JUST spaces, but also tabs,
    // line feeds, etc.  Add anything else you want to
    // "trim" here in Whitespace
    var whitespace = new String(" \t\n\r");

    var s = new String(str);

    if (whitespace.indexOf(s.charAt(0)) != -1) {
        // We have a string with leading blank(s)...

        var i = 0;       // Get length of string

        // Iterate from the left of string until we
        // don't have any more whitespace...
        while (i <= s.length && whitespace.indexOf(s.charAt(i)) != -1)
            i++;

        // Get the substring from the front of the string to
        // where the last non-whitespace character is...
        s = s.substring(i, s.length);
    }

    return s;
}

function Trim(str) {
	return LTrim(RTrim(str));
	}

function numeralsOnly(evt) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : 
        ((evt.which) ? evt.which : 0));
		
		if (charCode==45) {
			return true;
		}
		else 
		{	
    	if (charCode > 31 && (charCode < 48 || charCode > 57 )  ) {
        return false;
    	}else {
	   		return true;
			}
		}	
}


function chkMandatoryFields(form) {
	var count;
	count=form.elements.length;
	//alert(count);
	for(i=1;i<=count-3;i++) {
		//alert(form.elements[i].name);
			if (form.elements[i].value=="") {
				errmsg.innerText="! Fields marked with * are mandatory";
				return false;
				break;  
			}	
	}
	var pass=form.txtPass.value;
	var cpass=form.txtconfirmPass.value;
	if(pass!=cpass) {
		errmsg.innerText="Confirm password doesnt match";
				return false;
	}
}	

	 function copy()
	{                   
		//alert(document.customer.cboCountry_b.value);
		               
		                 document.customer.txtFname_s.value=document.customer.txtFname_b.value;
		                 document.customer.txtLname_s.value=document.customer.txtLname_b.value;
             		     document.customer.txtAdd1_s.value=document.customer.txtAdd1_b.value;
             		     document.customer.txtAdd2_s.value=document.customer.txtAdd2_b.value;
             		     document.customer.txtCity_s.value=document.customer.txtCity_b.value;
             		     document.customer.txtState_s.value=document.customer.txtState_b.value;
             		     document.customer.cboCountry_s.value=document.customer.cboCountry_b.value;
             		     document.customer.txtPin_s.value=document.customer.txtPin_b.value;
             		     document.customer.txtPhone_s.value=document.customer.txtPhone_b.value;
             		     document.customer.txtMobile_s.value=document.customer.txtMobile_b.value;
             		     document.customer.txtEmail_s.value=document.customer.txtEmail_b.value;         		   
     
		
	}
	 function copyAdmin()
	{                   
		//alert(document.customer.cboCountry_b.value);
		               
		                 document.frmOrderstatusadd.txSfname.value=document.frmOrderstatusadd.txBfname.value;
		                 document.frmOrderstatusadd.txtSlname.value=document.frmOrderstatusadd.txtBlname.value;
             		     document.frmOrderstatusadd.txtSadd1.value=document.frmOrderstatusadd.txtBadd1.value;
             		     document.frmOrderstatusadd.txtSadd2.value=document.frmOrderstatusadd.txtBadd2.value;
             		     document.frmOrderstatusadd.txtScity.value=document.frmOrderstatusadd.txtBcity.value;
             		     document.frmOrderstatusadd.txtSstate.value=document.frmOrderstatusadd.txtBstate.value;
             		     document.frmOrderstatusadd.txtScountry.value=document.frmOrderstatusadd.txtBcountry.value;
             		     document.frmOrderstatusadd.txtSpincode.value=document.frmOrderstatusadd.txtBpincode.value;
             		     document.frmOrderstatusadd.txtSphone.value=document.frmOrderstatusadd.txtBphone.value;
             		     document.frmOrderstatusadd.txtSmobileno.value=document.frmOrderstatusadd.txtBmobileno.value;
             		     document.frmOrderstatusadd.txtSemail.value=document.frmOrderstatusadd.txtBemail.value;         		   
     
		
	}
	 function copyAdminEdit()
	{                   
		//alert(document.customer.cboCountry_b.value);
		               
		                 document.frmOrderstatusEdit.txSfname.value=document.frmOrderstatusEdit.txBfname.value;
		                 document.frmOrderstatusEdit.txtSlname.value=document.frmOrderstatusEdit.txtBlname.value;
             		     document.frmOrderstatusEdit.txtSadd1.value=document.frmOrderstatusEdit.txtBadd1.value;
             		     document.frmOrderstatusEdit.txtSadd2.value=document.frmOrderstatusEdit.txtBadd2.value;
             		     document.frmOrderstatusEdit.txtScity.value=document.frmOrderstatusEdit.txtBcity.value;
             		     document.frmOrderstatusEdit.txtSstate.value=document.frmOrderstatusEdit.txtBstate.value;
             		     document.frmOrderstatusEdit.txtScountry.value=document.frmOrderstatusEdit.txtBcountry.value;
             		     document.frmOrderstatusEdit.txtSpincode.value=document.frmOrderstatusEdit.txtBpincode.value;
             		     document.frmOrderstatusEdit.txtSphone.value=document.frmOrderstatusEdit.txtBphone.value;
             		     document.frmOrderstatusEdit.txtSmobileno.value=document.frmOrderstatusEdit.txtBmobileno.value;
             		     document.frmOrderstatusEdit.txtSemail.value=document.frmOrderstatusEdit.txtBemail.value;         		   
     
		
	}
	
	
	
	
	function cat_filter(cid) {
		//alert('books.php?c_id='+cid);
		location.reload('books.php?c_id='+cid);
	}	
	
	
	
	var xmlHttp;
	function display_div(name,brwzby,lettr) {
		//sdocument.getElementById("img_div").visible=false;
		img_div.style.visibility="";
		/*xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="book_list.php"
		url=url+"?cid="+name
		url=url+"&browseby="+brwzby
		url=url+"&letter="+lettr
		xmlHttp.onreadystatechange=stateChanged 
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)*/

		alert(name);
	}
	
	function stateChanged() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
	//	alert(this.bklist.innerText);
	document.getElementById("txtHint").innerHTML=xmlHttp.responseText 
	//document.getElementById("txtHint").innerHTML=this.bklist.innerText
	//document.getElementById("tst").innerText=this.tst.innerHTML  
	//document.reload(xmlHttp.responseText );
		} 
	} 

	function GetXmlHttpObject()
	{ 
		var objXMLHttp=null
		if (window.XMLHttpRequest)
		{
			objXMLHttp=new XMLHttpRequest()
		}
		else if (window.ActiveXObject)
		{
			objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
		return objXMLHttp
	}
	
	function change_Pass() {
		location.reload('change_pass.php');
		
	}
	function chkPass(dbpass,oldpass) {
		var txtPass=document.getElementById('txtPass');
		var txtconfirm=document.getElementById('txtconfirmPass');
		//alert(oldpass);
		if(oldpass!="") {
			if(dbpass!=oldpass) {
				errmsg.innerText="The Old password does not match";
				//alert("err");
				return false;
			}
			else {
				txtPass.disabled=false;
				txtconfirm.disabled=false;
			}
		}
		else {
			errmsg.innerText="The Old password does not match";
			return false;
		}
	}
	
		function check_pay()
{
	var pay_info=document.paymentform.pay_info.value; 
	if((pay_info == "") ||(pay_info == null))
 {
  alert("Payment Details Field is blank , please try again.");
  return false;
 
 }
 else
 {
  return true;
 }
 return false;
	
}





function Validator(frmname)
{
  this.formobj=document.forms[frmname];
	if(!this.formobj)
	{
	  alert("BUG: couldnot get Form object "+frmname);
		return;
	}
	if(this.formobj.onsubmit)
	{
	 this.formobj.old_onsubmit = this.formobj.onsubmit;
	 this.formobj.onsubmit=null;
	}
	else
	{
	 this.formobj.old_onsubmit = null;
	}
	this.formobj.onsubmit=form_submit_handler;
	this.addValidation = add_validation;
	this.setAddnlValidationFunction=set_addnl_vfunction;
	this.clearAllValidations = clear_all_validations;
}
function set_addnl_vfunction(functionname)
{
  this.formobj.addnlvalidation = functionname;
}
function clear_all_validations()
{
	for(var itr=0;itr < this.formobj.elements.length;itr++)
	{
		this.formobj.elements[itr].validationset = null;
	}
}
function form_submit_handler()
{
	for(var itr=0;itr < this.elements.length;itr++)
	{
		if(this.elements[itr].validationset &&
	   !this.elements[itr].validationset.validate())
		{
		  return false;
		}
	}
	if(this.addnlvalidation)
	{
	  str =" var ret = "+this.addnlvalidation+"()";
	  eval(str);
    if(!ret) return ret;
	}
	return true;
}
function add_validation(itemname,descriptor,errstr)
{
  if(!this.formobj)
	{
	  alert("BUG: the form object is not set properly");
		return;
	}//if
	var itemobj = this.formobj[itemname];
  if(!itemobj)
	{
	  alert("BUG: Couldnot get the input object named: "+itemname);
		return;
	}
	if(!itemobj.validationset)
	{
	  itemobj.validationset = new ValidationSet(itemobj);
	}
  itemobj.validationset.add(descriptor,errstr);
}
function ValidationDesc(inputitem,desc,error)
{
  this.desc=desc;
	this.error=error;
	this.itemobj = inputitem;
	this.validate=vdesc_validate;
}
function vdesc_validate()
{
 if(!V2validateData(this.desc,this.itemobj,this.error))
 {
    this.itemobj.focus();
		return false;
 }
 return true;
}
function ValidationSet(inputitem)
{
    this.vSet=new Array();
	this.add= add_validationdesc;
	this.validate= vset_validate;
	this.itemobj = inputitem;
}
function add_validationdesc(desc,error)
{
  this.vSet[this.vSet.length]= 
	  new ValidationDesc(this.itemobj,desc,error);
}
function vset_validate()
{
   for(var itr=0;itr<this.vSet.length;itr++)
	 {
	   if(!this.vSet[itr].validate())
		 {
		   return false;
		 }
	 }
	 return true;
}
function validateEmailv2(email)
{
// a very simple email validation checking. 
// you can add more complex email checking if it helps 
    if(email.length <= 0)
	{
	  return true;
	}
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    {
      var regexp_user=/^\"?[\w-_\.]*\"?$/;
      if(splitted[1].match(regexp_user) == null) return false;
    }
    if(splitted[2] != null)
    {
      var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
      if(splitted[2].match(regexp_domain) == null) 
      {
	    var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
	    if(splitted[2].match(regexp_ip) == null) return false;
      }// if
      return true;
    }
return false;
}
function V2validateData(strValidateStr,objValue,strError) 
{ 
    var epos = strValidateStr.search("="); 
    var  command  = ""; 
    var  cmdvalue = ""; 
    if(epos >= 0) 
    { 
     command  = strValidateStr.substring(0,epos); 
     cmdvalue = strValidateStr.substr(epos+1); 
    } 
    else 
    { 
     command = strValidateStr; 
    } 
    switch(command) 
    { 
        case "req": 
        case "required": 
         { 
           if(eval(objValue.value.length) == 0) 
           { 
              if(!strError || strError.length ==0) 
              { 
                strError = objValue.name + " : Required Field"; 
              }//if 
              alert(strError); 
              return false; 
           }//if 
           break;             
         }//case required 
        case "maxlength": 
        case "maxlen": 
          { 
             if(eval(objValue.value.length) >  eval(cmdvalue)) 
             { 
               if(!strError || strError.length ==0) 
               { 
                 strError = objValue.name + " : "+cmdvalue+" characters maximum "; 
               }//if 
               alert(strError + "\n[Current length = " + objValue.value.length + " ]"); 
               return false; 
             }//if 
             break; 
          }//case maxlen 
        case "minlength": 
        case "minlen": 
           { 
             if(eval(objValue.value.length) <  eval(cmdvalue)) 
             { 
               if(!strError || strError.length ==0) 
               { 
                 strError = objValue.name + " : " + cmdvalue + " characters minimum  "; 
               }//if               
               alert(strError + "\n[Current length = " + objValue.value.length + " ]"); 
               return false;                 
             }//if 
             break; 
            }//case minlen 
        case "alnum": 
        case "alphanumeric": 
           { 
              var charpos = objValue.value.search("[^A-Za-z0-9]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
               if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name+": Only alpha-numeric characters allowed "; 
                }//if 
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//case alphanumeric 
        case "num": 
        case "numeric": 
           { 
              var charpos = objValue.value.search("[^0-9]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name+": Only digits allowed "; 
                }//if  
                alert(strError);              
                //--alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break;               
           }//numeric 
        case "alphabetic": 
        case "alpha": 
           { 
              var charpos = objValue.value.search("[^A-Za-z]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name+": Only alphabetic characters allowed "; 
                }//if                             
                //--alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//alpha 
		case "alnumhyphen":
			{
              var charpos = objValue.value.search("[^A-Za-z0-9\-_.]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name+": characters allowed are A-Z,a-z,0-9,- and _"; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 			
			break;
			}
			case "alnumhy":
			{
              var charpos = objValue.value.search("[^0-9\-_.]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name+": characters allowed are 0-9,.,- and _"; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 			
			break;
			}
		
			
			
        case "email": 
          { 
               if(!validateEmailv2(objValue.value)) 
               { 
                 if(!strError || strError.length ==0) 
                 { 
                    strError = objValue.name+": Enter a valid Email address "; 
                 }//if                                               
                 alert(strError); 
                 return false; 
               }//if 
           break; 
          }//case email 
        case "lt": 
        case "lessthan": 
         { 
            if(isNaN(objValue.value)) 
            { 
              alert(objValue.name+": Should be a number "); 
              return false; 
            }//if 
            if(eval(objValue.value) >=  eval(cmdvalue)) 
            { 
              if(!strError || strError.length ==0) 
              { 
                strError = objValue.name + " : value should be less than "+ cmdvalue; 
              }//if               
              alert(strError); 
              return false;                 
             }//if             
            break; 
         }//case lessthan 
        case "gt": 
        case "greaterthan": 
         { 
            if(isNaN(objValue.value)) 
            { 
              alert(objValue.name+": Should be a number "); 
              return false; 
            }//if 
             if(eval(objValue.value) <=  eval(cmdvalue)) 
             { 
               if(!strError || strError.length ==0) 
               { 
                 strError = objValue.name + " : value should be greater than "+ cmdvalue; 
               }//if               
               alert(strError); 
               return false;                 
             }//if             
            break; 
         }//case greaterthan 
        case "regexp": 
         { 
		 	if(objValue.value.length > 0)
			{
	            if(!objValue.value.match(cmdvalue)) 
	            { 
	              if(!strError || strError.length ==0) 
	              { 
	                strError = objValue.name+": Invalid characters found "; 
	              }//if                                                               
	              alert(strError); 
	              return false;                   
	            }//if 
			}
           break; 
         }//case regexp 
        case "dontselect": 
         { 
            if(objValue.selectedIndex == null) 
            { 
              alert("BUG: dontselect command for non-select Item"); 
              return false; 
            } 
            if(objValue.selectedIndex == eval(cmdvalue)) 
            { 
             if(!strError || strError.length ==0) 
              { 
              strError = objValue.name+": Please Select one option "; 
              }//if                                                               
              alert(strError); 
              return false;                                   
             } 
             break; 
         }//case dontselect 
         
       
          case "pass_edit": 
         {  
 						
 				 if(document.frmUsersEdit.txtpwd.value != document.frmUsersEdit.txtcpwd.value)
  						{
    						alert('The Password and verified password does not match!');
    							return false;
  						}
  			else
  				{
    				return true;
  				}
        }
        
          case "pass_add": 
         { 
         	 						
 				 if(document.frmUsersAdd.txtpwd.value != document.frmUsersAdd.txtcpwd.value)
  						{
    						alert('The Password and verified password does not match!');
    							return false;
  						}
  			else
  				{
    				return true;
  				}
        }
          
    }//switch 
    return true; 
}
