<!--
// Global variables
var isCSS, isW3C, isIE4, isNN4;
var mainNum= ""
var subNum = ""

function openImgWindow(strWindowTitle, strImgName, intImgWidth, intImgHeight){
	var url = "img_zoom.asp?img=" + strImgName + "&title=" + strWindowTitle
	var intWindowWidth = intImgWidth + 90
	var intWindowHeight = intImgHeight + 110
	
	//Make sure the window will fit on an 8x6 screen vertically
	if (intWindowHeight > 525){
	  intWindowHeight -= (intWindowHeight - 525)
	  var scrollBarValue = "yes"
	}else{
	  var scrollBarValue = "no"
	}
	
	var strParams = "resizable=no,menubar=no,scrollbars=" + scrollBarValue + ",status=no,toolbar=no,"
	var strWidth = intWindowWidth.toString()
	var strHeight = intWindowHeight.toString()
	
	strParams += "width=" + strWidth + ",height=" + strHeight
	window.open(url, "", strParams)
}

// initialize upon load to let all browsers establish content objects
function initDHTMLAPI() {
    if (document.images) {
        isCSS = (document.body && document.body.style) ? true : false;
        isW3C = (isCSS && document.getElementById) ? true : false;
        isIE4 = (isCSS && document.all) ? true : false;
        isNN4 = (document.layers) ? true : false;
        isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
    }
}

// Seek nested NN4 layer from string name
function seekLayer(doc, name) {
    var theObj;
    for (var i = 0; i < doc.layers.length; i++) {
        if (doc.layers[i].name == name) {
            theObj = doc.layers[i];
            break;
        }
        // dive into nested layers if necessary
        if (doc.layers[i].document.layers.length > 0) {
            theObj = seekLayer(document.layers[i].document, name);
        }
    }
    return theObj;
}

// Convert object name string or object reference
// into a valid element object reference
function getRawObject(obj) {
    var theObj;
    if (typeof obj == "string") {
        if (isW3C) {
            theObj = document.getElementById(obj);
        } else if (isIE4) {
            theObj = document.all(obj);
        } else if (isNN4) {
            theObj = seekLayer(document, obj);
        }
    } else {
        // pass through object reference
        theObj = obj;
    }
    return theObj;
}

// Convert object name string or object reference
// into a valid style (or NN4 layer) reference
function getObject(obj) {
    var theObj = getRawObject(obj);
    if (theObj && isCSS) {
        theObj = theObj.style;
    }
    return theObj;
}

// Set the background color of an object
function setBGColor(obj, color) {
  var theObj = getObject(obj);
  if (theObj) {
    if (isNN4) {
      theObj.bgColor = color;
    } else if (isCSS) {
      theObj.backgroundColor = color;
    }
  }
}

function onMainMenuMouseOver(obj, page){
	if (page == mainNum) { 
	  setBGColor(obj, "#DCDCDC")
	}else{
  	setBGColor(obj, "#99CCFF")
  }
}

function onMainMenuMouseOut(obj, page){
	if (page == mainNum) { 
	  setBGColor(obj, "#DCDCDC")
	}else{
	  setBGColor(obj, "")
	}
}

function onSubMenuMouseOver(obj, page){
	if (page == subNum) { 
	  setBGColor(obj, "#DCDCDC")
	}else{
	  setBGColor(obj, "#99CCFF")
	}
}

function onSubMenuMouseOut(obj, page){
	if (page == subNum) { 
	  setBGColor(obj, "#DCDCDC")
	}else{
	  setBGColor(obj, "")
	}
}

function checkMaxLength(obj, intMaxLength, strNextCtl) {
  alert("checkMaxLength\n\nObj is:  " + obj.name + 
        "\nintMaxLength is:  " + intMaxLength + 
        "\nNext control is:  " + strNextCtl + 
        "\n\nobj.value is:  " + obj.value + 
        "\nobj.value.length is:  " + obj.value.length)
  if (obj.value.length == intMaxLength) {
    document.rfq.elements[strNextCtl].focus()
  }
}

function setPageNum(main, sub){
	mainNum = main
	subNum = sub
	
	var mainName = "main" + main
	var mainNameA = "main" + main + "a"
	var mainNameBtm = "main" + main + "Btm"
	var mainNameABtm = "main" + main + "aBtm"
	var subName = "sub" + sub
	
	setBGColor(mainName, "#DCDCDC")
	setBGColor(mainNameA, "#DCDCDC")
	setBGColor(mainNameBtm, "#DCDCDC")
	setBGColor(mainNameABtm, "#DCDCDC")
	if (sub != "0"){
  	setBGColor(subName, "#DCDCDC")
	}
}
//-->