jQuery.noConflict();
var jkmegamenu={effectduration:300,delaytimer:200,megamenulabels:[],megamenus:[],zIndexVal:1E3,$shimobj:null,addshim:function(c){c(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=c("#outlineiframeshim")},alignmenu:function(c,b,a){var b=this.megamenus[a],
a=b.$menuobj,c=c(window).width()-(b.offsetx-c(document).scrollLeft())>b.actualwidth?b.offsetx:b.offsetx-b.actualwidth+b.anchorwidth,d=b.offsety+b.anchorheight;a.css({left:c+"px",top:d+"px"});this.$shimobj.css({width:b.actualwidth+"px",height:b.actualheight+"px",left:c+"px",top:d+"px",display:"block"})},showmenu:function(c,b){var a=this.megamenus[b],d=a.$menuobj,e=a.$menuinner;d.css("display")=="none"?(this.alignmenu(jQuery,c,b),d.css("z-index",++this.zIndexVal),d.show(this.effectduration,function(){e.css("visibility",
"visible")})):d.css("display")=="block"&&c.type=="click"&&this.hidemenu(c,b);return!1},hidemenu:function(c,b){var a=this.megamenus[b],d=a.$menuobj;a.$menuinner.css("visibility","hidden");this.$shimobj.css({display:"none",left:0,top:0});d.hide(this.effectduration)},definemenu:function(c,b,a){this.megamenulabels.push([c,b,a])},render:function(c){for(var b=0,a=this.megamenulabels[b];b<this.megamenulabels.length;b++,a=this.megamenulabels[b]){if(c("#"+a[0]).length!=1||c("#"+a[1]).length!=1)return;this.megamenus.push({$anchorobj:c("#"+
a[0]),$menuobj:c("#"+a[1]),$menuinner:c("#"+a[1]).children("ul:first-child"),revealtype:a[2],hidetimer:null});a=this.megamenus[b];a.$anchorobj.add(a.$menuobj).attr("_megamenupos",b+"pos");a.actualwidth=a.$menuobj.outerWidth();a.actualheight=a.$menuobj.outerHeight();a.offsetx=a.$anchorobj.offset().left;a.offsety=a.$anchorobj.offset().top;a.anchorwidth=a.$anchorobj.outerWidth();a.anchorheight=a.$anchorobj.outerHeight();c(document.body).append(a.$menuobj);a.$menuobj.css("z-index",++this.zIndexVal).hide();
a.$menuinner.css("visibility","hidden");a.$anchorobj.bind(a.revealtype=="click"?"click":"mouseenter",function(a){var c=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))];clearTimeout(c.hidetimer);return jkmegamenu.showmenu(a,parseInt(this.getAttribute("_megamenupos")))});a.$anchorobj.bind("mouseleave",function(a){var b=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))];if(a.relatedTarget!=b.$menuobj.get(0)&&c(a.relatedTarget).parents("#"+b.$menuobj.get(0).id).length==
0)b.hidetimer=setTimeout(function(){jkmegamenu.hidemenu(a,parseInt(b.$menuobj.get(0).getAttribute("_megamenupos")))},jkmegamenu.delaytimer)});a.$menuobj.bind("mouseenter",function(){var a=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))];clearTimeout(a.hidetimer)});a.$menuobj.bind("click mouseleave",function(a){var b=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))];b.hidetimer=setTimeout(function(){jkmegamenu.hidemenu(a,parseInt(b.$menuobj.get(0).getAttribute("_megamenupos")))},
jkmegamenu.delaytimer)})}/Safari/i.test(navigator.userAgent)?c(window).bind("resize load",function(){for(var a=0;a<jkmegamenu.megamenus.length;a++){var b=jkmegamenu.megamenus[a],c=b.$anchorobj.children().length==1&&b.$anchorobj.children().eq(0).is("img")?b.$anchorobj.children().eq(0):null;if(c)b.offsetx=c.offset().left,b.offsety=c.offset().top,b.anchorwidth=c.width(),b.anchorheight=c.height()}}):c(window).bind("resize",function(){for(var a=0;a<jkmegamenu.megamenus.length;a++){var b=jkmegamenu.megamenus[a];
b.offsetx=b.$anchorobj.offset().left;b.offsety=b.$anchorobj.offset().top}});jkmegamenu.addshim(c)}};jQuery(document).ready(function(c){jkmegamenu.render(c)});
