<!--  // hide the code
var DirLocation = (GetDirLvls());
// figures out where we are so we can set image paths to our relative location within the site directory structure...
function GetDirLvls(){
	var rtnValue = ""
	sTmp = (location.href.substring(0, location.href.lastIndexOf("/")).toLowerCase())
	sTmp = sTmp.replace("//", "")
	if (sTmp != ""){
		arrTmp = sTmp.split("/")
		for(var i = 1;i < (arrTmp.length-1);i++){
			if(i > 0){
				rtnValue = rtnValue + "../"
			}
		}
	}
	return rtnValue
}


/********* imports other js files from within a js file ****************************/
if (typeof(km_scripts) == 'undefined') var km_scripts = new Object();
function km_myclass_import(jsFile) {
	if (km_scripts[jsFile] != null) return;
	var scriptElt = document.createElement('script');
	scriptElt.type = 'text/javascript';
	scriptElt.src = jsFile;
	scriptElt.setAttribute('defer', 'defer');
	document.getElementsByTagName('head')[0].appendChild(scriptElt);
	km_scripts[jsFile] = jsFile;
}
function km_myclass_alert(){
	alert(importedValue);
}
km_myclass_import(DirLocation + 'js/sms_sideNavigation.js');
km_myclass_import(DirLocation + 'js/sms_vsSCLinkHandler.js');
km_myclass_import(DirLocation + 'js/SetActiveLink.js');
km_myclass_import(DirLocation + 'js/cookie.js');
km_myclass_import(DirLocation + 'js/debug.js');
km_myclass_import(DirLocation + 'js/swfobject.js');
km_myclass_import(DirLocation + 'js/pngfix_map.js');
km_myclass_import(DirLocation + 'js/pngfix.js');
km_myclass_import(DirLocation + 'js/Scrolling.Scroller.js');
km_myclass_import(DirLocation + 'js/Scrolling.Scrollbar.js');
km_myclass_import(DirLocation + 'js/Scrolling.ScrollTween.js');
km_myclass_import(DirLocation + 'js/ScrollInit.js');
km_myclass_import(DirLocation + 'js/ie6UpgradeMsg.js');

/********** end imports ***************************/


function loadBanner(){
	// <![CDATA[
	var soMain = new SWFObject("flash/RotatingText.swf", "rotatingText", "260", "15", "8", "#FFFFFF");
	//soMain.embedSWF("flash/RotatingText.swf", "rotatingText", "260", "120", "15.0.0", "expressInstall.swf");
	soMain.addParam("quality", "high");
	soMain.addParam("wmode", "transparent");
	soMain.addVariable("xmlFile","flash/RotatingText.xml");
	soMain.write("rotatingText");
	// ]]>
}

var timerId 
var today
var gotoLocation
function startTimer(destination){
   gotoLocation=destination
   window.setTimeout(((gotoLocation) ? "window.location.href = gotoLocation" : "location.reload()"), smsCoreCodeTimeLimit*1000)
}

function SwapBtnImg(objBtn, imageName){
	objBtn.src = ("images/" + imageName + ".gif");
}

function checkforNum(objElement){
	if (objElement.value != ""){
		var intNumber = parseInt(objElement.value);
		if (isNaN(intNumber)){
			objElement.value = "";
			objElement.focus();
		}else{
			objElement.value = intNumber
		}
	}
}

function createProcessDiv(){
	 var ProcessingContainer = document.createElement('DIV');
	 ProcessingContainer.id = "ProcessingContainer";
}

/*****************************************************************/
// css / javascript alert box...
var DisableBG = document.createElement('DIV');
var hoverInfo = document.createElement('DIV');
var hoverInfoContent = document.createElement('DIV');
var titleBar = document.createElement('DIV');
var closeLink = document.createElement('A');
var reloadFlag = false;
function createMessageDivs(){
	closeLink.innerHTML = "close"
	closeLink.href="javascript:void(0);"
	addEventSimple(closeLink,'click',HideCSSMsgBox);
	DisableBG.id = "DisableBG"
	hoverInfo.id = "hoverInfo"
	hoverInfoContent.id = "hoverInfoContent"
	titleBar.id = "titleBar"
	hoverInfo.appendChild(hoverInfoContent)
	hoverInfo.appendChild(titleBar)
	titleBar.appendChild(closeLink)
	document.body.appendChild(hoverInfo);
	document.body.appendChild(DisableBG);
}

function HideCSSMsgBox(){    
	try{
		hoverInfoContent.innerHTML = "";
		hoverInfo.style.display = "none";
		if (reloadFlag){
			document.location.reload();
		}else{
			DisableBG.style.display = "none";
		}
		reloadFlag = false;
		setFormFocus(); 
		return true;
	}catch(e){
		return false;
	}
}

// used for expandable windows...
function expandDiv(Msg, divWidth, divHeight){
	try{
	    var winl;
		var wint;
		var noPx = document.childNodes ? 'px' : 0;
		var windowWidth = document.documentElement.clientWidth || document.body.clientWidth;
	    var windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
		var windowScrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
		var windowScrollWidth = document.documentElement.scrollWidth || document.body.scrollWidth;
		winl = (windowWidth - divWidth) / 2;
	    wint = 30//(divHeight==0)?(30):((window.screen.height - divHeight) / 2);
		// grey out the background and set the height of the grey area to match that of page scroll.
		
		if (windowHeight>windowScrollHeight){
			windowScrollHeight = windowHeight
		}
		DisableBG.style.height = windowScrollHeight + noPx;
		DisableBG.style.display="block";
		
		// Insert message into our message container...
		hoverInfoContent.innerHTML = "";
		hoverInfoContent.style.height = (divHeight - 75) + noPx;
		hoverInfoContent.innerHTML = Msg;
		
		// display and position our message box...
		hoverInfo.style.left = winl + noPx;
		hoverInfo.style.top = wint + noPx;
		hoverInfo.style.width = divWidth + noPx;
		hoverInfo.style.height = divHeight + noPx;

		// add check to verify info is not show to prevent having to repaint the screen if it's already visible...
		if ((hoverInfo.style.display=="")||(hoverInfo.style.display=="none")){
			setOpacity(hoverInfo,0);
			hoverInfo.style.display="block";
			var fadeTime = 10;
			for(var a=0;a<100;a++){
				setTimeout('setOpacity(hoverInfo,'+(a+25)+')',fadeTime*a);
			}	
		}	
		
		// set focus to our close button...
		closeLink.focus();
	}catch (e){}
}

function setOpacity(e,opacity){
	var o=e.style;
	o.opacity=(opacity/100); //Opera
	o.MozOpacity=(opacity/100); //Mozilla+Firefox
	o.KhtmlOpacity=(opacity/100); //Konqueror
	o.filter="alpha(opacity="+opacity+")"; //IE
}


function showMessage(Msg, divWidth, divHeight){
	if(Msg != ""){
		var objInfoBox = expandDiv(Msg, divWidth, divHeight)
		return objInfoBox;
	}
}
/*****************************************************************/

/** Used to assign and remove events to page elements troughout the site **/
function addEventSimple(obj,evt,fn) {
	if (obj.addEventListener)
		obj.addEventListener(evt,fn,false);
	else if (obj.attachEvent)
	obj.attachEvent('on'+evt,fn);
}

function removeEventSimple(obj,evt,fn) {
	if (obj.removeEventListener)
		obj.removeEventListener(evt,fn,false);
	else if (obj.detachEvent)
	obj.detachEvent('on'+evt,fn);
}

/** PUSH AND SHIFT FOR IE5 **/
function Array_push() {
	var A_p = 0
	for (A_p = 0; A_p < arguments.length; A_p++) {
		this[this.length] = arguments[A_p]
	}
	return this.length
}

if (typeof Array.prototype.push == "undefined") {
	Array.prototype.push = Array_push
}

function Array_shift() {
	var A_s = 0
	var response = this[0]
	for (A_s = 0; A_s < this.length-1; A_s++) {
		this[A_s] = this[A_s + 1]
	}
	this.length--
	return response
}

if (typeof Array.prototype.shift == "undefined") {
	Array.prototype.shift = Array_shift
}	

// used on te199frm.js.
function getKey(e){
	if (e == null) e = window.event;
	var unicode=e.keyCode? e.keyCode : e.charCode
	return unicode;
}

function winStatus(msg)  {
	self.status = msg
	return true
}


var d=document;
// function used to open a new child window
var SelectionWindow = null;
function openWindow(url, width, height) {
	var winWidth = (width);
	var winHieght = (height);
	var winl = (screen.width - winWidth) / 2;
	var wint = (screen.height - winHieght) / 2;
    winStats='toolbar=no,location=no,directories=no,menubar=no,'
    winStats+='scrollbars=yes,width='+winWidth+',height='+winHieght
	if (navigator.appName.indexOf("Microsoft")>=0) {
         	winStats+=',left='+winl+',top='+wint
		}else{
      		winStats+=',screenX='+winl+',screenY='+wint
	}
	
	if (!SelectionWindow || SelectionWindow.closed){
		SelectionWindow = window.open(url,"",winStats);
	}else{
		SelectionWindow.focus();
	}

	if (SelectionWindow.opener == null){
		SelectionWindow.opener = self
	} 
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft + "|" + curtop];
}

// used to fill expandable window...
function ajaxFunction(pageName, ElementName){
	var xmlHttp;
	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}catch (e){// Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			try{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}catch (e){
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
    
	xmlHttp.onreadystatechange=function(){		
		switch(xmlHttp.readyState){
		case 1:
		  break;
		case 4:			
			document.getElementById(ElementName).innerHTML=xmlHttp.responseText;
		  break;
		default:	 
		}
	}
	xmlHttp.open("GET",pageName,true);
    xmlHttp.send(null);
}


 
function switchElementState(){
	var multiCurrencySelections = document.getElementById("multiCurrencySelections")
	multiCurrencySelections.style.display=(multiCurrencySelections.style.display!="block")? "block" : "none"
}

function prepMultiCurrencyMenu(){
	try{
		var multiCurrency = document.getElementById("multiCurrency")
		var multiCurrencySelections = document.getElementById("multiCurrencySelections")
		addEventSimple(multiCurrency,'click',switchElementState);
	}catch(e){}
} 


//***************************************************************************************/
// functions to handle zip code for tax calculation logic...
function getZipForm(addQS){
	var windowWidth = 500;
    var windowHeight = 300;
	if(addQS != ""){
		addQS = "&" + addQS;
	}
	var myShipZipURL = "faq/shipZipAlt.asp?BackLink=" + location.href + addQS;
	if (!myZipContainer){
		var myZipContainer = document.createElement('DIV');
	}
	myZipContainer.id = "myZipContainer";
	hoverInfoContent.innerHTML = "";
	
	var preLoaderImg = document.createElement('IMG');
	preLoaderImg.src = "images/ajax-loader.gif";
	preLoaderImg.className = "ajaxLoader"
	myZipContainer.appendChild(preLoaderImg);
  	hoverInfoContent.appendChild(myZipContainer);
	ajaxFunction(myShipZipURL, "myZipContainer");
	showMessage(hoverInfoContent.innerHTML, (windowWidth), (windowHeight));
} 

function submitZip(objForm){
	var myZipCode = objForm.zip.value
	var myHidVal = objForm.HidVal.value
	var myBackLink = objForm.BackLink.value
	reloadFlag = true;
	getZipForm("zip=" + myZipCode + "&HidVal=" + myHidVal)
	return false;
}

//***************************************************************************************/
// functions to handle pickup logic...
function ajaxPickupCall(pageName, ElementName, closeDiv){
	var xmlHttp;
	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}catch (e){// Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			try{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}catch (e){
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
    
	xmlHttp.onreadystatechange=function(){		
		switch(xmlHttp.readyState){
		case 1:
		  break;
		case 4:			
		  	if (closeDiv){
				HideCSSMsgBox();
			}else{
				document.getElementById(ElementName).innerHTML=xmlHttp.responseText;
			}
		  break;
		default:	 
		}
	}
	xmlHttp.open("GET",pageName,true);
    xmlHttp.send(null);
}

function showPickup(addQS, closeDiv){
	var windowWidth = 700;
    var windowHeight = 550;
	if(addQS){
		addQS = addQS + "&";
	}
	var myPickupURL = "GetPickupLocationsAJAX.asp?" + addQS + "BackLink=" + location.href;
	if (!myPickupContainer){
		var myPickupContainer = document.createElement('DIV');
	}
	myPickupContainer.id = "myPickupContainer";
	hoverInfoContent.innerHTML = "";
	var preLoaderImg = document.createElement('IMG');
	preLoaderImg.src = "images/ajax-loader.gif";
	preLoaderImg.className = "ajaxLoader"
	myPickupContainer.appendChild(preLoaderImg);
  	hoverInfoContent.appendChild(myPickupContainer);
	ajaxPickupCall(myPickupURL, "myPickupContainer", closeDiv);
	showMessage(hoverInfoContent.innerHTML, (windowWidth), (windowHeight));
} 

function submitPickup(objForm){
	var myBackLink = objForm.BackLink.value
	var myPickupLoc = objForm.PickupLoc.value
	var myPickupFlag = objForm.PickupFlag.value
	reloadFlag = true;
	showPickup("PickupLoc=" + myPickupLoc + "&PickupFlag=" + myPickupFlag, true)
	return false;
}

function setPickupInfo(element, myValue){
	var objForm = element.form;
	element.value = myValue;
	submitPickup(objForm);
}
//***************************************************************************************/

function setFormFocus() {
	var W3CDOM = document.createElement && document.getElementsByTagName;
	if (!W3CDOM) return;
	var forms = document.forms;
	var focusSet = false;
	for (var i=0;i<forms.length;i++) {
		for(var j=0;j<forms[i].elements.length;j++){
			if ((forms.length==1)&&(forms[i].elements[j].type=="text")){
				forms[i].elements[j].focus();
				focusSet = true;
				break;
			}else if((i>0)&&(forms[i].elements[j].type=="text")){
				if((forms[i].elements[j].name!="emailSignup")){
					forms[i].elements[j].focus();
					focusSet = true;
					break;
				}else{
					forms[i-1].elements[j].focus();
					focusSet = true;
					break;
				}
			}
		}
		if(focusSet){
			break;
		}
	}
}

function openWinPickup(url) {
	winStats='toolbar=no,location=no,directories=no,menubar=no,'
    winStats+='scrollbars=no,width=600,height=600'
    if (navigator.appName.indexOf("Microsoft")>=0) {
    	winStats+=',left=70,top=20'
	}else{
    	winStats+=',screenX=70,screenY=20'
    }
    floater=window.open(url,"",winStats)     
}

// set functions that need to run after page loads here...
function loadInitScripts(){
	createMessageDivs();	// handles the display of all site alerts returned from the STORIS server...
	var myAlertMsg = "";
	if (SessionMsg != ""){
		myAlertMsg = SessionMsg
	}else if(strMsg != ""){
		myAlertMsg = strMsg	
	}
	if(myAlertMsg != ""){
		showMessage(myAlertMsg, 400, 300)
	}
	startTimer();
	prepMultiCurrencyMenu();
	winStatus('');
	setupVideoElements();
	loadBanner();
	
	//*****debugging*********************************************************************************************************
	//showMessage("Alert window debugging in progress.", 400, 300)
	//*****debugging*********************************************************************************************************
}


/************************** Video Window *************************/
var videoDiv = document.createElement('DIV');
var videoDivContent = document.createElement('DIV');
videoDivContent.id = "videoDivContent"
function HideVideo(e){
	var evt = e || window.event;
	var evtTarget = evt.target || evt.srcElement;
	try{
		videoDivContent.innerHTML = "";
		videoDiv.style.display = "none";
		if (reloadFlag){
			document.location.reload();
		}else{
			DisableBG.style.display = "none";
		}
		reloadFlag = false;
		return true;
	}catch(e){
		return false;
	}
}

function setupVideoElements(){
	videoDiv.id = "videoDiv"
	var closeGraphic = document.createElement('IMG');
	closeGraphic.className = "closeGraphic"
	closeGraphic.src = "images/closeLink.png"
	videoDiv.appendChild(closeGraphic)
	videoDiv.appendChild(videoDivContent)
	document.body.appendChild(videoDiv);
	addEventSimple(closeGraphic,"mouseup",HideVideo)
}

function setupVideo(videoId){
	
}


function expandVideoDiv(e, Msg, divWidth, divHeight){
	var posObj = e.parentNode.parentNode;
	try{
	    var winl;
		var wint;
		var noPx = document.childNodes ? 'px' : 0;
		var windowWidth = document.documentElement.clientWidth || document.body.clientWidth;
	    var windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
		var windowScrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
		var windowScrollWidth = document.documentElement.scrollWidth || document.body.scrollWidth;
		var myStartPositions = getPosition(posObj)
		winl = (windowWidth - divWidth) / 2;
	    wint = 30//(divHeight==0)?(30):((window.screen.height - divHeight) / 2);
		// grey out the background and set the height of the grey area to match that of page scroll.
		if (windowHeight>windowScrollHeight){
			windowScrollHeight = windowHeight
		}
		DisableBG.style.height = windowScrollHeight + noPx;
		DisableBG.style.display = "block";
		// Insert video into container...
		videoDivContent.innerHTML = "";
		videoDivContent.innerHTML = '<a href="http://get.adobe.com/flashplayer/" target="_blank"><img src="images/installFlash.jpg" alt=""></a>';
		var soMain = new SWFObject("videoPlayer/MoviePlayer.swf", "videoDivContent", "380", "300", "8", "#FFFFFF");
		soMain.addParam("quality", "high");
		soMain.addParam("wmode", "transparent");
		soMain.addVariable("xmlFile", "videoPlayer/" + Msg + ".xml");
		soMain.addVariable("playedOnce", "false");
		soMain.write("videoDivContent");
		
		videoDiv.style.width = divWidth + noPx;
		videoDiv.style.height = divHeight + noPx;

		videoDiv.style.left = winl + noPx;
		videoDiv.style.top = wint + noPx;
		if (myStartPositions){
			videoDiv.style.left = (myStartPositions.x + 10) + noPx; 
			videoDiv.style.top = (myStartPositions.y + 30) + noPx;
		}

		// add check to verify info is not show to prevent having to repaint the screen if it's already visible...
		if ((videoDiv.style.display=="")||(videoDiv.style.display=="none")){
			videoDiv.style.display="block";
		}	
		return false;
	}catch (e){}
}

function expandVideoDivAlt(e, Msg, divWidth, divHeight){
	var posObj = e.parentNode.parentNode;
	try{
	    var winl;
		var wint;
		var noPx = document.childNodes ? 'px' : 0;
		var windowWidth = document.documentElement.clientWidth || document.body.clientWidth;
	    var windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
		var windowScrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
		var windowScrollWidth = document.documentElement.scrollWidth || document.body.scrollWidth;
		var myStartPositions = getPosition(posObj)
		winl = (windowWidth - divWidth) / 2;
	    wint = 30//(divHeight==0)?(30):((window.screen.height - divHeight) / 2);
		// grey out the background and set the height of the grey area to match that of page scroll.
		if (windowHeight>windowScrollHeight){
			windowScrollHeight = windowHeight
		}
		DisableBG.style.height = windowScrollHeight + noPx;
		DisableBG.style.display = "block";
		// Insert video into container...
		videoDivContent.innerHTML = "";
		videoDivContent.innerHTML = '<a href="http://get.adobe.com/flashplayer/" target="_blank"><img src="images/installFlash.jpg" alt=""></a>';
		var soMain = new SWFObject("videoPlayer/MoviePlayer.swf", "videoDivContent", "380", "300", "8", "#FFFFFF");
		soMain.addParam("quality", "high");
		soMain.addParam("wmode", "transparent");
		soMain.addVariable("xmlFile", Msg);
		soMain.addVariable("playedOnce", "false");
		soMain.write("videoDivContent");
		
		videoDiv.style.width = divWidth + noPx;
		videoDiv.style.height = divHeight + noPx;

		videoDiv.style.left = winl + noPx;
		videoDiv.style.top = wint + noPx;
		if (myStartPositions){
			videoDiv.style.left = (myStartPositions.x + 10) + noPx; 
			videoDiv.style.top = (myStartPositions.y + 30) + noPx;
		}

		// add check to verify info is not show to prevent having to repaint the screen if it's already visible...
		if ((videoDiv.style.display=="")||(videoDiv.style.display=="none")){
			videoDiv.style.display="block";
		}	
		return false;
	}catch (e){}
}


function getPosition(e){
	var evt = e || window.event;
	var evtTarget = evt.target || evt.srcElement;
    var left = 0;
    var top  = 0;
	while (evt.offsetParent){
      left += evt.offsetLeft;
      top += evt.offsetTop;
      evt = evt.offsetParent;
    }
    left += evt.offsetLeft;
    top  += evt.offsetTop;
    return {x:left, y:top};
}

/*****************************************************************/

function pngFixScripts(){
	try{
		pngFix();
		pngFixMap();
	}catch(e){
	
	}
}

addEventSimple(window,'load',loadInitScripts);
addEventSimple(window,'load',setFormFocus);
addEventSimple(window,'load',pngFixScripts);
//  done hiding the code -->




var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

function setGoogleAnalyticsScript(){
	try{
		var pageTracker = _gat._getTracker("UA-16087952-1");
		pageTracker._trackPageview();
	}catch(err) {}
}

addEventSimple(window,'load',setGoogleAnalyticsScript);
