/* This Code Free To Use As Long As These Lines Remain */
/* DOM Image Rollover Code */
/* Created by Chris Poole <http://www.chrispoole.com> */
/* Featured at <http://www.DesignerWiz.com> */
/* Development Resource & JavaScript Public Archive Center */
function init() {

    if (!document.getElementById) return
	var imgOriginSrc;
	var imgTemp = new Array();
	var imgarr = document.getElementsByTagName('img');
	for (var i = 0; i < imgarr.length; i++) {
	if (imgarr[i].getAttribute('hsrc') || imgarr[i].getAttribute('tip')) {
		imgTemp[i] = new Image();
		//imgTemp[i].src = imgarr[i].getAttribute('hsrc');

		imgarr[i].onmouseover = function() {

    if (this.getAttribute('hsrc'))
    {
        imgOriginSrc = this.getAttribute('src');
        this.setAttribute('src',this.getAttribute('hsrc'));
    }
    var tiptext = this.getAttribute("tip");
    if (tiptext) {
	var tipdiv = document.getElementById("tooltip");
	tipdiv.style.left= getAbsX(this) + (this.width) - 150 + "px";
	tipdiv.style.top= getAbsY(this) + 100 + "px";
	tipdiv.innerHTML=tiptext;
	tipdiv.style.visibility="visible";
   }
}
	imgarr[i].onmouseout = function() {
    if (this.getAttribute('hsrc'))
    {
	this.setAttribute('src',imgOriginSrc);
    }
    if (this.getAttribute("tip"))
    {
        var tipdiv = document.getElementById("tooltip");
        tipdiv.innerHTML="";
        tipdiv.style.visibility="hidden";
    }		
}
}
}
}
onload=init;

var popups = new Array();

function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); }
function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); }
function getAbsPos(elt,which) {
 iPos = 0;
 while (elt != null) {
  iPos += elt["offset" + which];
  elt = elt.offsetParent;
 }
 return iPos;
}
var detect = navigator.appName.toLowerCase();
function checkIt(string)
{
        place = detect.indexOf(string) + 1;
        thestring = string;
        return place;
}
function nscheck()
{
    if (checkIt('netscape'))
    {
          var im = document.getElementById("imagearea");
          if (im) {
          	var num = parseInt(im.style.left, 10);
          	im.style.left = 206;
          }
	  // alert(num);
    }
}
function docheck()
{
	nscheck();
	init();
}

function popup(event, hoverelement, elementname) { 
//	L = getAbsX(hoverelement);
//	T = getAbsY(hoverelement);

	var obj = document.getElementById(elementname)
    var posx,posy;
	posx=000;
	posy=000;
   
    unpop(null);
   	popups[popups.length] = obj;
   	
	if (!event) { var evwnt=window.event; }
	if(event.pageX||event.pageY){
          posx=event.pageX;
          posy=event.pageY;
	} else if(event.clientX||event.clientY){
          posx = event.clientX + document.documentElement.scrollLeft;
          posy = event.clientY + document.documentElement.scrollTop;
        }

	with( obj.style ) {
		//alert("Popping up " + elementname);
		
		visibility = "visible";
		position = "absolute";
		zindex = 100;
		left = posx-40;
		top = posy-10; 
	}


	obj.onmouseout=function (event) { unpop(event,obj); }
	stopEvents(event);
}

function unpop( event,obj ) {
    
    var i=0;
    var mytarget=null;
    var stop=popups.length;
    if (event != null)
    {
    	mytarget = event.target;
    }
    if (mytarget == obj)
    {
    	var len = popups.length -1;
	    while(len >= 0)
    	{
    		var obj2 = popups[len];
    	 	obj2.style.visibility = "hidden"; 
    	 	len--;

    	}
    }
    //obj.style.visibility = "hidden"; 
}

function stopEvents(e)
{
	if (!e) var e = window.event;
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
}