(function($){$.fn.layout=function(opts){var prefix="ui-layout-",defaults={paneClass:prefix+"pane",resizerClass:prefix+"resizer",togglerClass:prefix+"toggler",togglerInnerClass:prefix+"",buttonClass:prefix+"button",contentSelector:"."+prefix+"content",contentIgnoreSelector:"."+prefix+"ignore"};var options={name:"",scrollToBookmarkOnLoad:true,defaults:{applyDefaultStyles:false,closable:true,resizable:true,slidable:true,contentSelector:defaults.contentSelector,contentIgnoreSelector:defaults.contentIgnoreSelector,paneClass:defaults.paneClass,resizerClass:defaults.resizerClass,togglerClass:defaults.togglerClass,buttonClass:defaults.buttonClass,resizerDragOpacity:1,maskIframesOnResize:true,minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerTip_open:"Close",togglerTip_closed:"Open",resizerTip:"Resize",sliderTip:"Slide Open",sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseout",hideTogglerOnSlide:false,togglerContent_open:"",togglerContent_closed:"",showOverflowOnHover:false,enableCursorHotkey:true,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},initClosed:false,initHidden:false},north:{paneSelector:"."+prefix+"north",size:"auto",resizerCursor:"n-resize"},south:{paneSelector:"."+prefix+"south",size:"auto",resizerCursor:"s-resize"},east:{paneSelector:"."+prefix+"east",size:200,resizerCursor:"e-resize"},west:{paneSelector:"."+prefix+"west",size:200,resizerCursor:"w-resize"},center:{paneSelector:"."+prefix+"center"}};var effects={slide:{all:{duration:"fast"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},drop:{all:{duration:"slow"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},scale:{all:{duration:"fast"}}};var config={allPanes:"north,south,east,west,center",borderPanes:"north,south,east,west",zIndex:{resizer_normal:1,pane_normal:2,mask:4,sliding:100,resizing:10000,animation:10000},resizers:{cssReq:{position:"absolute",padding:0,margin:0,fontSize:"1px",textAlign:"left",overflow:"hidden",zIndex:1},cssDef:{background:"#DDD",border:"none"}},togglers:{cssReq:{position:"absolute",display:"block",padding:0,margin:0,overflow:"hidden",textAlign:"center",fontSize:"1px",cursor:"pointer",zIndex:1},cssDef:{background:"#AAA"}},content:{cssReq:{overflow:"auto"},cssDef:{}},defaults:{cssReq:{position:"absolute",margin:0,zIndex:2},cssDef:{padding:"10px",background:"#FFF",border:"1px solid #BBB",overflow:"auto"}},north:{edge:"top",sizeType:"height",dir:"horz",cssReq:{top:0,bottom:"auto",left:0,right:0,width:"auto"}},south:{edge:"bottom",sizeType:"height",dir:"horz",cssReq:{top:"auto",bottom:0,left:0,right:0,width:"auto"}},east:{edge:"right",sizeType:"width",dir:"vert",cssReq:{left:"auto",right:0,top:"auto",bottom:"auto",height:"auto"}},west:{edge:"left",sizeType:"width",dir:"vert",cssReq:{left:0,right:"auto",top:"auto",bottom:"auto",height:"auto"}},center:{dir:"center",cssReq:{left:"auto",right:"auto",top:"auto",bottom:"auto",height:"auto",width:"auto"}}};var state={id:Math.floor(Math.random()*10000),container:{},north:{},south:{},east:{},west:{},center:{}};var altEdge={top:"bottom",bottom:"top",left:"right",right:"left"},altSide={north:"south",south:"north",east:"west",west:"east"};var isStr=function(o){if(typeof o=="string"){return true}else{if(typeof o=="object"){try{var match=o.constructor.toString().match(/string/i);return(match!==null)}catch(e){}}}return false};var str=function(o){if(typeof o=="string"||isStr(o)){return $.trim(o)}else{return o}};var min=function(x,y){return Math.min(x,y)};var max=function(x,y){return Math.max(x,y)};var transformData=function(d){var json={defaults:{fxSettings:{}},north:{fxSettings:{}},south:{fxSettings:{}},east:{fxSettings:{}},west:{fxSettings:{}},center:{fxSettings:{}}};d=d||{};if(d.effects||d.defaults||d.north||d.south||d.west||d.east||d.center){json=$.extend(json,d)}else{$.each(d,function(key,val){a=key.split("__");json[a[1]?a[0]:"defaults"][a[1]?a[1]:a[0]]=val})}return json};var setFlowCallback=function(action,pane,param){var cb=action+","+pane+","+(param?1:0),cP,cbPane;$.each(c.borderPanes.split(","),function(i,p){if(c[p].isMoving){bindCallback(p);return false}});function bindCallback(p,test){cP=c[p];if(!cP.doCallback){cP.doCallback=true;cP.callback=cb}else{cpPane=cP.callback.split(",")[1];if(cpPane!=p&&cpPane!=pane){bindCallback(cpPane,true)}}}};var execFlowCallback=function(pane){var cP=c[pane];c.isLayoutBusy=false;delete cP.isMoving;if(!cP.doCallback||!cP.callback){return}cP.doCallback=false;var cb=cP.callback.split(","),param=(cb[2]>0?true:false);if(cb[0]=="open"){open(cb[1],param)}else{if(cb[0]=="close"){close(cb[1],param)}}if(!cP.doCallback){cP.callback=null}};var execUserCallback=function(pane,v_fn){if(!v_fn){return}var fn;try{if(typeof v_fn=="function"){fn=v_fn}else{if(typeof v_fn!="string"){return}else{if(v_fn.indexOf(",")>0){var args=v_fn.split(","),fn=eval(args[0]);if(typeof fn=="function"&&args.length>1){return fn(args[1])}}else{fn=eval(v_fn)}}}if(typeof fn=="function"){return fn(pane,$Ps[pane],$.extend({},state[pane]),$.extend({},options[pane]),options.name)}}catch(ex){}};var cssNum=function($E,prop){var val=0,hidden=false,visibility="";if(!$.browser.msie){if($.curCSS($E[0],"display",true)=="none"){hidden=true;visibility=$.curCSS($E[0],"visibility",true);$E.css({display:"block",visibility:"hidden"})}}val=parseInt($.curCSS($E[0],prop,true),10)||0;if(hidden){$E.css({display:"none"});if(visibility&&visibility!="hidden"){$E.css({visibility:visibility})}}return val};var cssW=function(e,outerWidth){var $E;if(isStr(e)){e=str(e);$E=$Ps[e]}else{$E=$(e)}if(outerWidth<=0){return 0}else{if(!(outerWidth>0)){outerWidth=isStr(e)?getPaneSize(e):$E.outerWidth()}}if(!$.boxModel){return outerWidth}else{return outerWidth-cssNum($E,"paddingLeft")-cssNum($E,"paddingRight")-($.curCSS($E[0],"borderLeftStyle",true)=="none"?0:cssNum($E,"borderLeftWidth"))-($.curCSS($E[0],"borderRightStyle",true)=="none"?0:cssNum($E,"borderRightWidth"))}};var cssH=function(e,outerHeight){var $E;if(isStr(e)){e=str(e);$E=$Ps[e]}else{$E=$(e)}if(outerHeight<=0){return 0}else{if(!(outerHeight>0)){outerHeight=(isStr(e))?getPaneSize(e):$E.outerHeight()}}if(!$.boxModel){return outerHeight}else{return outerHeight-cssNum($E,"paddingTop")-cssNum($E,"paddingBottom")-($.curCSS($E[0],"borderTopStyle",true)=="none"?0:cssNum($E,"borderTopWidth"))-($.curCSS($E[0],"borderBottomStyle",true)=="none"?0:cssNum($E,"borderBottomWidth"))}};var cssSize=function(pane,outerSize){if(c[pane].dir=="horz"){return cssH(pane,outerSize)}else{return cssW(pane,outerSize)}};var getPaneSize=function(pane,inclSpace){var $P=$Ps[pane],o=options[pane],s=state[pane],oSp=(inclSpace?o.spacing_open:0),cSp=(inclSpace?o.spacing_closed:0);if(!$P||s.isHidden){return 0}else{if(s.isClosed||(s.isSliding&&inclSpace)){return cSp}else{if(c[pane].dir=="horz"){return $P.outerHeight()+oSp}else{return $P.outerWidth()+oSp}}}};var setPaneMinMaxSizes=function(pane){var d=cDims,edge=c[pane].edge,dir=c[pane].dir,o=options[pane],s=state[pane],$P=$Ps[pane],$altPane=$Ps[altSide[pane]],paneSpacing=o.spacing_open,altPaneSpacing=options[altSide[pane]].spacing_open,altPaneSize=(!$altPane?0:(dir=="horz"?$altPane.outerHeight():$altPane.outerWidth())),containerSize=(dir=="horz"?d.innerHeight:d.innerWidth),limitSize=containerSize-paneSpacing-altPaneSize-altPaneSpacing,minSize=s.minSize||0,maxSize=Math.min(s.maxSize||9999,limitSize),minPos,maxPos;switch(pane){case"north":minPos=d.offsetTop+minSize;maxPos=d.offsetTop+maxSize;break;case"west":minPos=d.offsetLeft+minSize;maxPos=d.offsetLeft+maxSize;break;case"south":minPos=d.offsetTop+d.innerHeight-maxSize;maxPos=d.offsetTop+d.innerHeight-minSize;break;case"east":minPos=d.offsetLeft+d.innerWidth-maxSize;maxPos=d.offsetLeft+d.innerWidth-minSize;break}$.extend(s,{minSize:minSize,maxSize:maxSize,minPosition:minPos,maxPosition:maxPos})};var getPaneDims=function(){var d={top:getPaneSize("north",true),bottom:getPaneSize("south",true),left:getPaneSize("west",true),right:getPaneSize("east",true),width:0,height:0};with(d){width=cDims.innerWidth-left-right;height=cDims.innerHeight-bottom-top;top+=cDims.top;bottom+=cDims.bottom;left+=cDims.left;right+=cDims.right}return d};var getElemDims=function($E){var d={},e,b,p;$.each("Left,Right,Top,Bottom".split(","),function(){e=str(this);b=d["border"+e]=cssNum($E,"border"+e+"Width");p=d["padding"+e]=cssNum($E,"padding"+e);d["offset"+e]=b+p;if($E==$Container){d[e.toLowerCase()]=($.boxModel?p:0)}});d.innerWidth=d.outerWidth=$E.outerWidth();d.innerHeight=d.outerHeight=$E.outerHeight();if($.boxModel){d.innerWidth-=(d.offsetLeft+d.offsetRight);d.innerHeight-=(d.offsetTop+d.offsetBottom)}return d};var setTimer=function(pane,action,fn,ms){var Layout=window.layout=window.layout||{},Timers=Layout.timers=Layout.timers||{},name="layout_"+state.id+"_"+pane+"_"+action;if(Timers[name]){return}else{Timers[name]=setTimeout(fn,ms)}};var clearTimer=function(pane,action){var Layout=window.layout=window.layout||{},Timers=Layout.timers=Layout.timers||{},name="layout_"+state.id+"_"+pane+"_"+action;if(Timers[name]){clearTimeout(Timers[name]);delete Timers[name];return true}else{return false}};var create=function(){initOptions();initContainer();initPanes();initHandles();initResizable();sizeContent("all");if(options.scrollToBookmarkOnLoad){with(self.location){if(hash){replace(hash)}}}initHotkeys();$(window).resize(function(){var timerID="timerLayout_"+state.id;if(window[timerID]){clearTimeout(window[timerID])}window[timerID]=null;if(true||$.browser.msie){window[timerID]=setTimeout(resizeAll,100)}else{resizeAll()}})};var initContainer=function(){try{if($Container[0].tagName=="BODY"){$("html").css({height:"100%",overflow:"hidden"});$("body").css({position:"relative",height:"100%",overflow:"hidden",margin:0,padding:0,border:"none"})}else{var CSS={overflow:"hidden"},p=$Container.css("position"),h=$Container.css("height");if(!$Container.hasClass("ui-layout-pane")){if(!p||"fixed,absolute,relative".indexOf(p)<0){CSS.position="relative"}if(!h||h=="auto"){CSS.height="100%"}}$Container.css(CSS)}}catch(ex){}cDims=state.container=getElemDims($Container)};var initHotkeys=function(){$.each(c.borderPanes.split(","),function(i,pane){var o=options[pane];if(o.enableCursorHotkey||o.customHotkey){$(document).keydown(keyDown);return false}})};var initOptions=function(){opts=transformData(opts);if(opts.effects){$.extend(effects,opts.effects);delete opts.effects}$.each("name,scrollToBookmarkOnLoad".split(","),function(idx,key){if(opts[key]!==undefined){options[key]=opts[key]}else{if(opts.defaults[key]!==undefined){options[key]=opts.defaults[key];delete opts.defaults[key]}}});$.each("paneSelector,resizerCursor,customHotkey".split(","),function(idx,key){delete opts.defaults[key]});$.extend(options.defaults,opts.defaults);c.center=$.extend(true,{},c.defaults,c.center);$.extend(options.center,opts.center);var o_Center=$.extend(true,{},options.defaults,opts.defaults,options.center);$.each("paneClass,contentSelector,contentIgnoreSelector,applyDefaultStyles,showOverflowOnHover".split(","),function(idx,key){options.center[key]=o_Center[key]});var defs=options.defaults;$.each(c.borderPanes.split(","),function(i,pane){c[pane]=$.extend(true,{},c.defaults,c[pane]);o=options[pane]=$.extend(true,{},options.defaults,options[pane],opts.defaults,opts[pane]);if(!o.paneClass){o.paneClass=defaults.paneClass}if(!o.resizerClass){o.resizerClass=defaults.resizerClass}if(!o.togglerClass){o.togglerClass=defaults.togglerClass}$.each(["_open","_close",""],function(i,n){var sName="fxName"+n,sSpeed="fxSpeed"+n,sSettings="fxSettings"+n;o[sName]=opts[pane][sName]||opts[pane].fxName||opts.defaults[sName]||opts.defaults.fxName||o[sName]||o.fxName||defs[sName]||defs.fxName||"none";var fxName=o[sName];if(fxName=="none"||!$.effects||!$.effects[fxName]||(!effects[fxName]&&!o[sSettings]&&!o.fxSettings)){fxName=o[sName]="none"}var fx=effects[fxName]||{},fx_all=fx.all||{},fx_pane=fx[pane]||{};o[sSettings]=$.extend({},fx_all,fx_pane,defs.fxSettings||{},defs[sSettings]||{},o.fxSettings,o[sSettings],opts.defaults.fxSettings,opts.defaults[sSettings]||{},opts[pane].fxSettings,opts[pane][sSettings]||{});o[sSpeed]=opts[pane][sSpeed]||opts[pane].fxSpeed||opts.defaults[sSpeed]||opts.defaults.fxSpeed||o[sSpeed]||o[sSettings].duration||o.fxSpeed||o.fxSettings.duration||defs.fxSpeed||defs.fxSettings.duration||fx_pane.duration||fx_all.duration||"normal"})})};var initPanes=function(){$.each(c.allPanes.split(","),function(){var pane=str(this),o=options[pane],s=state[pane],fx=s.fx,dir=c[pane].dir,size=o.size=="auto"||isNaN(o.size)?0:o.size,minSize=o.minSize||1,maxSize=o.maxSize||9999,spacing=o.spacing_open||0,sel=o.paneSelector,isIE6=($.browser.msie&&$.browser.version<7),CSS={},$P,$C;$Cs[pane]=false;if(sel.substr(0,1)==="#"){$P=$Ps[pane]=$Container.find(sel+":first")}else{$P=$Ps[pane]=$Container.children(sel+":first");if(!$P.length){$P=$Ps[pane]=$Container.children("form:first").children(sel+":first")}}if(!$P.length){$Ps[pane]=false;return true}$P.attr("pane",pane).addClass(o.paneClass+" "+o.paneClass+"-"+pane);if(pane!="center"){s.isClosed=false;s.isSliding=false;s.isResizing=false;s.isHidden=false;s.noRoom=false;c[pane].pins=[]}CSS=$.extend({visibility:"visible",display:"block"},c.defaults.cssReq,c[pane].cssReq);if(o.applyDefaultStyles){$.extend(CSS,c.defaults.cssDef,c[pane].cssDef)}$P.css(CSS);CSS={};switch(pane){case"north":CSS.top=cDims.top;CSS.left=cDims.left;CSS.right=cDims.right;break;case"south":CSS.bottom=cDims.bottom;CSS.left=cDims.left;CSS.right=cDims.right;break;case"west":CSS.left=cDims.left;break;case"east":CSS.right=cDims.right;break;case"center":}if(dir=="horz"){if(size===0||size=="auto"){$P.css({height:"auto"});size=$P.outerHeight()}size=max(size,minSize);size=min(size,maxSize);size=min(size,cDims.innerHeight-spacing);CSS.height=max(1,cssH(pane,size));s.size=size;s.maxSize=maxSize;s.minSize=max(minSize,size-CSS.height+1);$P.css(CSS)}else{if(dir=="vert"){if(size===0||size=="auto"){$P.css({width:"auto","float":"left"});size=$P.outerWidth();$P.css({"float":"none"})}size=max(size,minSize);size=min(size,maxSize);size=min(size,cDims.innerWidth-spacing);CSS.width=max(1,cssW(pane,size));s.size=size;s.maxSize=maxSize;s.minSize=max(minSize,size-CSS.width+1);$P.css(CSS);sizeMidPanes(pane,null,true)}else{if(pane=="center"){$P.css(CSS);sizeMidPanes("center",null,true)}}}if(o.initClosed&&o.closable){$P.hide().addClass("closed");s.isClosed=true}else{if(o.initHidden||o.initClosed){hide(pane,true);s.isHidden=true}else{$P.addClass("open")}}if(o.showOverflowOnHover){$P.hover(allowOverflow,resetOverflow)}if(o.contentSelector){$C=$Cs[pane]=$P.children(o.contentSelector+":first");if(!$C.length){$Cs[pane]=false;return true}$C.css(c.content.cssReq);if(o.applyDefaultStyles){$C.css(c.content.cssDef)}$P.css({overflow:"hidden"})}})};var initHandles=function(){$.each(c.borderPanes.split(","),function(){var pane=str(this),o=options[pane],s=state[pane],rClass=o.resizerClass,tClass=o.togglerClass,$P=$Ps[pane];$Rs[pane]=false;$Ts[pane]=false;if(!$P||(!o.closable&&!o.resizable)){return}var edge=c[pane].edge,isOpen=$P.is(":visible"),spacing=(isOpen?o.spacing_open:o.spacing_closed),_pane="-"+pane,_state=(isOpen?"-open":"-closed"),$R,$T;$R=$Rs[pane]=$("<span></span>");if(isOpen&&o.resizable){}else{if(!isOpen&&o.slidable){$R.attr("title",o.sliderTip).css("cursor",o.sliderCursor)}}$R.attr("id",(o.paneSelector.substr(0,1)=="#"?o.paneSelector.substr(1)+"-resizer":"")).attr("resizer",pane).css(c.resizers.cssReq).css(edge,cDims[edge]+getPaneSize(pane)).addClass(rClass+" "+rClass+_pane+" "+rClass+_state+" "+rClass+_pane+_state).appendTo($Container);if(o.applyDefaultStyles){$R.css(c.resizers.cssDef)}if(o.closable){$T=$Ts[pane]=$("<div></div>");$T.attr("id",(o.paneSelector.substr(0,1)=="#"?o.paneSelector.substr(1)+"-toggler":"")).css(c.togglers.cssReq).attr("title",(isOpen?o.togglerTip_open:o.togglerTip_closed)).click(function(evt){toggle(pane);evt.stopPropagation()}).mouseover(function(evt){evt.stopPropagation()}).addClass(tClass+" "+tClass+_pane+" "+tClass+_state+" "+tClass+_pane+_state).appendTo($R);if(o.togglerContent_open){$("<span>"+o.togglerContent_open+"</span>").addClass("content content-open").css("display",s.isClosed?"none":"block").appendTo($T)}if(o.togglerContent_closed){$("<span>"+o.togglerContent_closed+"</span>").addClass("content content-closed").css("display",s.isClosed?"block":"none").appendTo($T)}if(o.applyDefaultStyles){$T.css(c.togglers.cssDef)}if(!isOpen){bindStartSlidingEvent(pane,true)}}});sizeHandles("all",true)};var initResizable=function(){var draggingAvailable=(typeof $.fn.draggable=="function"),minPosition,maxPosition,edge;$.each(c.borderPanes.split(","),function(){var pane=str(this),o=options[pane],s=state[pane];if(!draggingAvailable||!$Ps[pane]||!o.resizable){o.resizable=false;return true}var rClass=o.resizerClass,dragClass=rClass+"-drag",dragPaneClass=rClass+"-"+pane+"-drag",draggingClass=rClass+"-dragging",draggingPaneClass=rClass+"-"+pane+"-dragging",draggingClassSet=false,$P=$Ps[pane],$R=$Rs[pane];if(!s.isClosed){$R.attr("title",o.resizerTip).css("cursor",o.resizerCursor)}$R.draggable({containment:$Container[0],axis:(c[pane].dir=="horz"?"y":"x"),delay:200,distance:1,helper:"clone",opacity:o.resizerDragOpacity,zIndex:c.zIndex.resizing,start:function(e,ui){if(false===execUserCallback(pane,o.onresize_start)){return false}s.isResizing=true;clearTimer(pane,"closeSlider");$R.addClass(dragClass+" "+dragPaneClass);draggingClassSet=false;var resizerWidth=(pane=="east"||pane=="south"?o.spacing_open:0);setPaneMinMaxSizes(pane);s.minPosition-=resizerWidth;s.maxPosition-=resizerWidth;edge=(c[pane].dir=="horz"?"top":"left");$(o.maskIframesOnResize===true?"iframe":o.maskIframesOnResize).each(function(){$('<div class="ui-layout-mask"/>').css({background:"#fff",opacity:"0.001",zIndex:9,position:"absolute",width:this.offsetWidth+"px",height:this.offsetHeight+"px"}).css($(this).offset()).appendTo(this.parentNode)})},drag:function(e,ui){if(!draggingClassSet){$(".ui-draggable-dragging").addClass(draggingClass+" "+draggingPaneClass).children().css("visibility","hidden");draggingClassSet=true;if(s.isSliding){$Ps[pane].css("zIndex",c.zIndex.sliding)}}if(ui.position[edge]<s.minPosition){ui.position[edge]=s.minPosition}else{if(ui.position[edge]>s.maxPosition){ui.position[edge]=s.maxPosition}}},stop:function(e,ui){var dragPos=ui.position,resizerPos,newSize;$R.removeClass(dragClass+" "+dragPaneClass);switch(pane){case"north":resizerPos=dragPos.top;break;case"west":resizerPos=dragPos.left;break;case"south":resizerPos=cDims.outerHeight-dragPos.top-$R.outerHeight();break;case"east":resizerPos=cDims.outerWidth-dragPos.left-$R.outerWidth();break}newSize=resizerPos-cDims[c[pane].edge];sizePane(pane,newSize);$("div.ui-layout-mask").remove();s.isResizing=false}})})};var hide=function(pane,onInit){var o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane];if(!$P||s.isHidden){return}if(false===execUserCallback(pane,o.onhide_start)){return}s.isSliding=false;if($R){$R.hide()}if(onInit||s.isClosed){s.isClosed=true;s.isHidden=true;$P.hide();sizeMidPanes(c[pane].dir=="horz"?"all":"center");execUserCallback(pane,o.onhide_end||o.onhide)}else{s.isHiding=true;close(pane,false)}};var show=function(pane,openPane){var o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane];if(!$P||!s.isHidden){return}if(false===execUserCallback(pane,o.onshow_start)){return}s.isSliding=false;s.isShowing=true;if($R&&o.spacing_open>0){$R.show()}if(openPane===false){close(pane,true)}else{open(pane)}};var toggle=function(pane){var s=state[pane];if(s.isHidden){show(pane)}else{if(s.isClosed){open(pane)}else{close(pane)}}};var close=function(pane,force,noAnimation){var $P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane],o=options[pane],s=state[pane],doFX=!noAnimation&&!s.isClosed&&(o.fxName_close!="none"),edge=c[pane].edge,rClass=o.resizerClass,tClass=o.togglerClass,_pane="-"+pane,_open="-open",_sliding="-sliding",_closed="-closed",isShowing=s.isShowing,isHiding=s.isHiding;delete s.isShowing;delete s.isHiding;if(!$P||(!o.resizable&&!o.closable)){return}else{if(!force&&s.isClosed&&!isShowing){return}}if(c.isLayoutBusy){setFlowCallback("close",pane,force);return}if(!isShowing&&false===execUserCallback(pane,o.onclose_start)){return}c[pane].isMoving=true;c.isLayoutBusy=true;s.isClosed=true;if(isHiding){s.isHidden=true}else{if(isShowing){s.isHidden=false}}syncPinBtns(pane,false);if(!s.isSliding){sizeMidPanes(c[pane].dir=="horz"?"all":"center")}if($R){$R.css(edge,cDims[edge]).removeClass(rClass+_open+" "+rClass+_pane+_open).removeClass(rClass+_sliding+" "+rClass+_pane+_sliding).addClass(rClass+_closed+" "+rClass+_pane+_closed);if(o.resizable){$R.draggable("disable").css("cursor","default").attr("title","")}if($T){$T.removeClass(tClass+_open+" "+tClass+_pane+_open).addClass(tClass+_closed+" "+tClass+_pane+_closed).attr("title",o.togglerTip_closed)}sizeHandles()}if(doFX){lockPaneForFX(pane,true);$P.hide(o.fxName_close,o.fxSettings_close,o.fxSpeed_close,function(){lockPaneForFX(pane,false);if(!s.isClosed){return}close_2()})}else{$P.hide();close_2()}function close_2(){bindStartSlidingEvent(pane,true);if(!isShowing){execUserCallback(pane,o.onclose_end||o.onclose)}if(isShowing){execUserCallback(pane,o.onshow_end||o.onshow)}if(isHiding){execUserCallback(pane,o.onhide_end||o.onhide)}execFlowCallback(pane)}};var open=function(pane,slide,noAnimation){var $P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane],o=options[pane],s=state[pane],doFX=!noAnimation&&s.isClosed&&(o.fxName_open!="none"),edge=c[pane].edge,rClass=o.resizerClass,tClass=o.togglerClass,_pane="-"+pane,_open="-open",_closed="-closed",_sliding="-sliding",isShowing=s.isShowing;delete s.isShowing;if(!$P||(!o.resizable&&!o.closable)){return}else{if(!s.isClosed&&!s.isSliding){return}}if(s.isHidden&&!isShowing){show(pane,true);return}if(c.isLayoutBusy){setFlowCallback("open",pane,slide);return}if(false===execUserCallback(pane,o.onopen_start)){return}c[pane].isMoving=true;c.isLayoutBusy=true;if(s.isSliding&&!slide){bindStopSlidingEvents(pane,false)}s.isClosed=false;if(isShowing){s.isHidden=false}setPaneMinMaxSizes(pane);if(s.size>s.maxSize){$P.css(c[pane].sizeType,max(1,cssSize(pane,s.maxSize)))}bindStartSlidingEvent(pane,false);if(doFX){lockPaneForFX(pane,true);$P.show(o.fxName_open,o.fxSettings_open,o.fxSpeed_open,function(){lockPaneForFX(pane,false);if(s.isClosed){return}open_2()})}else{$P.show();open_2()}function open_2(){if(!s.isSliding){sizeMidPanes(c[pane].dir=="vert"?"center":"all")}if($R){$R.css(edge,cDims[edge]+getPaneSize(pane)).removeClass(rClass+_closed+" "+rClass+_pane+_closed).addClass(rClass+_open+" "+rClass+_pane+_open).addClass(!s.isSliding?"":rClass+_sliding+" "+rClass+_pane+_sliding);if(o.resizable){$R.draggable("enable").css("cursor",o.resizerCursor).attr("title",o.resizerTip)}else{$R.css("cursor","default")}if($T){$T.removeClass(tClass+_closed+" "+tClass+_pane+_closed).addClass(tClass+_open+" "+tClass+_pane+_open).attr("title",o.togglerTip_open)}sizeHandles("all")}sizeContent(pane);syncPinBtns(pane,!s.isSliding);execUserCallback(pane,o.onopen_end||o.onopen);if(isShowing){execUserCallback(pane,o.onshow_end||o.onshow)}execFlowCallback(pane)}};var lockPaneForFX=function(pane,doLock){var $P=$Ps[pane];if(doLock){$P.css({zIndex:c.zIndex.animation});if(pane=="south"){$P.css({top:cDims.top+cDims.innerHeight-$P.outerHeight()})}else{if(pane=="east"){$P.css({left:cDims.left+cDims.innerWidth-$P.outerWidth()})}}}else{if(!state[pane].isSliding){$P.css({zIndex:c.zIndex.pane_normal})}if(pane=="south"){$P.css({top:"auto"})}else{if(pane=="east"){$P.css({left:"auto"})}}}};var bindStartSlidingEvent=function(pane,enable){var o=options[pane],$R=$Rs[pane],trigger=o.slideTrigger_open;if(!$R||!o.slidable){return}if(trigger!="click"&&trigger!="dblclick"&&trigger!="mouseover"){trigger="click"}$R[enable?"bind":"unbind"](trigger,slideOpen).css("cursor",(enable?o.sliderCursor:"default")).attr("title",(enable?o.sliderTip:""))};var bindStopSlidingEvents=function(pane,enable){var o=options[pane],s=state[pane],trigger=o.slideTrigger_close,action=(enable?"bind":"unbind"),$P=$Ps[pane],$R=$Rs[pane];s.isSliding=enable;clearTimer(pane,"closeSlider");$P.css({zIndex:(enable?c.zIndex.sliding:c.zIndex.pane_normal)});$R.css({zIndex:(enable?c.zIndex.sliding:c.zIndex.resizer_normal)});if(trigger!="click"&&trigger!="mouseout"){trigger="mouseout"}if(enable){$P.bind(trigger,slideClosed);$R.bind(trigger,slideClosed);if(trigger="mouseout"){$P.bind("mouseover",cancelMouseOut);$R.bind("mouseover",cancelMouseOut)}}else{$P.unbind(trigger);$R.unbind(trigger);if(trigger="mouseout"){$P.unbind("mouseover");$R.unbind("mouseover");clearTimer(pane,"closeSlider")}}function cancelMouseOut(evt){clearTimer(pane,"closeSlider");evt.stopPropagation()}};var slideOpen=function(){var pane=$(this).attr("resizer");if(state[pane].isClosed){bindStopSlidingEvents(pane,true);open(pane,true)}};var slideClosed=function(){var $E=$(this),pane=$E.attr("pane")||$E.attr("resizer"),o=options[pane],s=state[pane];if(s.isClosed||s.isResizing){return}else{if(o.slideTrigger_close=="click"){close_NOW()}else{setTimer(pane,"closeSlider",close_NOW,300)}}function close_NOW(){bindStopSlidingEvents(pane,false);if(!s.isClosed){close(pane)}}};var sizePane=function(pane,size){var edge=c[pane].edge,dir=c[pane].dir,o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane];setPaneMinMaxSizes(pane);s.minSize=max(s.minSize,o.minSize);if(o.maxSize>0){s.maxSize=min(s.maxSize,o.maxSize)}size=max(size,s.minSize);size=min(size,s.maxSize);s.size=size;$R.css(edge,size+cDims[edge]);$P.css(c[pane].sizeType,max(1,cssSize(pane,size)));if(!s.isSliding){sizeMidPanes(dir=="horz"?"all":"center")}sizeHandles();sizeContent(pane);execUserCallback(pane,o.onresize_end||o.onresize)};var sizeMidPanes=function(panes,overrideDims,onInit){if(!panes||panes=="all"){panes="east,west,center"}var d=getPaneDims();if(overrideDims){$.extend(d,overrideDims)}$.each(panes.split(","),function(){if(!$Ps[this]){return}var pane=str(this),o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane],hasRoom=true,CSS={};if(pane=="center"){d=getPaneDims();CSS=$.extend({},d);CSS.width=max(1,cssW(pane,CSS.width));CSS.height=max(1,cssH(pane,CSS.height));hasRoom=(CSS.width>1&&CSS.height>1);if($.browser.msie&&(!$.boxModel||$.browser.version<7)){if($Ps.north){$Ps.north.css({width:cssW($Ps.north,cDims.innerWidth)})}if($Ps.south){$Ps.south.css({width:cssW($Ps.south,cDims.innerWidth)})}}}else{CSS.top=d.top;CSS.bottom=d.bottom;CSS.height=max(1,cssH(pane,d.height));hasRoom=(CSS.height>1)}if(hasRoom){$P.css(CSS);if(s.noRoom){s.noRoom=false;if(s.isHidden){return}else{show(pane,!s.isClosed)}}if(!onInit){sizeContent(pane);execUserCallback(pane,o.onresize_end||o.onresize)}}else{if(!s.noRoom){s.noRoom=true;if(s.isHidden){return}if(onInit){$P.hide();if($R){$R.hide()}}else{hide(pane)}}}})};var sizeContent=function(panes){if(!panes||panes=="all"){panes=c.allPanes}$.each(panes.split(","),function(){if(!$Cs[this]){return}var pane=str(this),ignore=options[pane].contentIgnoreSelector,$P=$Ps[pane],$C=$Cs[pane],e_C=$C[0],height=cssH($P);$P.children().each(function(){if(this==e_C){return}var $E=$(this);if(!ignore||!$E.is(ignore)){height-=$E.outerHeight()}});if(height>0){height=cssH($C,height)}if(height<1){$C.hide()}else{$C.css({height:height}).show()}})};var sizeHandles=function(panes,onInit){if(!panes||panes=="all"){panes=c.borderPanes}$.each(panes.split(","),function(){var pane=str(this),o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane];if(!$P||!$R||(!o.resizable&&!o.closable)){return}var dir=c[pane].dir,_state=(s.isClosed?"_closed":"_open"),spacing=o["spacing"+_state],togAlign=o["togglerAlign"+_state],togLen=o["togglerLength"+_state],paneLen,offset,CSS={};if(spacing==0){$R.hide();return}else{if(!s.noRoom&&!s.isHidden){$R.show()}}if(dir=="horz"){paneLen=$P.outerWidth();$R.css({width:max(1,cssW($R,paneLen)),height:max(1,cssH($R,spacing)),left:cssNum($P,"left")})}else{paneLen=$P.outerHeight();$R.css({height:max(1,cssH($R,paneLen)),width:max(1,cssW($R,spacing)),top:cDims.top+getPaneSize("north",true)})}if($T){if(togLen==0||(s.isSliding&&o.hideTogglerOnSlide)){$T.hide();return}else{$T.show()}if(!(togLen>0)||togLen=="100%"||togLen>paneLen){togLen=paneLen;offset=0}else{if(typeof togAlign=="string"){switch(togAlign){case"top":case"left":offset=0;break;case"bottom":case"right":offset=paneLen-togLen;break;case"middle":case"center":default:offset=Math.floor((paneLen-togLen)/2)}}else{var x=parseInt(togAlign);if(togAlign>=0){offset=x}else{offset=paneLen-togLen+x}}}var $TC_o=(o.togglerContent_open?$T.children(".content-open"):false),$TC_c=(o.togglerContent_closed?$T.children(".content-closed"):false),$TC=(s.isClosed?$TC_c:$TC_o);if($TC_o){$TC_o.css("display",s.isClosed?"none":"block")}if($TC_c){$TC_c.css("display",s.isClosed?"block":"none")}if(dir=="horz"){var width=cssW($T,togLen);$T.css({width:max(0,width),height:max(1,cssH($T,spacing)),left:offset});if($TC){$TC.css("marginLeft",Math.floor((width-$TC.outerWidth())/2))}}else{var height=cssH($T,togLen);$T.css({height:max(0,height),width:max(1,cssW($T,spacing)),top:offset});if($TC){$TC.css("marginTop",Math.floor((height-$TC.outerHeight())/2))}}}if(onInit&&o.initHidden){$R.hide();if($T){$T.hide()}}})};var resizeAll=function(){var oldW=cDims.innerWidth,oldH=cDims.innerHeight;cDims=state.container=getElemDims($Container);var checkH=(cDims.innerHeight<oldH),checkW=(cDims.innerWidth<oldW),s,dir;if(checkH||checkW){$.each(["south","north","east","west"],function(i,pane){s=state[pane];dir=c[pane].dir;if(!s.isClosed&&((checkH&&dir=="horz")||(checkW&&dir=="vert"))){setPaneMinMaxSizes(pane);if(s.size>s.maxSize){sizePane(pane,s.maxSize)}}})}sizeMidPanes("all");sizeHandles("all")};function keyDown(evt){if(!evt){return true}var code=evt.keyCode;if(code<33){return true}var PANE={38:"north",40:"south",37:"west",39:"east"},isCursorKey=(code>=37&&code<=40),ALT=evt.altKey,SHIFT=evt.shiftKey,CTRL=evt.ctrlKey,pane=false,s,o,k,m,el;if(!CTRL&&!SHIFT){return true}else{if(isCursorKey&&options[PANE[code]].enableCursorHotkey){pane=PANE[code]}else{$.each(c.borderPanes.split(","),function(i,p){o=options[p];k=o.customHotkey;m=o.customHotkeyModifier;if((SHIFT&&m=="SHIFT")||(CTRL&&m=="CTRL")||(CTRL&&SHIFT)){if(k&&code==(isNaN(k)||k<=9?k.toUpperCase().charCodeAt(0):k)){pane=p;return false}}})}}if(!pane){return true}o=options[pane];s=state[pane];if(!o.enableCursorHotkey||s.isHidden||!$Ps[pane]){return true}el=evt.target||evt.srcElement;if(el&&SHIFT&&isCursorKey&&(el.tagName=="TEXTAREA"||(el.tagName=="INPUT"&&(code==37||code==39)))){return true}toggle(pane);evt.stopPropagation();evt.returnValue=false;return false}function allowOverflow(elem){if(this&&this.tagName){elem=this}var $P;if(typeof elem=="string"){$P=$Ps[elem]}else{if($(elem).attr("pane")){$P=$(elem)}else{$P=$(elem).parents("div[pane]:first")}}if(!$P.length){return}var pane=$P.attr("pane"),s=state[pane];if(s.cssSaved){resetOverflow(pane)}if(s.isSliding||s.isResizing||s.isClosed){s.cssSaved=false;return}var newCSS={zIndex:(c.zIndex.pane_normal+1)},curCSS={},of=$P.css("overflow"),ofX=$P.css("overflowX"),ofY=$P.css("overflowY");if(of!="visible"){curCSS.overflow=of;newCSS.overflow="visible"}if(ofX&&ofX!="visible"&&ofX!="auto"){curCSS.overflowX=ofX;newCSS.overflowX="visible"}if(ofY&&ofY!="visible"&&ofY!="auto"){curCSS.overflowY=ofX;newCSS.overflowY="visible"}s.cssSaved=curCSS;$P.css(newCSS);$.each(c.allPanes.split(","),function(i,p){if(p!=pane){resetOverflow(p)}})}function resetOverflow(elem){if(this&&this.tagName){elem=this}var $P;if(typeof elem=="string"){$P=$Ps[elem]}else{if($(elem).hasClass("ui-layout-pane")){$P=$(elem)}else{$P=$(elem).parents("div[pane]:first")}}if(!$P.length){return}var pane=$P.attr("pane"),s=state[pane],CSS=s.cssSaved||{};if(!s.isSliding&&!s.isResizing){$P.css("zIndex",c.zIndex.pane_normal)}$P.css(CSS);s.cssSaved=false}function getBtn(selector,pane,action){var $E=$(selector),err="Error Adding Button \n\nInvalid ";if(!$E.length){alert(err+"selector: "+selector)}else{if(c.borderPanes.indexOf(pane)==-1){alert(err+"pane: "+pane)}else{var btn=options[pane].buttonClass+"-"+action;$E.addClass(btn+" "+btn+"-"+pane);return $E}}return false}function addToggleBtn(selector,pane){var $E=getBtn(selector,pane,"toggle");if($E){$E.attr("title",state[pane].isClosed?"Open":"Close").click(function(evt){toggle(pane);evt.stopPropagation()})}}function addOpenBtn(selector,pane){var $E=getBtn(selector,pane,"open");if($E){$E.attr("title","Open").click(function(evt){open(pane);evt.stopPropagation()})}}function addCloseBtn(selector,pane){var $E=getBtn(selector,pane,"close");if($E){$E.attr("title","Close").click(function(evt){close(pane);evt.stopPropagation()})}}function addPinBtn(selector,pane){var $E=getBtn(selector,pane,"pin");if($E){var s=state[pane];$E.click(function(evt){setPinState($(this),pane,(s.isSliding||s.isClosed));if(s.isSliding||s.isClosed){open(pane)}else{close(pane)}evt.stopPropagation()});setPinState($E,pane,(!s.isClosed&&!s.isSliding));c[pane].pins.push(selector)}}function syncPinBtns(pane,doPin){$.each(c[pane].pins,function(i,selector){setPinState($(selector),pane,doPin)})}function setPinState($Pin,pane,doPin){var updown=$Pin.attr("pin");if(updown&&doPin==(updown=="down")){return}var root=options[pane].buttonClass,class1=root+"-pin",class2=class1+"-"+pane,UP1=class1+"-up",UP2=class2+"-up",DN1=class1+"-down",DN2=class2+"-down";$Pin.attr("pin",doPin?"down":"up").attr("title",doPin?"Un-Pin":"Pin").removeClass(doPin?UP1:DN1).removeClass(doPin?UP2:DN2).addClass(doPin?DN1:UP1).addClass(doPin?DN2:UP2)}var $Container=$(this).css({overflow:"hidden"}),$Ps={},$Cs={},$Rs={},$Ts={},c=config,cDims=state.container;create();return{options:options,state:state,panes:$Ps,toggle:toggle,open:open,close:close,hide:hide,show:show,resizeContent:sizeContent,sizePane:sizePane,resizeAll:resizeAll,addToggleBtn:addToggleBtn,addOpenBtn:addOpenBtn,addCloseBtn:addCloseBtn,addPinBtn:addPinBtn,allowOverflow:allowOverflow,resetOverflow:resetOverflow,cssWidth:cssW,cssHeight:cssH}}})(jQuery);(function(E){var F="colorbox",s="hover",A=true,V=false,ab,n=!E.support.opacity,Y=n&&!window.XMLHttpRequest,v="cbox_open",j="cbox_load",u="cbox_complete",O="cbox_cleanup",q="cbox_closed",Q="resize.cbox_resize",K,Z,aa,U,C,k,X,p,W,R,I,g,f,B,l,M,P,m,L,t,ac,N,e,c,H,i,D,T,z,h,G={transition:"elastic",speed:350,width:V,height:V,innerWidth:V,innerHeight:V,initialWidth:"400",initialHeight:"400",maxWidth:V,maxHeight:V,scalePhotos:A,scrolling:A,inline:V,html:V,iframe:V,photo:V,href:V,title:V,rel:V,opacity:0.9,preloading:A,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:V,overlayClose:A,slideshow:V,slideshowAuto:A,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:V,onLoad:V,onComplete:V,onCleanup:V,onClosed:V};function J(ad,ae){ae=ae==="x"?R.width():R.height();return(typeof ad==="string")?Math.round((ad.match(/%/)?(ae/100)*parseInt(ad,10):parseInt(ad,10))):ad}function w(ad){ad=E.isFunction(ad)?ad.call(H):ad;return T.photo||ad.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function d(){for(var ad in T){if(E.isFunction(T[ad])&&ad.substring(0,2)!=="on"){T[ad]=T[ad].call(H)}}}function S(ae){H=ae;T=E(H).data(F);d();var ad=T.rel||H.rel;if(ad&&ad!=="nofollow"){W=E(".cboxElement").filter(function(){var af=E(this).data(F).rel||this.rel;return(af===ad)});D=W.index(H);if(D<0){W=W.add(H);D=W.length-1}}else{W=E(H);D=0}if(!z){z=A;h=A;i=H;i.blur();E().bind("keydown.cbox_close",function(af){if(af.keyCode===27){af.preventDefault();ab.close()}}).bind("keydown.cbox_arrows",function(af){if(W.length>1){if(af.keyCode===37){af.preventDefault();L.click()}else{if(af.keyCode===39){af.preventDefault();m.click()}}}});if(T.overlayClose){K.css({cursor:"pointer"}).one("click",ab.close)}E.event.trigger(v);if(T.onOpen){T.onOpen.call(H)}K.css({opacity:T.opacity}).show();T.w=J(T.initialWidth,"x");T.h=J(T.initialHeight,"y");ab.position(0);if(Y){R.bind("resize.cboxie6 scroll.cboxie6",function(){K.css({width:R.width(),height:R.height(),top:R.scrollTop(),left:R.scrollLeft()})}).trigger("scroll.cboxie6")}}M.add(L).add(m).add(P).add(l).hide();t.html(T.close).show();ab.slideshow();ab.load()}ab=E.fn.colorbox=function(ad,af){var ae=this;if(!ae.length){if(ae.selector===""){ae=E(ae).data(F,G);ad.open=A}else{return this}}ae.each(function(){var ag=E.extend({},E(this).data(F)?E(this).data(F):G,ad);E(this).data(F,ag).addClass("cboxElement");if(af){E(this).data(F).onComplete=af}});if(ad&&ad.open){S(ae)}return this};ab.init=function(){function ad(ae){return E('<div id="cbox'+ae+'"/>')}R=E(window);Z=E('<div id="colorbox"/>');K=ad("Overlay").hide();aa=ad("Wrapper");U=ad("Content").append(I=ad("LoadedContent").css({width:0,height:0}),f=ad("LoadingOverlay"),B=ad("LoadingGraphic").css({background:"url(/scripts/colorbox/loading.gif) center center no-repeat"}),l=ad("Title"),M=ad("Current"),P=ad("Slideshow"),m=ad("Next").css({background:"url(/scripts/colorbox/controls.png) top right no-repeat"}),L=ad("Previous").css({background:"url(/scripts/colorbox/controls.png) top left no-repeat"}),t=ad("Close").css({background:"url(/scripts/colorbox/controls.png) top center no-repeat"}));aa.append(E("<div/>").append(ad("TopLeft"),C=ad("TopCenter"),ad("TopRight")),E("<div/>").append(k=ad("MiddleLeft"),U,X=ad("MiddleRight")),E("<div/>").append(ad("BottomLeft"),p=ad("BottomCenter"),ad("BottomRight"))).children().children().css({"float":"left"});g=E("<div style='position:absolute; top:0; left:0; width:9999px; height:0;'/>");E("body").prepend(K,Z.append(aa,g));if(n){Z.addClass("cboxIE");if(Y){K.css("position","absolute")}}U.children().bind("mouseover mouseout",function(){E(this).toggleClass(s)}).addClass(s);ac=C.height()+p.height()+U.outerHeight(A)-U.height();N=k.width()+X.width()+U.outerWidth(A)-U.width();e=I.outerHeight(A);c=I.outerWidth(A);Z.css({"padding-bottom":ac,"padding-right":N}).hide();m.click(ab.next);L.click(ab.prev);t.click(ab.close);U.children().removeClass(s);E(".cboxElement").live("click",function(ae){if(ae.button!==0&&typeof ae.button!=="undefined"){return A}else{S(this);return V}})};ab.position=function(ai,af){var ae,ag=R.height(),ad=Math.max(ag-T.h-e-ac,0)/2+R.scrollTop(),ah=Math.max(document.documentElement.clientWidth-T.w-c-N,0)/2+R.scrollLeft();ae=(Z.width()===T.w+c&&Z.height()===T.h+e)?0:ai;aa[0].style.width=aa[0].style.height="9999px";function aj(ak){C[0].style.width=p[0].style.width=U[0].style.width=ak.style.width;B[0].style.height=f[0].style.height=U[0].style.height=k[0].style.height=X[0].style.height=ak.style.height}Z.dequeue().animate({width:T.w+c,height:T.h+e,top:ad,left:ah},{duration:ae,complete:function(){aj(this);h=V;aa[0].style.width=(T.w+c+N)+"px";aa[0].style.height=(T.h+e+ac)+"px";if(af){af()}},step:function(){aj(this)}})};ab.resize=function(ah){if(!z){return}var af,ag,ak,aj,an,ad,ao,ae=T.transition==="none"?0:T.speed;R.unbind(Q);if(!ah){ao=setTimeout(function(){var ap=I.wrapInner("<div style='overflow:auto'></div>").children();T.h=ap.height();I.css({height:T.h});ap.replaceWith(ap.children());ab.position(ae)},1);return}I.remove();I=E('<div id="cboxLoadedContent"/>').html(ah);function al(){T.w=T.w||I.width();T.w=T.mw&&T.mw<T.w?T.mw:T.w;return T.w}function ai(){T.h=T.h||I.height();T.h=T.mh&&T.mh<T.h?T.mh:T.h;return T.h}I.hide().appendTo(g).css({width:al(),overflow:T.scrolling?"auto":"hidden"}).css({height:ai()}).prependTo(U);E("#cboxPhoto").css({cssFloat:"none"});if(Y){E("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(O,function(){this.style.visibility="inherit"})}function am(ap){ab.position(ap,function(){if(!z){return}if(n){if(ad){I.fadeIn(100)}Z[0].style.removeAttribute("filter")}if(T.iframe){I.append("<iframe id='cboxIframe'"+(T.scrolling?" ":"scrolling='no'")+" name='iframe_"+new Date().getTime()+"' frameborder=0 src='"+(T.href||H.href)+"' "+(n?"allowtransparency='true'":"")+" />")}I.show();l.html(T.title||H.title);l.show();if(W.length>1){M.html(T.current.replace(/\{current\}/,D+1).replace(/\{total\}/,W.length)).show();m.html(T.next).show();L.html(T.previous).show();if(T.slideshow){P.show()}}f.hide();B.hide();E.event.trigger(u);if(T.onComplete){T.onComplete.call(H)}if(T.transition==="fade"){Z.fadeTo(ae,1,function(){if(n){Z[0].style.removeAttribute("filter")}})}R.bind(Q,function(){ab.position(0)})})}if((T.transition==="fade"&&Z.fadeTo(ae,0,function(){am(0)}))||am(ae)){}if(T.preloading&&W.length>1){ag=D>0?W[D-1]:W[W.length-1];aj=D<W.length-1?W[D+1]:W[0];an=E(aj).data(F).href||aj.href;ak=E(ag).data(F).href||ag.href;if(w(an)){E("<img />").attr("src",an)}if(w(ak)){E("<img />").attr("src",ak)}}};ab.load=function(){var ae,ad,ag,af=ab.resize;h=A;H=W[D];T=E(H).data(F);d();E.event.trigger(j);if(T.onLoad){T.onLoad.call(H)}T.h=T.height?J(T.height,"y")-e-ac:T.innerHeight?J(T.innerHeight,"y"):V;T.w=T.width?J(T.width,"x")-c-N:T.innerWidth?J(T.innerWidth,"x"):V;T.mw=T.w;T.mh=T.h;if(T.maxWidth){T.mw=J(T.maxWidth,"x")-c-N;T.mw=T.w&&T.w<T.mw?T.w:T.mw}if(T.maxHeight){T.mh=J(T.maxHeight,"y")-e-ac;T.mh=T.h&&T.h<T.mh?T.h:T.mh}ae=T.href||E(H).attr("href");f.show();B.show();if(T.inline){E('<div id="cboxInlineTemp" />').hide().insertBefore(E(ae)[0]).bind(j+" "+O,function(){E(this).replaceWith(I.children())});af(E(ae))}else{if(T.iframe){af(" ")}else{if(T.html){af(T.html)}else{if(w(ae)){ad=new Image();ad.onload=function(){var ah;ad.onload=null;ad.id="cboxPhoto";E(ad).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(T.scalePhotos){ag=function(){ad.height-=ad.height*ah;ad.width-=ad.width*ah};if(T.mw&&ad.width>T.mw){ah=(ad.width-T.mw)/ad.width;ag()}if(T.mh&&ad.height>T.mh){ah=(ad.height-T.mh)/ad.height;ag()}}if(T.h){ad.style.marginTop=Math.max(T.h-ad.height,0)/2+"px"}af(ad);if(W.length>1){E(ad).css({cursor:"pointer"}).click(ab.next)}if(n){ad.style.msInterpolationMode="bicubic"}};ad.src=ae}else{E("<div />").appendTo(g).load(ae,function(ah,ai){if(ai==="success"){af(this)}else{af(E("<p>Request unsuccessful.</p>"))}})}}}}};ab.next=function(){if(!h){D=D<W.length-1?D+1:0;ab.load()}};ab.prev=function(){if(!h){D=D>0?D-1:W.length-1;ab.load()}};ab.slideshow=function(){var af,ae,ad="cboxSlideshow_";P.bind(q,function(){P.unbind();clearTimeout(ae);Z.removeClass(ad+"off "+ad+"on")});function ag(){P.text(T.slideshowStop).bind(u,function(){ae=setTimeout(ab.next,T.slideshowSpeed)}).bind(j,function(){clearTimeout(ae)}).one("click",function(){af();E(this).removeClass(s)});Z.removeClass(ad+"off").addClass(ad+"on")}af=function(){clearTimeout(ae);P.text(T.slideshowStart).unbind(u+" "+j).one("click",function(){ag();ae=setTimeout(ab.next,T.slideshowSpeed);E(this).removeClass(s)});Z.removeClass(ad+"on").addClass(ad+"off")};if(T.slideshow&&W.length>1){if(T.slideshowAuto){ag()}else{af()}}};ab.close=function(){E.event.trigger(O);if(T.onCleanup){T.onCleanup.call(H)}z=V;E().unbind("keydown.cbox_close keydown.cbox_arrows");R.unbind(Q+" resize.cboxie6 scroll.cboxie6");K.css({cursor:"auto"}).fadeOut("fast");Z.stop(A,V).fadeOut("fast",function(){E("#colorbox iframe").attr("src","about:blank");I.remove();Z.css({opacity:1});try{i.focus()}catch(ad){}E.event.trigger(q);if(T.onClosed){T.onClosed.call(H)}})};ab.element=function(){return E(H)};ab.settings=G;E(ab.init)}(jQuery));function dump_dom(e){var c=new XMLSerializer();var d=XML(c.serializeToString(e)).toXMLString();alert(d)}var g_geo_timer=0;var g_playing=false;var g_streaming=false;function pause(){g_playing=false;g_streaming=false;clearTimeout(g_geo_timer)}function getChildData(c,e){var d=c.getElementsByTagName(e);if(d[0]!=null){if(d[0].childNodes[0]!=null){return d[0].childNodes[0].nodeValue}}return null}function onUser(c){pause();if(c!=""){setStatus("Retrieving results for user: "+c,true);var d="/api/user/"+escape(c)+".xml";onDownloadStatuses(d)}else{setStatus("No user specified",false)}}function onTopicSearch(c){pause();if(c!=""){setStatus("Retrieving results for search term: "+c,true);var d="/api/search/"+escape(c)+".xml";d+="?has_pic=1";onDownloadStatuses(d)}else{setStatus("No search term specified",false)}}function onLocationSearch(d){pause();if(d!=""){setStatus("Retrieving results for location search term: "+d,true);var c="/api/locationsearch/"+escape(d)+".xml";c+="?has_pic=1";onDownloadStatuses(c)}else{setStatus("No location specified",false)}}function onStatusId(c){pause();if(c!=""){setStatus("Retrieving results for status ID: "+c,true);var d="/api/status/"+escape(c)+".xml";onDownloadStatuses(d)}else{setStatus("No status ID specified",false)}}function getStatusDiv(k,v,s,m){var c=v;var g=c;var p=/http:\/\/([\w+?\.\w+])+([a-zA-Z0-9\~\!\@\#\$\%\^\&amp;\*\(\)_\-\=\+\\\/\?\.\:\;\'\,]*)?/gim;var t=g.match(p);if(t!=null){for(var q=0;q<t.length;q++){if(t[q]==s){var h='<a href="'+t[q]+'" id="twitter_text_link" title="'+k+'" class="cb_iframe"';if($.browser.msie){h+=" onclick=\"$.fn.colorbox({href:'"+s+"', title: '"+k+"', width:'90%', height:'90%', iframe:true, open:true}); return false;\""}else{h+=" onclick=\"$('.cb_iframe').colorbox({width:'90%', height:'90%', iframe:true});\""}h+=">"+t[q]+"</a>";g=g.replace(t[q],h)}else{g=g.replace(t[q],'<a href="'+t[q]+'" target="_blank" id="twitter_text_link">'+t[q]+"</a>")}}c=g}g=c;var l=/@+([a-zA-Z0-9_\-\~\!]*)?/gim;var d=g.match(l);if(d!=null){for(var q=0;q<d.length;q++){g=g.replace(d[q],'@<a href="http://twitter.com/'+d[q].substr(1)+'" target="_blank" id="twitter_text_link" onClick="onUser(\''+d[q].substr(1)+"'); return false;\">"+d[q].substr(1)+"</a>")}c=g}g=c;var f=/#+([a-zA-Z0-9_\-\~\!]*)?/gim;var j=g.match(f);if(j!=null){for(var q=0;q<j.length;q++){if(j[q].length>2){g=g.replace(j[q],'<a href="http://twitter.com/search?q=%23'+j[q].substr(1)+'" target="_blank" id="twitter_text_link" onClick="onTopicSearch(\''+j[q].substr(1)+"'); return false;\">"+j[q]+"</a>")}}c=g}var w=document.createElement("div");if(m==true){var n=document.createElement("a");n.setAttribute("href","/api/user/"+k+".kml");n.setAttribute("class","image_link");w.appendChild(n);var e=document.createElement("img");e.setAttribute("src","http://www.google.com/earth/gallery/images/kml_feed_small.png");e.setAttribute("alt","Open in Google Earth");e.setAttribute("title","Open in Google Earth");e.setAttribute("style","vertical-align:middle");e.setAttribute("height","12");e.setAttribute("width","12");n.appendChild(e)}var u=document.createElement("a");u.setAttribute("id","twitter_screen_name_link");u.setAttribute("href","/user/"+k);u.setAttribute("onClick","onUser('"+k+"'); return false;");w.appendChild(u);u.appendChild(document.createTextNode(k));w.innerHTML+=" "+c;return w}function makeTimeString(e){var f=parseInt(new Date().getTime().toString().substring(0,10))-e;var d="";if(f<259200){if(f<60){time_value=Math.round(f);time_unit="second"}else{if(f<3600){time_value=Math.round((f/60));time_unit="minute"}else{if(f<86400){time_value=Math.round((f/3600));time_unit="hour"}else{time_value=Math.round((f/86400));time_unit="day"}}}d+="about ";d+=time_value;d+=" ";d+=time_unit;if(time_value==1){d+=" ago"}else{d+="s ago"}}else{var c=new Date(e*1000);d+=c.getFullYear();d+="/";d+=c.getMonth()+1;d+="/";d+=c.getDate()}return d}var g_total_markers=0;var g_marker_hash=new Object();var g_marker_array=new Array();var g_current_marker=null;var g_top_element=null;var g_play_search_term="";var MIN_ZOOM_LEVEL=3;var MAX_ZOOM_LEVEL=14;var PLAY_INTERVAL_MS=2000;var MAX_MARKERS=1000;function ButtonControl(h,e,g,f,c,d){this.onClick=h;this.name=e;this.imageOver=g;this.imageOut=f;this.description=c;this.horzPos=d}ButtonControl.prototype=new GControl();ButtonControl.prototype.initialize=function(f){var c=document.createElement("div");var g=document.createElement("div");var e=document.createElement("a");e.setAttribute("href","");e.setAttribute("onClick",this.onClick);e.setAttribute("onMouseOver","document."+this.name+".src='"+this.imageOver+"'");e.setAttribute("onMouseOut","document."+this.name+".src='"+this.imageOut+"'");e.setAttribute("class","image_link");var d=document.createElement("img");d.setAttribute("src",this.imageOut);d.setAttribute("name",this.name);d.setAttribute("title",this.description);e.appendChild(d);g.appendChild(e);c.appendChild(g);f.getContainer().appendChild(c);return c};ButtonControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(this.horzPos,7))};ButtonControl.prototype.setButtonStyle_=function(c){c.style.textDecoration="underline";c.style.color="#0000cc";c.style.backgroundColor="white";c.style.font="small Arial";c.style.border="1px solid black";c.style.padding="2px";c.style.marginBottom="3px";c.style.textAlign="center";c.style.width="6em";c.style.cursor="pointer"};function StatusControl(){}StatusControl.prototype=new GControl();StatusControl.prototype.initialize=function(g){var f=document.createElement("div");var c=document.createElement("div");c.setAttribute("id","status_control");var e=document.createElement("span");e.setAttribute("id","status_span");c.appendChild(e);var d=document.createTextNode("");e.appendChild(d);f.appendChild(c);g.getContainer().appendChild(f);return f};StatusControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_BOTTOM_LEFT,new GSize(200,7))};StatusControl.prototype.setButtonStyle_=function(c){c.style.textDecoration="underline";c.style.color="#0000cc";c.style.backgroundColor="white";c.style.font="small Arial";c.style.border="1px solid black";c.style.padding="2px";c.style.marginBottom="3px";c.style.textAlign="center";c.style.width="6em";c.style.cursor="pointer"};function setStatus(d,g){var c=document.getElementById("status_span");if(c!=null){c.firstChild.nodeValue=d+" "}var f=document.getElementById("status_control");if(f!=null){if(g==true){if(document.getElementById("status_image")==null){var e=document.createElement("img");e.setAttribute("id","status_image");e.setAttribute("src","/images/loadingAnimation.gif");f.appendChild(e)}}else{var e=document.getElementById("status_image");if(e!=null){f.removeChild(e)}}}}function processStatuses(h){if(h==0){setStatus("Retrieved zero results",false);return}var k;if(g_total_markers==0){if(g_playing==false){k=new GLatLngBounds()}else{k=new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180))}}else{k=map.getBounds()}var j=GXml.parse(h);var c=j.documentElement.getElementsByTagName("status");var f="Retrieved "+c.length+" result";if(c.length!=1){f+="s"}setStatus(f,false);var e=null;for(var g=0;g<c.length;g++){var l=addStatus(c[g]);if(l!=null){e=l}k.extend(new GLatLng(getChildData(c[g],"lat"),getChildData(c[g],"lon")))}if(e==null){e=getPrevMarker(g_current_marker)}if(g_streaming==false){var d=map.getBoundsZoomLevel(k);if(d>MAX_ZOOM_LEVEL){d=MAX_ZOOM_LEVEL}if(d>MIN_ZOOM_LEVEL){map.setCenter(k.getCenter(),d)}if((e!=null)&&(e!=g_current_marker)){GEvent.trigger(e,"click")}}clearTimeout(g_geo_timer);if(g_playing==true){if(g_total_markers>MAX_MARKERS){clearMarkers();play()}else{g_geo_timer=setTimeout('onGeoSearch(true, "'+g_play_search_term+'", 1);',PLAY_INTERVAL_MS)}}else{if(g_streaming==true){a=$("div#info_window_footer a.image_link")[0].href.lastIndexOf("/")+1;b=$("div#info_window_footer a.image_link")[0].href.lastIndexOf(".");since=$("div#info_window_footer a.image_link")[0].href.substring(a,b);g_geo_timer=setTimeout('onStreamSearch(true, "'+g_play_search_term+'", '+since+");",PLAY_INTERVAL_MS)}}}function processTrends(g){if(g==0){return}var c=GXml.parse(g);var h=c.documentElement.getElementsByTagName("trend");var f=document.createElement("div");for(var e=0;e<h.length;e++){var k="";if(h[e].childNodes[0]!=null){k=h[e].childNodes[0].nodeValue}if(k.length!=0){trend_string_marked_up=k;if(k[0]=="#"){trend_string_marked_up=k.substring(1)}var d=document.createElement("a");d.href="http://heypic.me/search/"+trend_string_marked_up;d.appendChild(document.createTextNode(k));d.setAttribute("onClick","onGeoSearch(false, '"+trend_string_marked_up+"', 100); return false;");f.appendChild(d);f.appendChild(document.createElement("br"))}}var j=document.getElementById("tabs-west-3");j.appendChild(f)}function onDownloadStatuses(c){google.maps.DownloadUrl(c,function(d){processStatuses(d)})}function onDownloadTrends(c){google.maps.DownloadUrl(c,function(d){processTrends(d)})}Number.prototype.toRad=function(){return this*Math.PI/180};Number.prototype.toDeg=function(){return this*180/Math.PI};function onGeoSearch(n,d,k){var t=map.getBounds();var s=t.getCenter().lat();var q=t.getCenter().lng();var g=-90;var e=90;var w=-180;var v=180;if(n==false){g=t.getSouthWest().lat();e=t.getNorthEast().lat();w=t.getSouthWest().lng();v=t.getNorthEast().lng()}var i=6371;var p=(e-g).toRad();var m=(v-w).toRad();var C=Math.sin(p/2)*Math.sin(p/2)+Math.cos(g.toRad())*Math.cos(e.toRad())*Math.sin(m/2)*Math.sin(m/2);var z=2*Math.atan2(Math.sqrt(C),Math.sqrt(1-C));var f=i*z;var l=f/2;var A=1;var u=2500;var j=8000;var B=l;if(B<A){B=A;radians2=Math.PI/4;radians1=5*radians2;earth_radians=A/i;g=(Math.asin(Math.sin(s.toRad())*Math.cos(earth_radians)+Math.cos(s.toRad())*Math.sin(earth_radians)*Math.cos(radians1))).toDeg();w=(q.toRad()+Math.atan2(Math.sin(radians1)*Math.sin(earth_radians)*Math.cos(s.toRad()),Math.cos(earth_radians)-Math.sin(s.toRad())*Math.sin(g.toRad()))).toDeg();e=(Math.asin(Math.sin(s.toRad())*Math.cos(earth_radians)+Math.cos(s.toRad())*Math.sin(earth_radians)*Math.cos(radians2))).toDeg();v=(q.toRad()+Math.atan2(Math.sin(radians2)*Math.sin(earth_radians)*Math.cos(s.toRad()),Math.cos(earth_radians)-Math.sin(s.toRad())*Math.sin(e.toRad()))).toDeg()}else{if(B>u){B=u;if((l>=j)||(map.getZoom()<=MIN_ZOOM_LEVEL)){g=-90;w=-180;e=90;v=180}}}var D=1000000;var h="/api/geosearch/"+Math.round(g*D)/D+","+Math.round(w*D)/D+","+Math.round(e*D)/D+","+Math.round(v*D)/D+","+Math.round(s*D)/D+","+Math.round(q*D)/D+","+Math.round(B*D)/D+".xml?";if((k!=null)&&(k!=0)){h+="&count="+k}if((d!=null)&&(d.length!=0)){h+="&search="+d;setStatus("Geo Searching for "+d+" with radius = "+Math.round(l*D)/D+" km",true)}else{setStatus("Geo Searching with radius = "+Math.round(l*D)/D+" km",true)}onDownloadStatuses(h)}function onStreamSearch(m,d,D){var s=map.getBounds();var q=s.getCenter().lat();var p=s.getCenter().lng();var g=-90;var e=90;var v=-180;var u=180;if(m==false){g=s.getSouthWest().lat();e=s.getNorthEast().lat();v=s.getSouthWest().lng();u=s.getNorthEast().lng()}var i=6371;var n=(e-g).toRad();var l=(u-v).toRad();var B=Math.sin(n/2)*Math.sin(n/2)+Math.cos(g.toRad())*Math.cos(e.toRad())*Math.sin(l/2)*Math.sin(l/2);var w=2*Math.atan2(Math.sqrt(B),Math.sqrt(1-B));var f=i*w;var k=f/2;var z=1;var t=2500;var j=8000;var A=k;if(A<z){A=z;radians2=Math.PI/4;radians1=5*radians2;earth_radians=z/i;g=(Math.asin(Math.sin(q.toRad())*Math.cos(earth_radians)+Math.cos(q.toRad())*Math.sin(earth_radians)*Math.cos(radians1))).toDeg();v=(p.toRad()+Math.atan2(Math.sin(radians1)*Math.sin(earth_radians)*Math.cos(q.toRad()),Math.cos(earth_radians)-Math.sin(q.toRad())*Math.sin(g.toRad()))).toDeg();e=(Math.asin(Math.sin(q.toRad())*Math.cos(earth_radians)+Math.cos(q.toRad())*Math.sin(earth_radians)*Math.cos(radians2))).toDeg();u=(p.toRad()+Math.atan2(Math.sin(radians2)*Math.sin(earth_radians)*Math.cos(q.toRad()),Math.cos(earth_radians)-Math.sin(q.toRad())*Math.sin(e.toRad()))).toDeg()}else{if(A>t){A=t;if((k>=j)||(map.getZoom()<=MIN_ZOOM_LEVEL)){g=-90;v=-180;e=90;u=180}}}var C=1000000;var h="/api/geosearch/"+Math.round(g*C)/C+","+Math.round(v*C)/C+","+Math.round(e*C)/C+","+Math.round(u*C)/C+","+Math.round(q*C)/C+","+Math.round(p*C)/C+","+Math.round(A*C)/C+".xml?";if((D!=null)&&(D!=0)){h+="&since="+D}if((d!=null)&&(d.length!=0)){h+="&search="+d;setStatus("Geo Searching for "+d+" with radius = "+Math.round(k*C)/C+" km",true)}else{setStatus("Geo Searching with radius = "+Math.round(k*C)/C+" km",true)}onDownloadStatuses(h)}function myHashSize(e){var d=0;for(var c in e){d++}return d}function getPrevMarker(f){var e=null;for(var c=0;c<g_marker_array.length;c++){if(g_marker_array[c]==f){var d=c-1;if(d==-1){d=g_marker_array.length-1}e=g_marker_array[d];break}}return e}function doGeoSearch(){pause();onGeoSearch(false,g_play_search_term,100)}function play(){if(g_playing==false){var d=new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180));map.setCenter(d.getCenter(),MIN_ZOOM_LEVEL);g_playing=true;var c=1;if(g_play_search_term!=""){c=100}onGeoSearch(true,g_play_search_term,c)}}function stream(){if(g_streaming==false){var c=new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180));map.setCenter(c.getCenter(),MIN_ZOOM_LEVEL);g_streaming=true;onStreamSearch(true,g_play_search_term,0)}}function clearMarkers(){pause();map.clearOverlays();g_total_markers=0;g_current_marker=null;g_marker_hash=new Object();g_marker_array.length=0;var d=document.getElementById("tabs-west-1");var e=d.firstChild;while(e!=null){var c=e;e=e.nextSibling;if((c.nodeType==1)&&((c.getAttribute("class")=="left_side_status")||(c.nodeName.toLowerCase()=="hr"))){d.removeChild(c)}}g_top_element=null}function addStatus(H){var O=parseFloat(getChildData(H,"lat"));var j=parseFloat(getChildData(H,"lon"));var L=getChildData(H,"img_thumb_url");var w=getChildData(H,"img_link_url");var n=getChildData(H,"img_link_url_resolved");var B=getChildData(H,"twitter_screen_name");var e=getChildData(H,"twitter_status_text");var W=getChildData(H,"twitter_status_id");var Z=getChildData(H,"twitter_profile_image_url");var X=getChildData(H,"created_at_in_seconds");var D=getChildData(H,"in_reply_to_screen_name");var q=getChildData(H,"in_reply_to_status_id");var K=getChildData(H,"source");var N=O;var h=j;var s=O.toString()+j.toString();if(g_marker_hash[s]==undefined){g_marker_hash[s]=new Object()}else{if(g_marker_hash[s][W]==undefined){g_marker_hash[s][W]=0;var f=myHashSize(g_marker_hash[s])-1;theta=(f/20)*2*Math.PI;r=theta/1000;x=r*Math.cos(theta);y=r*Math.sin(theta);O+=x;j+=y}else{return null}}if((Z!=null)&&(Z.length!=0)){twitter_profile_image_url_tmp=Z}else{twitter_profile_image_url_tmp="http://s.twimg.com/a/1252097501/images/default_profile_bigger.png"}var V=140;var J=document.createElement("div");if((w!=null)&&(w.length!=0)){var I=B.length+e.length;if(I>100){V+=I*0.2+2}J.setAttribute("id","info_window_with_img");J.setAttribute("style","height: "+V+"px;")}else{J.setAttribute("id","info_window_no_img")}var U=document.createElement("div");U.setAttribute("id","info_window_profile_img");J.appendChild(U);var M=document.createElement("a");M.setAttribute("id","twitter_profile_img_link");M.setAttribute("href","/user/"+B);M.setAttribute("onClick","onUser('"+B+"'); return false;");U.appendChild(M);var G=document.createElement("img");G.setAttribute("src",twitter_profile_image_url_tmp);M.appendChild(G);U.appendChild(document.createElement("br"));var d=getStatusDiv(B,e,w,true);d.setAttribute("id","info_window_text");J.appendChild(d);var Y=document.createElement("br");Y.setAttribute("clear","both");J.appendChild(Y);if((w!=null)&&(w.length!=0)){var S=document.createElement("div");S.setAttribute("id","info_window_img");J.appendChild(S);S.appendChild(document.createElement("br"));var E=document.createElement("a");var F=w;if((n!=null)&&(n.length!=0)){F=n}var g=w.indexOf(".jpg");var C=false;if(g!=-1){C=true}if(C==true){E.setAttribute("class","cb_image");if($.browser.msie){E.setAttribute("onclick","$.fn.colorbox({href:'"+F+"', title: '"+B+"', maxWidth:'90%', maxHeight:'90%', open:true}); return false;")}else{E.setAttribute("onclick","$('.cb_image').colorbox({maxWidth:'90%', maxHeight:'90%'});")}}else{E.setAttribute("class","cb_iframe");if($.browser.msie){E.setAttribute("onclick","$.fn.colorbox({href:'"+F+"', title: '"+B+"', width:'90%', height:'90%', iframe:true, open:true}); return false;")}else{E.setAttribute("onclick","$('.cb_iframe').colorbox({width:'90%', height:'90%', iframe:true});")}}E.setAttribute("href",F);E.setAttribute("id","twitter_img_link");E.setAttribute("target","_blank");E.setAttribute("title",B);S.appendChild(E);var m=document.createElement("img");m.setAttribute("src",L);E.appendChild(m);S.appendChild(document.createElement("br"));var Y=document.createElement("br");Y.setAttribute("clear","both");J.appendChild(Y);var p=w.indexOf("imageshack");if(p!=-1){var u=document.createElement("a");u.href=w;u.appendChild(document.createTextNode("courtesy of imageshack"));S.appendChild(u);u.setAttribute("target","_blank");u.setAttribute("title",B);if(C==true){u.setAttribute("class","cb_image");if($.browser.msie){u.setAttribute("onclick","$.fn.colorbox({href:'"+w+"', title: '"+B+"', maxWidth:'90%', maxHeight:'90%', open:true}); return false;")}else{u.setAttribute("onclick","$('.cb_image').colorbox({maxWidth:'90%', maxHeight:'90%'});")}}else{u.setAttribute("class","cb_iframe");if($.browser.msie){u.setAttribute("onclick","$.fn.colorbox({href:'"+w+"', title: '"+B+"', width:'90%', height:'90%', iframe:true, open:true}); return false;")}else{u.setAttribute("onclick","$('.cb_iframe').colorbox({width:'90%', height:'90%', iframe:true});")}}}}var z=makeTimeString(X);var T=document.createElement("div");T.setAttribute("id","info_window_footer");J.appendChild(T);T.innerHTML=z;if((K!=null)&&(K.length!=0)){T.innerHTML+=" from "+unescape(K)}if((D!=null)&&(D.length!=0)&&(q!=null)&&(q.length!=0)&&(q!="0")){var i=document.createElement("a");i.setAttribute("href","/status/"+q);i.setAttribute("onClick","onStatusId('"+q+"'); return false;");i.setAttribute("target","_blank");i.setAttribute("id","hpm_link");T.appendChild(i);i.appendChild(document.createTextNode(" in reply to "+D))}T.appendChild(document.createElement("br"));var k=document.createElement("a");k.setAttribute("href","/api/status/"+W+".kml");k.setAttribute("class","image_link");T.appendChild(k);var A=document.createElement("img");A.setAttribute("src","http://www.google.com/earth/gallery/images/kml_feed_small.png");A.setAttribute("alt","Open in Google Earth");A.setAttribute("title","Open in Google Earth");A.setAttribute("style","vertical-align:middle");A.setAttribute("height","12");A.setAttribute("width","12");k.appendChild(A);T.appendChild(document.createTextNode("permalink: "));var l=document.createElement("input");l.setAttribute("type","text");l.setAttribute("id","permalink");l.setAttribute("readonly","readonly");l.setAttribute("class","readonly");l.setAttribute("onClick","select(); focus(); return false;");l.setAttribute("value","http://heypic.me/status/"+W);T.appendChild(l);T.appendChild(document.createElement("br"));var Q=document.createElement("a");Q.setAttribute("href","http://twitter.com/"+B);Q.setAttribute("target","_blank");Q.appendChild(document.createTextNode("twitter.com/"+B));T.appendChild(Q);T.appendChild(document.createElement("br"));var R=document.createElement("a");R.setAttribute("href","http://twitter.com/"+B+"/status/"+W);R.setAttribute("target","_blank");R.appendChild(document.createTextNode("twitter.com/"+B+"/status/"+W));T.appendChild(R);var v=new GIcon();v.shadow="/images/icon_shadow.png";v.iconSize=new GSize(24,24);v.ShadowSize=new GSize(32,32);v.iconAnchor=new GPoint(0,0);v.infoWindowAnchor=new GPoint(0,0);if((L!=null)&&(L.length>0)){v.image=L}else{v.image=Z}if((N!=O)||(h!=j)){var t=new GPolyline([new GLatLng(N,h),new GLatLng(O,j)],"#00FFFF",2,0.5);map.addOverlay(t)}var P=new GLatLng(O,j);var c=new GMarker(P,v);GEvent.addListener(c,"click",function(){c.openInfoWindow(J);g_current_marker=c});addStatusToLeftPane(J,c);map.addOverlay(c);g_marker_hash[s][W]=c;g_marker_array.push(c);g_total_markers++;return g_marker_hash[s][W]}function addStatusToLeftPane(e,f){if((e==0)||(f==null)){return}div_info_window_clone=e.cloneNode(true);var c=document.createElement("div");c.setAttribute("class","left_side_status");c.insertBefore(div_info_window_clone,null);GEvent.addDomListener(c,"click",function(){GEvent.trigger(f,"click")});GEvent.addDomListener(c,"mouseover",function(){c.style.backgroundColor="#C8D6E4"});GEvent.addDomListener(c,"mouseout",function(){c.style.backgroundColor="#99B3CC"});var d=document.getElementById("tabs-west-1");d.insertBefore(c,g_top_element);g_top_element=c;var g=document.createElement("hr");d.insertBefore(g,g_top_element);g_top_element=g};
