
var SAFARI_STYLESHEET_REFERENCE="./_resources/css/styles_safari.css";var FIREFOX_STYLESHEET_REFERENCE="./_resources/css/styles_firefox_mac.css";if(window.createPopup&&document.compatMode&&document.compatMode=="CSS1Compat"&&!window.XMLHttpRequest){document.onreadystatechange=function fixIE6AbsPos()
{if(!document.body){return;}
if(document.readyState=="complete"){document.body.style.height=document.documentElement.scrollHeight+'px';}}
try{document.execCommand('BackgroundImageCache',false,true);}catch(e){}}
function BrowserDetection()
{var sUserAgent=navigator.userAgent.toLowerCase();var sUserPalttform=navigator.platform.toLowerCase();this.isIE=(sUserAgent.indexOf('msie')!=-1);this.isIE7=(this.isIE&&typeof window.XMLHttpRequest!="undefined");this.isSafari=(sUserAgent.indexOf('safari')!=-1);this.isMozilla=(sUserAgent.indexOf('gecko')!=-1&&this.isSafari==false);this.isFirefox=(this.isMozilla==true&&sUserAgent.indexOf('firefox')!=-1);this.isFirefoxMac=(this.isMozilla==true&&sUserAgent.indexOf('mac')!=-1);this.isOpera=(sUserAgent.indexOf('opera')!=-1||typeof window.opera!="undefined");}
var oBrowser=new BrowserDetection();if(oBrowser.isSafari)
{document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\""+SAFARI_STYLESHEET_REFERENCE+"\" />");}
if(oBrowser.isFirefoxMac)
{document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\""+FIREFOX_STYLESHEET_REFERENCE+"\" />");}
function openPopup(url,popupName,width,height,posX,posY)
{var pos=getWindowPos(width,height,posX,posY);if(pos!=undefined)
{posX=pos[0];posY=pos[1];}
popupwindow=window.open(url,popupName,'width='+width+', height='+height+', toolbar=no, menubar=no, scrollbars=yes, resizable=yes, top='+posY+', left='+posX);popupwindow.focus();}
function getWindowPos(width,height,posX,posY)
{var standardX=255;var standardY=70;if(posX==undefined)
{if(window.screenLeft!=undefined){if(window.screenLeft+standardX+width<screen.width-100)
{posX=window.screenLeft+standardX;}
else
{posX=screenLeft-50;}
if(window.screenTop+standardY+height<screen.height-30)
{posY=window.screenTop+standardY;}
else
{posY=standardY;}}
else
{if(window.screenX+standardX+width<screen.width-100)
{posX=window.screenX+standardX;}
else
{posX=screenX-50;}
if(window.screenY+standardY+height<screen.height-30)
{posY=window.screenY+standardY+111;}
else
{posY=standardY+111;}}
return[posX,posY]}}
sfHover=function(){if(!document.getElementById("gen_nav"))return;var sfEls=document.getElementById("gen_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);function getWindowInnerSize()
{var objWin=new Object();if(self.innerHeight){objWin.width=self.innerWidth;objWin.height=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){objWin.width=document.documentElement.clientWidth;objWin.height=document.documentElement.clientHeight;}else if(document.body){objWin.width=document.body.clientWidth;objWin.height=document.body.clientHeight;}
return objWin;}
function getPos(id)
{var obj=document.getElementById(id);var pos={left:0,top:0};if(typeof obj.offsetLeft!='undefined'){while(obj){pos.left+=obj.offsetLeft;pos.top+=obj.offsetTop;obj=obj.offsetParent;}}else{pos.left=obj.left;pos.top=obj.top;}
return pos;}
function getHeight(element)
{element=document.getElementById(element);return element.offsetHeight;}
function setHeight(id,height)
{var obj=document.getElementById(id);obj.style.height=height+"px";}
function initLayout()
{var iWindowHeight=getWindowInnerSize().height;var iFooterHeight=(document.getElementById("footer"))?getHeight("footer"):0;var iFooterTopPosition=(document.getElementById("footer"))?getPos("footer").top:0;if(document.getElementById("footer_position_placeholder")){var iFooterPlaceholderHeight=getHeight("footer_position_placeholder");if(((iFooterTopPosition-iFooterPlaceholderHeight)+iFooterHeight)<iWindowHeight){var height=iFooterPlaceholderHeight+(iWindowHeight-(iFooterTopPosition+iFooterHeight));setHeight("footer_position_placeholder",height)}else{setHeight("footer_position_placeholder",0)}}}
window.onload=function(){initLayout();}
window.onresize=function(){initLayout();}
function addEvent(obj,type,fn)
{if(obj.addEventListener)
obj.addEventListener(type,fn,false);else if(obj.attachEvent)
{obj["e"+type+fn]=fn;obj[type+fn]=function(){obj["e"+type+fn](window.event);}
obj.attachEvent("on"+type,obj[type+fn]);}}
function initHiddenLinks(){$('li.hidden-links').hide();$('li.hidden-links-trigger').show();$('li.hidden-links-trigger').click(function(){$(this).parent().find('li.hidden-links').slideToggle("fast");$(this).toggleClass('shown');});}
function initPortletVisuals(){$('div.portlet-text-visual').each(function(i){if($(this).prev("a").get(0)){$(this).css("cursor","pointer");$(this).click(function(){location.href=$(this).prev("a").get(0).href;});}});}
function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}
else{window.onload=function(){if(oldonload){oldonload();}
func();}}}
function getElementsByClass(searchClass,node,tag){var classElements=new Array();if(node==null)
node=document;if(tag==null)
tag='*';var els=node.getElementsByTagName(tag);var elsLen=els.length;var pattern=new RegExp("(^|\\s)"+searchClass+"(\\s|$)");for(i=0,j=0;i<elsLen;i++){if(pattern.test(els[i].className)){classElements[j]=els[i];j++;}}
return classElements;}
function insertAfter(newElement,targetElement){var parent=targetElement.parentNode;if(parent.lastChild==targetElement){parent.appendChild(newElement);}
else{parent.insertBefore(newElement,targetElement.nextSibling);}}
function buttonEndings(){if(!document.getElementsByTagName){return false}
var buttons=getElementsByClass("rounded-button");for(i=0;i<buttons.length;i++){var div=document.createElement("div");div.className="buttonEnding";insertAfter(div,buttons[i]);}}
addLoadEvent(buttonEndings);
