function fn_swapImgRestore() { //v3.0
  var i,x,a=document.fn_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function fn_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.fn_p) d.fn_p=new Array();
    var i,j=d.fn_p.length,a=fn_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.fn_p[j]=new Image; d.fn_p[j++].src=a[i];}}
}

function fn_findObj(n, d) { //v3.0
  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=fn_findObj(n,d.layers[i].document); return x;
}

function fn_swapImage() { //v3.0
  var i,j=0,x,a=fn_swapImage.arguments; document.fn_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=fn_findObj(a[i]))!=null){document.fn_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*************************************** TAB TABLE MSIE ****************************************/
//a public function that the container uses to pass in values for the labels
function public_Labels(label1, label2){
	t1.innerText = label1;
	t2.innerText = label2;
	t3.innerText = label1;
	t4.innerText = label1;
	t5.innerText = label1;

}

//a public function that the container uses to pass in values for the card containers
function public_Contents(contents1, contents2){
	t1Contents.innerHTML = contents1;
	t2Contents.innerHTML = contents2;
	t3Contents.innerHTML = contents2;
	t4Contents.innerHTML = contents2;
	t5Contents.innerHTML = contents2;

	init();
}

//sets the default display to tab 1
function init(){
	tabContents.innerHTML = t1Contents.innerHTML;
}	

//this is the tab switching function
var currentTab;
var tabBase;
var firstFlag = true;


function changeTabs(){
	if(firstFlag == true){
		currentTab = t1;
		tabBase = t1base;
		firstFlag = false;
	}

	if(window.event.srcElement.className == "tab"){
		currentTab.className = "tab";
		tabBase.style.backgroundColor = "#93a5fe";
		currentTab = window.event.srcElement;
		tabBaseID = currentTab.id + "base";
		tabContentID = currentTab.id + "Contents";
		tabBase = document.all(tabBaseID);
		tabContent = document.all(tabContentID);
		currentTab.className = "selTab";
		tabBase.style.backgroundColor = "#d5d9f0";
		tabContents.innerHTML = tabContent.innerHTML;
	}
}

/***************************************** COOKIES ****************************************/
/* This code is Copyright (c) 1996 Nick Heinle and Athenia Associates, 
 * all rights reserved. In order to receive the right to license this 
 * code for use on your site the original code must be copied from the
 * Web site webreference.com/javascript/. License is granted to user to 
 * reuse this code on their own Web site if and only if this entire copyright
 * notice is included. Code written by Nick Heinle of webreference.com.
 */
function getCookie(name)
{
  var dcookie = document.cookie;
  var cname = name + "=";
  var clen = dcookie.length;
  var cbegin = 0;

  while (cbegin < clen)
  {
    var vbegin = cbegin + cname.length;
    if (dcookie.substring(cbegin, vbegin) == cname)
    {
      var vend = dcookie.indexOf(";", vbegin);
      if (vend == -1) vend = clen;
      return unescape(dcookie.substring(vbegin, vend));
    }
    cbegin = dcookie.indexOf(" ", cbegin) + 1;
    if (cbegin == 0) break;
  }
  return null;
}

function setCookie(name, value, expires)
{
  if (!expires) expires = new Date();
  document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString() + "; path=/";
}

/***************************************** COOKIES ****************************************/
/* This code voids the <A href> Tag to allow open windows without refresh the parent window.
 */
function FNothing() {;}

/***************************************** COOKIES ****************************************/
/* Default browsercheck. Puts the result into bw variable, mentioned below.
 */
function checkBrowser(){
    this.ver=navigator.appVersion
    this.dom=document.getElementById?1:0
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
    this.ie4=(document.all && !this.dom)?1:0;
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
    this.ns4=(document.layers && !this.dom)?1:0;
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
    return this
}
var bw=new checkBrowser()

/***************************************** COOKIES ****************************************/
/* This code hides and shows layers. Used to show the pictures with the set of products.
 * With nested layers for netscape, this function hides the layer if it's visible and visa versa
 */
function showHide(div)
{
  //Translation of above shortcut:
  if(bw.dom)
	{
    obj=document.getElementById(div).style;
  }
  else 
	{
    if(bw.ie4) 
		{
      obj=document.all[div].style;
    }
    else 
		{
      if(bw.ns4) 
			{
        obj=document[div];
			}
      else 
			{
        obj=0;
			}
		}
	}
  if((obj.visibility=='visible') || (obj.visibility=='show')) 
	{
    obj.visibility='hidden';
	}
  else 
	{
    obj.visibility='visible';
	}
}
