function allowText(e,num,alpha,spl){
	var keynum;
	var keychar;
	var numcheck;  
	if(window.event){ //IE
		keynum = e.keyCode;  
	}else if(e.which){
		keynum = e.which;
  	}
  	//alert(keynum);
  	keychar = String.fromCharCode(keynum);
  	//alert(keychar);
  	if(keynum == 8){
  		return true;
  	}  
  	if(keychar >= '0' && keychar <= '9'){
		if( num==true ) 
			return true;      
		else 
			return false;
	}else if((keychar >= "a" && keychar <= "z") || (keychar >= "A" && keychar <= "Z") ){
		if( alpha==true )
			return true;
		else
			return false;     
			}
	else{
		if( spl==true )
			return true;
  		else
   			return false;  
	}
}


function loadmenu() {
  var navRoot = document.getElementById("menu");
  for (var i=0; i<navRoot.childNodes.length; i++) {
   		var node = navRoot.childNodes[i];
   		if (node.nodeName=="LI" && node.id=="childmenu" && navigator.appName == "Microsoft Internet Explorer") {
		   node.onmouseover=function() {
			    this.className+="over";
			    this.style.color = '#ffffff';
				this.style.backgroundColor = '#5b675d';
     		}
     		node.onmouseout=function() {
      			this.className=this.className.replace("over", "");
      			this.style.color = '#000000';
				this.style.backgroundColor = '';
      		}
      }
      if(node.childNodes.length>0){
       		for (var j=0; j<node.childNodes.length; j++) {
        		var childnode = node.childNodes[j];
        		if(childnode.nodeName=="UL"){
         		if(navigator.appName == "Microsoft Internet Explorer"){
          			childnode.style.marginLeft=-1*node.offsetWidth+13+'px';
         		}else{
         			// childnode.style.marginLeft=node.offsetLeft+'px';
         		}
         		for (var k=0; k<childnode.childNodes.length; k++) {
       				var childnodeli = childnode.childNodes[k];
					if(childnodeli.nodeName == "LI" && childnodeli.id=="subUL"){
  							for (var l=0; l<childnodeli.childNodes.length; l++) {
       							var childnodel = childnodeli.childNodes[l];
       							if (childnodel.nodeName=="UL" ) {
									childnodel.style.display='none';
								}
								for (var m=0; m<childnodel.childNodes.length; m++) {
       									var childnodelli = childnodel.childNodes[m];
										if(childnodelli.nodeName == "LI"){
											childnodelli.onmouseover=function() {
												this.style.color = '#ffffff';
												this.style.backgroundColor = 'green';
											}
											childnodelli.onmouseout=function() {
												this.style.color = '#000000';
											   this.style.backgroundColor = '';
											}
										}
								}
							}
					}
       				if (childnodeli.nodeName=="LI"  ) {
					   childnodeli.onmouseover=function() {
         					this.className+="overli";
							this.style.color = '#ffffff';
							this.style.backgroundColor = 'green';
							if(this.nodeName == "LI" && this.id=="subUL"){
  								for (var l=0; l<this.childNodes.length; l++) {
       								var childnodel = this.childNodes[l];
       								if (childnodel.nodeName=="UL" ) {
										childnodel.style.display='';
										if(navigator.appName == "Microsoft Internet Explorer"){
//          									childnodel.style.marginLeft=-1*this.offsetWidth+0+'px';
          									childnodel.style.marginLeft=0;
//											childnodel.style.marginTop=-1*this.offsetWidth-1+'px';
         								}else{
         									// childnode.style.marginLeft=node.offsetLeft+'px';
         								}

									}
								}
							}
          				}
          				childnodeli.onmouseout=function() {
					         this.className=this.className.replace("overli", "");
							   this.style.color = '#000000';
							   this.style.backgroundColor = '';
							   if(this.nodeName == "LI" && this.id=="subUL"){
  								for (var l=0; l<this.childNodes.length; l++) {
       								var childnodel = this.childNodes[l];
       								if (childnodel.nodeName=="UL" ) {
										childnodel.style.display='none';

									}
								}
							}
				          }
         			}
        		}
       		}
      	}
      }
    }
}
