function openPopupWindow(url, width, height, junk1, junk2, scrlbars, toolbar, menubar, resizable, location) {
    var cleanValue = function (value) {
        if (!value)
            return 'no';
        return value;
    };
    window.open(url, null, 'width=' + width + ',height=' + height + ',status=yes,scrollbars=' + cleanValue(scrlbars)
        + ',toolbar=' + cleanValue(toolbar) + ',menubar=' + cleanValue(menubar) + ',location=' + cleanValue(location) 
        + ',resizable=' + cleanValue(resizable), false);
	return false;
}
function openScrollablePopupWindow(url, width, height) {
	window.open(url, "", "width=" + width + ",height=" + height + ",top=20,left=20,location=no,menubar=no,toolbar=no,scrollbars=yes,resizable=no");
}
function openScrollablePopupWindow(url, width, height) {
    window.open(url, "", "width=" + width + ",height=" + height + ",top=20,left=20,location=no,menubar=no,toolbar=no,scrollbars=yes,resizable=no");
}
function printDiv(divId, divTitle, title, authors, format, copyright, lastUpdate, availability, price, shipping, baseUrlPath) {
	var body = "<body><div class=\"FloatLeft\">\n";
    body += "\t<img alt=\"\" src='" + baseUrlPath + "/images/logos/West.gif' />\n\t";
    body += "<div style=\"padding-left:10px\">\n\t<b>" + title + "</b><br />";
    if (authors.length > 0)
        body += "<b>" + authors + "</b>\n\t";
    if (format.length > 0)
        body += "<br /><small>" + format + "</small>\n\t";
    if (copyright.length > 0)
        body += "<br /><small>Copyright: " + copyright + "</small>\n\t";
    if (lastUpdate.length > 0)
        body += "<br /><small>Last Updated: " + lastUpdate + "</small>\n\t";
    if (availability.length > 0)
        body += "<br /><small>Availability: " + availability + "</small>\n\t";
    if (price.length > 0)
        body += "<br /><small>List Price: " + price + "</small>\n\t";
    if (shipping.length > 0)
        body += "<br /><small>Shipping: " + shipping + "</small>\n\t";
    body += "</div>\n";
    body += "\t<div style=\"padding-left:10px\"><small>" + divTitle + ":</small></div>\n\n";
    if (document.getElementById(divId) == null)
        body += "Error: div tag '" + divId + "' not found.";
    else
        body += document.getElementById(divId).innerHTML.replace('style="OVERFLOW: auto"', '');
    body += "</div>\n</body>";
    sitecommon_printBody(body, title);
}
function sitecommon_printBody(body, title) {
    var html = "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
    var links = $("<div>").append($("link").clone()).html();
    html += "<head>" + links + "<title>" + title + "</title></head>\n" + body + "</html>";
    var width = 800;
    var height = 600;
    var left = Math.floor((screen.width - width) / 2);
    var top = Math.floor((screen.height - height) / 2);
    var settings = "toolbar=yes,resizable=yes,location=no,directories=no,menubar=no,status=yes,scrollbars=yes,width=" + width + ",height=" + height + ";left=" + left + ";top=" + top + ";";
    var printDiv = window.open('', '', settings);
    printDiv.document.open("text/html");
    printDiv.document.write(html);
    printDiv.document.close();
    printDiv.print();
    printDiv.close();
}
function printFunnel(divId, title, baseUrlPath) {
    var body = "<body onclick=\"window.status='Read Only'; return false\" onmouseout=\"window.status='Read Only';\">\n";
    body += "\t<img alt=\"" + title + "\" src='" + baseUrlPath + "/images/logos/West.gif' />\n";
    if (document.getElementById(divId) == null)
        body += "Error: div tag '" + divId + "' not found.";
    else
        body += document.getElementById(divId).innerHTML;
    body += "\n</body>";
    sitecommon_printBody(body, title);
}
function setCookie(c_name, value, expiredays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + expiredays);
    document.cookie = c_name + "=" + escape(value) +
((expiredays == null) ? "" : ";expires=" + exdate.toUTCString()) + "; path=/;";
}
function getCookie(c_name) {
    if (document.cookie.length > 0) {
        c_start = document.cookie.indexOf(c_name + "=");
        if (c_start != -1) {
            c_start = c_start + c_name.length + 1;
            c_end = document.cookie.indexOf(";", c_start);
            if (c_end == -1) c_end = document.cookie.length;
            return unescape(document.cookie.substring(c_start, c_end));
        }
    }
    return "";
}
