﻿// JScript File

var popUp;

// Global variables
var isCSS;
var isW3C;
var isIE4;
var isNN4;
        
// initialize upon load to let all browsers establish content objects
    function init() 
    {
	    if (document.images) 
	    {
		    isCSS = (document.body && document.body.style) ? true : false;
		    isW3C = (isCSS && document.getElementById) ? true : false;
		    isIE4 = (isCSS && document.all) ? true : false;
		    isNN4 = (document.layers) ? true : false;

	    }
    }	
    // Convert object name string or object reference
    // into a valid element object reference
    function getRawObject(obj) 
    {
	    var theObj;
	    if (typeof obj == "string") 
	    {
		    if (isW3C) 
		    {
			    theObj = document.getElementById(obj);
		    } 
		    else if (isIE4) 
		    {
			    theObj = document.all(obj);
		    } 
		    else if (isNN4) 
		    {
			    theObj = seekLayer(document.aspnetForm, obj);
		    }
	    } 
	    else 
	    {
		    // pass through object reference
		    theObj = obj;
	    }
	    return theObj;
    }
    
    function resetHover(obj)
    {
        realObj = getRawObject(obj);
        if (realObj != null)
        {
            if (realObj.className != "current")
            {
                realObj.style.background="#fff";
            }
        }
    }
    function resetMenuHover(obj)
    {
        realObj = getRawObject(obj);
        if (realObj != null)
        {
            if (realObj.className != "current")
            {
                realObj.style.background="url(../Images/MainMenuBackground.GIF)";
                realObj.style.backgroundRepeat = "repeat-x";
            }
        }
    }
    
    function popup(url, popUpName, windowAttribs)
    {   	
	    popUp = window.open(url, popUpName, windowAttribs);	
	    popUp.focus();
    }
    
    function SelectAll(obj)
    {
        realObj = getRawObject(obj);
        realObj.focus();
        realObj.select();
    }
    
    function clickControl(obj)
    {
        realObj = getRawObject(obj);
        realObj.click();
    }