
var req=new Array();
var The_ID=new Array();

url=window.location+'';
siteName=url.split('/');
siteName=siteName[3];

///////////////////////////////////////////////////////////////////////////////////////////////////

first = 0;
current = 0;
i=0;





function displayDivs(numDiv)

	{
		last=numDiv;
		
		
/*	setTimeout ("for(i=0;i<="+numDiv+";i++){ for(j=0;j<="+numDiv+";j++){ if(j==i) {  document.getElementById('div_'+i).style.display='';} else   document.getElementById('div_'+j).style.display='none';}}",5000);
	*/
	
	
	
	//setInterval("document.getElementById('div_"+i+"').style.display=''; i++; ",5000);
	
	setInterval("nextPicture()",10000);
	
	
	/*for(i=0;i<=numDiv;)
	{
	for(j=0;j<=numDiv;){ 
	if(j==i) {
		
		setTimeout('document.getElementById("div_'+i+'").style.display=""',5000);
		}
		else 
		setTimeout('document.getElementById("div_'+j+'").style.display="none"',5000);
	
	
	if(j==numDiv && i==numDiv)
	{
	i=0;
	j=0;
	}
	
	i++
	j++;
	
	}}*/
	
	}
	
									           
     function nextPicture() {
         // Hide current picture
         object = document.getElementById('div_' + current);
         object.style.display = 'none';
               
         // Show next picture, if last, loop back to front
         if (current == last) { current = 0; }
         else { current++ }
         object = document.getElementById('div_' + current);
         object.style.display = 'block';
      }




																																							
																																							


function get_id(id){
	
	
    var obj = null;
    if(document.getElementById){
        obj = document.getElementById(id);
    }else if(document.all){
        obj = document.all[id];
    }
    return obj;
}
function check_email(eml) {
  //var eml_filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
  var eml_filter=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/
  if (eml_filter.test(eml))return true;
  else return false;
}
var bad=" <b style='color:#990000'>Invalid</b>";
var good="<b style='color:#666666'>Valid</b>";	
var ctrlPressed=0;
var altPressed=0;
var shiftPressed=0;


function initiate_validation(form_id){	
	var form_here=get_id(form_id);
	for(i=0;i<form_here.elements.length;i++){
		if(form_here.elements[i].getAttribute("authtype"))
		{
			form_here.elements[i].onblur=function(){
				validate_field(this.id,this.getAttribute("authtype"));
			}
		}
	}
}


var validate_sign1=null;
var validate_password1=null;
var validate_rpassword1=null;
var validate_mail1=null;


function validate_field(itemID,check_against,min_size){
	
	var pass;
	if(!min_size)min_size=0;
	var msg="";
	if(get_id(itemID+"_validation"))
	{
		finalID=itemID+"_validation";
	}else{
		var valid=document.createElement("span");
		valid.id=itemID+"_validation";
		if(get_id(itemID).nextSibling){
			get_id(itemID).nextSibling.parentNode.insertBefore(valid,get_id(itemID).nextSibling);
		}else{
			get_id(itemID).parentNode.appendChild(valid);
		}
		finalID=itemID+"_validation";
	}
	switch(check_against){	
	
	case "name":
		if(get_id(itemID).value.length==0){
			msg2="";
			msg=bad+msg2;
			validate_sign1=false;
			validate_sign11=false;
		}else{
			msg=good;
			validate_sign1=true;
			validate_sign11=true;
		}
	break;
	
	case "password":
	
		if(get_id(itemID).value.length<6){
			msg2="";
			msg=bad+msg2;
			validate_password1=false;
			validate_password2=false;
		}
		else{
			msg=good;
			validate_password1=true;
			validate_password2=true;
		}
	break;	

   case "rpassword":
   
   if((get_id(itemID).value.length<6) || (get_id(itemID).value!=get_id('pass_word').value)){
			msg2="";
			msg=bad+msg2;
			validate_rpassword1=false;
			validate_rpassword2=false;
		}
		else{
			
			msg=good;
			validate_rpassword1=true;
			validate_rpassword2=true;
	
	       }
	  
	  break;	


case "email":
		if(check_email(get_id(itemID).value)==false){
			msg2="";
			msg=bad+msg2;
			validate_mail1=false;
			validate_mail2=false;
		}		
		else{
			msg=good;
			validate_mail1=true;
			validate_mail2=true;
		}	

	break;
	case "username":

		if(get_id(itemID).value.length<4){
			msg2="";
			msg=bad+msg2;
			validate_user1=false;
			validate_user2=false;
		}
		else{
			msg=good;
			validate_user1=true;
			validate_user2=true;
		}
	break;
	
	case "not_empty":
		if(get_id(itemID).value.length==0){
			msg2="";
			msg=bad+msg2;
			validate_sign1=false;
		}else{
			msg=good;
			validate_sign1=true;
		}
	break;
	
		
		}
	
	
	
	if(get_id(itemID).getAttribute("required") && 
		get_id(itemID).getAttribute("required")=="false" && get_id(itemID).value==""){

		msg=good;	
	}
	if(get_id(itemID).getAttribute("min_size") &&  get_id(itemID).value.length<get_id(itemID).getAttribute("min_size")){ 
		if(get_id(itemID).getAttribute("required") && 
		get_id(itemID).getAttribute("required")=="false" && get_id(itemID).value==""){
			msg=good;	
		}else{
			msg=bad+msg2;
		}
	}
	if(get_id(itemID).getAttribute("repeat") && get_id(itemID).value!=get_id(get_id(itemID).getAttribute("repeat")).value){
		msg=bad+msg2;	
	}
		get_id(finalID).style.fontSize="9px";
		get_id(finalID).innerHTML=msg;
		get_id(finalID).style.height="auto";
		get_id(finalID).style.fontFamily="Tahoma";	
	if(msg.indexOf(bad)>-1){
		get_id(itemID).style.border='#DD0000 1px solid';
		get_id(itemID).style.background='#FFEEEE';
		return false;
	}
	else{
		get_id(itemID).style.border='#8c8c8c 1px solid';		
		get_id(itemID).style.background='#ececec';
		return true;		
	}

}


function validate_reg_form(){
	
/*	
	if(validate_sign1==null || validate_password1==null || validate_rpassword1==null || validate_mail1==null )
{	

    return false;	
}
	*/

 if (validate_sign1==false || validate_password1==false || validate_rpassword1==false || validate_mail1==false)
	
	{
	return false;
}

else if(get_id('user_name').value.length>2 && get_id('pass_word').value.length>5 && get_id('rpass_word').value.length>5 && get_id('pass_word').value==get_id('rpass_word').value && get_id('lname').value.length>0 && get_id('f_name').value.length>0 && check_email(get_id('mail').value)==true) {
		return true;
	
		}




}



//////////////////////////////////////////////////////////////////////////////////////////////////

function $(id){
	var obj = null; 
	if(document.getElementById){ 
		obj = document.getElementById(id);
	}else if(document.all){ 
		obj = document.all[id]; 
		}
	return obj; 
}
var thespeed=50;


function toggle(OBJECT,img_ID)
{
	if(img_ID && $(img_ID))
	{
		var img_source=$(img_ID).src.toString();
	}
    var obj=$(OBJECT);
    if (obj.style.display=="" || obj.style.display=="block")
	{
		hide_now(OBJECT);
		if(img_ID && $(img_ID))$(img_ID).src=img_source.replace("up","down");
	}else{
		show_now(OBJECT);
		if(img_ID && $(img_ID))$(img_ID).src=img_source.replace("down","up");
	}
}

var z=new Array();
var thespeed=10;
function hide_now(obj_here)
{
	x=$(obj_here);
	ht=x.offsetHeight;
	thespeed=parseInt(parseInt(ht)/10)+1;
	$(obj_here).style.height=parseInt(ht)+"px";
	decrease(obj_here);
}
function show_now(obj_here,extra)
{
	if(!extra)extra=0;
	x=$(obj_here);
	x.style.display="block";	
	x.style.overflow="visible";		
	x.style.height="";
	ht=x.offsetHeight;
	thespeed=parseInt(parseInt(ht)/10)+2;
	x.style.overflow="hidden";
	x.style.height="0px";
	x.style.display="block";	
	increase(ht,obj_here,z.length,extra);
}
function decrease(obj_here,IndexOFz,extraOPTION){
	if(!extraOPTION)extraOPTION=0;
	x.style.overflow='hidden';
	x=$(obj_here);
	ht=x.style.height;
	if (parseInt(ht)>(thespeed-1)) 
	{
		ht=parseInt(ht)-thespeed;
		if(extraOPTION==1){
			x.style.top=(parseInt(x.style.top)+thespeed)+"px";
		}
		x.style.height=parseInt(ht)+"px";
		if(x.style.height=="")x.style.height="0";
		if(!IndexOFz){
			var IndexOFz=z.length;
		}
		z[IndexOFz]=setTimeout("decrease('"+obj_here+"',"+IndexOFz+","+extraOPTION+")",30);
	}
	else {
		x.style.height=0+"px";
		x.style.display="none";
		clearTimeout(z[IndexOFz]);	
	}
}
function increase(hx,obj_here,IndexOFz,extraOPTION){
	IndexOFz=0;
	if(!extraOPTION)extraOPTION=0;
	var x=$(obj_here);
	x.style.overflow='hidden';
	ht=x.style.height;
	x.style.height=(parseInt(x.style.height)+thespeed)+"px";									
	if(parseInt(x.style.height)>0)
	x.style.height="0px";						
	if (parseInt(ht)<(parseInt(hx)-(thespeed-1))) 
	{
		ht=parseInt(ht)+thespeed;
		x.style.height=parseInt(ht)+"px";
		z[IndexOFz]=setTimeout("increase("+hx+",'"+obj_here+"',"+IndexOFz+","+extraOPTION+")",30);
		if(extraOPTION==1){
			x.style.top=(parseInt(x.style.top)-thespeed)+"px";
		}
	}
	else {
		x.style.height="";
		x.style.overflow='visible';
		clearTimeout(z[IndexOFz]);	
		x.style.display='block';
	}
}







function updateBanner(bannerID,url){

			if(url.match('/contact-us/')!= null || url.match('/new_user/')!= null || url.match('/registration/')!=null)
			prefix="../";

			else if(url.match('/categories/')!= null || url.match('/magazine_archive/')!= null)
			prefix="../../";



			else if(url.match('/issues/index.html')!= null || url.match('/articles/')!= null)
			prefix="../../../";



			else if (url.match(siteName+'/index.html')!= null || url==('/'+siteName+'/')  || url.match(siteName+'/index.php')!= null)
			{prefix="";
			}



			else {
			prefix="../";
			}



			sR(prefix+"modules/update_banner.php?id="+bannerID,"","POST","[NULL]");
			
			
			}




function getRate(rank)
{  userID=document.getElementById('rate_form').rate_user_id.value;
    url=location.href;
	data=url.split("/");
	id=data[3];

//id=data[4];

	
	sR("../../../modules/rating_result.php?insert=1&rank="+rank+"&id="+id+"&user_id="+userID,"","POST","nn"); 
	
	}

function sign_in(){
	toggle('rect');
	user_name=document.getElementById("reg_username").value;
	password=document.getElementById("user_password").value;
	url=document.getElementById("root").value;
	url=url+"";
	       
			if (url.match(/index.php/)!= null){
			var name=url.split("index.php");
			prefix=name[0].toString();
			}
			
			else if (url.match(/modules/)!= null){
            var name=url.split("modules");
			prefix=name[0].toString();
				
				
				}
			
			else{
			prefix="";
						}

	sR(prefix+"modules/sign_in.php?name="+user_name+"&password="+password,"","POST","user_div");
	
	}


function add_comment(frmname){
	
	//commentBody=null;
	commentBody=document.getElementById("comment").comment_area.value;
	user_ip= document.getElementById("comment").user_ip.value;
	id=document.getElementById("comment").type_id.value;
	name=document.getElementById("comment").user_name.value;
    user_id=document.getElementById("comment").user_id.value;
     
	
	
	document.getElementById("comments").style.display="block";
	
   sR("../../../modules/add_comment.php?body="+commentBody+"&user_ip="+user_ip+"&user_name="+name+"&id="+id+"&user_id="+user_id,"","GET","comments")

	}




function getobjbyid(id){ // Short Name for "document.getElementById"
    var obj = null;
    if(document.getElementById)obj = document.getElementById(id);
    else if(document.all)obj = document.all[id];
    return obj;
}

function sR(url,params,HttpMethod,anyID)
{
	if (!HttpMethod)HttpMethod="POST";
	req.push(initXMLHTTPRequest());
	The_ID.push(anyID);
	i=parseInt(req.length)-1;
		if (req[i]){
			req[i].open(HttpMethod,url,true);
			req[i].onreadystatechange=onReadyState;
			req[i].setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			req[i].send(params);
		}
}

function initXMLHTTPRequest(){ // Initialize the XML HTTP  Object
	
	var xRequest=null;
	if (window.XMLHttpRequest)xRequest=new XMLHttpRequest();
	else if (window.ActiveXObject)xRequest=new ActiveXObject("Microsoft.XMLHTTP");
	else {	}
	return xRequest;
}


function onReadyState(){

for (i=0;i<req.length;i++)
	{
		if (req[i]) {
			var ready=req[i].readyState;
			var data=null;	
			if (ready==4) {	
				pass_ID=The_ID[i];
				
				data=req[i].responseText;
				
				The_ID.splice(i,1);
				
				req.splice(i,1);		
				
				if(data.indexOf("[MSGBOX]")>-1)alert(data.replace("[MSGBOX]",""));
				
				else if(data.indexOf("[VALIDATE]")>-1) { }// Do Something
				
				else if(data.indexOf("[DISPLAY_ERROR]")>-1){ } // Do Something Else
				
				else if(data.indexOf("[NULL]")>-1){ }// Do Nothing In The Html
				
				else toConsole(data,pass_ID);
			}		
			else {	/* Something Here */	}
		}	
	}
}

function toConsole(data,pass_ID)
{
	
	if (data!=null && getobjbyid(pass_ID)){
		if(getobjbyid(pass_ID))getobjbyid(pass_ID).innerHTML=data;
	}
}


function trim(sString){
	
	while (sString.substring(0,1) == ' '){
		sString = sString.substring(1, sString.length);
	}
	while (sString.substring(sString.length-1, sString.length) == ' '){
		sString = sString.substring(0,sString.length-1);
	}
		return sString;
	}		
/*function car_search(){
	        
			var prefix;
			var url=window.location;
			
			url=url+"";
			
			if (url.match(/categories/)!= null){
			var name=url.split("categories");
			prefix=name[0].toString();
			}
			
			/*else if (url.match(/modules/)!=null){
				
				var name=url.split("modules");
			    prefix=name[0].toString();
					
				}*/
	/*		else
			prefix="";
			
			
			if(trim(document.getElementById("search").value) == ''){	
			document.getElementById("form1").action =prefix+ "car_details.php" ;
		    document.forms["form"].submit();
		}
		else if(document.getElementById('make_id').value=="any" && document.getElementById('model_id').value=="any"){
			document.getElementById("form1").action =prefix+ "car_search.php" ;
			document.forms["form"].submit();
			}
		} 
		*/
	function poll_fn(no){



	url=document.getElementById("poll").url.value+"";


			if(url.match('/contact-us/')!= null || url.match('/new_user/')!= null || url.match('/registration/')!=null)
			prefix="../";

			else if(url.match('/categories/')!= null || url.match('/magazine_archive/')!= null)
			prefix="../../";
			
			
			else if(url.match('/issues/index.html')!= null || url.match('/articles/')!= null)
			prefix="../../../";
			
			
			else if (url.match(siteName+'/index.html')!= null || url==('/'+siteName+'/')  || url.match(siteName+'/index.php')!= null){
			prefix="";
			}
		
			
else {
		prefix="../";
	}




var selected_option = 0;
	var check= false ; 
	userId=document.getElementById("poll").user_id.value; 
	
		if(no==2){
		
			sR(prefix+'modules/poll_result.php','&selected_option='+selected_option+'&user_id='+userId,'POST','poll_result');
			}
	else{
			for(var i=0 ; i<document.getElementById("poll").elements.length;i++){
			if(document.getElementById("poll").elements[i].type=="radio" && document.getElementById("poll").elements[i].checked){
				selected_option = document.getElementById("poll").elements[i].value;
				check = true;
							}
			
		}
		
		

		if(check == true)
		
	       sR(prefix+'modules/poll_result.php','&selected_option='+selected_option+'&user_id='+userId,'POST','poll_result');
		   
	}
	}
	
	
	
	
	function email_validation(){
			var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
			var returnval=emailfilter.test(document.getElementById("email").value)
			if (returnval!=true){
                
				document.getElementById("email_error").innerHTML = "<span>Invalid Email Address.</span>";
				 return false;
			}
		
		
		
		
			
			<!-- contact@mydomain.com  -->
			<!-- jason+lang@gmail.com  -->
			<!-- help@nbc.co.uk  -->
			<!-- mary.k.ashley@celeb.com  -->
			<!-- george@sub.whatever.mydomain.ca  -->
			<!-- edward@42.234.12.345   -->
		}
		
		
		
		
/*		
		
function same(form)
  {
  if(form.pass_word.value==form.rpass_word.value)
  { 
    return true;
  }  
  else 
  alert("password and repeated password are not the same");
  return false;
  
  }
  





function Validator(frmname)
{
	
	
  this.formobj=document.forms[frmname];
	
	if(!this.formobj)
	{
	  alert("BUG: couldnot get Form object "+frmname);
		return;
	}
	
	
	
	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 false;
	}
	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; 
    }
	
	/////////////////////////////////////////////////////////////////////////////////////
	/////////////////////////////////////////////2nd argument//////////////////////////////
    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 "unique": 
         { 
           if(eval(objValue.value.length) == 0) 
           { 
              if(!strError || strError.length ==0) 
              { 
              strError = objValue.name + " : Required Field";  
			  }//if 
              alert(strError); 
              return false; 
           }//if 
		   
		   var aname=objValue.value;

		   
		   
		   
           break;             
         }
		 
		 
		 
		 
		 
		 ////////////////////////////////////////////////////////norhan
		 
		 
		 
		 
        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 + "\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 "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 
    }//switch////////////////////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////////////////////////
    return true; 
}

*/


