// browser sniffvar sniff =  {	isIE: false,	isIE6: false,	isIE7: false,	init: function() {		if (navigator.userAgent.indexOf("MSIE 6.0") != -1) {			this.isIE6 = true;		} else if (navigator.userAgent.indexOf("MSIE 7.0") != -1) {			this.isIE7 = true;			}		if (this.isIE6 || this.isIE7) { this.isIE = true }	}}sniff.init();// trace function for firebugvar trace = function(obj) {	if (window.console.log) {		window.console.log(obj);	}}// search helper appvar search = {	init: function() {		searchAsYouType.initialize(document.getElementById('searchField'), true);		Event.observe('searchField','focus',this.focusApp);		Event.observe('searchField','blur',this.blurApp);	},	focusApp: function(e) {		var target = Event.element(e);		if (!$F(target)) {			$('searchField_label').hide();		}	},	blurApp: function(e) {		var target = Event.element(e);		if (!$F(target)) {			$('searchField_label').show();		}	}}var login = {	regSlide: function(mode) {		var obj = $('login_slide');		switch (mode) {			case "down":				new Effect.SlideDown(obj, {duration: .5});				var focusTimer = window.setTimeout(function(){					$('username_login').focus();				},500)			break;			case "up":				new Effect.SlideUp(obj, {duration: .5});			break;					}	},	toolBar: function() {		//$('user_tools_menu').toggle();		new Effect.toggle('user_tools_menu','blind',{duration: .5});	}}// cookie helper appvar Cookie = {  set: function(name, value, daysToExpire) {    var expire = '';    if (daysToExpire != undefined) {      var d = new Date();      d.setTime(d.getTime() + (86400000 * parseFloat(daysToExpire)));      expire = '; expires=' + d.toGMTString();    }    return (document.cookie = escape(name) + '=' + escape(value || '') + expire);  },  get: function(name) {    var cookie = document.cookie.match(new RegExp('(^|;)\\s*' + escape(name) + '=([^;\\s]*)'));    return (cookie ? unescape(cookie[2]) : null);  },  erase: function(name) {    var cookie = Cookie.get(name) || true;    Cookie.set(name, '', -1);    return cookie;  },  accept: function() {    if (typeof navigator.cookieEnabled == 'boolean') {      return navigator.cookieEnabled;    }    Cookie.set('_test', '1');    return (Cookie.erase('_test') === '1');  }}// various global utility functions, stuff that gets run onload, etc.var util =  {	init: function() {	/*
	search.init();
*/		util.ie6Pwn();		util.imageResize();		//util.setMainNav();	},	ie6Pwn: function() {		if (sniff.isIE6 && Cookie.get('ie_alert') == null) {			var newDiv = new Element('div',{id: 'ie6_alert'});			var mssg = '<h2>You are using Internet Explorer 6.</h2>';			mssg += '<p>You\'re using IE 6, this site works best with FireFox and/or IE7. We suggest you upgrade or switch to one of the following: </p>';			mssg += '<ul>';			mssg += '<li class="ff"><a href="http://www.mozilla.com/en-US/products/download.html?product=firefox-2.0.0.12&os=win&lang=en-US">Mozilla Firefox</a></li>';			mssg += '<li class="safari"><a href="http://www.apple.com/safari/download/">Apple Safari</a></li>';			mssg += '<li class="ie7"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Microsoft Internet Explorer 7</a></li>';			mssg += '<li class="ie8"><a href="http://www.microsoft.com/windows/products/winfamily/ie/ie8/readiness/Install.htm">Microsoft Internet Explorer 8 beta</a></li>';			mssg += '<li class="close"><a href="##" onclick="util.hideIEMssg()">close this message</a></li>';			mssg += '</ul>';			newDiv.update(mssg);			$('wrapper').insertBefore(newDiv,$('content'));		}	},	hideIEMssg: function() {		Cookie.set('ie_alert','false',7);		new Effect.BlindUp('ie6_alert',{duration: .5});		var removeTimer = window.setTimeout(function(){			$('ie6_alert').parentNode.removeChild($('ie6_alert'));		},1000);	},	suckerfish: function() {		if (!sniff.isIE) { return };		$A(document.getElementsByClassName('suckerfish')).each(function(menuAt){			menuAt.onmouseover = function() {				$(menuAt).addClassName('hover');			}			menuAt.onmouseout = function() {				//$(menuAt).removeClassName('hover');			}		});	},	imageResize: function() {
		divList = $A($('content').getElementsByClassName("inline_image"));		maxWidth = 490;		if (divList.length != 0) {			divList.each(function(divAt) {				imgAt = divAt.getElementsByTagName("img")[0];				imgWidth = imgAt.width;				if (imgWidth < maxWidth) {					divAt.style.width = eval(imgWidth) + "px";				} else {					divAt.style.width = eval(maxWidth) + "px";				}			});		}	},	// makes dialog box for messaging users	talkbox: function(h) {		var content = $H(h.evalJSON());		content = content._object;		if ($('talkBox')) {			$('talkHeader').update(content.header);			$('talkTarget').update(content.bodyContent);			return;		}		var newX = $('wrapper').getWidth() / 2 - 400 / 2;		if (self.pageYOffset)  {			newY = self.pageYOffset;		}		else if (document.documentElement && document.documentElement.scrollTop) {			newY = document.documentElement.scrollTop;		}		else if (document.body) {			newY = document.body.scrollTop;		}		newY += 200;		var newDiv = Builder.node('div',{				id: 'talkBox', 				className: 'app-window',				style: 'top: ' + newY + 'px; left: ' + newX +'px; display: none;'},			[Builder.node('a',				{href: '#', className: 'close', onclick: 'util.removebox(); return false;'},				[Builder.node('span','close')]			)]		);		var content = $H(h.evalJSON());		content = content._object;		var talkHeader = Builder.node('h2',{id: 'talkHeader'}, content.header);		var targetDiv = Builder.node('div',{id: 'talkTarget'}, '');		$('wrapper').appendChild(newDiv);		$('talkBox').appendChild(talkHeader);		$('talkBox').appendChild(targetDiv);		$('talkTarget').update(content.bodyContent);		new Effect.Appear('talkBox', {duration: .5});		new Draggable('talkBox',{handle: 'talkHeader'});	},	removebox: function() {		new Effect.Fade('talkBox', {duration: .5});		var removeTimer = window.setTimeout(function(){			$('talkBox').parentNode.removeChild($('talkBox'));			}, 500);	},	adContainer: null}// dev debug toolzvar _tools = {	ajaxBug: function(t) {		$$('body')[0].style.background = 'none';		$('wrapper').update(t.responseText);	}}//email a friend toolvar emailMe = {	reveal: function(title) {		var emailMeForm = '<form name="emailMeForm" id="emailMeForm" action="index.cfm" enctype="multipart/form-data" method="post">'				      	 	    + '<label for="email_from">From:</label>'				      	 	    + '<input type="text" name="email_from" id="email_from" value="" />'				      	 	    + '<label for="email_to">To:</label>'				      	 	    + '<input type="text" name="email_to" id="email_to" value="" />'				      	 	    + '<input type="hidden" name="title" id="title" value="' + title + '" />'				      	 	    + '<input type="button" name="sendNow" id="sendNow" value="Send Now!" onclick="emailMe.sbt();" />'				      	 	+ '</form>';		$('emailContent').update(emailMeForm);		new Effect.BlindDown($('emailMe'));		return false;	},	cloak: function() {		new Effect.BlindUp($('emailMe'));		return false;	},	sbt: function() {		if ($('email_to').value == '') 			alert('Please enter an email address to send to.');		else {			if ($('email_from').value == '') 				alert('Please enter your email address.');			else {				new Ajax.Request('/bin/email/email-a-friend.cfm', {					method: 'post',					parameters: {						sendTo: $('email_to').value,						sendFrom: $('email_from').value,						title: $('title').value					},					onSuccess: function(t){						$('emailContent').update(t.responseText);					},					onFailure: function(t){						$('emailContent').update('Failure!');					}				});			}		}	}}Event.observe(window,'load',util.init);