﻿// JScript File

function popUp(URL) 
{
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=410,left = 312,top = 179');");
}

function startQuote(URL) 
{
    __utmLinker(this.href); 
    day = new Date();
    id = day.getTime();
    width = screen.availWidth;
    height = screen.availHeight;

    popUpWidth = width;
    if (width > 640) { popUpWidth = 779; }
    if (width > 800) { popUpWidth = 810; }

    popUpHeight = height - 30;

    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=no,scrollbars=1,location=no,statusbar=no,menubar=no,resizable=no,width=" + popUpWidth + ",height=" + popUpHeight + "');");
}

function generateRestoreURL() 
{
    var email = document.getElementById('txtEmail').value;
    var password = document.getElementById('txtPassword').value;

    if (email=='') {
        alert('Email cannot be blank.');
        }
    else {
        if (password=='') {
            alert('Password cannot be blank.');
            }
        else {
            //passed so far
            //generate the URL
            startQuote('login.aspx?brandID=0&email=' + email + '&pwd=' + password);
        }
    }
}
// End 