﻿jQuery.noConflict();var leftAdjust=20;var rightmegamenu={effectduration:500,delaytimer:500,megamenulabels:[],megamenus:[],zIndexVal:1000,$shimobj:null,addshim:function(a){a(document.body).append('<IFRAME id="outlineiframeshim" src="'+(location.protocol=="https:"?"blank.htm":"about:blank")+'" style="display:none; left:0; top:0; z-index:999; position:absolute; filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)" frameBorder="0" scrolling="no"></IFRAME>');this.$shimobj=a("#outlineiframeshim")},alignmenu:function(f,h,b){var g=this.megamenus[b];var d=g.$anchorobj;var c=g.$menuobj;var a=g.offsetx-g.actualwidth+g.anchorwidth;var i=g.offsety+g.anchorheight;c.css({left:a+"px",top:i+"px"});this.$shimobj.css({width:g.actualwidth+"px",height:g.actualheight+"px",left:a+"px",top:i+"px",display:"block"})},showmenu:function(f,a){var d=this.megamenus[a];var c=d.$menuobj;var b=d.$menuinner;if(c.css("display")=="none"){this.alignmenu(jQuery,f,a);c.css("z-index",++this.zIndexVal);c.stop(true,true).slideDown(this.effectduration,function(){b.css("visibility","visible")})}else{if(c.css("display")=="block"&&f.type=="click"){this.hidemenu(f,a)}}return false},hidemenu:function(f,a){var d=this.megamenus[a];var c=d.$menuobj;var b=d.$menuinner;b.css("visibility","hidden");this.$shimobj.css({display:"none",left:0,top:0});c.stop(true,true).hide()},definemenu:function(a,c,d,b){this.megamenulabels.push([a,c,d,b])},findPosX:function(a){var b=0;if(a.offsetParent){while(1){b+=a.offsetLeft;if(!a.offsetParent){break}a=a.offsetParent}}else{if(a.x){b+=a.x}}return b},findPosY:function(b){var a=0;if(b.offsetParent){while(1){a+=b.offsetTop;if(!b.offsetParent){break}b=b.offsetParent}}else{if(b.y){a+=b.y}}return a},render:function(c){for(var b=0,e=this.megamenulabels[b];b<this.megamenulabels.length;b++,e=this.megamenulabels[b]){if(c("#"+e[0]).length!=1||c("#"+e[1]).length!=1){return}this.megamenus.push({$anchorobj:c("#"+e[0]),$menuobj:c("#"+e[1]),$menuinner:c("#"+e[1]).children("ul:first-child"),revealtype:e[2],hidetimer:null,$liObject:c("#"+e[3])});var d=this.megamenus[b];d.$liObject.add(d.$menuobj).attr("_megamenupos",b+"pos");d.$anchorobj.add(d.$menuobj).attr("_megamenupos",b+"pos");d.actualwidth=325;d.actualheight=d.$menuobj.outerHeight();d.offsetx=findPosX(document.getElementById(e[3]));d.offsety=findPosY(document.getElementById(e[3]));d.anchorwidth=d.$liObject.outerWidth();d.anchorheight=d.$liObject.outerHeight();d.liwidth=d.$liObject.outerWidth();c(document.body).append(d.$menuobj);d.$menuobj.css("z-index",++this.zIndexVal).hide();d.$menuinner.css("visibility","hidden");var a=false;d.$menuobj.mouseenter(function(){a=true});d.$menuobj.mouseleave(function(f){a=false;var g=rightmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))];g.hidetimer=setTimeout(function(){rightmegamenu.hidemenu(f,parseInt(g.$menuobj.get(0).getAttribute("_megamenupos")))},rightmegamenu.delaytimer)});config={sensitivity:2,interval:250,over:function(f){var g=rightmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))];rightmegamenu.showmenu(f,parseInt(g.$menuobj.get(0).getAttribute("_megamenupos")))},timeout:250,out:function(f){if(!a){var g=rightmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))];g.hidetimer=setTimeout(function(){rightmegamenu.hidemenu(f,parseInt(g.$menuobj.get(0).getAttribute("_megamenupos")))},rightmegamenu.delaytimer)}else{return}}};d.$liObject.hoverIntent(config)}if(/Safari/i.test(navigator.userAgent)){c(window).bind("resize load",function(){for(var f=0;f<rightmegamenu.megamenus.length;f++){var h=rightmegamenu.megamenus[f];var g=(h.$anchorobj.children().length==1&&h.$anchorobj.children().eq(0).is("img"))?h.$anchorobj.children().eq(0):null;if(g){h.offsetx=g.offset().left;h.offsety=g.offset().top;h.anchorwidth=g.width();h.anchorheight=g.height()}}})}else{c(window).bind("resize",function(){for(var f=0;f<rightmegamenu.megamenus.length;f++){var g=rightmegamenu.megamenus[f];g.offsetx=g.$anchorobj.offset().left;g.offsety=g.$anchorobj.offset().top}})}rightmegamenu.addshim(c)}};jQuery(document).ready(function(a){rightmegamenu.render(a)});
