kapp.namespace('k_search');kapp.k_search.chocoChip=function(c){var oreo={};$A(document.cookie.split(";").each(function(s){var newSplit=s.split("=");oreo[newSplit[0].strip()]=newSplit[1].strip()}));return oreo[c]};if(kapp.searchCookie&&(/MSIE[\+]{1}((7\.0)|(8\.0))/i.test(kapp.searchCookie[1])||(/Firefox/i).test(kapp.searchCookie[1]))&&kapp.searchCookie[0]=='kosmix'&&(kapp.k_search.chocoChip('kosmixSearch')!='exists'&&kapp.k_search.chocoChip('kosmixSearch')!='declined')){$('titlebar').appendChild(new Element('div',{'id':'addSearchCont'}).update('<div id="searchGfc">&nbsp;</div><a id="addNewSearch"></a><a id="closeSearch"></a>'));Event.observe('addNewSearch','click',function(){window.external.AddSearchProvider('http://kosmix.com/external/kosmixSearchEngine.xml');var next5Years=new Date();next5Years.setDate(next5Years.getDate()+(365*5));document.cookie='kosmixSearch=exists;expires='+next5Years+';';$('addSearchCont').remove()});Event.observe('closeSearch','click',function(){$('addSearchCont').remove();var nextYear=new Date();nextYear.setDate(nextYear.getDate()+365);document.cookie='kosmixSearch=declined;expires='+nextYear+';'})}kapp.namespace("kapp.tabs");kapp.tabs.hovato_delay=500;kapp.tabs.hovato_enabled=true;kapp.tabs.switchTo=function(ev){if(ev)kapp.tabs.stopRotato.bind(this).call();nthis=$(this.getAttribute('k_module'));nthis.tab=this;var bd=nthis.up('.bd');kapp.log.click(ev,kapp.log.user_props.browser.indexOf('IE')!=0);if(!bd.current){this.siblings().each(function(s){if(s.hasClassName('active')){bd.current=$(s.getAttribute('k_module'));bd.current.tab=s}})};if(bd.current==nthis)return false;kapp.tabs.switcher(bd,nthis)};kapp.tabs.switcher=function(bd,to){var tmp_height=bd.getDimensions().height;if(tmp_height<20)tmp_height=to.getDimensions().height;bd.style.height=tmp_height+'px';bd.style.overflow='hidden';bd.style.clear='both';bd.style.position='relative';bd.current.style.position='absolute';to.style.position='absolute';bd.current.style.top='0';to.style.top='0';new Effect.Fade(bd.current,{duration:.5,queue:'t_switch'});new Effect.Morph(bd,{style:'height:'+to.getDimensions().height+'px',duration:.5,afterFinish:function(){this.style.overflow='visible'}.bind(bd),queue:'t_switch'});if(Prototype.Browser.IE&&to.down('table')){to.show();to.style.position='relative'}else{new Effect.Appear(to,{duration:.5,queue:'t_switch',afterFinish:function(){this.style.position='relative'}.bind(to)})}if(to.tab.refreshAds){kapp.ads.refreshAds()}bd.current.tab.removeClassName('active');to.tab.addClassName('active');bd.current=to};kapp.tabs.startRotato=function(){var first=this.select('li')[0];var bd=this.up('.mcontent').down('.bd');bd.rotato_start=first;bd.rotato_timer=4000;bd.rotato=setTimeout(kapp.tabs.next.bind(first),bd.rotato_timer)};kapp.tabs.stopRotato=function(){var bd=this.up('.mcontent').down('.bd');clearTimeout(bd.rotato)};kapp.tabs.next=function(){var bd=this.up('.mcontent').down('.bd');var nexty=this.next('li');if(!nexty)nexty=bd.rotato_start;kapp.tabs.switchTo.bind(nexty).call();bd.rotato=setTimeout(kapp.tabs.next.bind(nexty),bd.rotato_timer)};kapp.tabs.Hovatover=function(){if(kapp.tabs.hovato_enabled)this.hv=setTimeout(kapp.tabs.switchTo.bind(this),kapp.tabs.hovato_delay)};kapp.tabs.Hovatout=function(){if(this.hv)clearTimeout(this.hv)};$$("ul.tabs").each(function(u){u.select('li').each(function(s){if(s.hasClassName('active')){var bd=s.up('.mcontent').down('.bd');bd.current=$(s.getAttribute('k_module'));if(!bd.current){var sn=s.next();sn.addClassName('active');s.remove()}else{bd.current.style.display='block'}};if(s.getAttribute('k_module')&&$(s.getAttribute('k_module')))$(s.getAttribute('k_module')).tab=s;s.refreshAds=s.hasClassName('refreshAds');Event.observe(s,"click",kapp.tabs.switchTo.bind(s))});if(u.hasClassName('rotato')){Event.observe(window,'load',kapp.tabs.startRotato.bind(u))};if(u.hasClassName('hovato')){u.select('li').each(function(s){if(s.getAttribute('k_module')&&$(s.getAttribute('k_module')))$(s.getAttribute('k_module')).tab=s;Event.observe(s,"mouseover",kapp.tabs.Hovatover.bind(s));Event.observe(s,"mouseout",kapp.tabs.Hovatout.bind(s))})}});
