(function($){$.ajaxSettings.accepts._default="text/javascript, text/html, application/xml, text/xml, */*"})(jQuery);(function($){$.fn.reset=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};$.fn.enable=function(){return this.each(function(){this.disabled=false})};$.fn.disable=function(){return this.each(function(){this.disabled=true})}})(jQuery);(function($){$.extend({fieldEvent:function(el,obs){var field=el[0]||el,e="change";if(field.type=="radio"||field.type=="checkbox"){e="click"}else{if(obs&&(field.type=="text"||field.type=="textarea"||field.type=="password")){e="keyup"}}return e}});$.fn.extend({delayedObserver:function(delay,callback){var el=$(this);if(typeof window.delayedObserverStack=="undefined"){window.delayedObserverStack=[]}if(typeof window.delayedObserverCallback=="undefined"){window.delayedObserverCallback=function(stackPos){var observed=window.delayedObserverStack[stackPos];if(observed.timer){clearTimeout(observed.timer)}observed.timer=setTimeout(function(){observed.timer=null;observed.callback(observed.obj,observed.obj.formVal())},observed.delay*1000);observed.oldVal=observed.obj.formVal()}}window.delayedObserverStack.push({obj:el,timer:null,delay:delay,oldVal:el.formVal(),callback:callback});var stackPos=window.delayedObserverStack.length-1;if(el[0].tagName=="FORM"){$(":input",el).each(function(){var field=$(this);field.bind($.fieldEvent(field,delay),function(){var observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.oldVal){return}else{window.delayedObserverCallback(stackPos)}})})}else{el.bind($.fieldEvent(el,delay),function(){var observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.oldVal){return}else{window.delayedObserverCallback(stackPos)}})}},formVal:function(){var el=this[0];if(el.tagName=="FORM"){return this.serialize()}if(el.type=="checkbox"||el.type=="radio"){return this.filter("input:checked").val()||""}else{return this.val()}}})})(jQuery);(function($){$.fn.extend({visualEffect:function(o,options){if(options){speed=options.duration*1000}else{speed=null}e=o.replace(/\_(.)/g,function(m,l){return l.toUpperCase()});return eval("$(this)."+e+"("+speed+")")},appear:function(speed,callback){return this.fadeIn(speed,callback)},blindDown:function(speed,callback){return this.show("blind",{direction:"vertical"},speed,callback)},blindUp:function(speed,callback){return this.hide("blind",{direction:"vertical"},speed,callback)},blindRight:function(speed,callback){return this.show("blind",{direction:"horizontal"},speed,callback)},blindLeft:function(speed,callback){this.hide("blind",{direction:"horizontal"},speed,callback);return this},dropOut:function(speed,callback){return this.hide("drop",{direction:"down"},speed,callback)},dropIn:function(speed,callback){return this.show("drop",{direction:"up"},speed,callback)},fade:function(speed,callback){return this.fadeOut(speed,callback)},fadeToggle:function(speed,callback){return this.animate({opacity:"toggle"},speed,callback)},fold:function(speed,callback){return this.hide("fold",{},speed,callback)},foldOut:function(speed,callback){return this.show("fold",{},speed,callback)},grow:function(speed,callback){return this.show("scale",{},speed,callback)},highlight:function(speed,callback){return this.show("highlight",{},speed,callback)},puff:function(speed,callback){return this.hide("puff",{},speed,callback)},pulsate:function(speed,callback){return this.show("pulsate",{},speed,callback)},shake:function(speed,callback){return this.show("shake",{},speed,callback)},shrink:function(speed,callback){return this.hide("scale",{},speed,callback)},squish:function(speed,callback){return this.hide("scale",{origin:["top","left"]},speed,callback)},slideUp:function(speed,callback){return this.hide("slide",{direction:"up"},speed,callback)},slideDown:function(speed,callback){return this.show("slide",{direction:"up"},speed,callback)},switchOff:function(speed,callback){return this.hide("clip",{},speed,callback)},switchOn:function(speed,callback){return this.show("clip",{},speed,callback)}})})(jQuery);(function($){$.fn.textareaMaxlength=function(parameters){var opts=$.extend({},$.fn.textareaMaxlength.defaults,parameters);return this.each(function(){var $textarea=$(this);var $form=$(this).closest('form');var $submit=$form.find(opts.submitTarget);var disableSubmitInterval;var length=function(){return $textarea.val().length;};var textCount=function(){return opts.maxlength-length();};var updateDisplay=function(){$form.find(opts.displayTarget).html(textCount());};var disableSubmit=function(){if(!opts.allowBlank&&length()==0){$submit.attr("disabled","disabled");}else if(opts.maxlength<length()){$submit.attr("disabled","disabled");}else{$submit.removeAttr("disabled");}};var updateArea=function(){updateDisplay();disableSubmit();};var limitCheck=function(event){var len=length(),exceeded=len<opts.maxlength,code=event.keyCode;if(exceeded)
return true;switch(code){case 8:case 9:case 16:case 17:case 18:case 36:case 35:case 37:case 38:case 39:case 40:case 46:case 91:case 93:return true;case 65:case 88:if(event.metaKey||event.ctrlKey){return true;}else{return false;}
default:opts.limitedCallback($textarea);return false;}};updateDisplay();disableSubmit();$textarea.keyup(function(){updateArea();}).keydown(limitCheck).focus(function(){disableSubmitInterval=setInterval(disableSubmit,opts.checkInterval);updateArea();}).blur(function(){clearInterval(disableSubmitInterval);updateArea();}).submit(function(){clearInterval(disableSubmitInterval);});});};$.fn.textareaMaxlength.defaults={maxlength:140,displayTarget:".count_display",limitedCallback:function(){},submitTarget:"input.count_submit",allowBlank:false,checkInterval:2000};})(jQuery);(function($){$.fn.mouseOverChangeImage=function(parameters){var opts=$.extend({},$.fn.mouseOverChangeImage.defaults,parameters);return this.each(function(){var $this=$(this);var src=$this.attr('src');var ret=src.match(/([^.].*?)\.(.*(gif|jpg|png).*)/);var on_src=ret[1]+"_"+opts.addStr+"."+ret[2];$this.hover(function(){$this.attr('src',on_src);},function(){$this.attr('src',src);});});};$.fn.mouseOverChangeImage.defaults={addStr:'on'};})(jQuery);(function($){$.extend($.fn,{livequery:function(type,fn,fn2){var self=this,q;if($.isFunction(type))
fn2=fn,fn=type,type=undefined;$.each($.livequery.queries,function(i,query){if(self.selector==query.selector&&self.context==query.context&&type==query.type&&(!fn||fn.$lqguid==query.fn.$lqguid)&&(!fn2||fn2.$lqguid==query.fn2.$lqguid))
return(q=query)&&false;});q=q||new $.livequery(this.selector,this.context,type,fn,fn2);q.stopped=false;q.run();return this;},expire:function(type,fn,fn2){var self=this;if($.isFunction(type))
fn2=fn,fn=type,type=undefined;$.each($.livequery.queries,function(i,query){if(self.selector==query.selector&&self.context==query.context&&(!type||type==query.type)&&(!fn||fn.$lqguid==query.fn.$lqguid)&&(!fn2||fn2.$lqguid==query.fn2.$lqguid)&&!this.stopped)
$.livequery.stop(query.id);});return this;}});$.livequery=function(selector,context,type,fn,fn2){this.selector=selector;this.context=context||document;this.type=type;this.fn=fn;this.fn2=fn2;this.elements=[];this.stopped=false;this.id=$.livequery.queries.push(this)-1;fn.$lqguid=fn.$lqguid||$.livequery.guid++;if(fn2)fn2.$lqguid=fn2.$lqguid||$.livequery.guid++;return this;};$.livequery.prototype={stop:function(){var query=this;if(this.type)
this.elements.unbind(this.type,this.fn);else if(this.fn2)
this.elements.each(function(i,el){query.fn2.apply(el);});this.elements=[];this.stopped=true;},run:function(){if(this.stopped)return;var query=this;var oEls=this.elements,els=$(this.selector,this.context),nEls=els.not(oEls);this.elements=els;if(this.type){nEls.bind(this.type,this.fn);if(oEls.length>0)
$.each(oEls,function(i,el){if($.inArray(el,els)<0)
$.event.remove(el,query.type,query.fn);});}
else{nEls.each(function(){query.fn.apply(this);});if(this.fn2&&oEls.length>0)
$.each(oEls,function(i,el){if($.inArray(el,els)<0)
query.fn2.apply(el);});}}};$.extend($.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if($.livequery.running&&$.livequery.queue.length){var length=$.livequery.queue.length;while(length--)
$.livequery.queries[$.livequery.queue.shift()].run();}},pause:function(){$.livequery.running=false;},play:function(){$.livequery.running=true;$.livequery.run();},registerPlugin:function(){$.each(arguments,function(i,n){if(!$.fn[n])return;var old=$.fn[n];$.fn[n]=function(){var r=old.apply(this,arguments);$.livequery.run();return r;}});},run:function(id){if(id!=undefined){if($.inArray(id,$.livequery.queue)<0)
$.livequery.queue.push(id);}
else
$.each($.livequery.queries,function(id){if($.inArray(id,$.livequery.queue)<0)
$.livequery.queue.push(id);});if($.livequery.timeout)clearTimeout($.livequery.timeout);$.livequery.timeout=setTimeout($.livequery.checkQueue,20);},stop:function(id){if(id!=undefined)
$.livequery.queries[id].stop();else
$.each($.livequery.queries,function(id){$.livequery.queries[id].stop();});}});$.livequery.registerPlugin('append','prepend','after','before','wrap','attr','removeAttr','addClass','removeClass','toggleClass','empty','remove');$(function(){$.livequery.play();});var init=$.prototype.init;$.prototype.init=function(a,c){var r=init.apply(this,arguments);if(a&&a.selector)
r.context=a.context,r.selector=a.selector;if(typeof a=='string')
r.context=c||document,r.selector=a;return r;};$.prototype.init.prototype=$.prototype;})(jQuery);(function($){$.fn.fitimage=function(options){if(!options)options={};var defaults={placeholder:"data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAEBMgA7"};this.each(function(){var $el=$(this);var src=$el.attr('src');$el.attr('src',options.placeholder||defaults.placeholder);var width=options.width||$el.width();var height=options.height||$el.height();var img=new Image();img.onerror=function(){};img.onload=function(){var new_height,new_width,margin_hr,margin_ver;var is_small=(this.height<height&&this.width<width);var is_tall=this.height>this.width*height/width;if(is_small){new_height=this.height;new_width=this.width;margin_hr=(width-new_width)/2;margin_ver=(height-new_height)/2;}else if(is_tall){new_width=height*this.width/this.height;margin_hr=(width-new_width)/2;}else{new_height=width*this.height/this.width;margin_ver=(height-new_height)/2;}
if(margin_hr<0)margin_hr=0;if(margin_ver<0)margin_ver=0;var adjuster=function(name,margin){var current=$el.css(name);if(current&&current.match(/^(\d+)px$/)){return parseInt(RegExp.$1)+margin;}
return margin;};if(is_small){$el.css({width:new_width,height:new_height,"margin-top":adjuster("margin-top",margin_ver),"margin-bottom":adjuster("margin-bottom",margin_ver),"margin-left":adjuster("margin-left",margin_hr),"margin-right":adjuster("margin-right",margin_hr)});}else if(is_tall){$el.css({height:height,width:new_width,"margin-left":adjuster("margin-left",margin_hr),"margin-right":adjuster("margin-right",margin_hr)});}else{$el.css({width:width,height:new_height,"margin-top":adjuster("margin-top",margin_ver),"margin-bottom":adjuster("margin-bottom",margin_ver)});}
$el.attr("src",this.src);};img.src=src;});return this;};})(jQuery);$.fn.equalHeights=function(px){Number.prototype.pxToEm=String.prototype.pxToEm=function(settings){settings=jQuery.extend({scope:'body',reverse:false},settings);var pxVal=(this=='')?0:parseFloat(this);var scopeVal;var getWindowWidth=function(){var de=document.documentElement;return self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;};if(settings.scope=='body'&&$.browser.msie&&(parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(1)>0.0){var calcFontSize=function(){return(parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(3)*16;};scopeVal=calcFontSize();}
else{scopeVal=parseFloat(jQuery(settings.scope).css("font-size"));};var result=(settings.reverse==true)?(pxVal*scopeVal).toFixed(2)+'px':(pxVal/scopeVal).toFixed(2)+'em';return result;};$(this).each(function(){var currentTallest=0;$(this).children().each(function(i){if($(this).height()>currentTallest){currentTallest=$(this).height();}});if(!px||!Number.prototype.pxToEm)currentTallest=currentTallest.pxToEm();if($.browser.msie&&$.browser.version==6.0){$(this).children().css({'height':currentTallest});}
$(this).children().css({'min-height':currentTallest});});return this;};(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};})(jQuery);﻿
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}
if(p==this){return false;}
var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}
if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove.cluetip",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove.cluetip",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.bind('mouseover.cluetip',handleHover).bind('mouseout.cluetip',handleHover);};})(jQuery);;(function($){$.cluetip={version:'1.0.5'};var $cluetip,$cluetipInner,$cluetipOuter,$cluetipTitle,$cluetipArrows,$cluetipWait,$dropShadow,imgCount;$.fn.cluetip=function(js,options){if(typeof js=='object'){options=js;js=null;}
if(js=='destroy'){return this.unbind('.cluetip');}
return this.each(function(index){var link=this,$this=$(this);var opts=$.extend(true,{},$.fn.cluetip.defaults,options||{},$.metadata?$this.metadata():$.meta?$this.data():{});var cluetipContents=false;var cluezIndex=+opts.cluezIndex;$this.data('thisInfo',{title:link.title,zIndex:cluezIndex});var isActive=false,closeOnDelay=0;if(!$('#cluetip').length){$(['<div id="cluetip">','<div id="cluetip-outer">','<h3 id="cluetip-title"></h3>','<div id="cluetip-inner"></div>','</div>','<div id="cluetip-extra"></div>','<div id="cluetip-arrows" class="cluetip-arrows"></div>','</div>'].join(''))
[insertionType](insertionElement).hide();$cluetip=$('#cluetip').css({position:'absolute'});$cluetipOuter=$('#cluetip-outer').css({position:'relative',zIndex:cluezIndex});$cluetipInner=$('#cluetip-inner');$cluetipTitle=$('#cluetip-title');$cluetipArrows=$('#cluetip-arrows');$cluetipWait=$('<div id="cluetip-waitimage"></div>').css({position:'absolute'}).insertBefore($cluetip).hide();}
var dropShadowSteps=(opts.dropShadow)?+opts.dropShadowSteps:0;if(!$dropShadow){$dropShadow=$([]);for(var i=0;i<dropShadowSteps;i++){$dropShadow=$dropShadow.add($('<div></div>').css({zIndex:cluezIndex-1,opacity:.1,top:1+i,left:1+i}));};$dropShadow.css({position:'absolute',backgroundColor:'#000'}).prependTo($cluetip);}
var tipAttribute=$this.attr(opts.attribute),ctClass=opts.cluetipClass;if(!tipAttribute&&!opts.splitTitle&&!js)return true;if(opts.local&&opts.localPrefix){tipAttribute=opts.localPrefix+tipAttribute;}
if(opts.local&&opts.hideLocal){$(tipAttribute+':first').hide();}
var tOffset=parseInt(opts.topOffset,10),lOffset=parseInt(opts.leftOffset,10);var tipHeight,wHeight,defHeight=isNaN(parseInt(opts.height,10))?'auto':(/\D/g).test(opts.height)?opts.height:opts.height+'px';var sTop,linkTop,posY,tipY,mouseY,baseline;var tipInnerWidth=parseInt(opts.width,10)||275,tipWidth=tipInnerWidth+(parseInt($cluetip.css('paddingLeft'),10)||0)+(parseInt($cluetip.css('paddingRight'),10)||0)+dropShadowSteps,linkWidth=this.offsetWidth,linkLeft,posX,tipX,mouseX,winWidth;var tipParts;var tipTitle=(opts.attribute!='title')?$this.attr(opts.titleAttribute):'';if(opts.splitTitle){if(tipTitle==undefined){tipTitle='';}
tipParts=tipTitle.split(opts.splitTitle);tipTitle=tipParts.shift();}
if(opts.escapeTitle){tipTitle=tipTitle.replace(/&/g,'&amp;').replace(/>/g,'&gt;').replace(/</g,'&lt;');}
var localContent;function returnFalse(){return false;}
var activate=function(event){if(!opts.onActivate($this)){return false;}
isActive=true;$cluetip.removeClass().css({width:tipInnerWidth});if(tipAttribute==$this.attr('href')){$this.css('cursor',opts.cursor);}
if(opts.hoverClass){$this.addClass(opts.hoverClass);}
linkTop=posY=$this.offset().top;linkLeft=$this.offset().left;mouseX=event.pageX;mouseY=event.pageY;if(link.tagName.toLowerCase()!='area'){sTop=$(document).scrollTop();winWidth=$(window).width();}
if(opts.positionBy=='fixed'){posX=linkWidth+linkLeft+lOffset;$cluetip.css({left:posX});}else{posX=(linkWidth>linkLeft&&linkLeft>tipWidth)||linkLeft+linkWidth+tipWidth+lOffset>winWidth?linkLeft-tipWidth-lOffset:linkWidth+linkLeft+lOffset;if(link.tagName.toLowerCase()=='area'||opts.positionBy=='mouse'||linkWidth+tipWidth>winWidth){if(mouseX+20+tipWidth>winWidth){$cluetip.addClass(' cluetip-'+ctClass);posX=(mouseX-tipWidth-lOffset)>=0?mouseX-tipWidth-lOffset-parseInt($cluetip.css('marginLeft'),10)+parseInt($cluetipInner.css('marginRight'),10):mouseX-(tipWidth/2);}else{posX=mouseX+lOffset;}}
var pY=posX<0?event.pageY+tOffset:event.pageY;$cluetip.css({left:(posX>0&&opts.positionBy!='bottomTop')?posX:(mouseX+(tipWidth/2)>winWidth)?winWidth/2-tipWidth/2:Math.max(mouseX-(tipWidth/2),0),zIndex:$this.data('thisInfo').zIndex});$cluetipArrows.css({zIndex:$this.data('thisInfo').zIndex+1});}
wHeight=$(window).height();if(js){if(typeof js=='function'){js=js.call(link);}
$cluetipInner.html(js);cluetipShow(pY);}
else if(tipParts){var tpl=tipParts.length;$cluetipInner.html(tipParts[0]);if(tpl>1){for(var i=1;i<tpl;i++){$cluetipInner.append('<div class="split-body">'+tipParts[i]+'</div>');}}
cluetipShow(pY);}
else if(!opts.local&&tipAttribute.indexOf('#')!=0){if(/\.(jpe?g|tiff?|gif|png)$/i.test(tipAttribute)){$cluetipInner.html('<img src="'+tipAttribute+'" alt="'+tipTitle+'" />');cluetipShow(pY);}else if(cluetipContents&&opts.ajaxCache){$cluetipInner.html(cluetipContents);cluetipShow(pY);}else{var optionBeforeSend=opts.ajaxSettings.beforeSend,optionError=opts.ajaxSettings.error,optionSuccess=opts.ajaxSettings.success,optionComplete=opts.ajaxSettings.complete;var ajaxSettings={cache:false,url:tipAttribute,beforeSend:function(xhr){if(optionBeforeSend){optionBeforeSend.call(link,xhr,$cluetip,$cluetipInner);}
$cluetipOuter.children().empty();if(opts.waitImage){$cluetipWait.css({top:mouseY+20,left:mouseX+20,zIndex:$this.data('thisInfo').zIndex-1}).show();}},error:function(xhr,textStatus){if(isActive){if(optionError){optionError.call(link,xhr,textStatus,$cluetip,$cluetipInner);}else{$cluetipInner.html('<i>sorry, the contents could not be loaded</i>');}}},success:function(data,textStatus){cluetipContents=opts.ajaxProcess.call(link,data);if(isActive){if(optionSuccess){optionSuccess.call(link,data,textStatus,$cluetip,$cluetipInner);}
$cluetipInner.html(cluetipContents);}},complete:function(xhr,textStatus){if(optionComplete){optionComplete.call(link,xhr,textStatus,$cluetip,$cluetipInner);}
imgCount=$('#cluetip-inner img').length;if(imgCount&&!$.browser.opera){$('#cluetip-inner img').bind('load error',function(){imgCount--;if(imgCount<1){$cluetipWait.hide();if(isActive)cluetipShow(pY);}});}else{$cluetipWait.hide();if(isActive){cluetipShow(pY);}}}};var ajaxMergedSettings=$.extend(true,{},opts.ajaxSettings,ajaxSettings);$.ajax(ajaxMergedSettings);}}else if(opts.local){var $localContent=$(tipAttribute+(/#\S+$/.test(tipAttribute)?'':':eq('+index+')')).clone(true).show();$cluetipInner.html($localContent);cluetipShow(pY);}};var cluetipShow=function(bpY){$cluetip.addClass('cluetip-'+ctClass);if(opts.truncate){var $truncloaded=$cluetipInner.text().slice(0,opts.truncate)+'...';$cluetipInner.html($truncloaded);}
function doNothing(){};tipTitle?$cluetipTitle.show().html(tipTitle):(opts.showTitle)?$cluetipTitle.show().html('&nbsp;'):$cluetipTitle.hide();if(opts.sticky){var $closeLink=$('<div id="cluetip-close"><a href="#">'+opts.closeText+'</a></div>');(opts.closePosition=='bottom')?$closeLink.appendTo($cluetipInner):(opts.closePosition=='title')?$closeLink.prependTo($cluetipTitle):$closeLink.prependTo($cluetipInner);$closeLink.bind('click.cluetip',function(){cluetipClose();return false;});if(opts.mouseOutClose){$cluetip.bind('mouseleave.cluetip',function(){cluetipClose();});}else{$cluetip.unbind('mouseleave.cluetip');}}
var direction='';$cluetipOuter.css({zIndex:$this.data('thisInfo').zIndex,overflow:defHeight=='auto'?'visible':'auto',height:defHeight});tipHeight=defHeight=='auto'?Math.max($cluetip.outerHeight(),$cluetip.height()):parseInt(defHeight,10);tipY=posY;baseline=sTop+wHeight;if(opts.positionBy=='fixed'){tipY=posY-opts.dropShadowSteps+tOffset;}else if((posX<mouseX&&Math.max(posX,0)+tipWidth>mouseX)||opts.positionBy=='bottomTop'){if(posY+tipHeight+tOffset>baseline&&mouseY-sTop>tipHeight+tOffset){tipY=mouseY-tipHeight-tOffset;direction='top';}else{tipY=mouseY+tOffset;direction='bottom';}}else if(posY+tipHeight+tOffset>baseline){tipY=(tipHeight>=wHeight)?sTop:baseline-tipHeight-tOffset;}else if($this.css('display')=='block'||link.tagName.toLowerCase()=='area'||opts.positionBy=="mouse"){tipY=bpY-tOffset;}else{tipY=posY-opts.dropShadowSteps;}
if(direction==''){posX<linkLeft?direction='left':direction='right';}
$cluetip.css({top:tipY+'px'}).removeClass().addClass('clue-'+direction+'-'+ctClass).addClass(' cluetip-'+ctClass);if(opts.arrows){var bgY=(posY-tipY-opts.dropShadowSteps);$cluetipArrows.css({top:(/(left|right)/.test(direction)&&posX>=0&&bgY>0)?bgY+'px':/(left|right)/.test(direction)?0:''}).show();}else{$cluetipArrows.hide();}
$dropShadow.hide();$cluetip.hide()[opts.fx.open](opts.fx.open!='show'&&opts.fx.openSpeed);if(opts.dropShadow){$dropShadow.css({height:tipHeight,width:tipInnerWidth,zIndex:$this.data('thisInfo').zIndex-1}).show();}
if($.fn.bgiframe){$cluetip.bgiframe();}
if(opts.delayedClose>0){closeOnDelay=setTimeout(cluetipClose,opts.delayedClose);}
opts.onShow.call(link,$cluetip,$cluetipInner);};var inactivate=function(event){isActive=false;$cluetipWait.hide();if(!opts.sticky||(/click|toggle/).test(opts.activation)){cluetipClose();clearTimeout(closeOnDelay);};if(opts.hoverClass){$this.removeClass(opts.hoverClass);}};var cluetipClose=function(){$cluetipOuter.parent().hide().removeClass();opts.onHide.call(link,$cluetip,$cluetipInner);$this.removeClass('cluetip-clicked');if(tipTitle){$this.attr(opts.titleAttribute,tipTitle);}
$this.css('cursor','');if(opts.arrows)$cluetipArrows.css({top:''});};$(document).bind('hideCluetip',function(e){cluetipClose();});if((/click|toggle/).test(opts.activation)){$this.bind('click.cluetip',function(event){if($cluetip.is(':hidden')||!$this.is('.cluetip-clicked')){activate(event);$('.cluetip-clicked').removeClass('cluetip-clicked');$this.addClass('cluetip-clicked');}else{inactivate(event);}
this.blur();return false;});}else if(opts.activation=='focus'){$this.bind('focus.cluetip',function(event){activate(event);});$this.bind('blur.cluetip',function(event){inactivate(event);});}else{$this[opts.clickThrough?'unbind':'bind']('click',returnFalse);var mouseTracks=function(evt){if(opts.tracking==true){var trackX=posX-evt.pageX;var trackY=tipY?tipY-evt.pageY:posY-evt.pageY;$this.bind('mousemove.cluetip',function(evt){$cluetip.css({left:evt.pageX+trackX,top:evt.pageY+trackY});});}};if($.fn.hoverIntent&&opts.hoverIntent){$this.hoverIntent({sensitivity:opts.hoverIntent.sensitivity,interval:opts.hoverIntent.interval,over:function(event){activate(event);mouseTracks(event);},timeout:opts.hoverIntent.timeout,out:function(event){inactivate(event);$this.unbind('mousemove.cluetip');}});}else{$this.bind('mouseenter.cluetip',function(event){activate(event);mouseTracks(event);}).bind('mouseleave.cluetip',function(event){inactivate(event);$this.unbind('mousemove.cluetip');});}
$this.bind('mouseover.cluetip',function(event){$this.attr('title','');}).bind('mouseleave.cluetip',function(event){$this.attr('title',$this.data('thisInfo').title);});}});};$.fn.cluetip.defaults={width:275,height:'auto',cluezIndex:97,positionBy:'auto',topOffset:15,leftOffset:15,local:false,localPrefix:null,hideLocal:true,attribute:'rel',titleAttribute:'title',splitTitle:'',escapeTitle:false,showTitle:true,cluetipClass:'default',hoverClass:'',waitImage:true,cursor:'help',arrows:false,dropShadow:true,dropShadowSteps:6,sticky:false,mouseOutClose:false,activation:'hover',clickThrough:false,tracking:false,delayedClose:0,closePosition:'top',closeText:'Close',truncate:0,fx:{open:'show',openSpeed:''},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(e){return true;},onShow:function(ct,ci){},onHide:function(ct,ci){},ajaxCache:true,ajaxProcess:function(data){data=data.replace(/<(script|style|title)[^<]+<\/(script|style|title)>/gm,'').replace(/<(link|meta)[^>]+>/g,'');return data;},ajaxSettings:{dataType:'html'},debug:false};var insertionType='appendTo',insertionElement='body';$.cluetip.setup=function(options){if(options&&options.insertionType&&(options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)){insertionType=options.insertionType;}
if(options&&options.insertionElement){insertionElement=options.insertionElement;}};})(jQuery);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;}};(function($){$.fn.tweet=function(o){var s={username:["seaofclouds"],avatar_size:null,count:3,intro_text:null,outro_text:null,join_text:null,auto_join_text_default:"i said,",auto_join_text_ed:"i",auto_join_text_ing:"i am",auto_join_text_reply:"i replied to",auto_join_text_url:"i was looking at",loading_text:null,query:null};$.fn.extend({linkUrl:function(){var returning=[];var regexp=/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;this.each(function(){returning.push(this.replace(regexp,"<a href=\"$1\">$1</a>"))});return $(returning);},linkUser:function(){var returning=[];var regexp=/[\@]+([A-Za-z0-9-_]+)/gi;this.each(function(){returning.push(this.replace(regexp,"<a href=\"http://twitter.com/$1\">@$1</a>"))});return $(returning);},linkHash:function(){var returning=[];var regexp=/ [\#]+([A-Za-z0-9-_]+)/gi;this.each(function(){returning.push(this.replace(regexp,' <a href="http://search.twitter.com/search?q=&tag=$1&lang=all&from='+s.username.join("%2BOR%2B")+'">#$1</a>'))});return $(returning);},capAwesome:function(){var returning=[];this.each(function(){returning.push(this.replace(/(a|A)wesome/gi,'AWESOME'))});return $(returning);},capEpic:function(){var returning=[];this.each(function(){returning.push(this.replace(/(e|E)pic/gi,'EPIC'))});return $(returning);},makeHeart:function(){var returning=[];this.each(function(){returning.push(this.replace(/[&lt;]+[3]/gi,"<tt class='heart'>&#x2665;</tt>"))});return $(returning);}});function relative_time(time_value){var parsed_date=Date.parse(time_value);var relative_to=(arguments.length>1)?arguments[1]:new Date();var delta=parseInt((relative_to.getTime()-parsed_date)/1000);if(delta<60){return'less than a minute ago';}else if(delta<120){return'about a minute ago';}else if(delta<(45*60)){return(parseInt(delta/60)).toString()+' minutes ago';}else if(delta<(90*60)){return'about an hour ago';}else if(delta<(24*60*60)){return'about '+(parseInt(delta/3600)).toString()+' hours ago';}else if(delta<(48*60*60)){return'1 day ago';}else{return(parseInt(delta/86400)).toString()+' days ago';}}
if(o)$.extend(s,o);return this.each(function(){var list=$('<ul class="tweet_list">').appendTo(this);var intro='<p class="tweet_intro">'+s.intro_text+'</p>'
var outro='<p class="tweet_outro">'+s.outro_text+'</p>'
var loading=$('<p class="loading">'+s.loading_text+'</p>');if(typeof(s.username)=="string"){s.username=[s.username];}
var query='';if(s.query){query+='q='+s.query;}
query+='&q=from:'+s.username.join('%20OR%20from:');var url='http://search.twitter.com/search.json?&'+query+'&rpp='+s.count+'&callback=?';if(s.loading_text)$(this).append(loading);$.getJSON(url,function(data){if(s.loading_text)loading.remove();if(s.intro_text)list.before(intro);$.each(data.results,function(i,item){if(s.join_text=="auto"){if(item.text.match(/^(@([A-Za-z0-9-_]+)) .*/i)){var join_text=s.auto_join_text_reply;}else if(item.text.match(/(^\w+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+) .*/i)){var join_text=s.auto_join_text_url;}else if(item.text.match(/^((\w+ed)|just) .*/im)){var join_text=s.auto_join_text_ed;}else if(item.text.match(/^(\w*ing) .*/i)){var join_text=s.auto_join_text_ing;}else{var join_text=s.auto_join_text_default;}}else{var join_text=s.join_text;};var join_template='<span class="tweet_join"> '+join_text+' </span>';var join=((s.join_text)?join_template:' ')
var avatar_template='<a class="tweet_avatar" href="http://twitter.com/'+item.from_user+'"><img src="'+item.profile_image_url+'" height="'+s.avatar_size+'" width="'+s.avatar_size+'" alt="'+item.from_user+'\'s avatar" border="0"/></a>';var avatar=(s.avatar_size?avatar_template:'')
var date='<a href="http://twitter.com/'+item.from_user+'/statuses/'+item.id+'" title="view tweet on twitter">'+relative_time(item.created_at)+'</a>';var text='<span class="tweet_text">'+$([item.text]).linkUrl().linkUser().linkHash().makeHeart().capAwesome().capEpic()[0]+'</span>';list.append('<li>'+avatar+date+join+text+'</li>');list.children('li:first').addClass('tweet_first');list.children('li:odd').addClass('tweet_even');list.children('li:even').addClass('tweet_odd');});if(s.outro_text)list.after(outro);});});};})(jQuery);(function($){$.jGrowl=function(m,o){if($('#jGrowl').size()==0)
$('<div id="jGrowl"></div>').addClass($.jGrowl.defaults.position).appendTo('body');$('#jGrowl').jGrowl(m,o);};$.fn.jGrowl=function(m,o){if($.isFunction(this.each)){var args=arguments;return this.each(function(){var self=this;if($(this).data('jGrowl.instance')==undefined){$(this).data('jGrowl.instance',$.extend(new $.fn.jGrowl(),{notifications:[],element:null,interval:null}));$(this).data('jGrowl.instance').startup(this);}
if($.isFunction($(this).data('jGrowl.instance')[m])){$(this).data('jGrowl.instance')[m].apply($(this).data('jGrowl.instance'),$.makeArray(args).slice(1));}else{$(this).data('jGrowl.instance').create(m,o);}});};};$.extend($.fn.jGrowl.prototype,{defaults:{pool:0,header:'',group:'',sticky:false,position:'top-right',glue:'after',theme:'default',corners:'10px',check:250,life:3000,speed:'normal',easing:'swing',closer:true,closeTemplate:'&times;',closerTemplate:'<div>[ close all ]</div>',log:function(e,m,o){},beforeOpen:function(e,m,o){},open:function(e,m,o){},beforeClose:function(e,m,o){},close:function(e,m,o){},animateOpen:{opacity:'show'},animateClose:{opacity:'hide'}},notifications:[],element:null,interval:null,create:function(message,o){var o=$.extend({},this.defaults,o);this.notifications.push({message:message,options:o});o.log.apply(this.element,[this.element,message,o]);},render:function(notification){var self=this;var message=notification.message;var o=notification.options;var notification=$('<div class="jGrowl-notification ui-state-highlight ui-corner-all'+
((o.group!=undefined&&o.group!='')?' '+o.group:'')+'">'+'<div class="close">'+o.closeTemplate+'</div>'+'<div class="header">'+o.header+'</div>'+'<div class="message">'+message+'</div></div>').data("jGrowl",o).addClass(o.theme).children('div.close').bind("click.jGrowl",function(){$(this).parent().trigger('jGrowl.close');}).parent();$(notification).bind("mouseover.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",true);}).bind("mouseout.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",false);}).bind('jGrowl.beforeOpen',function(){if(o.beforeOpen.apply(notification,[notification,message,o,self.element])!=false){$(this).trigger('jGrowl.open');}}).bind('jGrowl.open',function(){if(o.open.apply(notification,[notification,message,o,self.element])!=false){if(o.glue=='after'){$('div.jGrowl-notification:last',self.element).after(notification);}else{$('div.jGrowl-notification:first',self.element).before(notification);}
$(this).animate(o.animateOpen,o.speed,o.easing,function(){if($.browser.msie&&(parseInt($(this).css('opacity'),10)===1||parseInt($(this).css('opacity'),10)===0))
this.style.removeAttribute('filter');$(this).data("jGrowl").created=new Date();});}}).bind('jGrowl.beforeClose',function(){if(o.beforeClose.apply(notification,[notification,message,o,self.element])!=false)
$(this).trigger('jGrowl.close');}).bind('jGrowl.close',function(){$(this).data('jGrowl.pause',true);$(this).animate(o.animateClose,o.speed,o.easing,function(){$(this).remove();var close=o.close.apply(notification,[notification,message,o,self.element]);if($.isFunction(close))
close.apply(notification,[notification,message,o,self.element]);});}).trigger('jGrowl.beforeOpen');if($.fn.corner!=undefined)$(notification).corner(o.corners);if($('div.jGrowl-notification:parent',self.element).size()>1&&$('div.jGrowl-closer',self.element).size()==0&&this.defaults.closer!=false){$(this.defaults.closerTemplate).addClass('jGrowl-closer ui-state-highlight ui-corner-all').addClass(this.defaults.theme).appendTo(self.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){$(this).siblings().children('div.close').trigger("click.jGrowl");if($.isFunction(self.defaults.closer)){self.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]);}});};},update:function(){$(this.element).find('div.jGrowl-notification:parent').each(function(){if($(this).data("jGrowl")!=undefined&&$(this).data("jGrowl").created!=undefined&&($(this).data("jGrowl").created.getTime()+$(this).data("jGrowl").life)<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl.pause")==undefined||$(this).data("jGrowl.pause")!=true)){$(this).trigger('jGrowl.beforeClose');}});if(this.notifications.length>0&&(this.defaults.pool==0||$(this.element).find('div.jGrowl-notification:parent').size()<this.defaults.pool))
this.render(this.notifications.shift());if($(this.element).find('div.jGrowl-notification:parent').size()<2){$(this.element).find('div.jGrowl-closer').animate(this.defaults.animateClose,this.defaults.speed,this.defaults.easing,function(){$(this).remove();});}},startup:function(e){this.element=$(e).addClass('jGrowl').append('<div class="jGrowl-notification"></div>');this.interval=setInterval(function(){$(e).data('jGrowl.instance').update();},this.defaults.check);if($.browser.msie&&parseInt($.browser.version)<7&&!window["XMLHttpRequest"]){$(this.element).addClass('ie6');}},shutdown:function(){$(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove();clearInterval(this.interval);},close:function(){$(this.element).find('div.jGrowl-notification').each(function(){$(this).trigger('jGrowl.beforeClose');});}});$.jGrowl.defaults=$.fn.jGrowl.prototype.defaults;})(jQuery);jQuery.fn.formtips=function(options){settings=jQuery.extend({tippedClass:"tipped"},options);return this.each(function(){jQuery(this).each(function(){var e=jQuery(this);jQuery(e).bind('focus',function(){var lv=jQuery(this).attr('title');if(jQuery(this).val()==lv){jQuery(this).val('').removeClass(settings.tippedClass);}
return false;});jQuery(e).bind('blur',function(){var lv=jQuery(this).attr('title');if(jQuery(this).val()==''){jQuery(this).val(lv).addClass(settings.tippedClass);}
return false;});var lv=jQuery(e).attr('title');if(jQuery(e).val()==''||jQuery(e).val()==jQuery(this).attr('title')){jQuery(e).val(lv).addClass(settings.tippedClass);}else{jQuery(e).removeClass(settings.tippedClass);}});if(jQuery('.'+settings.tippedClass,this).length>0){jQuery(this).submit(function(){jQuery('.'+settings.tippedClass,this).each(function(){var e=jQuery(this);var lv=jQuery(this).attr('title');if(jQuery(e).val()==lv){jQuery(e).val('').removeClass(settings.tippedClass);}});return true;});}});};$(document).ready(function(){var totWidth=0;var positions=new Array();$('#slides .slide').each(function(i){positions[i]=totWidth;totWidth+=$(this).width();if(!$(this).width())
{alert("Please, fill in width & height for all your images!");return false;}});$('#slides').width(totWidth);$('#menu ul li a').click(function(e){$('li.menuItem').removeClass('act').addClass('inact');$(this).parent().addClass('act');var pos=$(this).parent().prevAll('.menuItem').length;$('#slides').stop().animate({marginLeft:-positions[pos]+'px'},450);e.preventDefault();return false;});});$(document).ready(function(){$('img.fit').livequery(function(){$(this).fitimage({placeholder:"/images/spacer.gif"}).show();$(this).load(function(){$(this).show();});});$('textarea.limit').textareaMaxlength();$('a.edit_comment').live("click",function(){var entryRoot=$(this).closest('.entry');entryRoot.find('div.content').toggle();entryRoot.find('form.edit_comment').toggle().find('textarea').focus();return false;});$('form input.help, form textarea.help').formtips({tippedClass:"tipped"});$('a.new_comment').live("click",function(){var $this=$(this);$this.parents(".entry").find('form.new_comment').toggle().find('textarea').focus();return false;});$('#show_group_description').click(function(){$('#group_description_long').slideToggle();return false;});$('#show_search_form').click(function(){$('#group_search_form').slideToggle();return false;});$('#login_header').find('.login_open, .login_close').click(function(){$('#login_header').find('.login_open, .login_close, .login_form').toggle();return false;});$('#user_session_submit').click(function(){$(this).prev('.invisible').show();});$('a.attachment_link').click(function(){var $this=$(this);var type=$this.get(0).id;var show=$this.parent().get(0).className!="selected";$('.attachment_form .horizontal_menu li').removeClass('selected');$('.attachment_form .invisible:visible').hide().find(':input').attr('disabled','disabled');if(show){$this.parent('li').addClass('selected');$('.attachment_form .'+type).slideDown("slow").find(':input').removeAttr('disabled');};return false;});$('.attachment_form .invisible :input').attr('disabled','disabled');$('form.entry').find('textarea').focus(function(){$(this).next('.open_on_focus:hidden').slideDown();}).end().parents('body').click(function(){$(this).find('.open_on_focus').hide();}).end().click(function(event){event.stopPropagation();});$('.insert_mention').change(function(){var entryText=$('body').data('currentEntryTextarea');var text=$(this).find('option:selected').val();if(text!=""){entryText.focus();var originalContent=entryText.val();if(originalContent.length>0){var insertStr;if(originalContent[originalContent.length-1]==" "){insertStr='@'+text;}else{insertStr=' @'+text;}
entryText.val(originalContent+insertStr);}else{entryText.val('@'+text+' ');};}
return false;});$.fn.entryTextarea=function(options){if(!options)options={};this.each(function(){var $el=$(this);$el.blur(function(){$('body').data('currentEntryTextarea',$el);});if(!$('body').data('currentEntryTextarea')){$('body').data('currentEntryTextarea',$el);}});};$('textarea.entry_content').entryTextarea();$('textarea.entry_content').live('keydown',function(e){var submit_button=$(this).closest('form').find('.count_submit');if(e.keyCode==9){setTimeout("submit_button.focus()",1);return false;}
return true;});$('.category select').change(function(){var category_id=$(this).find(":selected").val();var $select=$(this);var indicator=$select.parent('.category').find('img');indicator.show();$.ajax({data:{"entry[category_id]":category_id},dataType:'json',type:'post',url:$(this).attr('target_url'),success:function(data,status,request){indicator.hide();$select.effect('pulsate',"fast");},error:function(data){alert("Error: "+data);}});}).after("<img src='/images/ajax-loader.gif' class='loading' style='display: none; height: 1em; margin: 0 5px;'>");loadDescendants=function(){$('.loading_descendants').each(function(index){var url=$(this).attr('load_url');$.ajax({url:url,dataType:'script'});});};loadDescendants();$('#flashes').find('div').each(function(){var error_options={sticky:true,theme:'ui-state-error'};var options;var $this=$(this);if($this.hasClass("error")){options=error_options;}else{options={};}
$.jGrowl($this.html(),options);});$("#youroom_tweet .tweet").tweet({username:"youroom",join_text:"auto",count:1,auto_join_text_default:"we said,",auto_join_text_ed:"we",auto_join_text_ing:"we were",auto_join_text_reply:"we replied to",auto_join_text_url:"we were checking out",loading_text:"loading tweets..."});$('img.mouse_over_tr').mouseOverChangeImage();$('#show_confirm_destroy').click(function(){$(this).hide();$('#confirm_destroy').slideDown('slow');return false;});$('form a.submit').click(function(){$(this).closest('form').submit();});$('#show_confirm_leave').click(function(){$(this).hide();$('#confirm_leave').slideDown('slow');return false;});$('form.remote').live('submit',function(){var submitButton=$(this).find(':submit');var originalSubmitValue=submitButton.val();var disableValue=submitButton.attr('disable_label')||'Save changes';submitButton.val(disableValue);submitButton.attr('disabled','disabled');$.ajax({data:$.param($(this).serializeArray()),dataType:'script',type:'post',url:$(this).attr('action'),complete:function(){submitButton.val(originalSubmitValue);submitButton.removeAttr('disabled');}});return false;});$('#initial_attention .ctip').cluetip({local:true,cursor:'pointer',sticky:true,dropShadow:false,closePosition:'title',activation:'click',mouseOutClose:true,closeText:'<span class="ui-icon ui-icon-closethick"></span>',cluetipClass:'default',arrow:true,positionBy:'bottomTop'});jQuery.fn.extend({check:function(){return this.each(function(){this.checked=true;});},uncheck:function(){return this.each(function(){this.checked=false;});}});$('input.check_all:checkbox').live('click',function(){if($(this).attr('checked')){$('.'+$(this).val()+':checkbox').check();}else{$('.'+$(this).val()+':checkbox').uncheck();}});var changePictureUploadSubmit=function(target){var $this=$(target);var submit=$this.closest('form').find("input[type='submit']");if($this.val()==""){submit.attr('disabled','disabled');}else{submit.removeAttr('disabled');}};changePictureUploadSubmit($('#picture_uploaded_data'));$('#picture_uploaded_data').change(function(){changePictureUploadSubmit(this);});var changeSubmitByTerms=function(check,submit){if(check.attr('checked')){submit.removeAttr('disabled');}else{submit.attr('disabled','disabled');}};var participationTermsOfService=$('#participation_terms_of_service').change(function(){var $this=$(this);var $form=$this.closest('form');var $submit=$form.find('input:submit');changeSubmitByTerms($this,$submit);});changeSubmitByTerms(participationTermsOfService,participationTermsOfService.closest('form').find('input:submit'));addIdsToMarkAsRead=function(ids_str){var mark_as_read=$('.mark_as_read');var href=mark_as_read.attr('href');mark_as_read.attr('href',href+ids_str);};$('.email_on_sign_up').blur(function(){if($('.profile_value_name').val()==""){var email_name=$(this).val().split('@')[0];$('.profile_value_name').val(email_name);};});$('.attach_file_link').click(function(){var $this=$(this);$this.attr('href',$this.attr('href')+"?authenticity_token="+encodeURIComponent(authenticity_token));});$('.select_on_focus').focus(function(){$(this).select();return false;}).click(function(){$(this).select();return false;});$('#open_room_key_input').click(function(){$('#room_key_input').show();$(this).hide();return false;});if(window.location.hash=="#edit"){$("#entry_show .entry.level0 .edit_comment").click();}
$('body.pc').find('#container:has(#main) .center_wrapper, #login_required:has(#main) .center_wrapper').equalHeights();$('body.iphone .entries.list .content .tappable').live('click',function(){var link=$(this).closest('.entry').find('.posted_time a').attr('href');location.href=link;});});