function checkMMDDYYYY(objName) {
	var strDatestyle = "US"; //United States date style
	var strDate;
	var strDateArray;
	var strDay;
	var strMonth;
	var strYear;
	var intday;
	var intMonth;
	var intYear;
	var booFound = false;
	var datefield = objName;
	var strSeparatorArray = new Array("/");
	var intElementNr;
	var err = 0;

	strDate = datefield.value;
	if (strDate.length < 1) {
		return true;
	}
        if (strDate.indexOf(strSeparatorArray[0]) < 0) {
                return false;
        }
	for (intElementNr = 0; intElementNr < strSeparatorArray.length; intElementNr++) {
		if (strDate.indexOf(strSeparatorArray[intElementNr]) != -1) {
			strDateArray = strDate.split(strSeparatorArray[intElementNr]);
		if (strDateArray.length != 3) {
			err = 1;
			return false;
		}else {
			strDay = strDateArray[0];
			strMonth = strDateArray[1];
			strYear = strDateArray[2];
		}
		booFound = true;
	   }
	}
	if (booFound == false) {
		if (strDate.length > 5) {
			strDay = strDate.substr(0, 2);
			strMonth = strDate.substr(2, 2);
			strYear = strDate.substr(4);
	   }
	}
	if (strYear.length != 4) {
		return false;
	}
	// US style
	if (strDatestyle == "US") {
		strTemp = strDay;
		strDay = strMonth;
		strMonth = strTemp;
	}
	intday = parseInt(strDay, 10);
	if (isNaN(intday)) {
		err = 2;
		return false;
	}
	intMonth = parseInt(strMonth, 10);
	if (isNaN(intMonth)) {
		for (i = 0;i<12;i++) {
			if (strMonth.toUpperCase() == strMonthArray[i].toUpperCase()) {
				intMonth = i+1;
				strMonth = strMonthArray[i];
				i = 12;
			}
		}
		if (isNaN(intMonth)) {
			err = 3;
			return false;
	   }
	}
	intYear = parseInt(strYear, 10);
	if (isNaN(intYear)) {
		err = 4;
		return false;
	}
	if (intMonth>12 || intMonth<1) {
		err = 5;
		return false;
	}
	if ((intMonth == 1 || intMonth == 3 || intMonth == 5 || intMonth == 7 || intMonth == 8 || intMonth == 10 || intMonth == 12) && (intday > 31 || intday < 1)) {
		err = 6;
		return false;
	}
	if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intday > 30 || intday < 1)) {
		err = 7;
		return false;
	}
	if (intMonth == 2) {
	if (intday < 1) {
		err = 8;
		return false;
	}
	if (LeapYear(intYear) == true) {
		if (intday > 29) {
			err = 9;
			return false;
		}
	} else {
		if (intday > 28) {
			err = 10;
			return false;
		}
	}
	}
	return true;
	}
	function LeapYear(intYear) {
	if (intYear % 100 == 0) {
		if (intYear % 400 == 0) { return true; }
	}
	else {
		if ((intYear % 4) == 0) { return true; }
	}
	return false;
}


function checkQtyBox(txtBox, itemNum, descr, itemPrice) {
  var result = true;
  var quantity = document.getElementById(txtBox).value;
  var extra = "";
  if (itemNum != "") extra = "\n\nFor Item: " + itemNum;
  if (descr != "") extra += " : " + descr;
  if (!isNumeric(quantity)) {
   	result = false;
	alert("Quantity can only be a numeric value." + extra);
  } else if (quantity < 1 && itemPrice >= 8) {
    	result = false;
	alert("Quantity ordered cannot be zero." + extra);
  } else if (quantity > 10000) {
    	result = false;
	alert("Quantity ordered can not exceed 10,000." + extra);
  }
  if (result) {
	if (parseInt(quantity) > 50) {
		alert("Please call for special pricing and availability on this type of quantity");
	}
  }
  return result;
}


function isNumeric(string) {
  var numbers = "0123456789";
  var result = true;
  var i = 0;
  if (string == "") result = false;
  while (result && i < string.length)
  {
    if (numbers.indexOf(string.charAt(i)) == -1)
	{
	  result = false;
	}
	i ++;
  }
  return result;
}

function singleAdd(form, qtyField, chkField) {
  if (checkQtyBox(qtyField, '', ''))
  {
    var qty = document.getElementById(qtyField).value;
	if(qty=="0")qty=1;
    document.getElementById(form).reset();
    document.getElementById(qtyField).value = qty;
    document.getElementById(chkField).checked = true;
    document.getElementById(form).submit();
  }
}

function getSelectedRadioValue(radioGroup) {
  var selectedRadioValue="";
  var radIndex;
  for (radIndex = 0; radIndex < radioGroup.length; radIndex ++)
  {
    if (radioGroup[radIndex].checked)
	{
	  selectedRadioValue = radioGroup[radIndex].value;
	  break;
	}
  }
  return selectedRadioValue;
}

function checkOrderQty(fld, maxQty, currQty) {
  if (fld == null) return currQty;
  if (fld.value != '') 
  { 
	if (!isNumeric(fld.value)) { 
		alert("Order quantity must be a numeric value."); 
		fld.value = currQty; 
	} else if (parseInt(fld.value) > 50) {
		alert("Please call for special pricing and availability on this type of quantity");
	}
  } 
  return fld.value;
}

function toggleTools(id) {
	var el = document.getElementById('tool_' + id);
	if (el) {
		if (el.style.display == '') {
			el.style.display = 'none';
		} else {
			el.style.display = '';
		}
	}
}

function toggleSellers(id) {
	var el = document.getElementById('top_' + id);
	if (el) {
		if (el.style.display == '') {
			el.style.display = 'none';
		} else {
			el.style.display = '';
		}
	}
}

function insertCount(id, count) {
	var el = document.getElementById('count_' + id);
	if (el) {
		el.innerHTML = '(' + count + ')';
	}
}

function addFavorite(rowID, productID) {
	var xmlObj = false;

	var el = document.getElementById('favorite_' + rowID);

	if (el) {
		el.style.display = 'none';
	}

	if (window.XMLHttpRequest) {
		xmlObj = new XMLHttpRequest();
	} else if (window.ActiveXObject) { 
		try {
			xmlObj = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
			try{
				xmlObj = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	} else {
		return false;
	}
	xmlObj.onreadystatechange=function(){
		if (xmlObj.readyState == 4 && xmlObj.status == 200) {
			if (xmlObj.responseText == 'true') {
				if (el) {
					el.innerHTML = '<span style="color:red">Added to your favorites!</span>';
				}
			} else {
				if (el) {
					el.innerHTML = '<span style="color:red">Please login first!</span>';
				}
			}

			if (el) {
				new Effect.Appear(el, {duration:1.0});
			}
		}
	}
	targetURL = '/ssi/ajax/addFavorite.asp?productID=' + productID;
	xmlObj.open('GET', targetURL, true);
	xmlObj.send(null);
}

	function removeQuoteItem(section,id) {
		var xmlObj = false;
		if (window.XMLHttpRequest) {
			xmlObj = new XMLHttpRequest();
		} else if (window.ActiveXObject) { 
			try {
				xmlObj = new ActiveXObject("Msxml2.XMLHTTP")
			} 
			catch (e){
				try{
					xmlObj = new ActiveXObject("Microsoft.XMLHTTP")
				}
				catch (e){}
			}
		} else {
			return false;
		}
		xmlObj.onreadystatechange=function(){
			if (xmlObj.readyState == 4 && xmlObj.status == 200) {
				var el = document.getElementById(section + '_' + id);
				var elNotes = document.getElementById(section + '_' + id + '_notes');
				if (el) {
					new Effect.Fade(el, {duration:1.0});
				}
				if (elNotes) {
					new Effect.Fade(elNotes, {duration:0.1});
				}
			}
		}
		targetURL = '/ssi/ajax/removeQuoteItem.asp?id='+id;
		xmlObj.open('GET', targetURL, true);
		xmlObj.send(null);
	}


function swap(section) {
  if (section == '') {
      section = 'intro';
  }
  var s = document.getElementById(section + '_text');
  var t = document.getElementById('swappable_text');
  if (s && t) {
      t.innerHTML = s.innerHTML;
  }
}

function toOn(section) {
  document[section].src = eval(section + "_o.src");
}

function toOff(section) {
  document[section].src = eval(section + ".src");
}

function resetCart() {
	if (confirm("Are you sure you want to empty this cart?")) {
		document.location = '/cart/empty.asp';
	}
}

function sameAsBilling() {
	// billTo_
	//   cname, address0, address1, address2, address3, address4, address5, stProv, countryCd, postalCd
	//   fax1, fax2, fax3, phone1, phone2, phone3

	if (document.form1.iSameAsBilling.checked) {		
		document.form1.name.value = document.form1.billTo_cname.value;	
		document.form1.address1.value = document.form1.billTo_address0.value;
		document.form1.address2.value = document.form1.billTo_address1.value;
		document.form1.address3.value = document.form1.billTo_address2.value;
		document.form1.city.value = document.form1.billTo_address3.value;
		document.form1.postal.value = document.form1.billTo_postalCd.value;
		document.form1.shipphone1.value = document.form1.billTo_phone1.value;
		document.form1.shipphone2.value = document.form1.billTo_phone2.value;
		document.form1.shipphone3.value = document.form1.billTo_phone3.value;
		document.form1.shipfax1.value = document.form1.billTo_fax1.value;
		document.form1.shipfax2.value = document.form1.billTo_fax2.value;
		document.form1.shipfax3.value = document.form1.billTo_fax3.value;
		populateDD('lstState', document.form1.billTo_stProv.value);
		if (document.form1.billTo_countryCd.value == 'US') {
			populateDD('lstCountry', '5');
		} else if (document.form1.billTo_countryCd.value == 'DE') {
			populateDD('lstCountry', '1');
		} else if (document.form1.billTo_countryCd.value == 'FR') {
			populateDD('lstCountry', '2');
		} else if (document.form1.billTo_countryCd.value == 'MEX') {
			populateDD('lstCountry', '3');
		} else if (document.form1.billTo_countryCd.value == 'UK') {
			populateDD('lstCountry', '4');
		} else if (document.form1.billTo_countryCd.value == 'CAN') {
			populateDD('lstCountry', '0');
		} else if (document.form1.billTo_countryCd.value == 'KY') {
			populateDD('lstCountry', '7');
		}
	}
}

function populateDD(field, value) {
	for (i=0; i < document.form1.elements[field].length; i++) {
		if (document.form1.elements[field].options[i].value == value) {
			document.form1.elements[field].options[i].selected = true;
		}
	}
}

function toggleCart(m) {
	var el = document.getElementById('quickCart');
	if (!el) return false;
	if (m == 'show') {
		el.style.display = 'block';
	} else { 
		el.style.display = 'none';
	}
}

function addQuoteItem(i) {
	window.location = '/price-quotes/queue.asp?mode=add&i=' + i;
}

function changePage(href) {
	document.form1.action=href;
	document.form1.submit();
}

//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}


function removeFavorite(productID) {
	if (confirm("Are you sure you want to remove this product?")) {
		window.location = '/favorites/default.asp?delete=' + productID;
	}
}

function saveFavorite(productID) {
	var xmlObj = false;
	if (window.XMLHttpRequest) {
		xmlObj = new XMLHttpRequest();
	} else if (window.ActiveXObject) { 
		try {
			xmlObj = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
			try{
				xmlObj = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	} else {
		return false;
	}
	xmlObj.onreadystatechange=function(){
		if (xmlObj.readyState == 4 && xmlObj.status == 200) {
			if (xmlObj.responseText == 'true') {
				alert('The product has been added as a favorite');
			} else {
				alert('The product could not be added as a favorite.  Please login first.');
			}
		}
	}
	targetURL = '/ssi/ajax/addFavorite.asp?productID=' + productID;
	xmlObj.open('GET', targetURL, true);
	xmlObj.send(null);
}

function pwdRemind() {
	var myleft, mytop;
	myleft = (screen.width) ? (screen.width - 500) / 2: 100;
	mytop = (screen.height) ? (screen.height - 300) / 2: 100;
	window.open("/account/popPwdRemind.asp","new_win","top="+mytop+",left="+myleft+",toolbar=no,width=500,height=300,scrollbars=no,resizable=no");
}


function openWindow(on,rs,m) {
	var myleft, mytop;
	myleft = (screen.width) ? (screen.width - 800) / 2: 100;
	mytop = (screen.height) ? (screen.height - 600) / 2: 100;
	window.open("/account/popInvoice.asp?on="+on+"&rs="+rs+"&m="+m+"","new_win", "top="+mytop+",left="+myleft+",toolbar=no,width=800,height=600,scrollbars=yes,resizable=yes");
}

function openWindowOrder(on,rs) {
	var myleft, mytop;
	myleft = (screen.width) ? (screen.width - 800) / 2: 100;
	mytop = (screen.height) ? (screen.height - 600) / 2: 100;
	window.open("/account/popInvoice.asp?on="+on+"&rs="+rs+"&m=O","new_win", "top="+mytop+",left="+myleft+",toolbar=no,width=800,height=600,scrollbars=yes,resizable=yes");
}

function openWindowInvoice(on,rs) {
	var myleft, mytop;
	myleft = (screen.width) ? (screen.width - 800) / 2: 100;
	mytop = (screen.height) ? (screen.height - 600) / 2: 100;
	window.open("/account/popInvoice.asp?on="+on+"&rs="+rs+"&m=I","new_win", "top="+mytop+",left="+myleft+",toolbar=no,width=800,height=600,scrollbars=yes,resizable=yes");
}

function openWindowReceipt(o) {
	var myleft, mytop;
	myleft = (screen.width) ? (screen.width - 800) / 2: 100;
	mytop = (screen.height) ? (screen.height - 600) / 2: 100;
	window.open("/cart/popReceipt.asp?o="+o,"new_win", "top="+mytop+",left="+myleft+",toolbar=no,width=800,height=600,scrollbars=yes,resizable=yes");
}

function addLoadEvent(func) {
	var oldonload = window.onload;

	if (typeof window.onload != 'function') {
		window.onload = func;
	}	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

// based on script by Sandeep V. Tamhankar (stamhankar@hotmail.com) 
function verifyEmail(emailStr) {
	var emailPat = /^(.+)@(.+)$/;
	var specialChars = "\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
	var validChars = "\[^\\s" + specialChars + "\]";
	var quotedUser = "(\"[^\"]*\")";
	var ipDomainPat = /^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	var atom = validChars + '+';
	var word = "(" + atom + "|" + quotedUser + ")";
	var userPat = new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat= new RegExp("^" + atom + "(\\." + atom +")*$");

	var matchArray = emailStr.match(emailPat);

	if (matchArray == null) { return false;}

	var user = matchArray[1]
	var domain = matchArray[2]
	if (user.match(userPat) == null) { return false; }

	var IPArray=domain.match(ipDomainPat)
	if (IPArray != null) {
		for (var i=1; i<=4; i++) {
	    		if (IPArray[i] > 255) {
	        		return false;
	    		}
    	}
   		return true;
	}

	var domainArray = domain.match(domainPat)
	if (domainArray == null) {
		return false;
	}

	var atomPat = new RegExp(atom,"g")
	var domArr = domain.match(atomPat)
	var len = domArr.length
	if (domArr[domArr.length-1].length < 2 || domArr[domArr.length-1].length > 3) {
		return false;
	}

	if (len < 2) { return false; }
	
   	return true;
}

// by Paul@YellowPencil.com and Scott@YellowPencil.com
// feel free to delete all comments except for the above credit

function setTall() {
	if (!document.getElementById) return;
	
	if (document.getElementById('submenu') && document.getElementById('content')) {
		var divs = new Array(document.getElementById('submenu'), document.getElementById('content'));
		
		var maxHeight = 0;
		for (var i = 0; i < divs.length; i++) {
			if (divs[i]) {
				if (divs[i].offsetHeight > maxHeight) maxHeight = divs[i].offsetHeight;
			}
		}
	
		if (maxHeight < 200) {
			maxHeight = 200;
		}
	
		for (var i = 0; i < divs.length; i++) {
			if (divs[i]) {
				divs[i].style.height = maxHeight + 'px';
	
				if (divs[i].offsetHeight > maxHeight) {
					divs[i].style.height = (maxHeight - (divs[i].offsetHeight - maxHeight)) + 'px';
				}
			}
		}
	}
}

function prepopulateDropdown(field,currValue) {
	for (i=0; i < document.form1.elements[field].length; i++) {
		if (document.form1.elements[field].options[i].value == currValue) {
			document.form1.elements[field].options[i].selected = true;
		}
	}
}
function prepopulateRadio(field,currValue) {
	for (i=0; i < document.form1.elements[field].length; i++) {
		if (document.form1.elements[field][i].value == currValue) {
			document.form1.elements[field][i].checked = true;
		}
	}
}
function prepopulateCheckbox(field,currValue) {
	if (document.form1.elements[field].value == currValue || currValue == 'on') {
		document.form1.elements[field].checked = true;
	}
}
function confirmOrderCancellation(o) {
	if (confirm("Are you sure you want to cancel this order?")) {
		window.location = '/account/cancel.asp?o=' + o;
	}
}

function openTechSupport() {
  var newWin = window.open("/rma/support.asp", "TechSupport", "height=500px,width=650px,menubar=no,toolbar=no,resizable=no,status=no");
}

function createPlayer(thePlace, thePlayer, theFile, start, icons , theID) {
	var s1 = new SWFObject("/new/images/mediaplayer/mediaplayer.swf", thePlayer, "68","20","8");
	s1.addParam("allowfullscreen", "true");
	s1.addParam("wmode","transparent");
	s1.addVariable("enablejs","true");
	s1.addVariable("repeat","true");
	s1.addVariable("shuffle","false");
	s1.addVariable("file", theFile);
	s1.addVariable("javascriptid",thePlayer);
	s1.addVariable("id",theID);
	s1.addVariable("width", "68");
	s1.addVariable("height", "20");
	if (start) s1.addVariable("autostart", "true");
	s1.write(thePlace);
}

/**
 * SWFObject v1.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formarly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, useExpressInstall, quality, xiRedirectUrl, redirectUrl, detectKey){
	if (!document.createElement || !document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute('version'), useExpressInstall);
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', useExpressInstall);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs.push(key +"="+ variables[key]);
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) this.addVariable("MMplayerType", "PlugIn");
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) this.addVariable("MMplayerType", "ActiveX");
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(reqVer, xiInstall){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else{
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			for (var i=3; axo!=null; i++) {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
				PlayerVersion = new deconcept.PlayerVersion([i,0,0]);
			}
		}catch(e){}
		if (reqVer && PlayerVersion.major > reqVer.major) return PlayerVersion; // version is ok, skip minor detection
		// this only does the minor rev lookup if the user's major version 
		// is not 6 or we are checking for a specific minor or revision number
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		if (!reqVer || ((reqVer.minor != 0 || reqVer.rev != 0) && PlayerVersion.major == reqVer.major) || PlayerVersion.major != 6 || xiInstall) {
			try{
				PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
			}catch(e){}
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = parseInt(arrVersion[0]) != null ? parseInt(arrVersion[0]) : 0;
	this.minor = parseInt(arrVersion[1]) || 0;
	this.rev = parseInt(arrVersion[2]) || 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param){
		var q = document.location.search || document.location.hash;
		if(q){
			var startIndex = q.indexOf(param +"=");
			var endIndex = (q.indexOf("&", startIndex) > -1) ? q.indexOf("&", startIndex) : q.length;
			if (q.length > 1 && startIndex > -1) {
				return q.substring(q.indexOf("=", startIndex)+1, endIndex);
			}
		}
		return "";
	}
}

/* add Array.push if needed (ie5) */
if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;

function searchFocus() {
	if (document.forms['frmSearch'].elements['itemNumber'].value == 'Enter product #') {
		document.forms['frmSearch'].elements['itemNumber'].value = '';
	}
}

function searchBlur() {
	if (document.forms['frmSearch'].elements['itemNumber'].value == '') {
		document.forms['frmSearch'].elements['itemNumber'].value = 'Enter product #';
	}
}
