function addLoadListener(fn){
if(typeof window.addEventListener!="undefined"){
window.addEventListener("load",fn,false);
}else{
if(typeof document.addEventListener!="undefined"){
document.addEventListener("load",fn,false);
}else{
if(typeof window.attachEvent!="undefined"){
window.attachEvent("onload",fn);
}else{
return false;
}
}
}
return true;
}
function attachEventListener(_2,_3,_4,_5){
if(typeof _2.addEventListener!="undefined"){
_2.addEventListener(_3,_4,_5);
}else{
if(typeof _2.attachEvent!="undefined"){
_2.attachEvent("on"+_3,_4);
}else{
return false;
}
}
return true;
}

checkBrowserWidth();
attachEventListener(window,"resize",checkBrowserWidth,false);
function checkBrowserWidth(){
var _1=getBrowserWidth();
if(_1==0){
var _2=document.cookie.match(/(^|;)tmib_res_layout[^;]*(;|$)/);
if(_2!=null){
setStylesheet(unescape(_2[0].split("=")[1]));
}
addLoadListener(checkBrowserWidth);
return false;
}
if(_1<990){
setStylesheet("800 x 600");
document.cookie="tmib_res_layout="+escape("800 x 600");
}else{
setStylesheet("");
document.cookie="tmib_res_layout=";
}
return true;
}
function getBrowserWidth(){
if(window.innerWidth){
return window.innerWidth;
}else{
if(document.documentElement&&document.documentElement.clientWidth!=0){
return document.documentElement.clientWidth;
}else{
if(document.body){
return document.body.clientWidth;
}
}
}
return 0;
}
function setStylesheet(_3){
var _4;
if(document.getElementsByTagName){
for(var i=0;(_4=document.getElementsByTagName("link")[i]);i++){
if(_4.getAttribute("rel").indexOf("style")!=-1&&_4.getAttribute("title")){
_4.disabled=true;
if(_4.getAttribute("title")==_3){
_4.disabled=false;
}
}
}
}
return true;
}

(function($){
$.superfish={};
$.superfish.o=[];
$.superfish.op={};
$.superfish.defaults={hoverClass:"sfHover",pathClass:"current",delay:800,animation:{opacity:"show",height:"show"},speed:"normal",oldJquery:false,disableHI:true,onInit:function(){
},onBeforeShow:function(){
},onShow:function(){
},onHide:function(){
}};
$.fn.superfish=function(op){
var _3="sfbreadcrumb",over=function(){
var $$=$(this),menu=getMenu($$);
getOpts(menu,true);
clearTimeout(menu.sfTimer);
$$.showSuperfishUl().siblings().hideSuperfishUl();
},out=function(){
var $$=$(this),menu=getMenu($$);
var o=getOpts(menu,true);
clearTimeout(menu.sfTimer);
if(!$$.is("."+_3)){
menu.sfTimer=setTimeout(function(){
$$.hideSuperfishUl();
if(o.$path.length){
over.call(o.$path);
}
},o.delay);
}
},getMenu=function(_7){
return _7.parents("ul.superfish:first")[0];
},getOpts=function(el,_9){
el=_9?el:getMenu(el);
return $.superfish.op=$.superfish.o[el.serial];
},hasUl=function(){
return $.superfish.op.oldJquery?"li[ul]":"li:has(ul)";
};
return this.each(function(){
var s=this.serial=$.superfish.o.length;
var o=$.extend({},$.superfish.defaults,op);
o.$path=$("li."+o.pathClass,this).each(function(){
$(this).addClass(o.hoverClass+" "+_3).filter(hasUl()).removeClass(o.pathClass);
});
$.superfish.o[s]=$.superfish.op=o;
$(hasUl(),this)[($.fn.hoverIntent&&!o.disableHI)?"hoverIntent":"hover"](over,out).not("."+_3).hideSuperfishUl();
var $a=$("a",this);
$a.each(function(i){
var _e=$a.eq(i).parents("li");
$a.eq(i).focus(function(){
over.call(_e);
}).blur(function(){
out.call(_e);
});
});
o.onInit.call(this);
}).addClass("superfish");
};
$.fn.extend({hideSuperfishUl:function(){
var o=$.superfish.op,$ul=$("li."+o.hoverClass,this).add(this).removeClass(o.hoverClass).find(">ul").hide().css("visibility","hidden");
o.onHide.call($ul);
return this;
},showSuperfishUl:function(){
var o=$.superfish.op,$ul=this.addClass(o.hoverClass).find(">ul:hidden").css("visibility","visible");
o.onBeforeShow.call($ul);
$ul.animate(o.animation,o.speed,function(){
o.onShow.call(this);
});
return this;
}});
$(window).unload(function(){
$("ul.superfish").each(function(){
$("li",this).unbind("mouseover","mouseout","mouseenter","mouseleave");
});
});
})(jQuery);
function activateMenu(){
$("div.mainNav ul, #language").superfish();
$("ol").parent().addClass("arrow");
$("li.current ol").parent().addClass("open");
$("ol li.current").parent().parent().addClass("subSelected");
$(window).bind('resize', function() {
$('#mainContainer').css(($.browser.msie && $.browser.version < 7 ? '' : 'min-') + 'height', $(window).height() + 'px');
}).trigger('resize');
$('#footer').show();
}

(function($){
$.fn.innerfade=function(_2){
this.each(function(){
var _3={animationtype:"fade",speed:2000,timeout:6000,type:"sequence",containerheight:"auto",runningclass:"innerfade"};
if(_2){
$.extend(_3,_2);
}
var _4=$(this).children();
if(_4.length>1){
$(this).css("position","relative");
$(this).css("height",_3.containerheight);
$(this).addClass(_3.runningclass);
for(var i=0;i<_4.length;i++){
$(_4[i]).css("z-index",String(_4.length-i)).css("position","absolute");
$(_4[i]).hide();
}
if(_3.type=="sequence"){
setTimeout(function(){
$.innerfade.next(_4,_3,1,0);
},_3.timeout);
$(_4[0]).show();
}else{
if(_3.type=="random"){
setTimeout(function(){
do{
current=Math.floor(Math.random()*(_4.length));
}while(current==0);
$.innerfade.next(_4,_3,current,0);
},_3.timeout);
$(_4[0]).show();
}else{
alert("type must either be 'sequence' or 'random'");
}
}
}
});
};
$.innerfade=function(){
};
$.innerfade.next=function(_6,_7,_8,_9){
if(_7.animationtype=="slide"){
$(_6[_9]).slideUp(_7.speed,$(_6[_8]).slideDown(_7.speed));
}else{
if(_7.animationtype=="fade"){
$(_6[_9]).fadeOut(_7.speed);
$(_6[_8]).fadeIn(_7.speed);
}else{
alert("animationtype must either be 'slide' or 'fade'");
}
}
if(_7.type=="sequence"){
if((_8+1)<_6.length){
_8=_8+1;
_9=_8-1;
}else{
_8=0;
_9=_6.length-1;
}
}else{
if(_7.type=="random"){
_9=_8;
while(_8==_9){
_8=Math.floor(Math.random()*(_6.length));
}
}else{
alert("type must either be 'sequence' or 'random'");
}
}
setTimeout((function(){
$.innerfade.next(_6,_7,_8,_9);
}),_7.timeout);
};
})(jQuery);

