jQuery(function(){new VivaNavi()});var VivaNavi=function(a){this.body_width=jQuery(document.body).width();this.body_height=jQuery(document.body).height();this.nav_padding_x=4;this.nav_padding_y=4;this.params=a;this.sub_navs_open={};this.timer=null;this.positioned={};this.curr=null;$VIVA_NAVI=this;this.init()};VivaNavi.prototype.init=function(){this.initMSIEFix();this.initEventHandlers()};VivaNavi.prototype.initMSIEFix=function(){if(!jQuery.browser.msie){return}jQuery("table.nav_submenu td").each(function(a,b){jQuery(b).prepend("<iframe frameborder='0' style='position:absolute; top:-1; left:-1; border:0; width:"+jQuery(b).width()+"px; height:"+jQuery(b).height()+"px; z-index:0; filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);'></iframe>")})};VivaNavi.prototype.initEventHandlers=function(){jQuery("#nav_root a.nav_link").hover($VIVA_NAVI.mouseOver,$VIVA_NAVI.mouseOut);jQuery("table.nav_submenu a").hover($VIVA_NAVI.mouseOver,$VIVA_NAVI.mouseOut);jQuery("table.nav_submenu a").click(function(){$VIVA_NAVI.closeNavi("nav_root");return true});jQuery(window).resize(function(){jQuery("table.nav_submenu").css({left:"-999em"});$VIVA_NAVI.body_width=jQuery(document.body).width();$VIVA_NAVI.body_height=jQuery(document.body).height();$VIVA_NAVI.positioned={}})};VivaNavi.prototype.mouseOver=function(){var i=jQuery(this).parent().parent().parent().parent()[0].id;var h=this.id+"_sub";var a=jQuery("#"+h);$VIVA_NAVI.curr=h;if($VIVA_NAVI.sub_navs_open[i]!=h){$VIVA_NAVI.closeNavi(i);if(a.length==1){var g=null;if(!$VIVA_NAVI.positioned[h]){var e=jQuery(this).offset();var b=jQuery(this).parent().width();var j=jQuery(this).parent().height();var d=(i=="nav_root");var f=(d)?e.top+j:e.top;var c=(d)?e.left-1:e.left+b-$VIVA_NAVI.nav_padding_x;c=(!d&&$VIVA_NAVI.body_width<=(c+b))?c-b-jQuery(a).width()+(2*$VIVA_NAVI.nav_padding_x):c;g={left:c+"px",top:f+"px"};$VIVA_NAVI.positioned[h]=g}else{g=$VIVA_NAVI.positioned[h]}a.css(g)}$VIVA_NAVI.sub_navs_open[i]=h}};VivaNavi.prototype.mouseOut=function(){$VIVA_NAVI.curr=null;window.clearTimeout($VIVA_NAVI.timer);$VIVA_NAVI.timer=window.setTimeout(function(){if(!$VIVA_NAVI.curr){$VIVA_NAVI.closeNavi("nav_root")}},500)};VivaNavi.prototype.closeNavi=function(b){var a=$VIVA_NAVI.sub_navs_open[b]||null;if(!a){return}$VIVA_NAVI.closeNavi(a);jQuery("#"+a).css({left:"-999em"});$VIVA_NAVI.sub_navs_open[b]=null};
