//**************************************************************************************************
//OPEN LINK - Opens the specified link in the target desired (i.e., current window or new window)
//**************************************************************************************************

//Declare and Initialize variables
function OpenWin(strURL){
	var intWinWidth  = "800"
	var intWinHeight = "600"
	var intWinTop    = (screen.width-intWinHeight)/8
	var intWinLeft   = (screen.width-intWinWidth)/2
	NewWindow = open("" + strURL + "",'NewWindow','location=0,status=0,toolbar=1,resizable=1,scrolling=yes,scrollbars=yes,width=' + intWinWidth + ',height=' + intWinHeight + ',top=' + intWinTop + ',left=' + intWinLeft + '')
	NewWindow.focus();
	}

function OpenLink(strURL,strTarget){	
	switch(strTarget.toUpperCase()){
		case "CURRENT":
			parent.location = "" + strURL + "";
			break;
		case "NEW":
			OpenWin(strURL);
			break;	
		}
	}

function BranchPopup(X){
    var intWinWidth  = "366"
    var intWinHeight = "445"
    var intWinTop    = "50"
    var intWinLeft   = "330"
    BranchDetails = open("" + X + "",'IrvineLocation2','scrolling=no,width=' + intWinWidth + ',height=' + intWinHeight + ',top=' + intWinTop + ',left=' + intWinLeft + '')
    BranchDetails.focus();
}

// only deals with RV & Marine Loans Page
function ProcessSelection() {
    var dropDownIndex = document.getElementById('loanMenu').selectedIndex;
    var dropDownValue = document.getElementById('loanMenu')[dropDownIndex].value;

    if (dropDownValue == 'Marine') {
        popupWindow('FUN', 'http://www.fun-loan.com/boat_application.asp?acode=wfs', 'FUN', 800, 600, 4, 'yes', 'yes', 'yes', 'yes', 'yes');
    }
    else if (dropDownValue == 'RV') {
        popupWindow('FUN', 'http://www.fun-loan.com/rv_application.asp?acode=wfs', 'FUN', 800, 600, 4, 'yes', 'yes', 'yes', 'yes', 'yes');
    }
    else {
        alert('You must select an item from the drop down menu');
    }
}

// only deals with Loan Value Page
function ProcessValueSelection(){
    var dropDownIndex = document.getElementById('loanMenu').selectedIndex;
    var dropDownValue = document.getElementById('loanMenu')[dropDownIndex].value;
    
    if (dropDownValue == 'Used') {
        popupWindow('popupWin', '/Consumers/popups/auto_values_used.htm','Used',880,620,10,'no','no','no','yes','yes');
    }
    else if (dropDownValue == 'New') {
        popupWindow('popupWin', '/Consumers/popups/auto_values_new.htm','New',880,620,10,'no','no','no','yes','yes');
    }
    else {
        alert('You must select an item from the drop down menu');
    }
}
