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