// Javascript functions file
        function changeBgColor(button, theColor) { 
            if (document.images) { 
                document.all.item(button).color = theColor;
            }
        }


        function addEntry(name, title, url, image, tip, yyyy, mm, dd){
            document.write("<tr width='150'><td align=center>");
            document.write("<div title='"+tip+"'>");
            if(thispage != name){
                document.write("<a href='"+jhomesite+url+"' target='_top' onMouseout=");
                document.write('"changeBgColor(');
                document.write("'"+name+"',");
                document.write("'#ff6666')");
                document.write('" onMouseover=');
                document.write('"changeBgColor(');
                document.write("'"+name+"',");
                document.write("'#ff0000')");
                document.write('">');
            }
            document.write("<font id='"+name+"' class='currentPage'>"+title+"</font>");
            if(thispage != name){
                document.write("</a>");
            }
            document.write("<br>");
            newCheck(yyyy,mm,dd)
            document.write("</div>");
            document.writeln("</td><td align=center>");
            if(thispage != name){
                document.write("<a href='"+jhomesite+url+"' target='_top'>");
            }
            document.write('<img onMouseout=');
            document.write('"changeBgColor(');
            document.write("'"+name+"',");
            document.write("'#ff6666')");
            document.write('" onMouseover=');
            document.write('"changeBgColor(');
            document.write("'"+name+"',");
            document.write("'#ff0000')");
            document.write('"');
            document.write(" src='"+image+"' alt='"+tip+"' border=0>");
            if(thispage != name){
                document.write("</a>");
            }
            document.writeln("</td></tr>");
        }

        function cookieVal(cookieName){
            thisCookie = document.cookie.split("; ")
            for (i=0; i<thisCookie.length; i++){
                if(cookieName == thisCookie[i].split("=")[0]){
                    return thisCookie[i].split("=")[1];
                }
            }
            return "1 January 1970"
        }
        
        function newCheck(yyyy,mm,dd){
            lastChgd = new Date(yyyy,mm-1,dd);
            
            if(lastChgd.getTime() > lastVisit.getTime()){
                document.write("<IMG SRC='Images/01_02_T.gif' WIDTH=35 HEIGHT=10 ALT='new'>");
            }
        }
        
Xoffset=-60;    // modify these values to ...
Yoffset= 20;    // change the popup position.


var nav,old,iex=(document.all),yyy=-1000;
if(navigator.appName=="Netscape"){(document.layers)?nav=true:old=true;}

var the_timeout = null;
var bVisible = false;
if(!old){
//	var skn=(nav)?document.UK_intranet_tooltip:UK_intranet_tooltip.style;
}


function showtip(current,e,text){
	

	if (bVisible) {
		kill();
	}

	if (the_timeout==null) {
		var xpos = window.event.x; // - */window.event.offsetX; // + */document.body.scrollLeft; //- window.event.offsetX;
		var ypos = window.event.y; // +document.body.scrollTop; 
		the_timeout = setTimeout("showWindow(\"" + text + "\",\"" + xpos + "\",\"" + ypos + "\");",1000);
	}
	else {
		clearTimeout(the_timeout);
		the_timeout = setTimeout("showWindow(\"" + text + "\",\"" + xpos + "\",\"" + ypos + "\");",1000);
	}
}


function hidetip(){
	
	clearTimeout(the_timeout);
	if(!old){yyy=-1000;skn.visibility="hidden";}
	
	the_timeout = null;
	bVisible = false;

}

function showWindow(msg, x, y) {
	var content="<TABLE WIDTH=180 BORDER=0 CELLSPACING=0 CELLPADDING=1><TR BGCOLOR=#000000><TD><TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=3><TR BGCOLOR=#CCCCCC><TD><font size='-1'><SPAN CLASS=copy>" + msg + "</span></font></TD></TR></TABLE></TD></TR></TABLE>";
	
	if(old){alert(msg);return;} 
	else{yyy=Yoffset;
	 if(nav){skn.document.write(content);skn.document.close();skn.visibility="visible"}
	 if(iex) {
	 	document.all("UK_intranet_tooltip").innerHTML=content;


		var TipRect = document.all("UK_intranet_tooltip").getBoundingClientRect()
		var TipHeight = TipRect.bottom - TipRect.top
		
		skn.visibility="visible"
		
		// Decide whether the tool tip should be displayed
		// above or below the mouse pointer
		if ((parseInt(y) + parseInt(TipHeight) + 20) < document.body.clientHeight) {
			// place tool tip below mouse pointer	
			skn.left= parseInt(x) +  parseInt(document.body.scrollLeft) + 10; 
			skn.top = parseInt(y) + document.body.scrollTop + 20;
		}
		else {
			// place tool tip above mouse pointer
			skn.left= parseInt(x) + parseInt(document.body.scrollLeft) + 10; 
			skn.top = parseInt(y) + document.body.scrollTop - TipHeight - 20;
		}		
		
	 }
	}
	 the_timeout = null;
	bVisible = true;
}


