﻿function gID(id)
{
	return document.getElementById(id);
}

function taggleModule(node)
{
	do node = node.nextSibling;
	while(node != null && node.nodeName != "DIV");
	with(node)
	style.display = (style.display == "")? "none" : "";
}

function taggleTab(link)
{
	if(link.className == "tabLinkVisited")
		return;

	var node = link;
	do node = node.parentNode;
	while(node != null && node.nodeName != "TABLE")
	for(var i = 0; i < node.rows[0].cells.length; i++)
	{
		var n = node.rows[0].cells[i].firstChild;
		while(n != null && n.nodeName != "A")
			n = n.nextSibling;
		n.className = "tabLink";
	}
	link.className = "tabLinkVisited";	
}

String.isEmpty = function(str)
{
	if(str == null || str == "")
		return true;
	return false;
}

function showModalWindow(url, width, height)
{
	if(window.showModalDialog)
	{
		window.showModalDialog(url +"&_tick=" + new Date().getTime(), null, 'dialogWidth=' + width + 'px;dialogHeight=' + height + 'px');
	}
	else
	{
		window.open(url, '', 'width=' + width +',height=' + height + ',modal=yes,status=yes');
	}
}

function showControlPanel(url)
{
	var frameUrl = webUrl + "/defaultFrame.aspx?target=" + url;
	showModalWindow(frameUrl, 760, 500);
	//window.open(url, '', 'width=760,height=500,scrollbars=yes, status=yes, top=' + (screen.height - 500) / 2 + ',left=' + (screen.width - 760) / 2);
	//window.showModalDialog(url, null,'dialogWidth=760px;dialogHeight=500px');
}