

  var checkflag = "false";
  function check(field) {
	if (checkflag == "false") {
		for (i = 0; i < field.length; i++) {
			field[i].checked = true;
		}
		checkflag = "true";
		//setAmp();
		return "Uncheck All";
	 }else {
		for (i = 0; i < field.length; i++) {
			field[i].checked = false;
	 	}
		checkflag = "false";
		//setAmp();
		return "Check All";
	 }
  }
  /*function setAmp(){
	if (checkflag == "true") {
		document.userInfoForm.amp.value="SELECTALL";
	 }else {
		document.userInfoForm.amp.value="";
	 }

  }*/
  function checkTheBox(name,vals){
    //alert(vals.length);
    //alert(name.length);
    for(k=0; k<name.length; k++){
	for(i=1; i<vals.length; i++){
	//alert(vals[i] + ", " + name[k].value);
  		if(vals[i] == name[k].value){
   			name[k].checked = true;
  		}
 	}
    }
  }
  function unCheckTheBox(name,vals){
    //alert(vals.length);
    //alert(name.length);
    for(k=0; k<name.length; k++){
	for(i=0; i<=vals.length; i++){
  		if(vals[i] == name[k].value){
   			name[k].checked = false;
  		}
 	}
    }
  }
  function setSelectAllFlag(){
    document.userInfoForm.selectall=1;
  }
  function inb_openWin(Url,Name,Width,Height,Scrollbars)  {
    var features = 'status=no,scrollbars=' + Scrollbars + ',width=' + Width + ',height=' + Height;
    window.open(Url, Name, features );
  }

  function isArray(obj){return(typeof(obj.length)=="undefined")?false:true;}

  function check_field(field,regEx,message){
	
      var x=field.value;
      var reg=new RegExp(regEx);
      if(reg.test(x)){
          result=true;
      }else{
          alert(message);
          result=false;
      }
      return(result);
  }


   	
   function checkUnamePasswd(form){   
		
          if(form.username.value=="" || form.password.value==""){
	     alert("Please enter Username and Password");
             return false;
          }
          return true;
   }