var pageNode,pageParent,contentWidth=0;
var isMacIE = (document.all && navigator.platform.indexOf('Mac') != -1) ? true : false;
/**
 * Base DOM creation function $.dom()
 * Creates DOM elements from passed arguments
 *
 * @params {misc} working on syntax documentation and examles :)
 * @type jQuery object
 */
jQuery.dom = function() {
	var $ = jQuery, r = $([]), a = arguments, d = a.callee,
		j, e, o, c, n, i = 0;

	for (;i<a.length; i++) {
		// skip argument if type is undefined
		if (a[i] == undefined) continue;

		// e - current argument (node or string)
		// o - next argument (attributes as simple object)
		// c - third argument (array of child nodes)
		// n - number of arguments to skip
		e = a[i]; o = a[i+1]; c = a[i+2]; n = 0;
		if (e.nodeType) e = $(e);
		if (e instanceof Array) e = d.apply(null, e);
		// try to create element node if next argument is a simple object
		if (o && o.constructor == Object && !o.jquery) {
			if (typeof e == "string") {
				// check for custom defined tag
				if (d.tag[j = e.toLowerCase()]) {
					n = 1;
					e = d(d.tag[j](e, o, (c instanceof Array && (n = 2)) ? c : undefined));
				} else e = $(document.createElement(e));
			}
			// set attributes and append child nodes if any
			if (e.jquery && !n) {
				e.attr(o);
				if (c instanceof Array) {
					n = 2;
					e._append(d.apply(null, c).get());
				} else n = 1;
			}
		}
		if (typeof e == "string") e = $(document.createTextNode(e));
		// add created elements
		if (e.jquery) for (j=0; j<e.size(); j++) r[r.length++] = e[j];
		i += n;
	}
	return r;
};

/**
 * appendChild fix
 * Prevents from creating invalid HTML structures.
 *
 * @param {DOMElement}
 * @param {DOMElement}
 */
jQuery.dom.append = function(parent, child) {
	if (parent.nodeType != 1) return;
	if (child.nodeType == 1) {
		var p = jQuery.dom.pnames, c = jQuery.dom.cnames,
			pn = parent.nodeName,
			cn = child.nodeName,
			tmp;

		// TABLE TR case exeption
		if (pn == 'TABLE' && cn == 'TR') {
			tmp = parent.getElementsByTagName("tbody")[0];
			if ( !tmp ) {
				tmp = document.createElement("tbody");
				parent.appendChild( tmp );
			}
			return jQuery.dom.append(tmp, child);
		}

		if ((p[pn] && !new RegExp('\\b'+ cn +'\\b').test(p[pn]))
			|| (c[cn] && !new RegExp('\\b'+ pn +'\\b').test(c[cn])))

			if (c[cn]) {
				tmp = document.createElement(c[cn].split(',')[0]);
				tmp.appendChild(child);
				return jQuery.dom.append(parent, tmp);
			} else if (p[pn]) {
				tmp = document.createElement(p[pn].split(',')[0]);
				parent.appendChild(tmp);
				return jQuery.dom.append(tmp, child);
			}
	}
	return parent.appendChild(child);
};
// a set of valid parent > child nodeNames
jQuery.dom.pnames = { 'TABLE' : "TBODY,THEAD,TFOOT,CAPTION,COLGROUP,COL", 'TBODY' : "TR", 'THEAD' : "TR", 'TFOOT' : "TR", 'TR' : "TD,TH", 'UL' : "LI", 'OL' : "LI", 'DL' : "DD,DT" };
// get a set of valid child < parent nodeNames
(function(){
	var p = jQuery.dom.pnames, c = jQuery.dom.cnames = {}, a, i, j;
	for (i in p) {
		a = p[i].split(',');
		for (var j=0; j<a.length; j++) c[a[j]] = (c[a[j]] ? c[a[j]] +"," : "") + i;
	}
})();
// fixed append
jQuery.fn._append = function() {
	var clone = this.size() > 1;
	var a = jQuery.clean(arguments);
	return this.each(function(){
		for ( var i = 0; i < a.length; i++ )
			jQuery.dom.append(this, clone ? a[i].cloneNode(true) : a[i] );
	});
};

/**
 * custom tag definition
 * @param {string} name of tag
 * @param {function} callback function
 */
jQuery.dom.tag = function() { var a = arguments, i=0; for (;i<a.length; i+=2) a.callee[a[i]] = a[i+1]; };

/**
 * runs jQuery DOM plugin taking jQuery object as the first argument
 */
jQuery.prototype.dom = function() {
	for (var i=0,a=[this]; i<arguments.length; i++) a[i+1] = arguments[i];
	return this.pushStack( jQuery.dom.apply( null, a ).get() );
};

// Generic function for cloning the events from one element to another
jQuery.event.clone = function(from,to) {
	for (var i in from.events)
		for (var j in from.events[i])
			jQuery.event.add(to, i, from.events[i][j]);
	return to;
};

// Clone the objects and the events
jQuery.prototype.clone = function(deep) {
	return this.pushStack( jQuery.map( this.get(), function(a){
		return jQuery.event.clone( a, a.cloneNode( deep == undefined || deep ) );
	} ) );
};

jQuery.html = function() { return this.clean(arguments); };

/**
 * Simple JSON object template method
 * Calls DOM template function for every JSON element
 *
 * @param {json} http://json.org
 * @param {function} template callback function
 * @param {array} additional arguments to pass to callback function
 * @type jQuery object
 */
jQuery.tpl = function(json, tpl, args) {
	var r = jQuery([]), a, i=0, j;
	json = json instanceof Array ? json : [json];

	for (; i<json.length; i++) {
		a = jQuery.dom(tpl.apply(json[i], args || []));
		for (j=0; j<a.size(); j++) r[r.length++] = a.get(j);
	}
	return r;
};

jQuery.prototype.exec = function(fn) { fn.apply(this, []); return this; };

// IE fix for form elements
if (jQuery.browser == "msie")
jQuery.dom.tag(
	'input',	function(name, attr){
		var i, element = "<input";
		for (var i in attr) element += " "+ i +'="'+ attr[i] +'"';
		return jQuery.html(element +" />");
	},
	// need testing :)
	'select',	function(name, attr, options){
		var i, element = "<select";
		for (var i in attr) element += " "+ i +'="'+ attr[i] +'"';
		element = jQuery.html(element +"></select>")[0];
		jQuery.dom(options).appendTo(element);
		return element;
	},
	'textarea',	function(name, attr, text){
		var i, element = "<textarea";
		for (var i in attr) element += " "+ i +'="'+ attr[i] +'"';
		element = jQuery.html(element +"></textarea>")[0];
		element.value = text.join("");
		return element;
	}
);
function parseHref(fullHref) {
  var domLoc;
  if (fullHref.charAt(0) == "/") fullHref = 'http://' + document.domain + fullHref;
  if (fullHref.indexOf('//')==-1) {
	var i=0
	var upDir = fullHref.split('/');
	for (i=0;i<upDir.length;i++) {
	  if (upDir[i] != '..') {
	    break;
	  }
	}
	var rebuildStop = (leaf) ? docLoc[2].length-(i+1) : docLoc[3].length-i;///*(*/
	rebuildCrumb = (leaf) ? docLoc[2].slice(0,rebuildStop) : docLoc[3].slice(0,rebuildStop);
	forkHref = upDir.slice(i);
	newHref = rebuildCrumb.concat(forkHref);
	fullHref = docLoc[1] + newHref.join('/');
  }
  if (fullHref.indexOf('local_fidm.com')!=-1) {
	domLoc = fullHref.substr(0,fullHref.indexOf('local_fidm.com')+15);
  } else {
	domStart = fullHref.lastIndexOf('//')+2;
	domEnd = fullHref.substr(domStart).indexOf('/')+1;
	domLoc = fullHref.substr(0,domStart+domEnd);
    //domLoc = document.domain;
  }
  if (fullHref.charAt(fullHref.length-1)=='/') fullHref+='index.html';
  var folderString = ((x=fullHref.indexOf('.html')) != -1) ? fullHref.substring(domLoc.length,x) : fullHref.substring(domLoc.length);
  crumbs = folderString.split('/');
  if ((lastFolder = folderString.lastIndexOf('index'))!=-1) folderString = folderString.substr(0,lastFolder);
  var trailingSlash = (folderString.charAt(folderString.length-1)=='/') ? folderString.substr(0,folderString.length-1) : folderString;
  columns = trailingSlash.split('/');
  hrefObj = new Array(fullHref,domLoc,crumbs,columns,folderString);
  return hrefObj;
}
var docLoc = parseHref(unescape(top.document.location.href));
var rootLoc = docLoc[1];

var gregorian = new Array("calendar","January","February","March","April","May","June","July","August","September","October","November","December");
function toCalendar(date) {
  return gregorian[parseInt(date.substring(4,6),10)] + ' ' + date.substring(0,4);
}
function nairogerg(dateStr) {
  dateArray = dateStr.split(' ');
  for (i=1;i<gregorian.length; i++) {
    if (gregorian[i].indexOf(dateArray[0]) == 0) {
	  zeroDigit = (i*.01) + '';
	  if (zeroDigit.length < 4) zeroDigit += '0';
      return dateArray[1] + zeroDigit.substring(2);
	}
  }
  return '200003'
}
function swapClass(newClass,activeObj) {
  $("#"+activeObj).get(0).className="";
  $("#"+activeObj).addClass(newClass);
}
function menuTrail() {
  var liHref,a=menuTrail.arguments;
  for(m=a.length-1;m>=0;m--) {
    var menuContainer = $("#"+a[m]+" ul li a").parent("li");
    menuContainer.each(function(i) {
	  liHref = parseHref(unescape($("a", this).get(0).getAttribute('href')))
	  if (m==a.length-1) {
	    if (liHref[2][0] == docLoc[2][0]) $(this).addClass("current");
	  } else if (m==1) {
		tempHref = liHref[2].slice(0,2+m);
      if (document.location.href.indexOf(tempHref.join('/'))!=-1 && liHref[1] == rootLoc) $(this).addClass("current");
	  } else if (m==0) {
		tempHref = liHref[2].slice(0,2+m);
		if (document.location.href.indexOf(tempHref.join('/'))!=-1 && liHref[1] == rootLoc) $(this).addClass("current");
	  } else if (document.location.href.indexOf(liHref[4])!=-1 && liHref[1] == rootLoc) {
		$(this).addClass("current");
		if (a[m] == 'morenav') {
		  $(this).attr('id','LIcurrent');
		  $(this).removeClass("current");
		}
	  }
	  if (m==2 && this.className == 'current' && (nestNav = $("#"+a[m]+" ul li ul li a").parent("li")).size() > 0) {
		tempHref = liHref[2].slice(0,2+m);
		if (document.location.href.indexOf(tempHref.join('/'))!=-1 && liHref[1] == rootLoc) {
		  nestNav.each(function(i) {
		    nestHref = parseHref(unescape($("a", this).get(0).getAttribute('href')));
		    if (document.location.href.indexOf(nestHref[4])!=-1 && nestHref[1] == rootLoc) {
		      (nestLI=$(this.parentNode.parentNode)).attr('id','current');
		      nestLI.removeClass("current");
			  $(this).addClass("current");
			}
		  })
		}
	  }
	})
  }
}
$.fn.hoverClass = function(c) {
    return this.each(function(){
        $(this).hover( 
            function() { $(this).addClass(c);  },
            function() { $(this).removeClass(c); }
        );
    });
};    
function startList() {
  var m,a=startList.arguments; document.startList=new Array;
  for(m=0;m<(a.length);m++) {
    $("#"+a[m]+" li ul, #"+a[m]+" li dl").parent("li").hover(
        function(){ $("ul, dd", this).fadeIn("fast");
    }, 
        function() { $("ul, dd", this).fadeOut("fast"); } 
    );
    if ((cut=a[m].indexOf('?')) != -1 && a[m].substring(cut+1).length>0) {
	  $("#"+a[m].substring(cut+1)+" li ul").parent("li").bind(a[m].substring(0,cut), function() {
		$(this).siblings("li").not(this).removeClass("over");
		if (this.className.indexOf('over')!=-1) {
		  $(this).removeClass("over")
		} else {
		  $(this).addClass("over")
		}
	  })
    } else if (document.all && document.getElementById && $("#"+a[m]).size()>0) {
      $("#"+a[m]+" li ul, #"+a[m]+" li dl").parent("li").hover( 
            function() { $(this).addClass('over');  },
            function() { $(this).removeClass('over'); }
        );
    }
  }
}
function textSwap(jqobj,msg,limit) {
  if (limit!=null && msg.length > limit) msg = msg.substring(0,limit) + '…';
  $(jqobj).html(msg);
}
function slideNav() {
  if ($("ul#slideshow").size()>0) {
    slideList = $("li#morenav ul li a").not("li#morenav ul li h5 a");
    slideCarousel = slideList.parent("li");
    pageNode = ($("li#LIcurrent").size()>0) ? $("li#LIcurrent") : slideList;
	menuTitle = $("li#morenav a span");
	menuTxt = menuTitle.text();
	menuTxtLngth = menuTxt.length;
	titleSlot = ($("li#LIcurrent").size()>0) ? $("a", pageNode).text() : menuTxt;
    textSwap("li#morenav a span",titleSlot,menuTxtLngth);
	$("li#morenav a").bind('mouseover', function() {
      menuTitle.html(menuTxt);
	})
	$("li#morenav a").bind("mouseout", function() {
      textSwap("li#morenav a span",titleSlot,menuTxtLngth);
	})
    if ($("ul#slideshow li#previous, ul#slideshow li#next").size()>0) {
	  previousSlide = slideCarousel.get(slideList.size()-1);
	  nextSlide = slideCarousel.get(0);
	  if (pageNode.get(0).id == "LIcurrent") {
		slideCarousel.each(function(i) {
		  if (this.id == "LIcurrent") { 
            nextSlide = (i<slideCarousel.size()-1) ? slideCarousel.get(i+1) : slideCarousel.get(0);
            previousSlide = (i>0) ? slideCarousel.get(i-1) : slideCarousel.get(slideCarousel.size()-1);
		  }
		})
	  }
	  newPrevious = $.dom(
	    'li', { 'id':"previous" }, [
    	  'a', {'href':previousSlide.firstChild.getAttribute('href')}, [
            'img', {'src':rootLoc + "global/images/1.gif", 'width':"30", 'height':"21", 'border':"0"}, []
		  ]
	    ]
      );
	  newNext = $.dom(
	    'li', { 'id':"next" }, [
    	  'a', {'href':nextSlide.firstChild.getAttribute('href')}, [
            'img', {'src':rootLoc + "global/images/1.gif", 'width':"30", 'height':"21", 'border':"0"}, []
		  ]
	    ]
	  );
      $("ul#slideshow li#previous, ul#slideshow li#next").remove();
      $("ul#slideshow").prepend(newNext.get(0)).prepend(newPrevious.get(0));
	$("li#previous a").bind('mouseover', function() {
      textSwap("li#morenav a span",previousSlide.firstChild.firstChild.data,menuTxtLngth);
	})
	$("li#next a").bind('mouseover', function() {
      textSwap("li#morenav a span",nextSlide.firstChild.firstChild.data,menuTxtLngth);
	})
	$("li#previous a, li#next a").bind("mouseout", function() {
      textSwap("li#morenav a span",titleSlot,menuTxtLngth);
	})
    }
  }
}
function disableIt() {
	for (i=0;i<(a=disableIt.arguments).length;i+=2) {
		$("#" + a[i]).get(0).disabled = a[i+1];
	}
}
function fixSearch() {
  if ((searchTab = document.getElementById('search'))!=null) {
	if (searchTab.firstChild.getAttribute('href')!=null) searchTab.firstChild.setAttribute('href','http://search.fidm.com/')
  }
  if ((searchForm = $("#gs")).size()>0) {
//  searchForm.get(0).setAttribute('action','http://search.fidm.com/search');
  searchForm.get(0).setAttribute('action','http://google.com/search');
  var inputArray = new Array()
  inputArray[inputArray.length] = new Array('as_sitesearch','fidm.com')
  inputArray[inputArray.length] = new Array('hl','en')
  inputArray[inputArray.length] = new Array('lr','')
  for (i=0;i<searchForm.get(0).childNodes.length;i++) {
    if (searchForm.get(0).childNodes[i].tagName == 'INPUT' && searchForm.get(0).childNodes[i].getAttribute('name') == 'as_sitesearch') {
      searchForm.get(0).removeChild(searchForm.childNodes[i]);
    }
  }
  $("form#gs input").not(".searchfield").not(".searchsubmit").remove('input');
  for (j=0;j<inputArray.length; j++) {
    searchForm.append($.dom('input',{'type':"hidden",'name':inputArray[j][0],'value':inputArray[j][1]},[]).get(0));
  }
}}
var aoproi="<script language=\"javascript\" src=\"http://track.roiservice.com/track/track.aspx?ROIID=935467107000023\"></s"+"cript><script language=\"javascript\">if (typeof(ROIID) + '' != 'undefined') TrackEvent('LandingPage', 0);</s"+"cript>";
$(document).ready(finishPage);
function finishPage() {
  if (top.document.location.href == document.location.href) getContentWidth();
  menuTrail('parentnav','lateralnav','interiornav','morenav','topmenu');
  sideCol();
  styleFinder();
  startList('smpllogo','interiornav','slideshow');
//  $("div#aop").html(aoproi);
  slideNav();
  self.focus();
  window.onresize = sideCol;
/*  if (!getCookie('alerted')) {
  	$("div#content").prepend(popAlert).show('slow').click(function() {
		$('div#alert').hide('fast',$('div#alert').remove());
	});
	setCookie('alerted',1);
	}
*/  
  //fixSearch(); emergency change to search;
/*  dcsVar();
  dcsMeta();
  dcsFunc("dcsAdv");
  dcsTag();*/
}

// Original JavaScript code by Duncan Crombie: dcrombie@chirp.com.au
// revised by Bradford Mar: bradfordmar@hotmail.com
// Please acknowledge use of this code by including this header.

//var bites = (document.cookie) ? document.cookie.split("; ") : null; // break cookie into array of bites

  function getCookie(name) { // use: getCookie("name");
    bites = (document.cookie) ? document.cookie.split("; ") : null; // break cookie into array of bites
    if (bites != null) {
      for (var i=0; i < bites.length; i++) {
        nextbite = bites[i].split("="); // break into name and value
        if (nextbite[0] == name) {// if name matches
          return unescape(nextbite[1]); // return value
        }
      }
    } else {
      return null;
    }
    return null;
  }

  function setCookie(name, value, expDate) {
    var today = new Date();
    var yearFromNow = new Date(today.getTime() + 31536000000); // plus 365 days
    var expiry = (expDate) ? expDate.toGMTString() : null;
    if (value != null && value != "") {
      newCookie = name + "=" + escape(value) + "; path=/";
      newCookie += (expiry) ? ";expires=" + expiry : "";
      document.cookie = newCookie;
      bites = document.cookie.split("; "); // update cookie bites
    }
  }
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_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_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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
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_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
    }
  }
}

// Body onload utility (supports multiple onload functions)
var gSafeOnload = new Array();
function SafeAddOnload(f) {
  if (window.onload) {
	if (window.onload != SafeOnload) {
	  gSafeOnload[gSafeOnload.length] = window.onload;
	  window.onload = SafeOnload;
	}		
	gSafeOnload[gSafeOnload.length] = f;
  } else {
	window.onload = f;
  }
}
function SafeOnload()
{
	for (var i=0;i<gSafeOnload.length;i++)
		gSafeOnload[i]();
}
function encodeId(pageName) {
  pageName=pageName.replace(/\./g,'');
  pageName=pageName.replace(/[+]|\%2b|\%2B/g,'-');
  return 'nav' + pageName;
}
function setActiveStyleSheet(title,mark) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
  if (mark) setCookie("style", title);
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function toggleActiveStyleSheet() {
  var currStyle = getActiveStyleSheet(), a=toggleActiveStyleSheet.arguments;
  switch (currStyle) {
	case a[0]:
	  setActiveStyleSheet(a[1],a[a.length-1]);
	  break;
	case a[1]:
	  setActiveStyleSheet(a[0],a[a.length-1]);
	  break;
	default:
	  setActiveStyleSheet(a[1],a[a.length-1]);
	  break;
  }
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function styleFinder() {
  var cookie = getCookie("style");
  var title = (cookie) ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title,false);
}

var cookie = getCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

function getBrowserWidth() {
  if (window.innerWidth) {
	return window.innerWidth;
  } else if (document.body.clientWidth!=0) {
	return parseFloat(document.body.clientWidth);
  } else if (document.documentElement && document.documentElement.clientWidth != 0 && !isMacIE) {//alert('document.documentElement.clientWidth= '+document.documentElement.clientWidth)
	return parseFloat(document.documentElement.clientWidth);
  }//alert('did not read document.body.clientWidth= '+document.body.clientWidth)
  return 0;
}
function getContentWidth() {
  $("div#content img, div#content table").each(function() {
	newWidth = ($(this).attr("width")) ? parseFloat($(this).attr("width")) : 200;
    if (newWidth>contentWidth) contentWidth = newWidth;
  })
  if (contentWidth==0) contentWidth = 250;
}

var columnAdjust = (docLoc[0].indexOf('.html')!=-1 && docLoc[0].indexOf('index')==-1 || leaf) ? 1 : 0;
var sideColumns = 3;
var pickLI = $.dom(
  'li', {'class':"current"}, [
    'a', {'href':'#'}, ["Features in this section"]
  ]
);
var pickLIid = $.dom(
  'li', {'id':"current"}, [
    'a', {'href':'#'}, ["Features in this section"]
  ]
);
function sideCol() {
  var nonIEX = (contentWidth<400) ? 1.45 : (document.all) ? 1 : 1.05;
  var scrollX = (contentWidth<300) ? 0.98 : (contentWidth<400) ? 1.03 : (document.all) ? 1.095 : 1.15;
  var contentADD = getBrowserWidth()*(((contentWidth+(50-(contentWidth*0.15)))*nonIEX)/(contentWidth*3));//alert(contentADD)
  var contentADD = (!document.all) ? contentADD*1.18 : contentADD;
  sideColumns = (getBrowserWidth()*scrollX < contentWidth + contentADD && docLoc[3].length-columnAdjust > 1 && document.location.href == top.document.location.href) ? 0 : (docLoc[3].length-columnAdjust <= 1) ? 1 : (docLoc[3].length-columnAdjust == 2) ? 2 : 3;//alert(getBrowserWidth()*scrollX + ',' + (contentWidth + contentADD))
  if (sideColumns != 3 && docLoc[2].length>1) {
    $("body").removeClass("side2").removeClass("side1").removeClass("side0").addClass("side" + sideColumns);
	if (sideColumns == 0) {
	  latUL = $("div#lateralnav ul");
	  intUL = $("div#interiornav ul");
	  if (docLoc[3].length==2 && latUL != null && $("li.current",latUL).size()==0) {
		latUL.prepend(pickLI.get(0));
	  } else if (docLoc[3].length==3 && intUL != null && $(".current").size()==0) {
		intUL.prepend(pickLIid.get(0));
	  }
	} else clearPick();
  } else {
    $("body").removeClass("side2").removeClass("side1").removeClass("side0")
	clearPick();
  }
  $("div#sidenav div").hover(function() {$(this).removeClass("out").siblings("div").not(this).addClass("out")}, function() {$(this).siblings().removeClass("out")}).hover( 
            function() { $(this).addClass('over');  },
            function() { $(this).removeClass('over'); }
        );
}
function clearPick() {
  $("div#sidenav ul > li:first-child").each( function() {
	if ($(this).text()==pickLIid.text() || $(this).text()==pickLI.text()) $(this).remove();
  })
}
var popAlert = '<div id="alert" style="visible: hidden; position: absolute; width:350px; margin-left: 20%; top: 65px; padding-bottom: 18px; background: #FFF url('+rootLoc+'global/images/important.jpg); z-index: 100; border: 1px #606 solid;"><h3 style="margin-top: 58px; color: #990033;">IMPORTANT NOTICE:</h3><p style="line-height: 1.2;">FIDM is continually working to improve our technology to better serve you. As part of this ongoing effort, we will be doing maintenance on this site starting Friday, December 12 at 4:00 PM (Pacific.) The site will be unavailable until Monday, December 15.<br /><br />We apologize for this inconvenience.</p></div>';
