(function($){var data=[{str:navigator.userAgent,sub:'Chrome',ver:'Chrome',name:'chrome'},{str:navigator.vendor,sub:'Apple',ver:'Version',name:'safari'},{prop:window.opera,ver:'Opera',name:'opera'},{str:navigator.userAgent,sub:'Firefox',ver:'Firefox',name:'firefox'},{str:navigator.userAgent,sub:'MSIE',ver:'MSIE',name:'ie'}];for(var n=0;n<data.length;n++){if((data[n].str&&(data[n].str.indexOf(data[n].sub)!=-1))||data[n].prop){var v=function(s){var i=s.indexOf(data[n].ver);return(i!=-1)?parseInt(s.substring(i+data[n].ver.length+1)):'';};$('html').addClass(data[n].name+' '+data[n].name+v(navigator.userAgent)||v(navigator.appVersion));break;}}})(jQuery);jQuery(function(){jQuery('ul.cg-hmenu a[href=#]').click(function(){return false;});if(!jQuery.browser.msie||parseInt(jQuery.browser.version)>6)return;jQuery.each(jQuery('ul.cg-hmenu li'),function(i,val){val.j=jQuery(val);val.UL=val.j.children('ul:first');if(val.UL.length==0)return;val.A=val.j.children('a:first');this.onmouseenter=function(){this.j.addClass('cg-hmenuhover');this.UL.addClass('cg-hmenuhoverUL');this.A.addClass('cg-hmenuhoverA');};this.onmouseleave=function(){this.j.removeClass('cg-hmenuhover');this.UL.removeClass('cg-hmenuhoverUL');this.A.removeClass('cg-hmenuhoverA');};});});jQuery(function(){jQuery("ul.cg-hmenu ul li").hover(function(){jQuery(this).prev().children("a").addClass("cg-hmenu-before-hovered");},function(){jQuery(this).prev().children("a").removeClass("cg-hmenu-before-hovered");});});jQuery(function(){if(!jQuery.browser.msie)return;var ieVersion=parseInt(jQuery.browser.version);if(ieVersion>7)return;jQuery.each(jQuery("ul.cg-hmenu ul"),function(){var maxSubitemWidth=0;var submenu=jQuery(this);var subitem=null;jQuery.each(submenu.children("li").children("a"),function(){subitem=jQuery(this);var subitemWidth=subitem.outerWidth();if(maxSubitemWidth<subitemWidth)
maxSubitemWidth=subitemWidth;});if(subitem!=null){var subitemBorderLeft=parseInt(subitem.css("border-left-width"),10)||0;var subitemBorderRight=parseInt(subitem.css("border-right-width"),10)||0;var subitemPaddingLeft=parseInt(subitem.css("padding-left"),10)||0;var subitemPaddingRight=parseInt(subitem.css("padding-right"),10)||0;maxSubitemWidth-=subitemBorderLeft+subitemBorderRight+subitemPaddingLeft+subitemPaddingRight;submenu.children("li").children("a").css("width",maxSubitemWidth+"px");}});if(ieVersion>6)return;jQuery("ul.cg-hmenu ul>li:first-child>a").css("border-top-width","{BorderWidth}px");});jQuery(function(){var c=jQuery('div.cg-content');if(c.length!==1)return;var s=c.parent().children('.cg-layout-cell:not(.cg-content)');if(jQuery.browser.msie&&parseInt(jQuery.browser.version)<8){jQuery(window).bind('resize',function(){var w=0;c.hide();s.each(function(){w+=this.clientWidth;});c.w=c.parent().width();c.css('width',c.w-w+'px');c.show();});}
jQuery(window).trigger('resize');});jQuery(function(){if(!jQuery('html').hasClass('ie7'))return;jQuery('ul.cg-vmenu li:not(:first-child),ul.cg-vmenu li li li:first-child,ul.cg-vmenu>li>ul').each(function(){jQuery(this).append('<div class="cg-vmenu-separator"> </div><div class="cg-vmenu-separator-bg"> </div>');});});jQuery(function(){setOpenSubmenuWithNoReload({vMenuClass:"cg-vmenu",activeClass:"active",hoveredClass:"hovered"});});function setOpenSubmenuWithNoReload(vMenuInfo){jQuery("ul."+vMenuInfo.vMenuClass+" li").each(function(){var item=jQuery(this);item.children("a").bind("click",function(e){var link=jQuery(this);var simple=link.siblings("ul").length==0;link.parent().siblings().children("ul."+vMenuInfo.activeClass).slideUp(function(){jQuery(this).find("li, a, ul").removeClass(vMenuInfo.activeClass);jQuery(this).removeClass(vMenuInfo.activeClass).siblings("a").removeClass(vMenuInfo.activeClass);jQuery(this).css("display","");});link.parent().siblings().children("a."+vMenuInfo.activeClass).removeClass(vMenuInfo.activeClass);link.parent().siblings().removeClass(vMenuInfo.activeClass);if(simple&&!link.hasClass(vMenuInfo.activeClass)){link.addClass(vMenuInfo.activeClass).parent().addClass(vMenuInfo.activeClass);}
if(!simple){if(link.hasClass(vMenuInfo.activeClass)){link.siblings("ul").slideUp("fast",function(){jQuery(this).removeClass(vMenuInfo.activeClass).siblings("a").removeClass(vMenuInfo.activeClass).parent().removeClass(vMenuInfo.activeClass);jQuery(this).css("display","");});}else{link.siblings("ul").slideDown("fast",function(){jQuery(this).addClass(vMenuInfo.activeClass).siblings("a").addClass(vMenuInfo.activeClass).parent().addClass(vMenuInfo.activeClass);jQuery(this).css("display","");});}
e.preventDefault();return false;}});});}
function artButtonSetup(className){jQuery.each(jQuery("a."+className+", button."+className+", input."+className),function(i,val){var b=jQuery(val);if(!b.parent().hasClass('cg-button-wrapper')){if(b.is('input'))b.val(b.val().replace(/^\s*/,'')).css('zoom','1');if(!b.hasClass('cg-button'))b.addClass('cg-button');jQuery("<span class='cg-button-wrapper'><span class='cg-button-l'> </span><span class='cg-button-r'> </span></span>").insertBefore(b).append(b);if(b.hasClass('active'))b.parent().addClass('active');}
b.mouseover(function(){jQuery(this).parent().addClass("hover");});b.mouseout(function(){var b=jQuery(this);b.parent().removeClass("hover");if(!b.hasClass('active'))b.parent().removeClass('active');});b.mousedown(function(){var b=jQuery(this);b.parent().removeClass("hover");if(!b.hasClass('active'))b.parent().addClass('active');});b.mouseup(function(){var b=jQuery(this);if(!b.hasClass('active'))b.parent().removeClass('active');});});}
jQuery(function(){artButtonSetup("cg-button");});jQuery(function(){artButtonSetup("button");});