function initTabs()
{
	var sets = document.getElementsByTagName("ul");
	for (var i = 0; i < sets.length; i++)
	{
		if (sets[i].className.indexOf("tabset") != -1)
		{
			var tabs = [];
			var links = sets[i].getElementsByTagName("a");
			for (var j = 0; j < links.length; j++)
			{
				if (links[j].className.indexOf("tab") != -1)
				{
					tabs.push(links[j]);
					links[j].tabs = tabs;
					var c = document.getElementById(links[j].href.substr(links[j].href.indexOf("#") + 1));

					if (c) if (links[j].className.indexOf("active") != -1) c.style.display = "block";
					else c.style.display = "none";

					links[j].onclick = function ()
					{
						var c = document.getElementById(this.href.substr(this.href.indexOf("#") + 1));
						if (c)
						{
							for (var i = 0; i < this.tabs.length; i++)
							{
								var tab = document.getElementById(this.tabs[i].href.substr(this.tabs[i].href.indexOf("#") + 1));
								if (tab)
								{
									tab.style.display = "none";
								}
								this.tabs[i].className = this.tabs[i].className.replace("active", "");
							}
							this.className += " active";
							c.style.display = "block";
							return false;
						}
					}
				}
			}
		}
	}
}
if (window.addEventListener)
	window.addEventListener("load", initTabs, false);
else if (window.attachEvent && !window.opera)
    window.attachEvent("onload", initTabs);

function openRelativeWindow(theURL, theName, baseWidth, baseHeight) {
    window.name = 'windowOpener';
    browser = navigator.appName;
    //Get the full screen size
    fullWidth = screen.width;
    fullHeight = screen.height;

    //Get the available screen Size
    if (browser.indexOf("WebTV") >= 0) {
        width = window.innerWidth - 16;
        height = window.innerHeight;
        fullHeight = window.outerHeight;
        fullWidth = window.outerWidth;
    }
    else if (browser.indexOf("Microsoft") >= 0) {
        width = document.body.offsetWidth - 20;
        height = document.body.offsetHeight;
        colorDepth = window.screen.colorDepth;
    }
    else if (browser.indexOf("Netscape") >= 0) {
        width = window.innerWidth - 16;
        height = window.innerHeight;
        colorDepth = window.screen.pixelDepth
    }
    var X = 0;
    var Y = 0;
    aspectRatio = (baseWidth / baseHeight);
    calcWidth = (screen.width / fullWidth) * baseWidth;
    calcHeight = calcWidth / aspectRatio;
    if (screen.availWidth) {
        X = (screen.availWidth / 2) - (calcWidth / 2);
        Y = (screen.availHeight / 2) - (calcHeight / 2);
    }
    var MyRemote = window.open(theURL, theName, "left=" + X + "screenX=" + X + "screenY=" + Y + ",top=" + Y + ",width=" + calcWidth + ",height=" + calcHeight + ",scrollbars=0,menubar=0,resizable=1");
    MyRemote.focus();
}


