var SSACode     = " ";

function openNewWindowURL(inRef, linkId)
{
    var tempURL = new String();
    var x       = screen.width;
    var y       = screen.height;
    var axel    = Math.random() + "";
    var ord     = axel * 1000000000000000000;

    if(SSACode != " ")
    {
        tempURL = "http://" + location.host + '/tracking/redirect/get_a_quote_button2.htm?' + "inRef="+inRef + '&SSACode=' + SSACode;
    }
    else
    {
        tempURL = "http://" + location.host + '/tracking/redirect/get_a_quote_button2.htm?' + "inRef="+inRef;
    }

    if ( typeof linkId != "undefined" ){
        tempURL =  tempURL + "&linkType="+linkId;
    }

    if(x > 799)
    {
        x = screen.width - 10;
        y = screen.height - 80;
    }
    parms = new String("width=" + x + ",height=" + y + ",scrollbars=yes,menubar=visible,statusbar=yes,status=yes,location=no,toolbar=no,history=no,resizable=yes,screenX=0,screenY=0,top=0,left=0");

    switch( inRef )
    {
        case "000100":
            tempURL = "/tracking/redirect/dlfs/dlfs_loans_calculator.htm";
    	    if ( typeof linkId != "undefined" ){
            	var theURL = "/tracking/redirect/dlfs/dlfs_loans_calculator.htm?linkType="+linkId;
    	    }
            DLIWindow = window.open(tempURL,"","height=600,width=800,screenY=50,top=15,left=50, menu=no, directories=no, status=yes , scrollbars=no,resizable=no");
            break;
        case "REGISTER":
            tempURL = "/folder_hostedservices/index.htm?req=req";
            DLIWindow = window.open(tempURL,"",parms);
            break;
        case "COPYRIGHT":
            var winleft = screen.width - 600 - 20;
            var wintop = screen.height - 130 - 60;
            parms ='width=600,height=130,scrollbars=no,left='+winleft+',top='+wintop+',status=yes';
    	    if ( typeof linkId != "undefined" ){
                DLIWindow = window.open( "copyright.htm?linkType="+linkId,"copyright",parms);
    	    }
            else
            {
                DLIWindow = window.open( "copyright.htm","copyright",parms);
            } 

            break;
        case "ONE_ACCOUNT":
            var theURL = "/tracking/redirect/oneaccount/service_oneaccount_newapp.htm";
    	    if ( typeof linkId != "undefined" ){
            	var theURL = "/tracking/redirect/oneaccount/service_oneaccount_newapp.htm?linkType="+linkId;
    	    }
            var winOpts='width=909,height=620,resizable=yes,toolbar=no,menubar=no,status=no,scrollbars=yes,top=10,left=10';
            var newWin=window.open(theURL,"directOne",winOpts);
            break;
        default:
            DLIWindow = window.open(tempURL,"",parms);
    }
    return;
}

function opennew(name, url, linkId)
{
    if ( typeof linkId != "undefined" ){
    	url = url+"?linkType="+linkId;
    }
    saleswin=window.open(url,name,"status=yes,scrollbars=yes,resizable=yes,width=777,height=560");
}
