var isIE = false;
var  MAX_TABS = 3;
var bFirstTimeLoaded = true;

  if (document.all)
  {
	isIE = true;
  }

function initialize()
{
	var nIndex = argItems("tabIndex");
	if ((isNaN(nIndex) == true) || (nIndex == ""))
	{
		nIndex = 1;
	}
	if ((nIndex > MAX_TABS) || (nIndex < 1))
	{
		nIndex = 1;
	}
	SwitchToTab(nIndex);
}


function SwitchToTab(i)
{
	var oObj;

	oObj = window.document.getElementById("TXT"+i);	 
	var txt = oObj.innerHTML;
	var oHolder = window.document.getElementById("TextHolder");
	oHolder.innerHTML = txt;
}

function argItems (theArgName) {
    var sArgs = location.search.slice(1).split('&');
    var r = '';
    for (var i = 0; i < sArgs.length; i++) {
        if (sArgs[i].split('=')[0].toLowerCase() == theArgName.toLowerCase()) {
            r = sArgs[i].split('=')[1];
            break;
        }
    }
    return (r.length > 0 ? unescape(r).split(',') : '')
}

function ShowMovie(moviePath, width, height)
{
	var oDiv = window.document.getElementById("showMovieDiv");
	oDiv.style.display = "";
	oDiv.style.visibility = "";
 
	var oImg = window.document.getElementById("disablerImg");
	var docHeight = getDocHeight();
 
	oImg.width = document.body.clientWidth;
	oImg.height = docHeight;
 
	var oDisablerDiv = window.document.getElementById("disablerDiv");
	oDisablerDiv.style.visibility = '';
	oDisablerDiv.style.display = '';
	oDisablerDiv.style.height = docHeight;
	oDisablerDiv.style.width = document.body.clientWidth;
 
	var oMoviePlayer = window.document.getElementById("oPlayer");
 
	var padderTop = (docHeight / 2) + (height / 2) + 100;
	var padderLeft = (document.body.clientWidth / 2) - (width / 2);
 
	var PlayerTxt = "<table><tr><td><img src='/Portals/42159/NewHP/Images/empty.gif' width='"+padderLeft+"' height='"+padderTop+"'></td><td>";
	PlayerTxt += '<div style="background-color:#cccccc; border:1px solid #000000">';
	PlayerTxt += "<div onclick='CloseMovie()' style='color:red; font-size: 18px; cursor:hand; cursor: pointer;'><b>&nbsp;X</b></div>";
	PlayerTxt += '<object width="'+width+'" height="'+height+'"><param name="movie" value="'+moviePath+'"></param><param name="allowFullScreen" value="false"></param><param name="allowscriptaccess" value="always"></param><embed src="'+moviePath+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'+width+'" height="'+height+'"></embed></object>';
	PlayerTxt += '</div></td></tr></table>';
	oMoviePlayer.innerHTML = PlayerTxt;
}
 
function CloseMovie()
{
	var oDiv = window.document.getElementById("showMovieDiv");
	oDiv.style.dislpay = "none";
	oDiv.style.visibility = "hidden";
 
	var oImg = window.document.getElementById("disablerImg");
	oImg.width = 1;
	oImg.height = 1;
 
	var oDisablerDiv = window.document.getElementById("disablerDiv");
	oDisablerDiv.style.visibility = 'hidden';
	oDisablerDiv.style.display = 'none';
 
	var oMoviePlayer = window.document.getElementById("oPlayer");
	oMoviePlayer.innerHTML = "";
}
 
function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}
 
