//<![CDATA[

// Author:                Mateus Prado (http://www.mateusprado.com)

/*  CLASSES
 * ie - Internet Explorer
 * ie6 - Internet Explorer 6
 * ie5 - Internet Explorer 5
 * gecko - Mozilla, Firefox, Camino
 * opera - Opera
 * konqueror - Konqueror
 * webkit or safari - Safari, NetNewsWire, OmniWeb, Shiira
 */
var css_browser_selector = function() {
	var ua = navigator.userAgent.toLowerCase();
	var h = document.getElementsByTagName('html')[0];
	var c = h.className;

	if (ua.indexOf('msie') != -1 && !(ua.indexOf('opera') != -1)
			&& (ua.indexOf('webtv') == -1))
		h.className = 'ie' + ' ie' + ua.charAt(ua.indexOf('msie') + 5) + ' '
				+ c;
	else if (ua.indexOf('gecko/') != -1)
		h.className = ('gecko ' + c);
	else if (ua.indexOf('opera') != -1)
		h.className = ('opera ' + c);
	else if (ua.indexOf('konqueror') != -1)
		h.className = ('konqueror ' + c);
	else if (ua.indexOf('applewebkit/') != -1)
		h.className = ('webkit safari ' + c);
	else if (ua.indexOf('mozilla/') != -1)
		h.className = ('gecko ' + c);
}.apply(this);

function openWin(path, winW, winH) {
	var iMyWidth;
	var iMyHeight;
	iMyWidth = (window.screen.width / 2) - ((winW / 2) + 10);
	iMyHeight = (window.screen.height / 2) - ((winH / 2) + 50);
	var win2 = window.open(path, '', "status,toolbar=0,height=" + winH
			+ ",width=" + winW + ",resizable=yes,left=" + iMyWidth + ",top="
			+ iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight
			+ ",scrollbars=yes");
	win2.opener = window;
	win2.focus();
	return false;
}

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);
/* http://www.htmldog.com/articles/suckerfish/dropdowns/ */

/* Fix IE flicker */
try {
	document.execCommand('BackgroundImageCache', false, true);
} catch (e) {
}

// ]]>
