<!--

// **************************************
// Handle Popup Windows
var wnd; 
var popupDefault='width=450,height=492,status=no,scrollbars=yes,resizable=yes';
var popupBig='width=650,height=600,status=no,scrollbars,resizable=yes';



function loadWindow ( url, options ) {
	return window.open(url, '_blank', options);
}

function launchWindow( wnd, url, override, options ) {
	if (!wnd) { 
		//Variable not defined yet.
		return loadWindow(url, options);
	} else {
		if (wnd.closed) {
			// Wnd was previous open, but is no longer. Open it.
			return loadWindow(url, options);
		} else {
			if(!override) {
				// Window is already open.  Forget this request, and just give the popup focus.
				wnd.focus();
				return wnd;
			} else {
				// Window is already open.  Give it focus, and change to the new page instead.
				wnd.focus();
				wnd.location.href=url;
				return wnd;
			}
		}
	}
}


//get title
//get url
//generate email this page url
function emailthispage (url) {
	title = document.title;
	surl = location.href;
	url = url+'?title='+title+'&amp;surl='+surl;
	launchWindow(wnd,url,1,popupDefault);
}

var isNav = 0;
if (navigator.appName=="Netscape"&&parseFloat(navigator.appVersion)<5) isNav=1;


function find_x() {
	//finds and returns the x resolution
	var windowWidth
	if (isNav) {
		//alert('window.innerWidth='+window.innerWidth);
		windowWidth=window.innerWidth;
	} else {
		//alert('document.body.clientWidth='+document.body.clientWidth);
		windowWidth=document.body.clientWidth;
	}
	return windowWidth;
}


var offset=0;
var animCurrentFrame=0;
var animFrameCount;
var animFromX;
var animFromY;
var Mytmr;

function getControlsByName(controlName) {
	// get form elements and declare variables
		var formElements = document.forms[0].elements
		var elName = null;
		var currentEl = null;
		var namePos = -1
		var retArray = new Array();
	// loop through elements
		for (var counter=0;counter < formElements.length;counter ++) {
			// get current element
				currentEl = formElements.item(counter);
			// get name of element
				elNameUC = currentEl.getAttribute("name").toUpperCase();
			// output elName
				if (elNameUC != null) {
					// get position of name
						namePos = elNameUC.indexOf(controlName.toUpperCase())
					// if name is found within the string
						if (namePos > -1) {
							// if it's at the very end, we've found our element
								if (namePos + controlName.length == elNameUC.length) {
									retArray.push(currentEl);
								}
						}
				}
		}
	// return either nothing, first item, or array
		if (retArray.length > 0) {
			if (retArray.length == 1) {
				return retArray[0];
			} else {
				return retArray;
			}
		} else {
			return null
		}
}


function obj(name) {
	if (document.getElementById && document.getElementById(name))
		return document.getElementById(name);
	else if (document.getElementsByName && document.getElementsByName(name)[0])
		return document.getElementsByName(name)[0];
	else if (document.all)
		return document.all[name];
}

//Netscape doesn't have an integer-based "left" or "top" property for objects.
//This function takes "150px" and converts it to a numeric 150
function pix(st) {
	return new Number(st.substring(0, st.length-2));
}

function animateThis(o,animToX,animToY,ms) {
	window.clearInterval(Mytmr);
	animCurrentFrame=0;
	animFromX=pix(obj(o).style.left);
	animFromY=pix(obj(o).style.top);

	animDistanceX=(animFromX-animToX)*-1;
	animDistanceY=(animFromY-animToY)*-1;

	animFrameRate=60;
	animFrameInterval=1000/animFrameRate;
	animFrameCount=Math.round(ms/animFrameInterval);

	animOffsetPerFrameX=animDistanceX / animFrameCount;
	animOffsetPerFrameY=animDistanceY / animFrameCount;

	Mytmr=window.setInterval("animateInterval('"+o+"',"+animToX+","+animToY+","+animOffsetPerFrameX+","+animOffsetPerFrameY+");", animFrameInterval/2);

	return false;
}

function animateInterval(o, animToX, animToY, animOffsetPerFrameX, animOffsetPerFrameY){
	animCurrentFrame++;
	//obj('debug').innerHTML=animCurrentFrame+'/'+animFrameCount+ ' - (' + pix(obj(o).style.left) + ','+pix(obj(o).style.top)+') - (' + animOffsetPerFrameX + ','+animOffsetPerFrameY+')';
	CurrentX=Math.round(animFromX+(animOffsetPerFrameX*animCurrentFrame));
	CurrentY=Math.round(animFromY+(animOffsetPerFrameY*animCurrentFrame));
	obj(o).style.left=CurrentX.toString()+'px';
	obj(o).style.top=CurrentY.toString()+'px';
	if(animCurrentFrame==animFrameCount) {
		window.clearInterval(Mytmr);
	}
}

function center_it(o) {
	//moves the element to the center
	var movingID1 = obj(o);

	//set off-set for layers.
	obj(o).style.left=Math.round((find_x()/2)+172);
	offset = pix(obj(o).style.left);
	//alert('left='+obj(o).style.left+'; width='+obj(o).clientWidth);
	return offset;
}

// Find the X coordinate of an object on the screen.
function documentFindX(o) {
	var sumX = 0
	try {
		if(o.offsetParent) {
			sumX = documentFindX(o.offsetParent);
		}
	} catch (er) { return sumX;  }
	return sumX+o.offsetLeft;
}

// Find the Y coordinate of an object on the screen.
function documentFindY(o) {
	var sumY = 0
	try {
		if(o.offsetParent) {
			sumY = documentFindY(o.offsetParent);
		}
	} catch (er) { return sumY; }
	return sumY+o.offsetTop;
}

var adminAutoClear;
var adminSectionID;
var adminContentID;
var adminContentExternal;
var adminTemplate;

//onmouseout and over for span tags.
function adminHideBorders() {
	obj('contentBorder').style.display='none';
	obj('sectionBorder').style.display='none';
}

function adminContentBorderOn(o,color)
  {
		clearTimeout(adminAutoClear);
		var contentBorder=obj('contentBorder');
		if(contentBorder.style.display!='inline'){ contentBorder.style.display='inline' };
		contentBorder.style.left=documentFindX(o);
		contentBorder.style.top=documentFindY(o);
		contentBorder.style.width=o.offsetWidth;
		contentInside.style.height=o.offsetHeight-6;
		contentBorder.style.height=o.offsetHeight;
		contentBorder.style.borderColor=color;
		contentBorder.clickTarget=o;
		contentBorder.title = o.title;
		clearTimeout(adminAutoClear);
		adminSectionID = o.sectionID;
		adminContentID = o.contentID;
		adminContentExternal = o.contentExternal;
		adminTemplate = o.template;
  }

 function adminContentBorderOff()
  {
		//adminHideBorders();
	}

 function adminSectionBorderOn(o,color)
  {
		clearTimeout(adminAutoClear);
		var sectionBorder=obj('sectionBorder');
		if(sectionBorder.style.display!='inline'){ sectionBorder.style.display='inline' };
		sectionBorder.style.left=documentFindX(o)-3;
		sectionBorder.style.top=documentFindY(o)-3;
		sectionBorder.style.width=o.offsetWidth+6;
		sectionBorder.style.height=o.offsetHeight+6;
		sectionBorder.style.borderColor=color;
		sectionBorder.clickTarget=o;
		clearTimeout(adminAutoClear);
  }

 function adminSectionBorderOff()
  {
		obj('sectionBorder').style.display='none';
  }

	function adminContentUp() {
		if(adminContentID!=0) {
			window.parent.ContentMoveUp(adminSectionID,adminContentID);
		} else {
			alert('Sorry, there are no elements that can be moved in this section.  Try adding one first.');
		}
		window.event.cancelBubble=true;
	}

	function adminContentDown() {
		if(adminContentID!=0) {
			window.parent.ContentMoveDown(adminSectionID,adminContentID);
		} else {
			alert('Sorry, there are no elements that can be moved in this section.  Try adding one first.');
		}
		window.event.cancelBubble=true;
	}

	function adminContentAdd() {
		window.parent.ContentAdd(adminSectionID,adminContentID);
		window.event.cancelBubble=true;
	}

	function adminContentDelete() {
		if(adminContentID!=0) {
			if(window.confirm('Are you sure you want to remove this content block from the page?')){
				window.parent.ContentDelete(adminSectionID,adminContentID);
			}
		} else {
			alert('Sorry, there are no elements that can be moved in this section.  Try adding one first.');
		}
		window.event.cancelBubble=true;
	}

	function adminContentEdit() {
		//alert('ContentEdit::'+adminContentID+'::'+adminSectionID);
		if (adminContentExternal==1) {
			alert('This is an external content block, and cannot be edited. ('+adminTemplate+')');
		} else {
			window.parent.ContentEdit(adminSectionID,adminContentID);
		}
		window.event.cancelBubble=true;
	}
	
	//handles create account check
	function CopyField(Source,Destination) {
		BackupField(Destination);
		Destination.value=Source.value;
	}

	function BackupField(Field) {
		Field.OldValue=Field.value;
	}

	function CopyFieldOnly(Source,Destination) {
		Destination.value=Source.value;
	}

	function RestoreField(Destination) {
		Destination.value=Destination.OldValue;
	}
	
	function ShipSameAsBillClick() {
		if(document.frmAccount.same_info.checked) {
			CopyField( document.frmAccount.Bill_First   , document.frmAccount.Ship_First    );
			CopyField( document.frmAccount.Bill_Last    , document.frmAccount.Ship_Last     );
			CopyField( document.frmAccount.Bill_Company , document.frmAccount.Ship_Company  );
			CopyField( document.frmAccount.Bill_Phone1  , document.frmAccount.Ship_Phone1   );
			CopyField( document.frmAccount.Bill_Phone2  , document.frmAccount.Ship_Phone2   );
			CopyField( document.frmAccount.Bill_Fax     , document.frmAccount.Ship_Fax      );
			CopyField( document.frmAccount.Bill_Address1, document.frmAccount.Ship_Address1 );
			CopyField( document.frmAccount.Bill_Address2, document.frmAccount.Ship_Address2 );
			CopyField( document.frmAccount.Bill_City    , document.frmAccount.Ship_City     );
			CopyField( document.frmAccount.Bill_State   , document.frmAccount.Ship_State    );
			CopyField( document.frmAccount.Bill_Province, document.frmAccount.Ship_Province );
			CopyField( document.frmAccount.Bill_Zip     , document.frmAccount.Ship_Zip      );
			CopyField( document.frmAccount.Bill_Country , document.frmAccount.Ship_Country  );
		} else {
			RestoreField(document.frmAccount.Ship_First    );
			RestoreField(document.frmAccount.Ship_Last     );
			RestoreField(document.frmAccount.Ship_Company  );
			RestoreField(document.frmAccount.Ship_Phone1   );
			RestoreField(document.frmAccount.Ship_Phone2   );
			RestoreField(document.frmAccount.Ship_Fax      );
			RestoreField(document.frmAccount.Ship_Address1 );
			RestoreField(document.frmAccount.Ship_Address2 );
			RestoreField(document.frmAccount.Ship_City     );
			RestoreField(document.frmAccount.Ship_State    );
			RestoreField(document.frmAccount.Ship_Province );
			RestoreField(document.frmAccount.Ship_Zip      );
			RestoreField(document.frmAccount.Ship_Country  );
		}
	}
	
	//toggle for FAQ page.
function getObj(name) {
	if (document.getElementById) {
		return document.getElementById(name);
	} else if (document.all) {
		return document.all[name];
	} else {
	return document.layers[name];
	}
}

function closeAll(number) {
		var div;
 		for (var i=1; i<number; i++)
    {
				div=getObj('q' + i);
				div.style.display = "none";
    }
}

function toggle(that) {
closeAll(1);
	if (that.style.display == "none") {
		that.style.display = "inline";
	} else {
		that.style.display = "none";
	}
}


/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
function setCookie(name, value, expires, path, domain, secure)
{
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

/**																														* 
 * Gets the value of the specified cookie.										* 
 *																														* 
 * name  Name of the desired cookie.													* 
 *																														* 
 * Returns a string containing value of specified cookie,			* 
 *   or null if cookie does not exist.												* 
 *                                                            */
function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

/**																																								 * 
 * Deletes the specified cookie.																									 * 
 *																																								 * 
 * name      name of the cookie																										 * 
 * [path]    path of the cookie (must be same as path used to create cookie)			 * 
 * [domain]  domain of the cookie (must be same as domain used to create cookie)	 * 
 *																																								 */
function deleteCookie(name, path, domain)
{
    if (getCookie(name))
    {
        document.cookie = name + "=" + 
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}



var zNavCloseTimer;
var zNavObjToClose;
var zNavSubMenuList = new Array();
var zNavCurrMenuOver;
var zNavCurrMenuOut;
var zNavCurrMenuItemOver;
var zNavCurrMenuItemOut;

function zNavMouseOver(myobj, sParentMenu) {
	myobj.style.backgroundColor='#da2128';
	zNavCloseTimer=clearTimeout(zNavCloseTimer);


	//Stow away the parent menu of the menu item that has just gained focus.
	zNavCurrMenuOver = obj(sParentMenu);
	zNavCurrMenuItemOver = myobj;

	//The if MouseOver'd menu is the same as the most recent MouseOut'd window, 
	if((typeof(zNavCurrMenuOut) != "undefined") && (zNavCurrMenuOver.id == zNavCurrMenuOut.id) && (zNavCurrMenuItemOver != zNavCurrMenuItemOut)) {
		//Then, if the MouseOver'd menu has an openChild...
		if(typeof(zNavCurrMenuOver.openChild) != "undefined") {
			//Then close it.
			zNavCloseMenu(zNavCurrMenuOver.openChild)
		}
	}
}

function zNavMouseOut(myobj,sParentMenu) {
	myobj.style.backgroundColor='#DA2128';

	//Stow away the parent menu of the menu item that has just lost focus.
	zNavCurrMenuOut = obj(sParentMenu)
	zNavCurrMenuItemOut = myobj;
}

function zNavOpenSubmenu(TabID, objId, objMenuItem, isVertical) {
	//Abort any timers we have set.
	zNavCloseTimer=clearTimeout(zNavCloseTimer);
	var childObj = obj('zNavMenuSub'+TabID);
	var parentObj=obj(objId);
	//Close any open submenus
	if(typeof ( parentObj.openChild ) != "undefined") {
		zNavCloseMenu(parentObj.openChild, 1);
		
	}
	//Display the submenu.
	childObj.style.display='inline';
	//Move the submenu to the proper location.
	if(isVertical==0) {
		//HORIZONTAL MENU
		
		//Position the menu to be centered below the selected element of the parent menu.
		var intLeft =documentFindX(objMenuItem)+((objMenuItem.offsetWidth/2)-(childObj.offsetWidth/2));
		//Will it be off the right edge of the browser?
		if (intLeft+childObj.offsetWidth > (document.body.clientWidth-document.body.scrollLeft)) {
			//Yes - move it left so it stays inside the browser.
			intLeft=document.body.clientWidth-childObj.offsetWidth+document.body.scrollLeft;	
		}		
		//Will it be off the left edge of the browser?  If so, dock it to the left edge.
		if (intLeft < document.body.scrollLeft) { intLeft=document.body.scrollLeft; }
		
		//Position the menu to be just below the parent menu (and move it down 2px to make it perfect)
		var intTop=documentFindY(objMenuItem)+objMenuItem.offsetHeight+2;
		//Will it be off the bottom edge of the browser?
		if (intTop+childObj.offsetHeight > document.body.clientHeight+document.body.scrollTop) {		
			//Yes - Move it up so the whole thing is visible.
			intTop=document.body.clientHeight - (childObj.offsetHeight + document.body.scrollTop);
		}
		//Finally, set our properties for the menu.
		childObj.style.left=intLeft;
		childObj.style.top=intTop;


	} else {
		
		//Position the menu to the right edge of the parent menu.
		var intLeft=documentFindX(objMenuItem)+objMenuItem.offsetWidth+2;
		//Will it be off the right edge of the browser?
		if (intLeft+childObj.offsetWidth > (document.body.clientWidth-document.body.scrollLeft)) {
			//Yes - position the menu to the left of the submenu.
			intLeft=documentFindX(objMenuItem)-childObj.offsetWidth;
		}
		
		//Position the menu to be inline with the selected element of the parent menu (and move up 3px to make it perfect)
		var intTop=documentFindY(objMenuItem)-3;
		//Will it be off the bottom edge of the browser?
		if (intTop+childObj.offsetHeight > document.body.clientHeight+document.body.scrollTop) {
			//Yes - Move it up so the whole thing is visible.
			intTop=document.body.clientHeight - childObj.offsetHeight+document.body.scrollTop;
		}

		//Finally, set our properties for the menu.
		childObj.style.left=intLeft;
		childObj.style.top=intTop;
		
	}
	//Tell the parent menu of his new child.
	parentObj.openChild=childObj;
}

function zNavMenuMouseOut(myobj){
	//Set a timer to close opened menus
	zNavCloseTimer=clearTimeout(zNavCloseTimer);
	zNavCloseTimer= setTimeout('zNavHideAll();',500);
}

function zNavCloseMenu(myobj){
	//Hide the specified menu.  If the menu has children, close them recursively.
	myobj.style.display='none';
	if(typeof ( myobj.openChild ) != "undefined") {
		zNavCloseMenu(myobj.openChild, 0);
	}

}

function zNavClickLink(itemUrl){
	//This event happens when you click a TD without clicking the <a href=""> itself.
	location.href=itemUrl;
}

function zNavHideAll(){
	//Close all menus.
	if(zNavSubMenuList.length==0) {
		for(var i=0; i < document.all.length; i++) {
			if(document.all[i].id.indexOf('zNavMenuSub') > -1){
				document.all[i].style.display='none';
				zNavSubMenuList[zNavSubMenuList.length]=document.all[i];
			}
		}	
	} else {
		for(var i=0; i < zNavSubMenuList.length; i++) {
			zNavSubMenuList[i].style.display='none';
		}
	}
}

function zNavLoad(o) {
	alert('blah');
	//zNavSubMenuList[zNavSubMenuList.length]=o;
}

function zSubmit(action,parm) {
	obj('zParm').value=parm;
	obj('zAction').value=action;
	document.forms[0].submit();
}
//-->    