<!--

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function isNav4() {
	return (navigator.appName == 'Netscape' && navigator.appVersion.substring(0,1) == '4')?true:false;
}

function theNode(obj) {
	obj = document.getElementById(obj).style;
	if (obj.display == 'block') {
		obj.display = 'none';
	} else {
		obj.display = 'block';
	}
}

function setPanelState(panel, state) {
	var expdate = new Date ();
	FixCookieDate (expdate); // Correct for Mac date bug - call only once for given Date object!
	expdate.setTime (expdate.getTime() + (365 * 24 * 60 * 60 * 1000)); // 1 year from now 
	SetCookie ('Collaspe' + panel, state, expdate);
}

function collaspePanel(panel) {
	if (MM_findObj(panel)) {
		MM_findObj(panel).style.display = 'none';
		setPanelState(panel, 'yes');
	}
}

function expandPanel(panel) {
	if (MM_findObj(panel)) {
		MM_findObj(panel).style.display = 'block';
		setPanelState(panel, 'no');
	}
}

function defaultPanelState() {
	(GetCookie("CollaspeWishlistPanel") == 'yes')?
		collaspePanel('WishlistPanel'):
		expandPanel('WishlistPanel');
	(GetCookie("CollaspeMyBasketPanel") == 'yes')?
		collaspePanel('MyBasketPanel'):
		expandPanel('MyBasketPanel');
}

document.layerPopUnderHeight = 0;
function popUnder(clipHeight, layerTop, popState) {
	if (!document.layerPopUnderHeight) document.layerPopUnderHeight = MM_findObj('lyPopUnder').style.height.substr(0, MM_findObj('lyPopUnder').style.height.length - 2);
	if (((clipHeight == 0) && (popState == 'close'))
		|| ((clipHeight == document.layerPopUnderHeight) && (popState == 'open'))) {
		if (navigator.appName == 'Netscape') docWidth = window.pageXOffset + ((window.innerWidth - 300) / 2);
		else docWidth = document.body.scrollLeft + ((document.body.clientWidth - 300) / 2);
		MM_findObj('lyPopUnder').style.left = docWidth;
		ms = 1;
		MM_showHideLayers('lyPopUnder','','show');
	}
	else {
		ms = 1;
	}
	MM_findObj('lyPopUnder').style.clip = 'rect(' + clipHeight + ' auto auto auto)';
	MM_findObj('lyPopUnder').style.top = layerTop;

	if ((clipHeight < document.layerPopUnderHeight) && (popState == 'close')) {
		setTimeout('popUnder(' + (clipHeight + 5) + ', ' + (layerTop - 5) + ', \'' + popState + '\')',ms);
	}
	else if ((clipHeight > 0) && (popState == 'open')) {
		setTimeout('popUnder(' + (clipHeight - 5) + ', ' + (layerTop + 5) + ', \'' + popState + '\')',ms);
	}
	else if ((clipHeight <= 0) && (popState == 'open')) {
		evalStr = 'popUnder(0,' + MM_findObj('lyPopUnder').style.top.substr(0, MM_findObj('lyPopUnder').style.top.length - 2) + ',\'close\')';
		setTimeout(evalStr,10000);
	}
	else {
	}
}

function splash(lyname) {
	var expdate = new Date ();
	FixCookieDate (expdate); // Correct for Mac date bug - call only once for given Date object!
	expdate.setTime (expdate.getTime() + (12 * 60 * 60 * 1000)); // half day later 
	if (GetCookie('ShowSplash') == 'yes') return;
	SetCookie ('ShowSplash', 'yes', expdate);
	
	lyHeight = MM_findObj(lyname).style.height.substr(0, MM_findObj(lyname).style.height.length - 2);
	lyWidth = lyWidth = MM_findObj(lyname).style.width.substr(0, MM_findObj(lyname).style.width.length - 2);
	if (navigator.appName == 'Netscape') {
		lyLeft = window.pageXOffset + ((window.innerWidth - lyWidth) / 2);
		lyTop = window.pageYOffset + ((window.innerHeight - lyHeight) / 2);
	}
	else {
		lyLeft = document.body.scrollLeft + ((document.body.clientWidth - lyWidth) / 2);
		lyTop = document.body.scrollTop + ((document.body.clientHeight - lyHeight) / 2);
	}
		
	MM_findObj(lyname).style.left = lyLeft;
	MM_findObj(lyname).style.top = lyTop;
	
	MM_showHideLayers(lyname,'','show');
	setTimeout('MM_showHideLayers(\''+lyname+'\',\'\',\'hide\');',8000);
}

document.layerAdPopUnderHeight = 0;
function adPopUnder(clipHeight, layerTop, popState) {
	if (!document.layerAdPopUnderHeight) document.layerAdPopUnderHeight = MM_findObj('lyAdPopUnder').style.height.substr(0, MM_findObj('lyAdPopUnder').style.height.length - 2);
	lyWidth = MM_findObj('lyAdPopUnder').style.width.substr(0, MM_findObj('lyAdPopUnder').style.width.length - 2);
	if (((clipHeight == 0) && (popState == 'close'))
		|| ((clipHeight >= document.layerAdPopUnderHeight) && (popState == 'open'))) {
		layerWidth = (navigator.appName == 'Netscape')?window.innerWidth - lyWidth:document.body.clientWidth - lyWidth;
		if (navigator.appName == 'Netscape') docWidth = window.pageXOffset + (layerWidth / 2);
		else docWidth = document.body.scrollLeft + (layerWidth / 2);
		MM_findObj('lyAdPopUnder').style.left = docWidth;

		ms = 1;
		MM_showHideLayers('lyAdPopUnder','','show');
	}
	else {
		ms = 50;
	}

	MM_findObj('lyAdPopUnder').style.clip = 'rect(' + clipHeight + ' auto auto auto)';
	MM_findObj('lyAdPopUnder').style.top = layerTop;

	if ((clipHeight < document.layerAdPopUnderHeight) && (popState == 'close')) {
		setTimeout('adPopUnder(' + (clipHeight + 5) + ', ' + (layerTop - 5) + ', \'' + popState + '\')',ms);
	}
	else if ((clipHeight > 0) && (popState == 'open')) {
		setTimeout('adPopUnder(' + (clipHeight - 5) + ', ' + (layerTop + 5) + ', \'' + popState + '\')',ms);
	}
	else if ((clipHeight <= 0) && (popState == 'open')) {
		evalStr = 'adPopUnder(0,' + MM_findObj('lyAdPopUnder').style.top.substr(0, MM_findObj('lyAdPopUnder').style.top.length - 2) + ',\'close\')';
		setTimeout(evalStr,10000);
	}
	else {
	}
}

function resizeAdPopUnder() {
	winWidth = (navigator.appName == 'Netscape')?window.innerWidth:document.body.clientWidth;
	if (winWidth < 760) return;
	layerWidth = (navigator.appName == 'Netscape')?window.innerWidth - 343:document.body.clientWidth - 320;
	MM_findObj('lyAdPopUnder').style.width = layerWidth;
}

function isCheckBoxChecked(objName) {
	checkBox = MM_findObj(objName);
	for (i=0; i<checkBox.length; i++) {
		if (checkBox[i].checked) return true;
	}
	return false;
}

// swap items from src menulist to dest menulist
// if [swap] == true, selected items in src and dest menulist will swap over
// if [swap] == false, only selected items in src will be moved over to dest menulist
//
// usage: mnuSwapper(src, dest, [swap = false])
function mnuSwapper(src, des, swap) {
	// stores the index of the src items that have been moved over to the dest menu
	tracker = new Array();
	
	srcObj = MM_findObj(src).options;
	desObj = MM_findObj(des).options;
	desObjLen = desObj.length;
	for (i = 0; i < srcObj.length; i++) {
		if (srcObj[i].selected) {
			desObj[desObj.length]=new Option(srcObj[i].text, srcObj[i].value, false, false);
			srcObj[i--] = null;
			tracker[tracker.length] = desObj.length - 1;
		}
	}
	
	// if [swap] == true, swap selected items of src with selected items of dest menulist
	if (swap)
	for (i = 0; i < desObj.length; i++) {
		if (desObj[i].selected) {
			srcObj[srcObj.length]=new Option(desObj[i].text, desObj[i].value, false, true);
			desObj[i--] = null;
			
			// update new index for items in dest menulist that were moved over from src menulist
			for (j = 0; j < tracker.length; j++) {
				if (i < tracker[j])
					tracker[j]--;
			}
		}
	}
	
	// set [selected] = true for the dest items that were moved over from src menulist 
	while (tracker.length) desObj[tracker.pop()].selected = true;
}
//-->