var checkPhoneNumberWindowWidth=600;
var checkPhoneNumberWindowHeight=250;

var phoneChecker = 'For help entering and verifying a phone number, click on this image to display the Phone Number Verifier.  The Phone Number Verifier helps you make sure you\'ve entered a number correctly, which can be especially useful if you\'re entering a number that isn\'t in the same country as you.';

function stripNonDigits(o){
    return o.value.replace(/(\D)+/g,"");
 }

function fnHelp(helpUrl)
{
    window.open(helpUrl, new Date().getTime(), "width=500, height=500, location=no, menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=no");
}

function fnHelpIndex(helpUrl)
{
    window.open(helpUrl, new Date().getTime(), "width=750, height=500, location=no, menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=no");
}

function fnCheckChangeFlag()
{
    if (document.forms[0].changeFlag != null &&
        document.forms[0].changeFlag.value == 'Y')
    {
        var answer = confirm('You\'ve made changes on this page.  Do you want to save them?');

        if (answer)
        {
            // Check if presubmit functions are needed to be done
            if (document.forms[0].preSubmit != null &&
                document.forms[0].preSubmit.value == 'Y')
            {
                fnPreSubmit();
            }

            document.forms[0].submit();
        }
            else
        {
            return true;
        }
    }
}

function fnSetChangeFlag()
{
    document.forms[0].changeFlag.value = 'Y';
}

function fnSubmit()
{
    if (document.forms[0].submitOnlyOnce != null &&
        document.forms[0].submitOnlyOnce.value == 'Y')
    {
        if (document.forms[0].submitAlready != null &&
            document.forms[0].submitAlready.value == 'Y')
        {
            return;
        }
        else
        {
            document.forms[0].submitAlready.value = 'Y';
        }
    }

    document.forms[0].changeFlag.value = 'N';

    // Check if presubmit functions are needed to be done
    if (document.forms[0].preSubmit != null &&
        document.forms[0].preSubmit.value == 'Y')
    {
        fnPreSubmit();
    }

    document.forms[0].submit();
}

function fnSetContentTitle(title, urllink, endcrumb)
{
    var contentTitle = '<a class="title_link" href="' + urllink + '" target="content">' + title + '</a>: <span class="title_text">' + endcrumb + '</span>';
    parent.setContentTitle(contentTitle);
}

function checkForPopupBlocker() {
    /*  Function:      setEvents
        Creation Date: April 5, 2004
        Programmer:    Edmond Woychowsky
        Purpose:       The purpose of this function is to attempt to open
                       a popup window to determine if a popup blocker is
                       enabled.
        Source:        http://builder.com.com/5100-6371-5213774.html
    */
    var objChild;                           // Window
    var reWork = new RegExp('object','gi'); // Regular expression
    try {
        objChild = window.open('','child','width=0,height=0,left=5000,top=5000,status=no,resizable=yes');

        objChild.close();
    }
    catch(e) { }
    if(!reWork.test(String(objChild)))
        alert('Your system currently blocks the creation of pop-up windows.  Since some of ' + brandName + ' Center\'s features use pop-up windows, to experience the site correctly you should enable your browser to display pop-up windows, or disable pop-up blockers for this website only.');
}

function fnTestCookie()
{
    document.cookie = "testCenterCookie=Enabled";

    if (getCookieValue("testCenterCookie") == "Enabled")
    {
        return true;
    }
        else
    {
        return false;
    }
}

function getCookieValue (cookieName)
{
    var reg = new RegExp (escape(cookieName) + "=([^;]+)");
    
    if (reg.test (document.cookie + ";"))
    {
        reg.exec (document.cookie + ";");
        return unescape(RegExp.$1);
    }
        else
    {
    	return false;
    }
}