<!--


var blueBulletImagePath = "/assets/images/list_bullet_blue.gif";
var orangeBulletImagePath = "/assets/images/list_bullet_orange.gif";
var orangeBlueBulletImagePath = "/assets/images/list_bullet_orange_blue.gif";
var inactiveContextMenuClass = "context_nav_bar_menu_link";
var activeContextMenuClass = "context_nav_bar_sel_menu_link";
var contextNavBarDivID = "context_nav_bar_div_id";
var contextNavBarImageID = "context_nav_bar_image_id";
var contextImageLinkID = "context_image_link_id";
var contextBlendTime = 200;

var selSecMenuItemID = null;

function pageInitialization() {
	var initialContextItem = "context_menu_item_one";
	var initialImagePath = document.getElementById(contextNavBarImageID).src;
	var initialLinkTarget = document.getElementById(contextImageLinkID).href;
    secNavBarMenuMouseOverEvent(initialContextItem, initialImagePath, initialLinkTarget);
	shiftOpacity("info_bar", 500);
}

function swapImage(imageID, imagePath) {
    document.getElementById(imageID).src = imagePath;
}

function secNavBarMenuMouseOverEvent(itemID, imagePath, linkTarget) {
	blendimage(contextNavBarDivID, contextNavBarImageID, imagePath ,contextBlendTime);
    if (selSecMenuItemID != null) {
        document.getElementById(selSecMenuItemID).className = inactiveContextMenuClass;
        document.getElementById(selSecMenuItemID + "_bullet").src = orangeBlueBulletImagePath;
    }
    document.getElementById(itemID).className = activeContextMenuClass;
    document.getElementById(itemID + "_bullet").src = blueBulletImagePath;
	document.getElementById(contextImageLinkID).href = linkTarget;
    selSecMenuItemID = itemID;
}

function secNavBarMenuMouseOutEvent(itemID, activeClassName, inactiveClassName) {
    if (selSecMenuItemID != null) {
        document.getElementById(selSecMenuItemID).className = activeClassName;
        document.getElementById(selSecMenuItemID + "_bullet").src = blueBulletImagePath;
    }
    document.getElementById(itemID).className = inactiveClassName;
    document.getElementById(itemID + "_bullet").src = orangeBlueBulletImagePath;
    selSecMenuItemID = itemID;
}

// Opens a window with no buttons, borders, or menus...
function openWindow(windowurl,windowname) {
	var newWindow = window.open(windowurl,windowname,"toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=800,height=600");
	newWindow.focus();
    return false; // prevent the window from acting on the href
}

// Opens window for Map It function in locator...
function openWindowIV(windowurl,windowname) {
	var newWindow = window.open(windowurl,windowname,"toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=800,height=600");
	newWindow.focus();
    return false; // prevent the window from acting on the href
}


//First opens a popup window informing the user that the link they clicked on
//will take them outside of the HealthLink/NCPPO website
//If the user clicks 'OK' it closes the window and takes them to the link
//If the user clicks 'Cancel' it simply closes the window
function openExternalWindow(externalsiteurl,externalsitename,windowname) {
	//Centers the popup window
	var verticalPos = ((screen.height - 150) / 2)
	var horizontalPos = ((screen.width - 350) / 2)
	
	//Sets up the popup window
	var externalWindow = window.open("",windowname,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=150,top=" + verticalPos + ",left=" + horizontalPos);
	
	//Writes the custom code to the popup window
	externalWindow.document.write("<html>");
	externalWindow.document.write("<head>");
	externalWindow.document.write("<title>Attention</title>");
	externalWindow.document.write("<link rel='stylesheet' href='/assets/css/main.css' type='text/css'>");
	externalWindow.document.write("<script language=\"JavaScript1.2\" src=\"/assets/scripts/main.js\"></script>");
	externalWindow.document.write("</head>");
	externalWindow.document.write("<body bgcolor='#FFFFFF' background='/assets/images/popup_background.gif' leftmargin='0' marginheight='0' marginspacing='0' marginwidth='0' topmargin='0'>");
    externalWindow.document.write("<div class='popup_container'>");
	externalWindow.document.write("<table width='350' border='0' cellspacing='0' cellpadding='3'>");
	externalWindow.document.write("<tr><td>");
	externalWindow.document.write("<img src='/assets/images/one_pixel_transparent.gif' width='75' height='75'>");
	externalWindow.document.write("</td><td>");
	externalWindow.document.write("<span class='bold_red'>Attention:</span><br>You are about to leave the HealthLink web site. By clicking <b>OK</b> you will leave the HealthLink web site and be taken to the <b>" + externalsitename + "</b> web site. By clicking <b>Cancel</b> you will remain at the HealthLink web site.");
	externalWindow.document.write("</td></tr>");
	externalWindow.document.write("<tr><td>");
	externalWindow.document.write("&nbsp;");
	externalWindow.document.write("</td><td align='center'>");
	externalWindow.document.write("<img src='/assets/images/one_pixel_transparent.gif' width='50' height='5'><br><a href='#' onClick='openWindow(\"" + externalsiteurl + "\",\"" + windowname + "_dest\"); window.close();'><img src='/assets/images/button_ok.gif' border='0'></a><img src='/assets/images/one_pixel_transparent.gif' width='27' height='27'><a href='#' onClick='window.close();'><img src='/assets/images/button_cancel.gif' border='0'></a>");
	externalWindow.document.write("</td></tr>");
	externalWindow.document.write("</table>");
    externalWindow.document.write("</div>");
	externalWindow.document.write("</body>");
	externalWindow.document.write("</html>");
	
	externalWindow.focus();
}

//First opens a popup window informing the user that the link they clicked on
//will take them outside of the HealthLink/NCPPO website
//If the user clicks 'OK' it closes the window and takes them to the link
//If the user clicks 'Cancel' it simply closes the window
function openExternalWindowII(disclaimer,externalsiteurl,externalsitename,windowname) {
	//Centers the popup window
	var verticalPos = ((screen.height - 150) / 2)
	var horizontalPos = ((screen.width - 350) / 2)
	
	//Sets up the popup window
	var externalWindow = window.open("",windowname,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=250,top=" + verticalPos + ",left=" + horizontalPos);
	
	//Writes the custom code to the popup window
	externalWindow.document.write("<html>");
	externalWindow.document.write("<head>");
	externalWindow.document.write("<title>Attention</title>");
	externalWindow.document.write("<link rel='stylesheet' href='/assets/css/main.css' type='text/css'>");
	externalWindow.document.write("<script language=\"JavaScript1.2\" src=\"/assets/scripts/main.js\"></script>");
	externalWindow.document.write("</head>");
	externalWindow.document.write("<body bgcolor='#FFFFFF' background='/assets/images/popup_background.gif' leftmargin='0' marginheight='0' marginspacing='0' marginwidth='0' topmargin='0'>");
    externalWindow.document.write("<div class='popup_container'>");
	externalWindow.document.write("<table width='350' border='0' cellspacing='0' cellpadding='3'>");
	externalWindow.document.write("<tr><td>");
	externalWindow.document.write("<img src='/assets/images/one_pixel_transparent.gif' width='75' height='75'>");
	externalWindow.document.write("</td><td>");
	externalWindow.document.write("<span class='bold_red'>Attention:</span><br><i>" + disclaimer + "</i><br><br>By clicking <b>OK</b> you will leave the HealthLink web site and be taken to the <b>" + externalsitename + "</b> web site. By clicking <b>Cancel</b> you will remain at the HealthLink web site.");
	externalWindow.document.write("</td></tr>");
	externalWindow.document.write("<tr><td>");
	externalWindow.document.write("&nbsp;");
	externalWindow.document.write("</td><td align='center'>");
	externalWindow.document.write("<img src='/assets/images/one_pixel_transparent.gif' width='50' height='5'><br><a href='#' onClick='openWindow(\"" + externalsiteurl + "\",\"" + windowname + "_dest\"); window.close();'><img src='/assets/images/button_ok.gif' border='0'></a><img src='/assets/images/one_pixel_transparent.gif' width='27' height='27'><a href='#' onClick='window.close();'><img src='/assets/images/button_cancel.gif' border='0'></a>");
	externalWindow.document.write("</td></tr>");
	externalWindow.document.write("</table>");
    externalWindow.document.write("</div>");
	externalWindow.document.write("</body>");
	externalWindow.document.write("</html>");
	
	externalWindow.focus();
}

//This displays the help text when a help balloon icon is clicked on
function openHelpBalloonWindow(helptitle,helptext,windowname) {
	//Centers the popup window
	var verticalPos = ((screen.height - 275) / 2)
	var horizontalPos = ((screen.width - 350) / 2)
	
	//Sets up the popup window
	var helpWindow = window.open("",windowname,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=275,top=" + verticalPos + ",left=" + horizontalPos);
	
	//Writes the custom code to the popup window
	helpWindow.document.write("<html>");
	helpWindow.document.write("<head>");
	helpWindow.document.write("<title>Help Balloon</title>");
	helpWindow.document.write("<link rel='stylesheet' href='/assets/css/main.css' type='text/css'>");
	helpWindow.document.write("</head>");
	helpWindow.document.write("<body bgcolor='#FFFFFF' background='/assets/images/popup_background.gif' leftmargin='0' marginheight='0' marginspacing='0' marginwidth='0' topmargin='0'>");
    helpWindow.document.write("<div class='popup_container'>");
	helpWindow.document.write("<table width='350' border='0' cellspacing='0' cellpadding='3'>");
	helpWindow.document.write("<tr><td>");
	helpWindow.document.write("<img src='/assets/images/one_pixel_transparent.gif' width='75' height='75'>");
	helpWindow.document.write("</td><td>");
	helpWindow.document.write("<span class='bold_red'>" + helptitle + "</span><br>" + helptext);
	helpWindow.document.write("</td></tr>");
	helpWindow.document.write("<tr><td>");
	helpWindow.document.write("&nbsp;");
	helpWindow.document.write("</td><td align='center'>");
	helpWindow.document.write("<img src='/assets/images/one_pixel_transparent.gif' width='50' height='10'><br><a href='#' onClick='window.close();'><img src='/assets/images/button_close_window.gif' border='0'></a>");
	helpWindow.document.write("</td></tr>");
	helpWindow.document.write("</table>");
    helpWindow.document.write("</div>");
	helpWindow.document.write("</body>");
	helpWindow.document.write("</html>");
	
	helpWindow.focus();
}

//Warns the user that they will be creating a Customized Directory of their search
//results and allows them to enter a customized name for the Customized Directory 
function openCustomizedDirectoryWarning(customQueryString) {
	//Centers the popup window
	var verticalPos = ((screen.height - 320) / 2)
	var horizontalPos = ((screen.width - 350) / 2)
	
	//Sets up the popup window
	var externalWindow = window.open("","cdww","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=320,top=" + verticalPos + ",left=" + horizontalPos);
	
	//Writes the custom code to the popup window
	externalWindow.document.write("<html>");
	externalWindow.document.write("<head>");
	externalWindow.document.write("<title>Attention</title>");
	externalWindow.document.write("<link rel='stylesheet' href='/assets/css/main.css' type='text/css'>");
	externalWindow.document.write("</head>");
	externalWindow.document.write("<body bgcolor='#FFFFFF' background='/assets/images/popup_background.gif' leftmargin='0' marginheight='0' marginspacing='0' marginwidth='0' topmargin='0'>");
    externalWindow.document.write("<div class='popup_container'>");
	externalWindow.document.write("<table width='350' border='0' cellspacing='0' cellpadding='3'>");
	externalWindow.document.write("<tr><td>");
	externalWindow.document.write("<img src='/assets/images/one_pixel_transparent.gif' width='75' height='75'>");
	externalWindow.document.write("</td><td>");
	externalWindow.document.write("<span class='bold_red'>Attention:</span><br>You have chosen to create a Customized Directory of your Physician/Hospital Locator results.  Please note, based on your Internet connection speed and the number of providers your search returned, the process of creating a PDF could take several minutes.<br><br>It is recommended that if you have more than <b>5,000 search results</b> and a slow Internet connection, please perform a new search by choosing more specific criteria.<br><br>By clicking <b>OK</b> you will proceed with the creation of your Customized Directory. By clicking <b>Cancel</b> you will continue to view your Physician/Hospital Locator results.");
	externalWindow.document.write("</td></tr>");
	externalWindow.document.write("<tr><td>");
	externalWindow.document.write("&nbsp;");
	externalWindow.document.write("</td><td align='center'>");
	externalWindow.document.write("<img src='/assets/images/one_pixel_transparent.gif' width='50' height='5'><br><a href='#' onClick=\"window.opener.location='" + customQueryString + "'; window.close();\"><img src='/assets/images/button_ok.gif' border='0'></a><img src='/assets/images/one_pixel_transparent.gif' width='27' height='27'><a href='#' onClick='window.close();'><img src='/assets/images/button_cancel.gif' border='0'></a>");
	externalWindow.document.write("</td></tr>");
	externalWindow.document.write("</table>");
    externalWindow.document.write("</div>");
	externalWindow.document.write("</body>");
	externalWindow.document.write("</html>");
	
	externalWindow.focus();
}

function openPolicyDisclaimer(pageToGoTo) {
	//Window size
	var windowHeight = 400;
	var windowWidth = 600;
	
	//Centers the popup window
	var verticalPos = ((screen.height - windowHeight) / 2);
	var horizontalPos = ((screen.width - windowWidth) / 2);
	
	//Disclaimer text
	var disclaimerText = "<strong>Medical Policies</strong><br><br>HealthLink provides network access and related services to payors of benefits provided to members under the terms of a payor sponsored health benefit plan (''benefit plan[s]''). Payors may be insurance companies or other groups such as self-insured employers, trusts or governments. Usually, benefits for medical services or supplies that are payable under the terms of a benefit plan are paid directly by the payor. For some payors, HealthLink may make benefit recommendations and payments on behalf of the payor using payor funds.<br><br>Utilization management services provided by HealthLink are available to a payor. Not all payors purchase such services for the benefit plans they sponsor. For payors who have purchased such services, utilization management is the process by which HealthLink reviews medical services or supplies, provided or to be provided to a benefit plan member, for the purpose of making a recommendation to the payor regarding the medical necessity of such services or supplies. HealthLink's medical necessity recommendations are used by the payor to make benefit determinations. <br><br>The administrator of the benefit plan retains authority with respect to eligibility, coverage and the benefits under the benefit plan. Members should contact their local customer services representative for specific coverage information, and to determine whether their benefit plan has purchased HealthLink’s utilization management services.  Coverage recommendations are subject to all terms and conditions of the applicable benefit plan, including specific exclusions and limitations, and to applicable state and/or federal law. Medical policy does not constitute plan authorization, nor is it an explanation of benefits. <br><br>HealthLink has developed medical policies that serve as one of the sets of guidelines for coverage recommendations when it performs utilization management on behalf of a payor.  Benefit plans vary in coverage and some plans may not provide coverage for certain services discussed in the medical policies. <br><br>Medical policies can be highly technical and complex and are provided here for informational purposes. The medical policies do not constitute medical advice or medical care. Treating health care providers are solely responsible for diagnosis, treatment and medical advice. HealthLink members should discuss the information in the medical policies with their treating health care providers.<br><br>Medical technology is constantly evolving and these medical policies are subject to change without notice. HealthLink may provide advance notice of changes that could have a negative impact on claims payment.  Additional medical policies may be developed from time to time and some may be withdrawn from use.<br><br>The doctors, hospitals, and other providers which are part of the network of providers referred to in this document are independent contractors who exercise independent judgment and over who HealthLink has no control or right of control.  They are not agents or employees of HealthLink.<br><br>If you would like to request a hard copy of an individual medical policy, please call HealthLink at the number on the back of the member’s identification card.<br><br><br><strong>Clinical UM Guidelines</strong><br><br>HealthLink has developed clinical UM guidelines that serve as one of the sets of guidelines for coverage decisions.  HealthLink is also licensed to use Milliman Care Guidelines&reg; 11<sup>th</sup> edition to guide utilization management decisions. This may include but is not limited to decisions involving pre-certification, inpatient review, level of care, discharge planning and retrospective review. The Milliman Care Guidelines&reg; licensed include (1) Inpatient and Surgical Care Guidelines, and (2) General Recovery Guidelines.  HealthLink also has the right to customize Milliman Care Guidelines® based on determinations by its Medical Policy & Technology Assessment Committee (MPTAC). <br><br>Benefit plans vary in coverage and some plans may not provide coverage for certain services discussed in the clinical UM guidelines.  Coverage decisions are subject to all terms and conditions of the applicable benefit plan, including specific exclusions and limitations, and to applicable state and/or federal law. A clinical UM guideline does not constitute plan authorization, nor is it an explanation of benefits.<br><br>Clinical UM guidelines can be highly technical and complex and are provided here for informational purposes. These guidelines do not constitute medical advice or medical care. Treating health care providers are solely responsible for diagnosis, treatment and medical advice. HealthLink members should discuss the information in the clinical UM guideline with their treating health care providers.<br><br>The clinical UM guidelines published on this web site represent the clinical UM guidelines currently available to all health plans throughout our enterprise.  These guidelines address the medical necessity of existing, generally accepted services, technologies and drugs.  Because local practice patterns, claims systems and benefit designs vary, a local plan may choose whether to implement a particular clinical UM guideline.  While the clinical UM guidelines developed by HealthLink are published on this web site, the licensed standard and customized Milliman Care Guidelines&reg; are proprietary to Milliman and not published on the Internet site. <br><br>Medical technology is constantly evolving and clinical UM guidelines are subject to change without notice.   Additional clinical UM guidelines may be developed from time to time and some may be withdrawn from use.  Members should contact their local customer services representative for specific coverage information.<br><br>The doctors, hospitals, and other providers which are part of the network of providers referred to in this document are independent contractors who exercise independent judgment and over whom HealthLink has no control or right of control.  They are not agents or employees of HealthLink.<br><br>If you would like to request a hard copy of an individual clinical UM guideline or Milliman Care Guideline&reg;, please contact the member's health plan at the number on the back of their identification card.<br><br><strong>TO LEARN WHETHER YOUR HEALTH PLAN HAS IMPLEMENTED ONE OR MORE OF THE CLINICAL UM GUIDELINES, PLEASE CONTACT THE MEMBER’S HEALTH PLAN AT THE NUMBER ON THE BACK OF THEIR IDENTIFICATION CARD, OR CONTACT YOUR LOCAL PROVIDER RELATIONS REPRESENTATIVE.</strong>";

	//Sets up the popup window
	var externalWindow = window.open("","","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=" + windowWidth + ",height=" + windowHeight + ",top=" + verticalPos + ",left=" + horizontalPos);
	
	//Writes the custom code to the popup window
	externalWindow.document.write("<html>");
	externalWindow.document.write("<head>");
	externalWindow.document.write("<title>Medical Policy Disclaimer</title>");
	externalWindow.document.write("<link rel='stylesheet' href='/assets/css/main.css' type='text/css'>");
	externalWindow.document.write("</head>");
	externalWindow.document.write("<body bgcolor='#FFFFFF' background='/assets/images/popup_background.gif' leftmargin='0' marginheight='0' marginspacing='0' marginwidth='0' topmargin='0'>");
    externalWindow.document.write("<div class='popup_container'>");
	externalWindow.document.write("<table width='100%' border='0' cellspacing='0' cellpadding='3'>");
	externalWindow.document.write("<tr><td>");
	externalWindow.document.write("<img src='/assets/images/one_pixel_transparent.gif' width='75' height='75'>");
	externalWindow.document.write("</td><td>");
	externalWindow.document.write("<span class='bold_blue'>By clicking on 'Continue' below, I acknowledge that I have read the following:</span><br><hr size='1' noshade>" + disclaimerText + "</span><br><hr size='1' noshade><div align='center'><span class='bold_blue'>I have read the above information.</span></div>");
	externalWindow.document.write("</td></tr>");
	externalWindow.document.write("<tr><td>");
	externalWindow.document.write("&nbsp;");
	externalWindow.document.write("</td><td align='center'>");
	externalWindow.document.write("<img src='/assets/images/one_pixel_transparent.gif' width='50' height='5'><br><a href='#nogo' onClick='window.opener.location.href=\"" + pageToGoTo + "\"; window.close();'><img src='/assets/images/button_ok.gif' border='0'></a><img src='/assets/images/one_pixel_transparent.gif'><a href='#nogo' onClick='window.close();'><img src='/assets/images/button_cancel.gif' border='0'></a><br><img src='/assets/images/one_pixel_transparent.gif' width='50' height='10'>");
	externalWindow.document.write("</td></tr>");
	externalWindow.document.write("</table>");
    externalWindow.document.write("</div>");
	externalWindow.document.write("</body>");
	externalWindow.document.write("</html>");
	
	externalWindow.focus();
}

function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if (opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id);
    object.style.opacity = (opacity / 100);
    object.style.MozOpacity = (opacity / 100);
    object.style.KhtmlOpacity = (opacity / 100);
    object.style.filter = "alpha(opacity=" + opacity + ")";
} 

function shiftOpacity(id, millisec) {
	if ((document.getElementById(id)) && (document.getElementById(id) != null)) {
    //if an element is invisible, make it visible, else make it ivisible
        if (document.getElementById(id).style.opacity == 0) {
            opacity(id, 0, 100, millisec);
        } else {
            opacity(id, 100, 0, millisec);
        }
	}
} 

function currentOpac(id, opacEnd, millisec) {
    //standard opacity is 100
    var currentOpac = 100;
    
    //if the element has an opacity set, get it
    if(document.getElementById(id).style.opacity < 100) {
        currentOpac = document.getElementById(id).style.opacity * 100;
    }

    //call for the function that changes the opacity
    opacity(id, currentOpac, opacEnd, millisec)
} 

function blendimage(divid, imageid, imagefile, millisec) {
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //set the current image as background
    document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
    
    //make image transparent
    changeOpac(0, imageid);
    
    //make new image
    document.getElementById(imageid).src = imagefile;

    //fade in image
    for(i = 0; i <= 100; i++) {
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
        timer++;
    }
} 


// Standard library of functions
function addEvent(element, type, handler) {
    // assign each event handler a unique ID
    if (!handler.$$guid) handler.$$guid = addEvent.guid++;

    // create a hash table of event types for the element
    if (!element.events) element.events = {};

    // create a hash table of event handlers for each element/event pair
    var handlers = element.events[type];
    if (!handlers) {
        handlers = element.events[type] = {};

        // store the existing event handler (if there is one)
        if (element["on" + type]) {
            handlers[0] = element["on" + type];
        }

    }

    // store the event handler in the hash table
    handlers[handler.$$guid] = handler;

    // assign a global event handler to do all the work
    element["on" + type] = handleEvent;
};

// a counter used to create unique IDs
addEvent.guid = 1;

function removeEvent(element, type, handler) {
    // delete the event handler from the hash table
    if (element.events && element.events[type]) {
        delete element.events[type][handler.$$guid];
    }
};

function handleEvent(event) {
    var returnValue = true;

    // grab the event object (IE uses a global event object)
    event = event || fixEvent(window.event);

// get a reference to the hash table of event handlers
    var handlers = this.events[event.type];

    // execute each event handler
    for (var i in handlers) {
        this.$$handleEvent = handlers[i];
        if (this.$$handleEvent(event) === false) {
            returnValue = false;
        }
    }

    return returnValue;
};

// Add some "missing" methods to IE's event object
function fixEvent(event) {
    // add W3C standard event methods
    event.preventDefault = fixEvent.preventDefault;
    event.stopPropagation = fixEvent.stopPropagation;
    return event;
};

fixEvent.preventDefault = function() {
    this.returnValue = false;
};

fixEvent.stopPropagation = function() {
    this.cancelBubble = true;
};

// Get a style property (name) of a specific element (elem)
function getStyle( elem, name ) {
    // If the property exists in style[], then it's been set
    // recently (and is current)
    if (elem.style[name])
        return elem.style[name];

    // Otherwise, try to use IE's method
    else if (elem.currentStyle)
        return elem.currentStyle[name];

    // Or the W3C's method, if it exists
    else if (document.defaultView && document.defaultView.getComputedStyle) {
        // It uses the traditional 'text-align' style of rule writing,
        // instead of textAlign
        name = name.replace(/([A-Z])/g,"-$1");
        name = name.toLowerCase();

        // Get the style object and get the value of the property (if it exists)
        var s = document.defaultView.getComputedStyle(elem,"");
        return s && s.getPropertyValue(name);

    // Otherwise, we're using some other browser
    } else
        return null;
}

// Find the X (Horizontal, Left) position of an element
function pageX(elem) {
    // See if we're at the root element, or not
    return elem.offsetParent ?

        // If we can still go up, add the current offset and recurse upwards
        elem.offsetLeft + pageX( elem.offsetParent ) :

        // Otherwise, just get the current offset
        elem.offsetLeft;
}

// Find the Y (Vertical, Top) position of an element
function pageY(elem) {
    // See if we're at the root element, or not
    return elem.offsetParent ?

        // If we can still go up, add the current offset and recurse upwards
        elem.offsetTop + pageY( elem.offsetParent ) :

        // Otherwise, just get the current offset
        elem.offsetTop;
}

// Find the horizontal positioing of an element within its parent
function parentX(elem) {
    // If the offsetParent is the element's parent, break early
    return elem.parentNode == elem.offsetParent ?
        elem.offsetLeft :

        // Otherwise, we need to find the position relative to the entire
        // page for both elements, and find the difference
        pageX( elem ) - pageX( elem.parentNode );
}

// Find the vertical positioning of an element within its parent
function parentY(elem) {
    // If the offsetParent is the element's parent, break early
    return elem.parentNode == elem.offsetParent ?
        elem.offsetTop :

        // Otherwise, we need to find the position relative to the entire
        // page for both elements, and find the difference
        pageY( elem ) - pageY( elem.parentNode );
}

// Find the left position of an element
function posX(elem) {
    // Get the computed style and get the number out of the value
    return parseInt( getStyle( elem, "left" ) );
}

// Find the top position of an element
function posY(elem) {
    // Get the computed style and get the number out of the value
    return parseInt( getStyle( elem, "top" ) );
}

// A function for setting the horizontal position of an element
function setX(elem, pos) {
    // Set the 'left' CSS property, using pixel units
    elem.style.left = pos + "px";
}

// A function for setting the vertical position of an element
function setY(elem, pos) {
    // Set the 'left' CSS property, using pixel units
    elem.style.top = pos + "px";
}

// A function for adding a number of pixels to the horizontal
// position of an element
function addX(elem,pos) {
    // Get the current horz. position and add the offset to it.
    setX( posX(elem) + pos );
}

// A function that can be used to add a number of pixels to the
// vertical position of an element
function addY(elem,pos) {
    // Get the current vertical position and add the offset to it
    setY( posY(elem) + pos );
}

// Get the actual height (using the computed CSS) of an element
function getHeight( elem ) {
    // Gets the computed CSS value and parses out a usable number
    return parseInt( getStyle( elem, 'height' ) );
}

// Get the actual width (using the computed CSS) of an element
function getWidth( elem ) {
    // Gets the computed CSS value and parses out a usable number
    return parseInt( getStyle( elem, 'width' ) );
}

// Find the full, possible, height of an element (not the actual,
// current, height)
function fullHeight( elem ) {
    // If the element is being displayed, then offsetHeight
    // should do the trick, barring that, getHeight() will work
    if ( getStyle( elem, 'display' ) != 'none' )
        return elem.offsetHeight || getHeight( elem );

    // Otherwise, we have to deal with an element with a display
    // of none, so we need to reset its CSS properties to get a more
    // accurate reading
    var old = resetCSS( elem, {
        display: '',
        visibility: 'hidden',
        position: 'absolute'
    });

    // Figure out what the full height of the element is, using clientHeight
    // and if that doesn't work, use getHeight
    var h = elem.clientHeight || getHeight( elem );

    // Finally, restore the CSS properties back to what they were
    restoreCSS( elem, old );

    // and return the full height of the element
    return h;
}

// Find the full, possible, width of an element (not the actual,
// current, width)
function fullWidth( elem ) {
    // If the element is being displayed, then offsetWidth
    // should do the trick, barring that, getWidth() will work
    if ( getStyle( elem, 'display' ) != 'none' )
        return elem.offsetWidth || getWidth( elem );

    // Otherwise, we have to deal with an element with a display
    // of none, so we need to reset its CSS properties to get a more
    // accurate reading
    var old = resetCSS( elem, {
        display: '',
        visibility: 'hidden',
        position: 'absolute'
    });
    // Figure out what the full width of the element is, using clientWidth
    // and if that doesn't work, use getWidth
    var w = elem.clientWidth || getWidth( elem );

    // Finally, restore the CSS properties back to what they were
    restoreCSS( elem, old );

    // and return the full width of the element
    return w;
}

// A function used for setting a set of CSS properties, which
// can then be restored back again later
function resetCSS( elem, prop ) {
    var old = {};

    // Go through each of the properties
    for ( var i in prop ) {
        // Remember the old property value
        old[ i ] = elem.style[ i ];

        // And set the new value
        elem.style[ i ] = prop[i];
    }

    // Retun the set of changed values, to be used by restoreCSS
    return old;
}

// A function for restoring the side effects of the resetCSS function
function restoreCSS( elem, prop ) {
    // Reset all the properties back to their original values
    for ( var i in prop )
        elem.style[ i ] = prop[ i ];
}

// A function for hiding (using display) an element
function hide( elem ) {
    // Find out what its current display state is
    var curDisplay = getStyle( elem, 'display' );

    //  Remember its display state for later
    if ( curDisplay != 'none' )
        elem.$oldDisplay = curDisplay;


// Set the display to none (hiding the element)
    elem.style.display = 'none';
}

// A function for showing (using display) an element
function show( elem ) {
    // Set the display property back to what it use to be, or use
    // 'block', if no previous display had been saved
    elem.style.display = elem.$oldDisplay || '';
}

// Set an opacity level for an element
// (where level is a number 0-100)
function setOpacity( elem, level ) {
    // If filters exist, then this is IE, so set the Alpha filter
    if ( elem.filters )
        elem.style.filters = 'alpha(opacity=' + level + ')';

    // Otherwise use the W3C opacity property
    else
        elem.style.opacity = level / 100;
}

// Find the height of the viewport
function windowHeight() {
    // A shortcut, in case we're using Internet Explorer 6 in Strict Mode
    var de = document.documentElement;

    // If the innerHeight of the browser is available, use that
    return self.innerHeight ||

        // Otherwise, try to get the height off of the root node
        ( de && de.clientHeight ) ||

        // Finally, try to get the height off of the body element
        document.body.clientHeight;
}

// Find the width of the viewport
function windowWidth() {
    // A shortcut, in case we're using Internet Explorer 6 in Strict Mode
    var de = document.documentElement;

    // If the innerWidth of the browser is available, use that
    return self.innerWidth ||

        // Otherwise, try to get the width off of the root node
        ( de && de.clientWidth ) ||

        // Finally, try to get the width off of the body element
        document.body.clientWidth;
}

function slideDown( elem ) {
    // Start the slide down at  0
    elem.style.height = '0px';

    // Show the element (but you can see it, since the height is 0)
    show( elem );

    // Find the full, potential, height of the element
    var h = fullHeight( elem );

    // We're going to do a 20 'frame' animation that takes
    // place over one second
    for ( var i = 0; i <= 100; i += 5 ) {
        // A closure to make sure that we have the right 'i'
        (function(){
            var pos = i;

            // Set the timeout to occur at the specified time in the future
            setTimeout(function(){

                // Set the new height of the element
                elem.style.height = (( pos / 100 ) * h ) + "px";

            }, ( pos + 1 ) * 10 );
        })();
    }
}

function fadeIn( elem ) {
    // Start the opacity at  0
    setOpacity( elem, 0 );

    // Show the element (but you can see it, since the opacity is 0)
    show( elem );

    // We're going to do a 20 'frame' animation that takes
    // place over one second
    for ( var i = 0; i <= 100; i += 5 ) {
        // A closure to make sure that we have the right 'i'
        (function(){
            var pos = i;

            // Set the timeout to occur at the specified time in the future
            setTimeout(function(){

                // Set the new opacity of the element
                setOpacity( elem, pos );

            }, ( pos + 1 ) * 10 );
        })();
    }
}

// This is a hack for IE to display a absolute positioned div like a fixed positioned div
function move_overlay() {  
    var offset = 0; // set offset 
    var element = document.getElementById('overlay');  
  
    element.style.top = (document.documentElement.scrollTop + offset) + 'px';  
}  

//-->
