function show(id) {
	document.getElementById(id).style.visibility = "visible";
}

function hide(id) {
	document.getElementById(id).style.visibility = "hidden";
}

function setLyr(obj,lyr)
{
	var newX = findPosX(obj);
	var newY = findPosY(obj);
	newY += 27;
	newX += 15;
	var x = new getObj(lyr);
	x.style.top = newY + 'px';
	x.style.left = newX + 'px';
}
function setLyrh(obj,lyr)
{
	var newX = findPosX(obj);
	var newY = findPosY(obj);
	newY += 27;
	newX += 20;
	var x = new getObj(lyr);
	x.style.top = newY + 'px';
	x.style.left = newX + 'px';
}

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;
}

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;
        return curtop;
} 

function getObj(name)
{
	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
}

function scrollWin() {
	obj = document.getElementById("tabs");
	y = findPosY(obj);
	window.scroll(0, y); 
}

if (screen) {
	leftPos = (screen.width/2)-320
	topPos = (screen.height/2)-240
}

function popFlash() {
	if (screen) {
		leftPos = (screen.width/2)-320;
		topPos = (screen.height/2)-240;
	}
	window.open('/demo/' , 'OpSource On-Demand Demo' , 'width=791,height=597,toolbar=no,scrollbars=no,location=no,resize=yes,left='+leftPos+',top='+topPos+'');
}


// This function shows/hides the side nav items list
function toggleItem(id,name,loc) {
	if(document.getElementById) {
		var el = document.getElementById(id);
		if( el.style.display == "none" || el.style.display == "") {
			document.location=loc;
			//el.style.display = "inline";
			//document[name].src="images/arrow_down.gif";
		} else {
			el.style.display = "none";
			document[name].src="images/arrow_right.gif";
		}
	}
}

