// Browser Selector
function css_browser_selector(u){var ua = u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',h=document.getElementsByTagName('html')[0],b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3')?g+' ff3':is('gecko/')?g:/opera(\s|\/)(\d+)/.test(ua)?'opera opera'+RegExp.$2:is('konqueror')?'konqueror':is('chrome')?w+' chrome':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);
// Image Rollover
if (document.getElementsByTagName && document.getElementById) { if (window.addEventListener) window.addEventListener('load', setImageSwaps, false); else if (window.attachEvent) window.attachEvent('onload', setImageSwaps);}
function setImageSwaps() { prepareImageSwap('example2',true,true,true,true); prepareImageSwap('example3',true,false,true,false); prepareImageSwap(document.body);}
function prepareImageSwap(elem,mouseOver,mouseOutRestore,mouseDown,mouseUpRestore,mouseOut,mouseUp) { if (typeof(elem) == 'string') elem = document.getElementById(elem); if (elem == null) return; var regg = /(.*)(_nm\.)([^\.]{3,4})$/
var prel = new Array(), img, imgList, imgsrc, mtchd; imgList = elem.getElementsByTagName('img'); for (var i=0; img = imgList[i]; i++) { if (!img.rolloverSet && img.src.match(regg)) { mtchd = img.src.match(regg); img.hoverSRC = mtchd[1]+'_hv.'+ mtchd[3]; img.outSRC = img.src; if (typeof(mouseOver) != 'undefined') { img.hoverSRC = (mouseOver) ? mtchd[1]+'_hv.'+ mtchd[3] : false; img.outSRC = (mouseOut) ? mtchd[1]+'_ou.'+ mtchd[3] : (mouseOver && mouseOutRestore) ? img.src : false; img.mdownSRC = (mouseDown) ? mtchd[1]+'_md.' + mtchd[3] : false; img.mupSRC = (mouseUp) ? mtchd[1]+'_mu.' + mtchd[3] : (mouseOver && mouseDown && mouseUpRestore) ? img.hoverSRC : (mouseDown && mouseUpRestore) ? img.src : false;}
if (img.hoverSRC) {preLoadImg(img.hoverSRC); img.onmouseover = imgHoverSwap;}
if (img.outSRC) {preLoadImg(img.outSRC); img.onmouseout = imgOutSwap;}
if (img.mdownSRC) {preLoadImg(img.mdownSRC); img.onmousedown = imgMouseDownSwap;}
if (img.mupSRC) {preLoadImg(img.mupSRC); img.onmouseup = imgMouseUpSwap;}
img.rolloverSet = true;}
}
function preLoadImg(imgSrc) { prel[prel.length] = new Image(); prel[prel.length-1].src = imgSrc;}
}
function imgHoverSwap() {this.src = this.hoverSRC;}
function imgOutSwap() {this.src = this.outSRC;}
function imgMouseDownSwap() {this.src = this.mdownSRC;}
function imgMouseUpSwap() {this.src = this.mupSRC;}
// Topnav
var menusystem={disabletablinks:false,snap2original:[true,500],currentpageurl:window.location.href.replace("http://"+window.location.hostname,"").replace(/^\//,""),definemenu:function(tabid,dselected){this[tabid+"-menuitems"]=null
this[tabid+"-dselected"]=-1
this.addEvent(window,function(){menusystem.init(tabid,dselected)},"load")},showsubmenu:function(tabid,targetitem){var menuitems=this[tabid+"-menuitems"]
this.clearrevert2default(tabid)
for(i=0;i<menuitems.length;i++){menuitems[i].className=""
if(typeof menuitems[i].hasSubContent!="undefined")
document.getElementById(menuitems[i].getAttribute("rel")).style.display="none"}
targetitem.className="current"
if(typeof targetitem.hasSubContent!="undefined")
document.getElementById(targetitem.getAttribute("rel")).style.display="block"},isSelected:function(menuurl){var menuurl=menuurl.replace("http://"+menuurl.hostname,"").replace(/^\//,"")
return(menusystem.currentpageurl==menuurl)},isContained:function(m,e){var e=window.event||e
var c=e.relatedTarget||((e.type=="mouseover")?e.fromElement:e.toElement)
while(c&&c!=m)try{c=c.parentNode}catch(e){c=m}
if(c==m)
return true
else
return false},revert2default:function(outobj,tabid,e){if(!menusystem.isContained(outobj,tabid,e)){window["hidetimer_"+tabid]=setTimeout(function(){menusystem.showsubmenu(tabid,menusystem[tabid+"-dselected"])},menusystem.snap2original[1])}},clearrevert2default:function(tabid){if(typeof window["hidetimer_"+tabid]!="undefined")
clearTimeout(window["hidetimer_"+tabid])},addEvent:function(target,functionref,tasktype){var tasktype=(window.addEventListener)?tasktype:"on"+tasktype
if(target.addEventListener)
target.addEventListener(tasktype,functionref,false)
else if(target.attachEvent)
target.attachEvent(tasktype,functionref)},init:function(tabid,dselected){var menuitems=document.getElementById(tabid).getElementsByTagName("a")
this[tabid+"-menuitems"]=menuitems
for(var x=0;x<menuitems.length;x++){if(menuitems[x].getAttribute("rel")){this[tabid+"-menuitems"][x].hasSubContent=true
if(menusystem.disabletablinks)
menuitems[x].onclick=function(){return false}
if(menusystem.snap2original[0]==true){var submenu=document.getElementById(menuitems[x].getAttribute("rel"))
menuitems[x].onmouseout=function(e){menusystem.revert2default(submenu,tabid,e)}
submenu.onmouseover=function(){menusystem.clearrevert2default(tabid)}
submenu.onmouseout=function(e){menusystem.revert2default(this,tabid,e)}}}
else
menuitems[x].onmouseout=function(e){this.className="";if(menusystem.snap2original[0]==true)menusystem.revert2default(this,tabid,e)}
menuitems[x].onmouseover=function(){menusystem.showsubmenu(tabid,this)}
if(dselected=="auto"&&typeof setalready=="undefined"&&this.isSelected(menuitems[x].href)){menusystem.showsubmenu(tabid,menuitems[x])
this[tabid+"-dselected"]=menuitems[x]
var setalready=true}
else if(parseInt(dselected)==x){menusystem.showsubmenu(tabid,menuitems[x])
this[tabid+"-dselected"]=menuitems[x]}}}}

function submitform() { document.searchSite.submit(); }
