// need to consolidate these into one and pass the window parameters; will do later
function printWindow(url) {
	window.open(url, "NewWindow", "width=600,height=400,status=no,resizable=yes,scrollbars=yes");
}

function gotoPage(object) {
    window.location.href = object.options[object.selectedIndex].value;
}

function openWin(url){
	w = window.open(url, "VWindow", "width=700,height=400,status=no,location=yes,resizable=yes,scrollbars");
}
function openShippingWin(url){
	w = window.open(url, "shippingOffer", "width=500,height=300,status=no,resizable=yes,scrollbars=yes");
}
function imgWindow(url){
	w = window.open(url, "NewWindow", "width=450,height=400,status=no,resizable=yes,scrollbars");
}

function multiImgWindow(url){
	window.open(url, "MIWindow", "width=450,height=450,status=no,resizable=yes,scrollbars");
}

function popup(fileName,name,winwidth,winheight) {
	var page = fileName;
	var windowprops = "width=" + winwidth + ",height=" + winheight + ",location=no,scrollbars=no,menubar=no,toolbar=no,resizable=no";
	window.open(page, name, windowprops);  
}

function scrollbarPopup(fileName,name,winwidth,winheight) {
	var page = fileName;
	var windowprops = "width=" + winwidth + ",height=" + winheight + ",location=no,scrollbars=yes,menubar=no,toolbar=no,resizable=no";
	window.open(page, name, windowprops);  
}

function left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}
function mid(str, start, len)
{
// Make sure start and len are within proper bounds
    if (start < 0 || len < 0) return "";
    var iEnd, iLen = String(str).length;
    if (start + len > iLen)
          iEnd = iLen;
    else
          iEnd = start + len;
    return String(str).substring(start,iEnd);
}