// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;

<!-- // Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Can't detect in all other cases
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
   	// loop backwards through the versions until we find the newest version	
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
				
			}
		}
	}	
}
function screenSize() {
	// Find out the size of the screen and modify the amount of 'gap' to add to it
	if (screen.availHeight < 600) {
		cGap = 250;
	} else {
		cGap = 325;
	}
	cHeight = screen.availHeight - cGap;
	
	cDiv1 = document.getElementById("div1");
	cDiv2 = document.getElementById("div2");
	cDiv3 = document.getElementById("div3");
		
	// Find out which section (left, middle, right) is the longest
	if (cDiv1.clientHeight > cDiv2.clientHeight && cDiv1.clientHeight > cDiv3.clientHeight) {
		if (cDiv1.clientHeight > cHeight) {
			cHeight = cDiv1.clientHeight;
		}
	} else if (cDiv2.clientHeight > cDiv3.clientHeight) {
		if (cDiv2.clientHeight > cHeight) {
			cHeight = cDiv2.clientHeight;
		}
	} else {
		if (cDiv3.clientHeight > cHeight) {
			cHeight = cDiv3.clientHeight;
		}
	}
	
	// set all sections to be the same length;
	cDiv1.style.height = cHeight + "px";
	cDiv2.style.height = cHeight + "px";
	cDiv3.style.height = cHeight + "px";
}
function ShowTip(cID, obj) {
	// Grab the tooltip box and it's position
	cDiv = document.getElementById("tooltip"+cID);
	myleft = offsetX(obj);
	mytop = offsetY(obj);
	
	// Divide the position by 3 to center it
	myleft -= cDiv.offsetWidth/3;
	mytop -= cDiv.offsetHeight;

	// If it goes off the right side of the page, set it to move back on with 5 px of padding
	if (myleft + cDiv.offsetWidth > screen.availWidth) {
		myleft -= (myleft + cDiv.offsetWidth) - (screen.availWidth - 5);
	}
	
	// If it goes off the left or top of the page, bring it back in
	if (myleft < 0) {
		myleft = 0;
	}
	
	if (mytop < 0) {
		mytop = 0;
	}

	// Change the position and make it visible
	cDiv.style.top = mytop + "px";
	cDiv.style.left = myleft + "px";
	cDiv.style.visibility = "visible";
}
function HideTip(cID) {
	// Hide the tooltip
	cDiv = document.getElementById("tooltip"+cID);
	cDiv.style.visibility = "hidden";
}

function changeCaption(cImg) {
	// This function takes an image element, finds it's ALT tag value, and puts it into the designated caption area of the page.
	cParagraph = document.getElementById("caption");
	cParagraph.innerHTML = cImg.alt;
}

function offsetY(obj) {
	// Finds the screen's vertical offest
	curtop = 0;
	if (obj.offsetParent) {
	   	while (obj.offsetParent) {
    	   	curtop += obj.offsetTop;
            obj = obj.offsetParent;
        }
    } else if (obj.y) {
        curtop += obj.y;
	}
	return curtop;
}

function offsetX(obj) { 
	// Finds the screen's horizontal offset
	curleft = 0;
	if (obj.offsetParent) {
    	while (obj.offsetParent) {
        	curleft += obj.offsetLeft
            obj = obj.offsetParent;
        }
    } else if (obj.x) {
        curleft += obj.x;
	}
	return curleft;
}

function UpdateFields(cSelect) {
	// Updates the content of the shipping fields
	cProduct = document.getElementById("product");
	cHcode = document.getElementById("hcode");
	cProductForm = document.getElementById("ProductName");
	cHcodeForm = document.getElementById("HarmonizedCode");
	cIndicator = document.getElementById("indicator");
	
	switch(cSelect.options[cSelect.selectedIndex].value) {
		case "FedExInfoBarcode":
			cProduct.innerHTML = "Barcode Scanner(s)";
			cHcode.innerHTML = "8471.49.42.00";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>Barcode Scanner(s)</span>. See below.";
			break;
		case "FedExInfoDisplayLg":
			cProduct.innerHTML = "Flat Panel Monitor(s) (over 30.5cm diagonal width)";
			cHcode.innerHTML = "8471.60.45.00";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>Flat Panel Monitor(s) (over 30.5cm diagonal width)</span>. See below.";
			break;
		case "FedExInfoDisplaySm":
			cProduct.innerHTML = "Flat Panel Monitor(s) (under 30.5cm diagonal width)";
			cHcode.innerHTML = "8471.60.30.00";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>Flat Panel Monitor(s) (under 30.5cm diagonal width)</span>. See below.";
			break;
		case "FedExInfoFlatTvLg":
			cProduct.innerHTML = "Flat Screen TV(s) (over 34.29cm diagonal width)";
			cHcode.innerHTML = "8528.12.72.01";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>Flat Screen TV(s) (over 34.29cm diagonal width)</span>. See below.";
			break;
		case "FedExInfoFlatTvSm":
			cProduct.innerHTML = "Flat Screen TV(s) (under 34.29cm diagonal width)";
			cHcode.innerHTML = "8528.12.68.01";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>Flat Screen TV(s) (under 34.29cm diagonal width)</span>. See below.";
			break;
		case "FedExInfoHDDBare":
			cProduct.innerHTML = "Internal Hard Drive(s)";
			cHcode.innerHTML = "8471.70.40.65";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>Internal Hard Drive(s)</span>. See below.";
			break;
		case "FedExInfoHDDEnclosure":
			cProduct.innerHTML = "External Hard Drive(s)";
			cHcode.innerHTML = "8471.70.50.65";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>External Hard Drive(s)</span>. See below.";
			break;
		case "FedExInfoLaptop":
			cProduct.innerHTML = "Laptop(s)";
			cHcode.innerHTML = "8471.30.00.00";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>Laptop(s)</span>. See below.";
			break;
		case "FedExInfoLaptopHinges":
			cProduct.innerHTML = "Laptop Hinge(s)";
			cHcode.innerHTML = "8302.10.60.90";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>Laptop Hinge(s)</span>. See below.";
			break;
		case "FedExInfoLCD": 
			cProduct.innerHTML = "LCD Display(s) (Non Monitor/TV)";
			cHcode.innerHTML = "9013.80.70.00";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>LCD Display(s) (Non Monitor/TV)</span>. See below.";
			break;
		case "FedExInfoLCDParts":
			cProduct.innerHTML = "LCD Part(s) (Non Monitor/TV)";
			cHcode.innerHTML = "9013.90.50.00";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>LCD Part(s) (Non Monitor/TV)</span>. See below.";
			break;
		case "FedExInfoOtherDrive":
			cProduct.innerHTML = "Optical, CD, DVD Drive(s)";
			cHcode.innerHTML = "8471.70.90.00";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>Optical, CD, DVD Drive(s)</span>. See below.";
			break;
		case "FedExInfoTapeBare":
			cProduct.innerHTML = "Internal Tape Drive(s)";
			cHcode.innerHTML = "8471.70.60.00";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>Internal Tape Drive(s)</span>. See below.";
			break;
		case "FedExInfoTapeEnclosure":
			cProduct.innerHTML = "External Tape Drive(s)";
			cHcode.innerHTML = "8471.70.90.00";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>External Tape Drive(s)</span>. See below.";
			break;
		case "FedExInfoTelescopeComplete":
			cProduct.innerHTML = "Whole Telescope(s)";
			cHcode.innerHTML = "8471.70.40.40";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>Whole Telescope(s)</span>. See below.";
			break;
		case "FedExInfoTelescopeParts":
			cProduct.innerHTML = "Telescope Component(s)";
			cHcode.innerHTML = "8471.70.80.00";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>Telescope Component(s)</span>. See below.";
			break;
case "Modem":
			cProduct.innerHTML = "Modem";
			cHcode.innerHTML = "8517.18.00.50";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>Modem</span>. See below.";
                        break;
case "Router":
			cProduct.innerHTML = "Network Router";
			cHcode.innerHTML = "8517.62.00.50";
			cIndicator.innerHTML = "Harmonized Code and Description updated for <span style='background-color : #FCFF2A; font-weight : bold;'>Router</span>. See below.";
			break;
		default:
			cProduct.innerHTML = "____________";
			cHcode.innerHTML = "___________";
			cIndicator.innerHTML = "";
			break;
	}
	cProductForm.value = cProduct.innerHTML;
	cHcodeForm.value = cHcode.innerHTML;
}




function PrinterFriendly() {
	// Submits the shipping form if someone has picked an item to ship
	cForm = document.getElementById("Printer");
	cSelect = document.getElementById("ProductList");
	
	if (cSelect.selectedIndex > 0) {
		if (document.all) {
			document.Printer.submit();
		} else {
			cForm.submit();
		}
	} else {
		alert("You must select a part to ship from the list.");
		cSelect.focus();
	}
}