
if(window.jQuery&&jQuery.noConflict&&(typeof $('body')=='object')){jQuery.noConflict();jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
return cookieValue;}};jQuery.noConflict();jQuery("#ja-botsl1").ready(function($){var cookieName='ja-bottom-sliding';var mainSlider=$('#ja-botsl1 .main');var _height=mainSlider.height();if($.cookie(cookieName)!=null){if($.cookie(cookieName)=='show'){mainSlider.slideDown('fast',function(){$('.jm-open').removeClass('hide').addClass('show').html('Close');});}else{mainSlider.slideUp(0,function(){$('.jm-open').removeClass('show').addClass('hide').html('Open');});}}
$('.jm-open').click(function(){mainSlider.slideToggle("slow",function(){if($(this).is(':visible')){$('html, body').animate({scrollTop:$('.jm-open').offset().top-_height/2},3000);jQuery.cookie(cookieName,'show',{expires:100});$('.jm-open').removeClass('hide').addClass('show').html('Close');}else{jQuery.cookie(cookieName,'hide',{expires:100});$('.jm-open').removeClass('show').addClass('hide').html('Open');}});});});(function($){$.fn.jaContentTabs=function(_options){return this.each(function(){var container=$(this);new $.jaContentTabs().setup(this,container);});}
$.jaContentTabs=function(){var self=this;this.lastTab=null;this.nextTab=null;this.setup=function(obj,o){var contentTabs=o.children('div.ja-tab-content');var nav=o.children('ul.ja-tab-navigator');contentTabs.children('div').hide();nav.children('li:first').addClass('first').addClass('active');contentTabs.children('div:first').show();nav.children('li').children('a').click(function(){self.lastTab=nav.children('li.active').children('a').attr('href');nav.children('li.active').removeClass('active')
$(this).parent().addClass('active');var currentTab=$(this).attr('href');self.tabActive(contentTabs,currentTab);return false;});};this.tabActive=function(contentTabs,currentTab){if(this.lastTab!=currentTab){contentTabs.children(this.lastTab).hide();}
contentTabs.children(currentTab).show();};};})(jQuery);}
function switchFontSize(ckname,val){var bd=$$('body')[0];switch(val){case'inc':if(CurrentFontSize+1<7){bd.removeClassName('fs'+CurrentFontSize);CurrentFontSize++;bd.addClassName('fs'+CurrentFontSize);}
break;case'dec':if(CurrentFontSize-1>0){bd.removeClassName('fs'+CurrentFontSize);CurrentFontSize--;bd.addClassName('fs'+CurrentFontSize);}
break;default:bd.removeClassName('fs'+CurrentFontSize);CurrentFontSize=val;bd.addClassName('fs'+CurrentFontSize);}
createCookie(ckname,CurrentFontSize,365);}
function switchTool(ckname,val){createCookie(ckname,val,365);window.location.reload();}
function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else expires="";document.cookie=name+"="+value+expires+"; path=/";}
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");};function menuFistLastItem(){if((menu=$('nav'))&&(children=menu.childElements())&&(children.length)){children[0].addClassName('first');children[children.length-1].addClassName('last');}}
function addSpanToTitle(){var modules=$$('#ja-botsl2 .head h4','#ja-col1 .head h4','.jm-product-list .head h4','#ja-container .head h4','.category-head3 h2','.page-head h3','.page-head-alt h3','.account-nav .head h3','.category-head h2');if(!modules)return;modules.each(function(title){var html=title.innerHTML;var text=html.stripTags();var pos=text.indexOf(' ');if(pos!=-1){text=text.substr(0,pos);}
title.update(html.replace(new RegExp(text),'<span class="first-word"><span>'+text+'</span></span>'));});}
document.observe("dom:loaded",function(){menuFistLastItem();navMouseHover();});function navMouseHover(){var lis=$$('#nav li');if(lis&&lis.length){lis.each(function(li){li.onMouseover=toggleMenu(li,1);li.onMouseout=toggleMenu(li,0);});}}
toggleMenu=function(el,over){var iS=false;if(Element.childElements(el)&&Element.childElements(el).length>1){var uL=Element.childElements(el)[1];iS=true;}
if(over){Element.addClassName(el,'over');Element.addClassName(el.down('a'),'over');if(iS){uL.addClassName('shown-sub')};}
else{Element.removeClassName(el,'over');Element.removeClassName(el.down('a'),'over');if(iS){uL.removeClassName('shown-sub')};}}
function makeEqualHeight(divs,offset){if(!offset)offset=0;if(!divs||divs.length<2)return;var maxh=0;divs.each(function(el){var ch=el.getHeight();maxh=(maxh<ch)?ch:maxh;});maxh+=offset;divs.each(function(el){el.setStyle({height:(maxh-parseInt(el.getStyle('padding-top'))-parseInt(el.getStyle('padding-bottom')))+'px'});});}
function displayChildMenu(id){jQuery("#"+'child_menu'+id).css("display","block");if(jQuery("#"+'parent_menu'+id).attr("class").indexOf("active")<0)
jQuery("#"+'parent_menu'+id).addClass("over");}
function hideAllMenu(){menu=jQuery("[id*=child_menu]");jQuery.each(menu,function(){jQuery("#"+this.id).css("display","none");jQuery("#parent_menu"+this.id.replace("child_menu","")).removeClass("over");});}
function rollbackCurrentMenu(){hideAllMenu();jQuery("[rel=active_menu]").css("display","block");}