		if (document.layers) document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove=hide;
		
		var current_sub='';	
		var current_img='';
		var NS4 = document.all || document.getElementById?false:true;
		var x=0;
		var y=0;
		var img_height=14;

		function hideDivs(sub_menu){
			if(current_sub!='' && current_sub!=sub_menu){
			  if (document.layers){
					document.layers[current_sub].visibility="hide";
				}else if(document.all){ 
					document.all[current_sub].style.visibility = "hidden";		
				}else{ 
					document.getElementById(current_sub).style.visibility = "hidden";
				}
			}			
		}

		function show(imgID,sub_menu){
			hideDivs(sub_menu);
			
			current_sub=sub_menu;
			current_img=imgID;
		
			if (document.all) {
				document.all[sub_menu].style.left=getCoorX(imgID);
				document.all[sub_menu].style.top=getCoorY(imgID)+img_height+2;
				document.all[sub_menu].style.visibility = "visible";				
    	}else if (document.layers) {
		   	document.layers[sub_menu].left=getCoorX(imgID);
				document.layers[sub_menu].top=getCoorY(imgID)+img_height+2;   			
    		document.layers[sub_menu].visibility="show";				
    	}else if (document.getElementById) {
		   	document.getElementById(sub_menu).style.left=getCoorX(imgID);
				document.getElementById(sub_menu).style.top=getCoorY(imgID)+img_height+2;
    		document.getElementById(sub_menu).style.visibility="visible";				
    	}
		}




		function hide(e) {
			if(current_sub!=''){
				var xarea1=getCoorX(current_img);
				var yarea1=getCoorY(current_img)-10;		
				var xmouse;
				var ymouse;	
				var xarea2;
				var yarea2;
						
			  if (document.layers){
					xmouse=e.pageX;
					ymouse=e.pageY;			  
			  	xarea2=xarea1+document.layers[current_sub].clip.width+5;
			  	yarea2=yarea1+document.layers[current_sub].clip.height+32;
			  	
			  	if(!(xmouse>xarea1 && xmouse<xarea2 && ymouse>(yarea1-3) && ymouse<yarea2)){document.layers[current_sub].visibility="hide";}
			  }else if(document.all){ 
					xmouse=event.x;
					ymouse=event.y+document.body.scrollTop;				  
			  	xarea2=xarea1+parseInt(document.all[current_sub].style.width)+5;
			  	yarea2=yarea1+parseInt(document.all[current_sub].style.height)+32;
			  			  
			  	if(!(xmouse>xarea1 && xmouse<xarea2 && ymouse>yarea1 && ymouse<yarea2)){document.all[current_sub].style.visibility = "hidden";}					
				}else{ 
					xmouse=e.pageX;
					ymouse=e.pageY;						
			  	xarea2=xarea1+parseInt(document.getElementById(current_sub).style.width)+5;
			  	yarea2=yarea1+parseInt(document.getElementById(current_sub).style.height)+32;		
			  	
			  	if(!(xmouse>xarea1 && xmouse<xarea2 && ymouse>yarea1 && ymouse<yarea2)){document.getElementById(current_sub).style.visibility = "hidden";}					
				}
			}
		}
	
		function getCoorX(imgID) {
		  if (NS4) return eval(imgID).x
		  else return docjslib_getRealLeft(imgID);
		}
		
		function getCoorY(imgID) {  
		  if (NS4) return eval(imgID).y
		  else return docjslib_getRealTop(imgID);
		}
			
		function moveDivTo(selDiv,x,y){
			if (document.all) {
				document.all[selDiv].style.left=x;
				document.all[selDiv].style.top=y;
				document.all[selDiv].style.visibility="visible";
    	}else if (document.layers) {
		   	document.layers[selDiv].left=x;
				document.layers[selDiv].top=y;
				document.layers[selDiv].visibility="show";
    	}else if (document.getElementById) {
		   	document.getElementById(selDiv).style.left=x;
				document.getElementById(selDiv).style.top=y;
				document.getElementById(selDiv).style.visibility="visible";
    	}
		}				
		
		function docjslib_getRealLeft(imgElem) {
			xPos = eval(imgElem).offsetLeft;
			tempEl = eval(imgElem).offsetParent;
		  	while (tempEl != null) {
		  		xPos += tempEl.offsetLeft;
		  		tempEl = tempEl.offsetParent;
		  	}
			return xPos;
		}
		
		function docjslib_getRealTop(imgElem) {
			yPos = eval(imgElem).offsetTop;
			tempEl = eval(imgElem).offsetParent;
			while (tempEl != null) {
		  		yPos += tempEl.offsetTop;
		  		tempEl = tempEl.offsetParent;
		  	}
			return yPos;
		}
		
		function trim(strText) { 
			// this will get rid of leading spaces 
			while (strText.substring(0,1) == ' ') 
				strText = strText.substring(1, strText.length);
			
			// this will get rid of trailing spaces 
			while (strText.substring(strText.length-1,strText.length) == ' ')
				strText = strText.substring(0, strText.length-1);
			
			return strText;
		}				
		
		function popUp(picPath,picWidth,picHeight){
			var winLeft = screen.availWidth;
			winLeft=(winLeft/2)-(picWidth/2);
			window.open("/pic.asp?picPath=" + picPath,"Informations","width=" + picWidth + ",height=" + picHeight + ",left=" + winLeft + ",top=0,menubar=0,location=0,toolbar=0,personalbar=0,status=0,resizable=1,scrollbars=0");
		}

		String.prototype.right = function (numOf) { 
			var tmp = "";
			for (i=this.length-numOf; i<this.length; i++) {
				tmp += this.charAt(i);
			}
			return tmp;
		};
		
		function validDOC(docSrc){
			var isValid=false;
			docSrc = docSrc.toLowerCase();
		
			for(x=0;x<validExt.length;x++){
				if(docSrc.right(validExt[x].length)==validExt[x]){
					isValid=true;
					break;
				}
			}
			
			return isValid;
		}					