function alternate(id){
	if(document.getElementsByTagName){  
   		var table = document.getElementById(id);  
   		var rows = table.getElementsByTagName("tr");  
   		for(i = 0; i < rows.length; i++){          
 			if(i % 2 == 0){
       			rows[i].className = "even";
     		} else{
       			rows[i].className = "odd";
     		}      
   		}
 	}
}

function txtCt( field, maxlimit) {
  if ( field != null && field.value.length > maxlimit )
  {
    field.value = field.value.substring( 0, maxlimit );
    alert('Textarea max length can only be '+maxlimit );
    return false;
  }
  else
  {
    return true;
  }
}


function validate(maxLen) {
  	var x = window.document.getElementsByTagName('textarea');
  	alert("x="+x);
  	if (x != null) {
  		for (var i=0;i<x.length;i++) {
  	  		alert('x['+i+']='+x[i].name);
  	  		if (!txtCt(x[i].name, maxLen)) {
  	  			alert("false");
    			return false;
  			}
  		}
  	}
}
