// JScript File

function HeaderJS()
{
//not used anymore
}

function PopupCopyright()
{
    window.open('CopyrightStatement.htm','','width=400,height=200','false');
}


function sizeDivs()
{

 

    var screenWidth = document.documentElement.clientWidth;
    
    var headerHolder = document.getElementById("headerHolder");
        
    //var contentHolder = document.getElementById("contentHolder");
        
    //var footerHolder = document.getElementById("footerHolder");
    
    //var leftNavHolder = document.getElementById("leftNavHolder");
    
    //var mainDiv = document.getElementById("mainDiv");
    
    var bodyDiv = document.getElementById("bodyDiv");

    //var leftNavHeight = leftNavHolder.clientHeight;
        
    //var contentHeight = contentHolder.clientHeight;
    
    //var mainDivHeight = mainDiv.clientHeight;
    
   
    
    var newSize = 0;

    //leftNavHolder.style.height = contentHeight + "px";
    
    if(screenWidth>800 && screenWidth<1004)
    {
        newSize = screenWidth;
        
        screenWidth = "dynamic";
    }
    
    if(screenWidth<801)
    {
        screenWidth = 780;
        
    }
    
    if(screenWidth>1004)
    {
        screenWidth = 1004

    }
    
    switch(screenWidth)
    {
        case (780):
        
            //headerHolder.style.width = screenWidth + "px";
            
            bodyDiv.style.width = screenWidth + "px";
        
            //contentHolder.style.width = (screenWidth - 180) + "px"; 
        
            //footerHolder.style.width = screenWidth + "px";
            
        break
        
        case (1004):
        
            //headerHolder.style.width = "1024px";
            
            bodyDiv.style.width = "1004px";
        
            //contentHolder.style.width = (1024 - 180) + "px"; 
        
            //footerHolder.style.width = "1024px";
            
        break 
        
        case ("dynamic"):
        
            //headerHolder.style.width = newSize + "px";
            
            bodyDiv.style.width = newSize + "px";
        
            //contentHolder.style.width = (newSize - 180) + "px"; 
        
            //footerHolder.style.width = newSize + "px";
            
        break   
            
    }
    
    //alert(newSize + " " + screenWidth);
        
}

function ShowInternalContentPlayer(thePath,theWidth,theHeight,isAutoPlay)
{
AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', theWidth,
			'height', theHeight,
			'src', 'contentPlayer/swfPlayerInternal',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', 'swfPlayerInternal',
			'bgcolor', '#ffffff',
			'name', 'swfPlayerInternal',
			'menu', 'true',
			'allowFullScreen', 'true',
			'allowScriptAccess','always',
			'movie', 'contentPlayer/swfPlayerInternal',
			'salign', ''
			); //end AC code
var el;

if (navigator.appVersion.indexOf("MSIE")!=-1)
{
	el = document.getElementById("swfPlayerInternal");
}
else
{
	el = document.getElementsByName("swfPlayerInternal")[0];
}

var theInterval = setInterval(function()
{
clearInterval(theInterval);

el.LoadContent(thePath,theWidth,theHeight,isAutoPlay);
},100);

}


function redirect(arg)
    {
        var obj = document.getElementById(arg.firstChild.id);
        
        window.location = obj.href;
        
    }
    
    function AddOnClick()
    {
        //adds onclick event handler to TreeView cells

        var links = document.getElementsByTagName("a");
        
        for(i=0; i < links.length; i++)
        {           
            var obj = links[i];

            if(obj.id.indexOf("treeControl_TreeView1t")==0)
            {
                
                obj.parentNode.onclick = function(){redirect(this);};
            }
        }
    }
    
    function ShowValueAddedBox(theWidth, theHeight, theText)
{
AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', theWidth,
			'height', theHeight,
			'src', 'swf/valueAddedBox',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', 'valueAddedBox',
			'bgcolor', '#ffffff',
			'name', 'valueAddedBox',
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','always',
			'movie', 'swf/valueAddedBox',
			'salign', ''
			); //end AC code
var el;

if (navigator.appVersion.indexOf("MSIE")!=-1)
{
	el = document.getElementById("valueAddedBox");
}
else
{
	el = document.getElementsByName("valueAddedBox")[0];
}

var theInterval = setInterval(function()
{

clearInterval(theInterval);
el.ShowAddedValueBox(theWidth,theHeight, theText);
},2000);

}

    
