function toggleDiv (id)
{
	if (obj=document.getElementById(id)) {	// DOM3 = IE5, NS6
		if (obj.style.visibility == 'hidden') {
			obj.style.visibility = 'visible';
			obj.style.position = 'relative';
		} else {
			obj.style.visibility = 'hidden';
			obj.style.position = 'absolute';
		}
	} else {
		if (document.layers) {	// NS4
			if (document.id.visibility == 'hidden') {
				document.id.visibility = 'visible';
				document.id.position = 'relative';
			} else {
				document.id.visibility = 'hidden';
				document.id.position = 'absolute';
			}
		} else {				// IE4
			if (document.all.id.style.visibility == 'hidden') {
				document.all.id.style.visibility = 'visible';
				document.all.id.style.position = 'relative';
			} else {
				document.all.id.style.visibility = 'hidden';
				document.all.id.style.position = 'absolute';
			}
		}
	}
}

function Is() {
 var agent = navigator.userAgent.toLowerCase();
 this.major = parseInt(navigator.appVersion);
 this.minor = parseFloat(navigator.appVersion);
 this.ns = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
 this.ns2 = (this.ns && (this.major == 2));
 this.ns3 = (this.ns && (this.major == 3));
 this.ns4 = (this.ns && (this.major == 4));
 this.ns5 = (this.ns && (this.major > 4));
 this.ns6 = (this.ns && (agent.indexOf('netscape6')!=-1) );
 this.ns7 = (this.ns && (agent.indexOf('netscape/7')!=-1) );
 this.ns7pr = (this.ns && (agent.indexOf('netscape/7.0b1')!=-1) );
 this.ns71 = (this.ns && (agent.indexOf('netscape/7.1')!=-1) );
 this.ns72 = (this.ns && (agent.indexOf('netscape/7.2')!=-1) );
 this.ie = (agent.indexOf("msie") != -1);
 this.ie3 = (this.ie && (this.major == 2));
 this.ie4 = (this.ie && (this.major >= 4));
 this.ie5 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") != -1));
 this.ie55 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.5") != -1));
 this.ie6 = (this.ie && (agent.indexOf("msie 6.0")!=-1));
 this.op3 = (agent.indexOf("opera") != -1);
 this.pc  = (agent.indexOf("win") != -1);
 this.mac = (agent.indexOf("mac")!=-1); // Mac detect
 this.client = ( (navigator.userAgent.indexOf('AOL')!=-1) || (navigator.userAgent.indexOf('CS 2000')!=-1) )? 1 : 0;
 this.moz = ( this.ns && (agent.indexOf("netscape/") == -1) );
 if (this.moz) this.ns = 0;
}

var is = new Is();

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft -1 ;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
    if (is.ie)
    	return curtop+25;
    else if (is.op3)
        return curtop+25;
    else
        return curtop+25;
}
