function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		home_over = newImage("images/home-over.gif");
		departments_home_over = newImage("images/departments-home_over.gif");
		products_home_over = newImage("images/products-home_over.gif");
		manufacturers_home_over = newImage("images/manufacturers-home_over.gif");
		go2marine_home_over = newImage("images/go2marine-home_over.gif");
		quotes_home_over = newImage("images/quotes-home_over.gif");
		contactus_home_over = newImage("images/contactus-home_over.gif");
		preloadFlag = true;
	}
}

var buttonClicked = false;
function isButtonClicked() {
    return buttonClicked;
}

//Commercial Account

function submitCommercialLogin() {
    buttonClicked = true;
    document.commLogin.submit();    
}

function submitRetailLogin() {
    buttonClicked = true;
    document.retailLogin.submit();    
}

function commApply () {
    newWin = window.open('go2marine/commApply.shtml','CommApply','width=500,height=350,resizable=yes');
    newWin.focus();
}

function launchGo2marine() {
	opener.window.open('http://www.go2marine.com','Go2marine','width=800,height=600,resizable=yes,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=no,');

window.close(); 
}

function msQuote(url) {
    window.opener.parent.location = url;
    window.close();
}

function openpopup() {
    newWin = window.open('/commdivision/go2marine/popup.shtml','PopUp','width=500,height=250,resizable=yes');
    newWin.focus();
}

function openQuotes() {
    newWin = window.open('/commdivision/quotes/popup.shtml', 'Quotes', 'width=500,height=425,resizable=yes');
    newWin.focus();
}

var popUp;

function PopWin(url, newWidth, newHeight) {
    var heightValue = 500;
    var widthValue = 700;

    if (popUp && !popUp.closed) {
        popUp.close();
    }

    if (newHeight != null && newHeight != "") {
        heightValue = newHeight;
    }

    if (newWidth != null && newWidth != "") {
        widthValue = newWidth;
    }

    popUp=window.open(url,"PopUp","scrollbars=1,resizable=1,width="+widthValue+",height="+heightValue+",left=0,top=0");
}

function newCommAccount () {
	opener.window.open('http://www.go2marine.com/g2m?action=NewCommercialCustomer','Go2marine','width=800,height=600,resizable=yes,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=no,');

	window.close(); 
}

function commAccountInfo () {	
	opener.window.open('http://www.go2marine.com/pop/com_accts_register.html','Go2marine','width=700,height=500,resizable=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,');

window.close(); 
}





