function centerWindow(w,h){
        x1 = document.body.clientWidth;
        y1 = document.body.clientHeight;
        x2 = w;
        y2 = h;
        scTop = document.body.scrollTop;
        xx = Math.ceil((x1/2)-(x2/2));
        yy = Math.ceil((y1/2)-(y2/2))+scTop;
        //reviewWind.left = xx;
        //reviewWind.left = yy;
        return;
    }
    
    function  openWind(u,w,h){
    	reviewWind = window.open(u, 'reviewCard', 'toolbar=false, status=false, menubar=false, scrollbars=false, width='+w+', height='+h);
        centerWindow(w,h);
        reviewWind.moveBy(xx,yy);
    }
    
    function doSomething(e){
        
            if (!e){
                var e = window.event;
                e.cancelBubble = true;
            }
            if (e.stopPropagation) e.stopPropagation();
       
    }
   
    function checkSize2(){
		picWH[0] = Img.clientWidth;
		picWH[1] = Img.clientHeight;
		
		if (picWH[0] < 40 || picWH[1] < 40){
			setTimeout('checkSize2()', 100);
		} else {
            return picWH;
		}
	}
    
	function hidePic(){
		Img = document.getElementById('personnelPic');
		Lyr = document.getElementById('personnelLyr');
		Img.style.visibility = "hidden";
		Img.src = "";
		Lyr.style.visibility = "hidden";
		
		document.getElementById('L').style.height = 1;
		cells = n.parentNode.children;
		for(i=0;i<cells.length;i++){
			cells[i].className='altBG1';
		}
	}
    
    function coverPage(){
        c = document.getElementById('CoverLayer');
        tbl = document.body;
        if(c.style.display == "none"){
            c.style.display = "block";
            c.style.width = tbl.offsetWidth;
            c.style.height = tbl.offsetHeight;
        }else{
            c.style.display = "none";
        }
        //return;
    }
    
     function showPic2(p){ //alert(p);
		picWH = new Array();
        picWH[0] = 0;
        picWH[1] = 0;
        coverPage();
        Lyr = document.getElementById('PicLayer');
        Img = document.getElementById('PicImg');
        if(Lyr.style.display == "none"){
            Img.src = "";
            Lyr.style.display = "block";
    		Img.src = p;
            checkSize2();
    //alert(picWH.toString());
            document.getElementById('PicL').height = parseInt(picWH[1])-3;
    		centerWindow(picWH[0],picWH[1]);
            Lyr.style.top = yy+"px";
            Lyr.style.left = xx+"px";
            //Lyr.scrollIntoView();
        }else{
            Lyr.style.display = "none";
        }
        //return;
	}
    
    function listMO(ph,co){
        document.getElementById('cellContA'+ph).className=co;
        document.getElementById('cellContB'+ph).className=co;
    }
    

		function showPrefs(){
			p = document.getElementById('lyrPrefs');
			if(p.style.visibility == "hidden"){
				p.style.visibility = "visible";
			}else{
				p.style.visibility = "hidden";
			}
		}
		
		function setCookie(name, value){
	         //If name is the empty string, it places a ; at the beginning of document.cookie, causing clearCookies() to malfunction.
	         if(name != '')
	            document.cookie = name + '=' + value;
		}
	
		function getCookie(name){
	         //Without this, it will return the first value in document.cookie when name is the empty string.
	         if(name == '')
	            return('');
	         
	         name_index = document.cookie.indexOf(name + '=');
	         
	         if(name_index == -1)
	            return('');
	         
	         cookie_value =  document.cookie.substr(name_index + name.length + 1, 
	                                                document.cookie.length);
	         
	         //All cookie name-value pairs end with a semi-colon, except the last one.
	         end_of_cookie = cookie_value.indexOf(';');
	         if(end_of_cookie != -1)
	            cookie_value = cookie_value.substr(0, end_of_cookie);
	
	         //Restores all the blank spaces.
	         space = cookie_value.indexOf('+');
	         while(space != -1){ 
	              cookie_value = cookie_value.substr(0, space) + ' ' + 
	              cookie_value.substr(space + 1, cookie_value.length);
								 
	              space = cookie_value.indexOf('+');
	           }
	
	         return(cookie_value);
		}
		
		function clearCookie(name){                  
	         expires = new Date();
	         expires.setYear(expires.getYear() - 1);
	
	         document.cookie = name + '=null' + '; expires=' + expires; 		 
	         }
	         
		function clearCookies(){
	         Cookies = document.cookie;
	         Cookie = Cookies;
	         expires = new Date();
	         expires.setYear(expires.getYear() - 1);
	
	         while(Cookie.length > 0){
	              //All cookie name-value pairs end with a semi-colon, except the last one.
	              Cookie = Cookies.substr(0, Cookies.indexOf(';'));
	              Cookies = Cookies.substr(Cookies.indexOf(';') + 1, Cookies.length);
	
	              if(Cookie != '')
	                 document.cookie = Cookie + '; expires=' + expires;
	              else
	                 document.cookie = Cookies + '; expires=' + expires;			  			  	  
	         }
		}
        function addListener(element, type, expression, bubbling){
            bubbling = bubbling || false;
            if(window.addEventListener)	{ // Standard
                element.addEventListener(type, expression, bubbling);
                return true;
            } else if(window.attachEvent) { // IE
                element.attachEvent('on' + type, expression);
                return true;
            } else return false;
        }
