/********** NAV DROPDOWN *************/

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


/********** ROLLOVERS *************/

function imghighlight(whichimg) {
	var imgsrc = new String(whichimg.src);
	imgsrc = imgsrc.replace(new RegExp('_off\.','g'),'_on\.');
	whichimg.src = imgsrc;
}

function imgnohighlight(whichimg) {
	var imgsrc = new String(whichimg.src);
	imgsrc = imgsrc.replace(new RegExp('_on\.','g'),'_off\.');
	whichimg.src = imgsrc;
}


/********** pop-up window functionality *************/

function popwin(loc,winname,w,h,scroll,resize) {
 var newwin = window.open( loc, winname, "width="+w+",height="+h+",top="+((screen.height - h) / 2)+",left="+((screen.width - w) / 2)+",location=no,scrollbars="+scroll+",menubar=no,toolbar=no,resizable="+resize);
 } // function..popwin

function closePopWin() {
     if(win != null) {
          if(!win.closed) {
              win.close();
              win = null;
          } else {
              win = null;
          }
     }
}


/**********  about page random images ************/

var ran = Math.ceil(Math.random() * 4);
	
var mainimgstring = '<img src="/_images/about/pic_landing' + ran + '.gif" width="439" height="412" border="0" id="mainPic" />';



/********** SHOPPING CART DROPDOWN ************/

function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}


/********** SWAP DIVS (PROPAGANDA) ************/

var activetext = 0;
var activeScope = 0;

function showScope(whichScope) {
	if (whichScope != activeScope) {
		document.getElementById("swapscope" + whichScope).style.display = "block";
		document.getElementById("swapscope" + activeScope).style.display = "none";
		activeScope = whichScope;
	}
}

function showText(whichtext) {
	if (whichtext != activetext) {
		document.getElementById("swaptext" + whichtext).style.display = "block";
		document.getElementById("swaptext" + activetext).style.display = "none";
		activetext = whichtext;
	}
}

/********** SWAP DIVS (CREW) ************/

function hideScope(whichScope) {
	document.getElementById("swapscope" + whichScope).style.display = "none";
	activeScope = 0;
}



