// JavaScripts that can be or are used on every page in the site.

function toggleLayers(Layer1, Layer2, hideDropDowns) 
{
	//This is the primary function used to hide and display DIV layers with IDs through out the site.
	//IE6.5 and earlier display dropdowns above any layers by default. The default of this script
	//is to hide those dropdowns. However, if this script is only toggling two elements or the elements
	//themselves have dropdowns in them, simply include "noHideDD" as the third element.
	var box;  
	 if( document.getElementById ) 
	   // this is the way the standards work
	 box = document.getElementById( Layer1 );  
	 else if( document.all ) 
	   // this is the way old msie versions work
	 box = document.all[Layer1];  
	 else if( document.layers ) 
	   // this is the way nn4 works
	 box = document.layers[Layer1];  
	 
	 if (box != null) 
		{
		 if(box.style.display==''&&box.offsetWidth!=undefined&&box.offsetHeight!=undefined)
		 box.style.display = (box.offsetWidth!=0&&box.offsetHeight!=0)?'block':'none';  
		 box.style.display = (box.style.display==''||box.style.display=='block')?'none':'block';
		}
	 if (Layer2 != 'noHideDD')
		 {
			 var box2;  
			 if( document.getElementById ) 
			   // this is the way the standards work
			 box2 = document.getElementById( Layer2 );  
			 else if( document.all ) 
			 // this is the way old msie versions work
			 box2 = document.all[Layer2];  
			 else if( document.layers ) 
			   // this is the way nn4 works
			 box2 = document.layers[Layer2];  
			
			 if (box2 != null) 
				{
				 if(box2.style.display==''&&box2.offsetWidth!=undefined&&box2.offsetHeight!=undefined)
				 box2.style.display = (box2.offsetWidth!=0&&box2.offsetHeight!=0)?'block':'none';  
				 box2.style.display = (box2.style.display==''||box2.style.display=='block')?'none':'block';
				 }
		 }

	var agt=navigator.userAgent.toLowerCase();
	var appVer = navigator.appVersion.toLowerCase();
	var iePos  = appVer.indexOf('msie');
    var is_mac = (agt.indexOf("mac")!=-1);
	var is_ie = (iePos!=-1);
	if (is_ie) {
       if(is_mac) is_minor = parseFloat(agt.substring(iePos+5,agt.indexOf(';',iePos)));
       else is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
	   var is_ie7up = (is_ie && is_minor >= 7);
		}

	
	 if (Layer2 == 'noHideDD' || hideDropDowns == 'noHideDD' && is_ie!=null ) { }
	 else
		 {
			
			if (is_ie && is_ie7up==false) 
			{
				if (box.style.display == 'block' || box2.style.display == 'block') { var action = "hidden" }
				else { var action = "visible" }
				
				for (var S = 0; S < document.forms.length; S++) {
					for (var R = 0; R < document.forms[S].length; R++) {
						if (document.forms[S].elements[R].options) { 
							if (document.forms[S].elements[R].name != "Find_Type")
							document.forms[S].elements[R].style.visibility = action; 
						}
					}
				} 
			}
		 }
}

function show1HideRest(Layer1, Layer2Hide, Layer3Hide, Layer4Hide, hideDropDowns) 
{
	//Originally coded for product testing page on 2/4/09. Use this to hide or keep hid three layers 
	//and display one (i.e. Layer1).
	var box;  
	 if( document.getElementById ) 
	   // this is the way the standards work
	 box = document.getElementById( Layer1 );  
	 else if( document.all ) 
	   // this is the way old msie versions work
	 box = document.all[Layer1];  
	 else if( document.layers ) 
	   // this is the way nn4 works
	 box = document.layers[Layer1];  
	 
	 if (box != null) 
		{
		 box.style.display='block';
		 //if(box.style.display==''&&box.offsetWidth!=undefined&&box.offsetHeight!=undefined)
		 //box.style.display = (box.offsetWidth!=0&&box.offsetHeight!=0)?'block':'none';  
		 //box.style.display = (box.style.display==''||box.style.display=='block')?'none':'block';
		}
	 if (Layer2Hide != 'noHideDD')
		 {
			 var box2;  
			 if( document.getElementById ) 
			   // this is the way the standards work
			 box2 = document.getElementById( Layer2Hide );  
			 else if( document.all ) 
			 // this is the way old msie versions work
			 box2 = document.all[Layer2Hide];  
			 else if( document.layers ) 
			   // this is the way nn4 works
			 box2 = document.layers[Layer2Hide];  
			
			 if (box2 != null) box2.style.display = 'none'
		 }
		 
	if (Layer3Hide != 'noHideDD')
		 {
			 var box3;  
			 if( document.getElementById ) 
			   // this is the way the standards work
			 box3 = document.getElementById( Layer3Hide );  
			 else if( document.all ) 
			 // this is the way old msie versions work
			 box3 = document.all[Layer3Hide];  
			 else if( document.layers ) 
			   // this is the way nn4 works
			 box3 = document.layers[Layer3Hide];  
			
			 if (box3 != null) box3.style.display = 'none'
		 }
		 
	if (Layer4Hide != 'noHideDD')
		 {
			 var box4;  
			 if( document.getElementById ) 
			   // this is the way the standards work
			 box4 = document.getElementById( Layer4Hide );  
			 else if( document.all ) 
			 // this is the way old msie versions work
			 box4 = document.all[Layer4Hide];  
			 else if( document.layers ) 
			   // this is the way nn4 works
			 box4 = document.layers[Layer4Hide];  
			
			 if (box4 != null) box4.style.display = 'none'
		 }

	 if (Layer2Hide == 'noHideDD' || Layer3Hide == 'noHideDD' || Layer4Hide == 'noHideDD' || hideDropDowns == 'noHideDD' && is_ie!=null ) { }
	 else
		 {
			if (is_ie==true && is_ie7up==false) 
			{
				if (box.style.display == 'block' || box2.style.display == 'block') { var action = "hidden" }
				else { var action = "visible" }
				
				for (var S = 0; S < document.forms.length; S++) {
					for (var R = 0; R < document.forms[S].length; R++) {
						if (document.forms[S].elements[R].options) { 
							if (document.forms[S].elements[R].name != "Find_Type")
							document.forms[S].elements[R].style.visibility = action; 
						}
					}
				} 
			}
		 }
}

function fieldReset(id,defaultMsg,clrSign) {
	//Use this script to blank a field from the default value when clicked,
	//and then if nothing is typed, script resets the field to the default message again.
	//This script also changes the font to black when clicked, and back to gray
	//when clicked off and nothing typed.
	if(defaultMsg!=null)
	{
		if( document.getElementById ) 
		// this is the way the standards work
		 field = document.getElementById( id );  
		 else if( document.all ) 
		   // this is the way old msie versions work
		 field = document.all[id];  
		 else if( document.layers ) 
		   // this is the way nn4 works
		 field = document.layers[id]; 
		 
		 var fieldValue = field.value;

		if (clrSign!=null && clrSign == "return") field.value = defaultMsg
		else 
		{
			if (fieldValue == defaultMsg && clrSign!=null) {field.value = clrSign;field.style.color = "#000000";}
			else if (clrSign!=null && fieldValue == clrSign) {field.value = defaultMsg;field.style.color = "#666666";}
			else if (fieldValue == "") {field.value = defaultMsg;field.style.color = "#666666";}
		}
	}
	else alert('You must include the default "value" as the second element in the call for the fieldReset function to work.');
 }
 
function popupiFrame (contenthref, locationid, width, height, resize) 
{ //like the normal popupBox, but this creates the iframe code on the page in the DIV --usually placed just above the Body tag.
	if (locationid!=null)
	{
		var location; 
		 // this is the way the standards work
		 if (document.getElementById) location = document.getElementById( locationid )
		 // this is the way old msie versions work
		 else if (document.all) location = document.all[locationid]
		 // this is the way nn4 works
		 else if (document.layers) location = document.layers[locationid]
	
		if (location!=null)
		{
			windowWidth=sizeOrPosition('window','wide');
			windowHeight=sizeOrPosition('window','high');
			scrollposX=sizeOrPosition('scroll','wide');
			scrollposY=sizeOrPosition('scroll','high');

			fadeScreen(location,windowHeight,windowWidth);
			if (resize==null) toggleLayers(locationid);
			
			if (contenthref!=null) {
				
				//location.offsetWidth; //Used to find size of the object if it's displayed.
				if (width=="" || width==null) var width = 610;
				if (height=="" || height==null) var height = 610;

				if ((Math.round((windowHeight/2)-(height/2)+scrollposY)) < 0) location.style.top='0px';
				else location.style.top = Math.round((windowHeight/2)-(height/2)+scrollposY)+'px';
	
				if (Math.round((windowWidth/2)-(width/2)+scrollposX) < 0) location.style.left = '0px'
				else location.style.left = Math.round((windowWidth/2)-(width/2)+scrollposX)+'px'
				
				location.style.zIndex = '60';
				location.innerHTML="<a href=javascript:toggleLayers('" + locationid + "','popupScreenFade')><div id=\"iframe_close\"><img src=\"images/icon_close_15x15.png\" width=\"15px\" height=\"15px\" alt=\"Close\" align=\"absmiddle\" />Close</div></a><iframe name=\"iframe_popup\" id=\"iframe_popup\" src=\"" + contenthref + "\" width=\"" + width + "\" height=\"" + height + "\" frameborder=\"0\" scrolling=\"yes\" allowtransparency=\"no\"></iframe>";
				
			}
			else alert('Please make sure a link is as the first element of the JS call.')
		}
		else alert('Please make sure you have a DIV on the page with an ID matching the second element in the JS call. This script will not work without it.');
	}
	else alert('Please make sure you have a DIV layer ID in the second element of your JS call. This script will not work without it.');

	document.returnValue=false;
}

function fadeScreen (box,windowHeight,windowWidth,resize)
{
	windowWidth= Number(windowWidth); //Values passed through variables aren't recognized as numbers in JS.
	windowHeight= Number(windowHeight);
	//Get full page size, even outside of scrolled location
	var pageWidth= sizeOrPosition('page','wide');
	var pageHeight= sizeOrPosition('page','high');
	var fadeWidth, fadeHeight;
	if (document.body) {
		var scrWidth = document.body.scrollWidth;
		var bodyHeight = document.body.offsetHeight;
		var bodyWidth = document.body.offsetWidth;
		//alert("offset: "+document.body.offsetWidth+ "; ScrollW: " +document.body.scrollWidth);
	}
	else {
		var scrWidth = pageWidth;
		var bodyHeight = pageHeight;
		var bodyWidth = pageWidth;
	}
	
	var fadeSecondTime;
	// this is the way the standards work
	if (document.getElementById) fadeSecondTime= document.getElementById( 'popupScreenFade' );
	// this is the way old msie versions work
	else if (document.all) fadeSecondTime= document.all['popupScreenFade'];
	// this is the way nn4 works
	else if (document.layers) fadeSecondTime= document.layers['popupScreenFade'];
	
	if (pageHeight > windowHeight) fadeHeight= pageHeight;
	else fadeHeight= windowHeight;
	if ((windowWidth>=pageWidth) && (is_moz2up==false)) fadeWidth = windowWidth;
	else if (is_moz2up) fadeWidth= scrWidth+12;
	else fadeWidth= pageWidth;
		//alert("Scroll: y=" +scrollposY+ "; x=" +scrollposX+ "; Window: " +windowWidth+ " x " +windowHeight+ "; Page: " +pageWidth+ " x " +pageHeight+ "; ScrollW:" + scrWidth);
		//alert(fadeWidth);
	
	if (fadeSecondTime==null) {	
		var fadeDIV= document.createElement('div');
		fadeDIV.setAttribute ('id','popupScreenFade');
		fadeDIV.style.display = 'block';
		fadeDIV.style.top = '0px';
		fadeDIV.style.left = '0px';
		fadeDIV.style.width = fadeWidth+'px';
		fadeDIV.style.height = fadeHeight+'px';
		fadeDIV.style.zIndex = '50';
		var parentDiv = box.parentNode;
		parentDiv.insertBefore(fadeDIV, box);
	}
	else if (resize==null) {
		toggleLayers( 'popupScreenFade' );
		if ((fadeSecondTime.style.width!=fadeWidth+'px') || (fadeSecondTime.style.height!=fadeHeight+'px')) {
			fadeSecondTime.style.width= fadeWidth+'px';
			fadeSecondTime.style.height= fadeHeight+'px';
			}
		}
	else {
		fadeSecondTime.style.width= fadeWidth+'px';
		fadeSecondTime.style.height= fadeHeight+'px';
	}
}

function sizeOrPosition(object,type) 
{
	//Determine scroll position
	var output = 0;
	if (object=="scroll") {
		if (typeof(window.pageYOffset)=='number') { //Netscape compliant
			if (type=="high") output = window.pageYOffset;
			if (type=="wide") output = window.pageXOffset;
		} 
		else if (document.body && (document.body.scrollLeft||document.body.scrollTop)) { //DOM compliant
			if (type=="high") output = document.body.scrollTop;
			if (type=="wide") output = document.body.scrollLeft;
		} 
		else if (document.documentElement && (document.documentElement.scrollLeft||document.documentElement.scrollTop)) { //IE6 standards compliant mode
			if (type=="high") output = document.documentElement.scrollTop;
			if (type=="wide") output = document.documentElement.scrollLeft;
		}
	}
	
	if(object=="window") {
		if (typeof(window.innerWidth)=='number') { //Non-IE
			if (type=="wide") output = window.innerWidth;
			if (type=="high") output = window.innerHeight;
		} 
		else if (document.documentElement && (document.documentElement.clientWidth||document.documentElement.clientHeight)) { //IE 6+ in 'standards compliant mode'
			if (type=="wide") output = document.documentElement.clientWidth;
			if (type=="high") output = document.documentElement.clientHeight;
		} 
		else if (document.body && (document.body.clientWidth||document.body.clientHeight)) { //IE 4 compatible
			if (type=="wide") output = document.body.clientWidth;
			if (type=="high") output = document.body.clientHeight;
		}
	}
	
	if(object=="page") {
		if(window.innerHeight && window.scrollMaxY) { // Firefox
			if (type=="wide") output = window.innerWidth + window.scrollMaxX;
			if (type=="high") output = window.innerHeight + window.scrollMaxY;
		} 
		else if(document.body.scrollHeight>document.body.offsetHeight) { // all but Explorer Mac
			if (type=="wide") output = document.body.scrollWidth;
			if (type=="high") output = document.body.scrollHeight;
		}
		else { //backup
			if (type=="wide") output = document.body.offsetWidth + document.body.offsetLeft;
			if (type=="high") output = document.body.offsetHeight + document.body.offsetTop;
		}
	}

	return output;
}


//The following is used to deactivate the activation click required for SWFs in IE 6, 6.5, and 7.
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;
}

//Video switch script -- mostly used on product pages if a product has 2 videos
function videoSwitch(id,videoID,currType,newType,key) {
	var videoBox
	if( document.getElementById ) 
	// this is the way the standards work
	 videoBox = document.getElementById( id );  
	 else if( document.all ) 
	   // this is the way old msie versions work
	 videoBox = document.all[id];  
	 else if( document.layers ) 
	   // this is the way nn4 works
	 videoBox = document.layers[id]; 

	var video,videoIDnow
	if (currType=='tangle') videoIDnow=videoID+'GT';
	else videoIDnow=videoID;
	//alert(videoIDnow);
	
	if( document.getElementById ) 
	 // this is the way the standards work
	 video = document.getElementById( videoIDnow );  
	 else if( document.all ) 
	 // this is the way old msie versions work
	 video = document.all[videoIDnow];  
	 else if( document.layers ) 
	 // this is the way nn4 works
	 video = document.layers[videoIDnow];
	
	if (video==null) { //If it doesn't find the layers, then it will assume the video is using the large (i.e. Lg) styles.
		if(currType=='tangle') videoIDnow=videoID+'GTLg';
		else videoIDnow=videoID+'Lg';
	
		if( document.getElementById ) 
		 // this is the way the standards work
		 video = document.getElementById( videoIDnow );  
		 else if( document.all ) 
		 // this is the way old msie versions work
		 video = document.all[videoIDnow];  
		 else if( document.layers ) 
		 // this is the way nn4 works
		 video = document.layers[videoIDnow];
	}

	if (video==null) alert('"'& videoIDnow & '" object ID cannot be found.')
	else if (videoBox!=null) {
		var enlarge="";
		//alert('id: '+id+'; Width='+video.clientWidth);
		if (Number(video.clientWidth)>200) enlarge="Lg";
		if (newType=="tangle") {videoBox.innerHTML='<embed id="ProductDetail_videoGT'+enlarge+'" src="http://www.tangle.com/flash/swf/flvplayer.swf" FlashVars="viewkey=' + key + '" wmode="transparent" quality="high" name="tangle" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>'}
		else if (newType=="ytpl") {videoBox.innerHTML='<embed id="ProductDetail_video'+enlarge+'" src="http://www.youtube.com/cp/' + key + '" wmode="transparent" type="application/x-shockwave-flash"></embed>'}
		else {videoBox.innerHTML='<embed id="ProductDetail_video'+enlarge+'" src="http://www.youtube.com/v/' + key + '&hl=en&fs=1&color1=0x555555&color2=0x333333" wmode="transparent" type="application/x-shockwave-flash" allowfullscreen="true"></embed>'}
	}
}

// video enlarge -- mostly used on product pages
function changeSize (id, dwidth, dheight, lwidth, lheight, tangleExists)
{ //d=default sizes; l=larger sizes
	//typical: 
	// large: width=430px, height=350px;
	// default: width=183px, height=150px (163px for YouTube height);
	// gtSize=if the godtube video size is present, then uses a different id and height
 
 var elemLayer;
 //Detects if a youtube video is showing
 if( document.getElementById ) 
 // this is the way the standards work
 elemLayer = document.getElementById( id );  
 else if( document.all ) 
 // this is the way old msie versions work
 elemLayer = document.all[id];  
 else if( document.layers ) 
 // this is the way nn4 works
 elemLayer = document.layers[id]; 

 if (elemLayer==null) { //if normal size YT video not found, then it looks for a YT video showing large
	 if( document.getElementById ) 
	 // this is the way the standards work
	 elemLayer = document.getElementById( id+"Lg" );  
	 else if( document.all ) 
	 // this is the way old msie versions work
	 elemLayer = document.all[id+"Lg"];  
	 else if( document.layers ) 
	 // this is the way nn4 works
	 elemLayer = document.layers[id+"Lg"]; }

 if ((elemLayer==null) && (tangleExists=='Y')) { //if no YT videos are found and one of the two videos are a tangle video, it looks for a normal sized Tangle video
	 if( document.getElementById ) 
	 // this is the way the standards work
	 elemLayer = document.getElementById( id+'GT' );  
	 else if( document.all ) 
	 // this is the way old msie versions work
	 elemLayer = document.all[id+'GT'];  
	 else if( document.layers ) 
	 // this is the way nn4 works
	 elemLayer = document.layers[id+'GT'];}

 if ((elemLayer==null) && (tangleExists=='Y')) { //if normal size Tangle video not found, then it looks for a Tangle video showing large
	 if( document.getElementById ) 
	 // this is the way the standards work
	 elemLayer = document.getElementById( id+"GTLg" );  
	 else if( document.all ) 
	 // this is the way old msie versions work
		 elemLayer = document.all[id+"GTLg"];  
		 else if( document.layers ) 
		 // this is the way nn4 works
		 elemLayer = document.layers[id+"GTLg"]; 
	 }

 if (elemLayer==null) alert('"' + id + '"...Lg, GT, and GTLg object IDs cannot be found.')
 else { //As long as a video is found, it now looks for the size of the video DIV showing
	var enlarge,boxWidth;
	boxWidth=elemLayer.clientWidth; //determines current size
	if (Number(boxWidth)<200) enlarge=true;
	else enlarge=false;
	
	//alert(videoBox.clientWidth);
	 if (enlarge) {
		elemLayer.style.width = lwidth; 
		elemLayer.style.height= lheight; }
	 else {
		elemLayer.style.width = dwidth;
		if (tangleExists=='Y') elemLayer.style.height='150px';
		else elemLayer.style.height= dheight; }
	//alert('Item Name: '+id+'; boxWidth: '+boxWidth+"; width: "+elemLayer.style.width+"; height: "+elemLayer.style.height);
 }
}

//Older Scripts
function NewWindow(theURL,winName,features) { //v2.0
	//not sure where this is used (1/30/2009). May be used in custom department pages.
	//used to open a new window with several features such as scroll bar, toolbar, status bar, etc.
	window.open(theURL,winName,features);
}

function Old_NewWindow(mypage, myname, w, h, scroll, menubar, status, location) {
	//not sure where this is used (1/30/2009). May be used in custom department pages. Was replaced by the other "newwindow" function.
	//used to open a new window with several features such as scroll bar, toolbar, status bar, etc.
	 var winl = w;
	 var wint = h;
	 winprops = 'height='+h+',width='+w+',scrollbars='+scroll+',resizable'+',menubar='+menubar+',status='+status+',location='+location
	 win = window.open(mypage, myname, winprops)
	 if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function GoToLink() { //v3.0
	//not sure where this is used (1/30/2009). Was used for the ads when Flash was not installed. We no longer use this.
	//Can be used to make a whole item clickable that normally isn't (e.g. a table's cell).
	var i, args=GoToLink.arguments; document.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];}}
}