//ajax
var http_request = false;

function makeRequest(url, idname) {
    http_request = false;

    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/xml');
        }
    } else if (window.ActiveXObject) { // IE
    try {
        http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
                    } catch (e) {}
            }
    }

    if (!http_request) {
        alert('Cannot create an XMLHTTP instance');
        return false;
    }
    http_request.onreadystatechange = function() { alertContents(http_request, idname); };
    http_request.open('GET', url, true);
    http_request.send(null);
}

function alertContents(http_request, idname) {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            document.getElementById(idname).innerHTML = http_request.responseText;
        } else {
            alert('There was a problem with the request.');
        }
    }else{
        document.getElementById(idname).innerHTML = '<img src="/images/loading.gif" style="padding:10px;" />';
    }
}
////////////////////////////////////////////////////////////////
function menuOpen(child) {
    var v = document.getElementById(child);
    if (null != v)
        v.className = v.className == "collapsed" ? "expanded" : "collapsed";
}

window.name = "main"

function showcalc(doc_name)
{
	remote = window.open(doc_name, "calc", "height=450,width=550")
}
function bg(id, color) {
  document.getElementById(id).style.borderColor = '#'+color;
}
function changeImage(imgName, stockNo) { //v4.0
	document.vesselImage.src = "http://yachtauctions.com/images/" + stockNo + "/" + imgName;
}

function viewPhotos(path){
  //window.open( path,'','toolbar=no, menubar=no, width=600,height=600' );
}

function printlisting()
{
			window.open( '/listing/print/94850909/' );
	}
	
function popWin( url, name, width, height, scroller ) { var outStr = 'height=' + height + ',width=' + width; if (scroller != 'true') { outStr = outStr + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no'; } else { outStr = outStr + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no'; } window.open(url, name, outStr); }
function SecondWindow (URL){ 
  window.open(URL,"Window1","width=800,height=540,scrollbars=YES,directories=YES,menubar=YES,toolbar=YES,location=YES,resizable=YES")
} 