;(function($){var $scrollTo=$.scrollTo=function(target,duration,settings){$(window).scrollTo(target,duration,settings);};$scrollTo.defaults={axis:'y',duration:1};$scrollTo.window=function(scope){return $(window).scrollable();};$.fn.is_scrollable=function(){return this.map(function(){var win=this.parentWindow||this.defaultView,elem=this.nodeName=='#document'?win.frameElement||win:this,doc=elem.contentDocument||(elem.contentWindow||elem).document,isWin=elem.setInterval;return elem.nodeName=='IFRAME'||isWin&&$.browser.safari?doc.body:isWin?doc.documentElement:this;});};$.fn.scrollTo=function(target,duration,settings){if(typeof duration=='object'){settings=duration;duration=0;}
if(typeof settings=='function')
settings={onAfter:settings};settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.speed||settings.duration;settings.queue=settings.queue&&settings.axis.length>1;if(settings.queue)
duration/=2;settings.offset=both(settings.offset);settings.over=both(settings.over);return this.is_scrollable().each(function(){var elem=this,$elem=$(elem),targ=target,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=)?\d+(px)?$/.test(targ)){targ=both(targ);break;}
targ=$(targ,this);case'object':if(targ.is||targ.style)
toff=(targ=$(targ)).offset();}
$.each(settings.axis.split(''),function(i,axis){var Pos=axis=='x'?'Left':'Top',pos=Pos.toLowerCase(),key='scroll'+Pos,old=elem[key],Dim=axis=='x'?'Width':'Height',dim=Dim.toLowerCase();if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(targ.css('margin'+Pos))||0;attr[key]-=parseInt(targ.css('border'+Pos+'Width'))||0;}
attr[key]+=settings.offset[pos]||0;if(settings.over[pos])
attr[key]+=targ[dim]()*settings.over[pos];}else
attr[key]=targ[pos];if(/^\d+$/.test(attr[key]))
attr[key]=attr[key]<=0?0:Math.min(attr[key],max(Dim));if(!i&&settings.queue){if(old!=attr[key])
animate(settings.onAfterFirst);delete attr[key];}});animate(settings.onAfter);function animate(callback){$elem.animate(attr,duration,settings.easing,callback&&function(){callback.call(this,target,settings);});};function max(Dim){var attr='scroll'+Dim,doc=elem.ownerDocument;return win?Math.max(doc.documentElement[attr],doc.body[attr]):elem[attr];};}).end();};function both(val){return typeof val=='object'?val:{top:val,left:val};};})(jQuery);(function(){function log(args){console.log("$f.fireEvent",[].slice.call(args));}function clone(obj){if(!obj||typeof obj!='object'){return obj;}var temp=new obj.constructor();for(var key in obj){if(obj.hasOwnProperty(key)){temp[key]=clone(obj[key]);}}return temp;}function each(obj,fn){if(!obj){return;}var name,i=0,length=obj.length;if(length===undefined){for(name in obj){if(fn.call(obj[name],name,obj[name])===false){break;}}}else{for(var value=obj[0];i<length&&fn.call(value,i,value)!==false;value=obj[++i]){}}return obj;}function el(id){return document.getElementById(id);}function extend(to,from,skipFuncs){if(to&&from){each(from,function(name,value){if(!skipFuncs||typeof value!='function'){to[name]=value;}});}}function select(query){var index=query.indexOf(".");if(index!=-1){var tag=query.substring(0,index)||"*";var klass=query.substring(index+1,query.length);var els=[];each(document.getElementsByTagName(tag),function(){if(this.className&&this.className.indexOf(klass)!=-1){els.push(this);}});return els;}}function stopEvent(e){e=e||window.event;if(e.preventDefault){e.stopPropagation();e.preventDefault();}else{e.returnValue=false;e.cancelBubble=true;}return false;}function bind(to,evt,fn){to[evt]=to[evt]||[];to[evt].push(fn);}function makeId(){return"_"+(""+Math.random()).substring(2,10);}var Clip=function(json,index,player){var self=this;var cuepoints={};var listeners={};self.index=index;if(typeof json=='string'){json={url:json};}extend(this,json,true);each(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){var evt="on"+this;if(evt.indexOf("*")!=-1){evt=evt.substring(0,evt.length-1);var before="onBefore"+evt.substring(2);self[before]=function(fn){bind(listeners,before,fn);return self;};}self[evt]=function(fn){bind(listeners,evt,fn);return self;};if(index==-1){if(self[before]){player[before]=self[before];}if(self[evt]){player[evt]=self[evt];}}});extend(this,{onCuepoint:function(points,fn){if(arguments.length==1){cuepoints.embedded=[null,points];return self;}if(typeof points=='number'){points=[points];}var fnId=makeId();cuepoints[fnId]=[points,fn];if(player.isLoaded()){player._api().fp_addCuepoints(points,index,fnId);}return self;},update:function(json){extend(self,json);if(player.isLoaded()){player._api().fp_updateClip(json,index);}var conf=player.getConfig();var clip=(index==-1)?conf.clip:conf.playlist[index];extend(clip,json,true);},_fireEvent:function(evt,arg1,arg2,target){if(evt=='onLoad'){each(cuepoints,function(key,val){if(val[0]){player._api().fp_addCuepoints(val[0],index,key);}});return false;}if(index!=-1){target=self;}if(evt=='onCuepoint'){var fn=cuepoints[arg1];if(fn){return fn[1].call(player,target,arg2);}}if(evt=='onStart'||evt=='onUpdate'){extend(target,arg1);if(!target.duration){target.duration=arg1.metaData.duration;}else{target.fullDuration=arg1.metaData.duration;}}var ret=true;each(listeners[evt],function(){ret=this.call(player,target,arg1,arg2);});return ret;}});if(json.onCuepoint){var arg=json.onCuepoint;self.onCuepoint.apply(self,typeof arg=='function'?[arg]:arg);delete json.onCuepoint;}each(json,function(key,val){if(typeof val=='function'){bind(listeners,key,val);delete json[key];}});if(index==-1){player.onCuepoint=this.onCuepoint;}};var Plugin=function(name,json,player,fn){var listeners={};var self=this;var hasMethods=false;if(fn){extend(listeners,fn);}each(json,function(key,val){if(typeof val=='function'){listeners[key]=val;delete json[key];}});extend(this,{animate:function(props,speed,fn){if(!props){return self;}if(typeof speed=='function'){fn=speed;speed=500;}if(typeof props=='string'){var key=props;props={};props[key]=speed;speed=500;}if(fn){var fnId=makeId();listeners[fnId]=fn;}if(speed===undefined){speed=500;}json=player._api().fp_animate(name,props,speed,fnId);return self;},css:function(props,val){if(val!==undefined){var css={};css[props]=val;props=css;}json=player._api().fp_css(name,props);extend(self,json);return self;},show:function(){this.display='block';player._api().fp_showPlugin(name);return self;},hide:function(){this.display='none';player._api().fp_hidePlugin(name);return self;},toggle:function(){this.display=player._api().fp_togglePlugin(name);return self;},fadeTo:function(o,speed,fn){if(typeof speed=='function'){fn=speed;speed=500;}if(fn){var fnId=makeId();listeners[fnId]=fn;}this.display=player._api().fp_fadeTo(name,o,speed,fnId);this.opacity=o;return self;},fadeIn:function(speed,fn){return self.fadeTo(1,speed,fn);},fadeOut:function(speed,fn){return self.fadeTo(0,speed,fn);},getName:function(){return name;},_fireEvent:function(evt,arg){if(evt=='onUpdate'){var json=player._api().fp_getPlugin(name);if(!json){return;}extend(self,json);delete self.methods;if(!hasMethods){each(json.methods,function(){var method=""+this;self[method]=function(){var a=[].slice.call(arguments);var ret=player._api().fp_invoke(name,method,a);return ret=='undefined'?self:ret;};});hasMethods=true;}}var fn=listeners[evt];if(fn){fn.call(self,arg);if(evt.substring(0,1)=="_"){delete listeners[evt];}}}});};function Player(wrapper,params,conf){var
self=this,api=null,html,commonClip,playlist=[],plugins={},listeners={},playerId,apiId,playerIndex,activeIndex,swfHeight,wrapperHeight;extend(self,{id:function(){return playerId;},isLoaded:function(){return(api!==null);},getParent:function(){return wrapper;},hide:function(all){if(all){wrapper.style.height="0px";}if(api){api.style.height="0px";}return self;},show:function(){wrapper.style.height=wrapperHeight+"px";if(api){api.style.height=swfHeight+"px";}return self;},isHidden:function(){return api&&parseInt(api.style.height,10)===0;},load:function(fn){if(!api&&self._fireEvent("onBeforeLoad")!==false){each(players,function(){this.unload();});html=wrapper.innerHTML;flashembed(wrapper,params,{config:conf});if(fn){fn.cached=true;bind(listeners,"onLoad",fn);}}return self;},unload:function(){try{if(api&&api.fp_isFullscreen()){}}catch(error){return;}if(api&&html.replace(/\s/g,'')!==''&&!api.fp_isFullscreen()&&self._fireEvent("onBeforeUnload")!==false){api.fp_close();wrapper.innerHTML=html;self._fireEvent("onUnload");api=null;}return self;},getClip:function(index){if(index===undefined){index=activeIndex;}return playlist[index];},getCommonClip:function(){return commonClip;},getPlaylist:function(){return playlist;},getPlugin:function(name){var plugin=plugins[name];if(!plugin&&self.isLoaded()){var json=self._api().fp_getPlugin(name);if(json){plugin=new Plugin(name,json,self);plugins[name]=plugin;}}return plugin;},getScreen:function(){return self.getPlugin("screen");},getControls:function(){return self.getPlugin("controls");},getConfig:function(copy){return copy?clone(conf):conf;},getFlashParams:function(){return params;},loadPlugin:function(name,url,props,fn){if(typeof props=='function'){fn=props;props={};}var fnId=fn?makeId():"_";self._api().fp_loadPlugin(name,url,props,fnId);var arg={};arg[fnId]=fn;var p=new Plugin(name,null,self,arg);plugins[name]=p;return p;},getState:function(){return api?api.fp_getState():-1;},play:function(clip){function play(){if(clip!==undefined){self._api().fp_play(clip);}else{self._api().fp_play();}}if(api){play();}else{self.load(function(){play();});}return self;},getVersion:function(){var js="flowplayer.js 3.0.3";if(api){var ver=api.fp_getVersion();ver.push(js);return ver;}return js;},_api:function(){if(!api){throw"Flowplayer "+self.id()+" not loaded. Try moving your call to player's onLoad event";}return api;},_dump:function(){console.log(listeners);},setClip:function(clip){self.setPlaylist([clip]);},getIndex:function(){return playerIndex;}});each(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,Fullscreen*,FullscreenExit,Error").split(","),function(){var name="on"+this;if(name.indexOf("*")!=-1){name=name.substring(0,name.length-1);var name2="onBefore"+name.substring(2);self[name2]=function(fn){bind(listeners,name2,fn);return self;};}self[name]=function(fn){bind(listeners,name,fn);return self;};});each(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,reset,close,setPlaylist").split(","),function(){var name=this;self[name]=function(arg){if(!api){return self;}var ret=(arg===undefined)?api["fp_"+name]():api["fp_"+name](arg);return ret=='undefined'?self:ret;};});self._fireEvent=function(evt,arg0,arg1,arg2){if(conf.debug){log(arguments);}if(!api&&evt=='onLoad'&&arg0=='player'){api=api||el(apiId);swfHeight=api.clientHeight;each(playlist,function(){this._fireEvent("onLoad");});each(plugins,function(name,p){p._fireEvent("onUpdate");});commonClip._fireEvent("onLoad");}if(evt=='onLoad'&&arg0!='player'){return;}if(evt=='onError'){if(typeof arg0=='string'||(typeof arg0=='number'&&typeof arg1=='number')){arg0=arg1;arg1=arg2;}}if(evt=='onContextMenu'){each(conf.contextMenu[arg0],function(key,fn){fn.call(self);});return;}if(evt=='onPluginEvent'){var name=arg0.name||arg0;var p=plugins[name];if(p){p._fireEvent("onUpdate",arg0);p._fireEvent(arg1);}return;}if(evt=='onPlaylistReplace'){playlist=[];var index=0;each(arg0,function(){playlist.push(new Clip(this,index++,self));});}var ret=true;if(arg0===0||(arg0&&arg0>=0&&arg0<playlist.length)){activeIndex=arg0;var clip=playlist[arg0];if(clip){ret=clip._fireEvent(evt,arg1,arg2);}if(!clip||ret!==false){ret=commonClip._fireEvent(evt,arg1,arg2,clip);}}var i=0;each(listeners[evt],function(){ret=this.call(self,arg0,arg1);if(this.cached){listeners[evt].splice(i,1);}if(ret===false){return false;}i++;});return ret;};function init(){if($f(wrapper)){$f(wrapper).getParent().innerHTML="";playerIndex=$f(wrapper).getIndex();players[playerIndex]=self;}else{players.push(self);playerIndex=players.length-1;}wrapperHeight=parseInt(wrapper.style.height,10)||wrapper.clientHeight;if(typeof params=='string'){params={src:params};}playerId=wrapper.id||"fp"+makeId();apiId=params.id||playerId+"_api";params.id=apiId;conf.playerId=playerId;if(typeof conf=='string'){conf={clip:{url:conf}};}conf.clip=conf.clip||{};if(wrapper.getAttribute("href",2)&&!conf.clip.url){conf.clip.url=wrapper.getAttribute("href",2);}commonClip=new Clip(conf.clip,-1,self);conf.playlist=conf.playlist||[conf.clip];var index=0;each(conf.playlist,function(){var clip=this;if(typeof clip=='object'&&clip.length){clip=""+clip;}if(!clip.url&&typeof clip=='string'){clip={url:clip};}each(conf.clip,function(key,val){if(clip[key]===undefined&&typeof val!='function'){clip[key]=val;}});conf.playlist[index]=clip;clip=new Clip(clip,index,self);playlist.push(clip);index++;});each(conf,function(key,val){if(typeof val=='function'){bind(listeners,key,val);delete conf[key];}});each(conf.plugins,function(name,val){if(val){plugins[name]=new Plugin(name,val,self);}});if(!conf.plugins||conf.plugins.controls===undefined){plugins.controls=new Plugin("controls",null,self);}params.bgcolor=params.bgcolor||"#000000";params.version=params.version||[9,0];params.expressInstall='http://www.flowplayer.org/swf/expressinstall.swf';function doClick(e){if(!self.isLoaded()&&self._fireEvent("onBeforeClick")!==false){self.load();}return stopEvent(e);}html=wrapper.innerHTML;if(html.replace(/\s/g,'')!==''){if(wrapper.addEventListener){wrapper.addEventListener("click",doClick,false);}else if(wrapper.attachEvent){wrapper.attachEvent("onclick",doClick);}}else{if(wrapper.addEventListener){wrapper.addEventListener("click",stopEvent,false);}self.load();}}if(typeof wrapper=='string'){flashembed.domReady(function(){var node=el(wrapper);if(!node){throw"Flowplayer cannot access element: "+wrapper;}else{wrapper=node;init();}});}else{init();}}var players=[];function Iterator(arr){this.length=arr.length;this.each=function(fn){each(arr,fn);};this.size=function(){return arr.length;};}window.flowplayer=window.$f=function(){var instance=null;var arg=arguments[0];if(!arguments.length){each(players,function(){if(this.isLoaded()){instance=this;return false;}});return instance||players[0];}if(arguments.length==1){if(typeof arg=='number'){return players[arg];}else{if(arg=='*'){return new Iterator(players);}each(players,function(){if(this.id()==arg.id||this.id()==arg||this.getParent()==arg){instance=this;return false;}});return instance;}}if(arguments.length>1){var swf=arguments[1];var conf=(arguments.length==3)?arguments[2]:{};if(typeof arg=='string'){if(arg.indexOf(".")!=-1){var instances=[];each(select(arg),function(){instances.push(new Player(this,clone(swf),clone(conf)));});return new Iterator(instances);}else{var node=el(arg);return new Player(node!==null?node:arg,swf,conf);}}else if(arg){return new Player(arg,swf,conf);}}return null;};extend(window.$f,{fireEvent:function(id,evt,a0,a1,a2){var p=$f(id);return p?p._fireEvent(evt,a0,a1,a2):null;},addPlugin:function(name,fn){Player.prototype[name]=fn;return $f;},each:each,extend:extend});if(document.all){window.onbeforeunload=function(){$f("*").each(function(){if(this.isLoaded()){this.close();}});};}if(typeof jQuery=='function'){jQuery.prototype.flowplayer=function(params,conf){if(!arguments.length||typeof arguments[0]=='number'){var arr=[];this.each(function(){var p=$f(this);if(p){arr.push(p);}});return arguments.length?arr[arguments[0]]:new Iterator(arr);}return this.each(function(){$f(this,clone(params),conf?clone(conf):{});});};}})();(function(){var jQ=typeof jQuery=='function';function isDomReady(){if(domReady.done){return false;}var d=document;if(d&&d.getElementsByTagName&&d.getElementById&&d.body){clearInterval(domReady.timer);domReady.timer=null;for(var i=0;i<domReady.ready.length;i++){domReady.ready[i].call();}domReady.ready=null;domReady.done=true;}}var domReady=jQ?jQuery:function(f){if(domReady.done){return f();}if(domReady.timer){domReady.ready.push(f);}else{domReady.ready=[f];domReady.timer=setInterval(isDomReady,13);}};function extend(to,from){if(from){for(key in from){if(from.hasOwnProperty(key)){to[key]=from[key];}}}return to;}function concatVars(vars){var out="";for(var key in vars){if(vars[key]){out+=[key]+'='+asString(vars[key])+'&';}}return out.substring(0,out.length-1);}function asString(obj){switch(typeOf(obj)){case'string':obj=obj.replace(new RegExp('(["\\\\])','g'),'\\$1');obj=obj.replace(/^\s?(\d+)%/,"$1pct");return'"'+obj+'"';case'array':return'['+map(obj,function(el){return asString(el);}).join(',')+']';case'function':return'"function()"';case'object':var str=[];for(var prop in obj){if(obj.hasOwnProperty(prop)){str.push('"'+prop+'":'+asString(obj[prop]));}}return'{'+str.join(',')+'}';}return String(obj).replace(/\s/g," ").replace(/\'/g,"\"");}function typeOf(obj){if(obj===null||obj===undefined){return false;}var type=typeof obj;return(type=='object'&&obj.push)?'array':type;}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};});}function map(arr,func){var newArr=[];for(var i in arr){if(arr.hasOwnProperty(i)){newArr[i]=func(arr[i]);}}return newArr;}function getEmbedCode(p,c){var html='<embed type="application/x-shockwave-flash" ';if(p.id){extend(p,{name:p.id});}for(var key in p){if(p[key]!==null){html+=key+'="'+p[key]+'"\n\t';}}if(c){html+='flashvars=\''+concatVars(c)+'\'';}html+='/>';return html;}function getObjectCode(p,c,embeddable){var html='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';html+='width="'+p.width+'" height="'+p.height+'"';if(!p.id&&document.all){p.id="_"+(""+Math.random()).substring(5);}if(p.id){html+=' id="'+p.id+'"';}html+='>';if(document.all){p.src+=((p.src.indexOf("?")!=-1?"&":"?")+Math.random());}html+='\n\t<param name="movie" value="'+p.src+'" />';var e=extend({},p);e.id=e.width=e.height=e.src=null;for(var k in e){if(e[k]!==null){html+='\n\t<param name="'+k+'" value="'+e[k]+'" />';}}if(c){html+='\n\t<param name="flashvars" value=\''+concatVars(c)+'\' />';}if(embeddable){html+=getEmbedCode(p,c);}html+="</object>";return html;}function getFullHTML(p,c){return getObjectCode(p,c,true);}function getHTML(p,c){var isNav=navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length;return(isNav)?getEmbedCode(p,c):getObjectCode(p,c);}window.flashembed=function(root,userParams,flashvars){var params={src:'#',width:'100%',height:'100%',version:null,onFail:null,expressInstall:null,debug:false,allowfullscreen:true,allowscriptaccess:'always',quality:'high',type:'application/x-shockwave-flash',pluginspage:'http://www.adobe.com/go/getflashplayer'};if(typeof userParams=='string'){userParams={src:userParams};}extend(params,userParams);var version=flashembed.getVersion();var required=params.version;var express=params.expressInstall;var debug=params.debug;if(typeof root=='string'){var el=document.getElementById(root);if(el){root=el;}else{domReady(function(){flashembed(root,userParams,flashvars);});return;}}if(!root){return;}if(!required||flashembed.isSupported(required)){params.onFail=params.version=params.expressInstall=params.debug=null;root.innerHTML=getHTML(params,flashvars);return root.firstChild;}else if(params.onFail){var ret=params.onFail.call(params,flashembed.getVersion(),flashvars);if(ret===true){root.innerHTML=ret;}}else if(required&&express&&flashembed.isSupported([6,65])){extend(params,{src:express});flashvars={MMredirectURL:location.href,MMplayerType:'PlugIn',MMdoctitle:document.title};root.innerHTML=getHTML(params,flashvars);}else{if(root.innerHTML.replace(/\s/g,'')!==''){}else{root.innerHTML="<h2>Flash version "+required+" or greater is required</h2>"+"<h3>"+(version[0]>0?"Your version is "+version:"You have no flash plugin installed")+"</h3>"+"<p>Download latest version from <a href='"+params.pluginspage+"'>here</a></p>";}}return root;};extend(window.flashembed,{getVersion:function(){var version=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var _d=navigator.plugins["Shockwave Flash"].description;if(typeof _d!="undefined"){_d=_d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var _m=parseInt(_d.replace(/^(.*)\..*$/,"$1"),10);var _r=/r/.test(_d)?parseInt(_d.replace(/^.*r(.*)$/,"$1"),10):0;version=[_m,_r];}}else if(window.ActiveXObject){try{var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{_a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version=[6,0];_a.AllowScriptAccess="always";}catch(ee){if(version[0]==6){return;}}try{_a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(eee){}}if(typeof _a=="object"){_d=_a.GetVariable("$version");if(typeof _d!="undefined"){_d=_d.replace(/^\S+\s+(.*)$/,"$1").split(",");version=[parseInt(_d[0],10),parseInt(_d[2],10)];}}}return version;},isSupported:function(version){var now=flashembed.getVersion();var ret=(now[0]>version[0])||(now[0]==version[0]&&now[1]>=version[1]);return ret;},domReady:domReady,asString:asString,getHTML:getHTML,getFullHTML:getFullHTML});if(jQ){jQuery.prototype.flashembed=function(params,flashvars){return this.each(function(){flashembed(this,params,flashvars);});};}})();(function($){function Scrollable(el,config){var self=this;if(!Scrollable.current){Scrollable.current=this;}
var opts={size:5,vertical:false,activeClass:'active',speed:300,onSeek:null,clickable:true,items:'.items',prev:'.prev',next:'.next',navi:'.navi',naviItem:'span',loop:false};this.opts=$.extend(opts,config);this.opts.horizontal=!opts.vertical;this.root=$(el);var root=this.root;var itemRoot=$(opts.items,root);if(!itemRoot.length){itemRoot=root;}
itemRoot.css({position:'relative',overflow:'hidden',visibility:'visible'});itemRoot.children().wrapAll('<div class="__scrollable" style="position:absolute"/>');this.wrap=itemRoot.find(":first");this.wrap.css(opts.horizontal?"width":"height","200000em").after('<br clear="all" />');this.items=this.wrap.children();this.index=0;if(opts.horizontal){itemRoot.width(opts.size*(this.items.eq(1).offset().left-this.items.eq(0).offset().left)-2);}else{itemRoot.height(opts.size*(this.items.eq(1).offset().top-this.items.eq(0).offset().top)-2);}
if($.isFunction($.fn.mousewheel)){root.bind("mousewheel.scrollable",function(e,delta){self.move(-delta,50);return false;});}
if(opts.clickable){this.items.each(function(index,arg){$(this).bind("click.scrollable",function(){self.click(index);});});}
this.activeIndex=0;$(opts.prev,root).click(function(){self.prev();});$(opts.next,root).click(function(){self.next();});$(opts.navi,root).each(function(){var navi=$(this);var status=self.getStatus();if(navi.is(":empty")){for(var i=0;i<status.pages;i++){var item=$("<"+opts.naviItem+"/>").attr("page",i).click(function(e){var el=$(this);el.parent().children().removeClass(opts.activeClass);el.addClass(opts.activeClass);self.setPage(el.attr("page"));e.preventDefault();});if(i===0){item.addClass(opts.activeClass);}
navi.append(item);}}else{var els=navi.find("a");if(!els.length){els=navi.children();}
els.each(function(i){var item=$(this);item.attr("page",i);if(i===0){item.addClass(opts.activeClass);}
item.click(function(){navi.find("."+opts.activeClass).removeClass(opts.activeClass);item.addClass(opts.activeClass);self.setPage(item.attr("page"));});});}});}
$.extend(Scrollable.prototype,{getVersion:function(){return'@VERSION';},click:function(index){var item=this.items.eq(index);var klass=this.opts.activeClass;if(!item.hasClass(klass)&&(index>=0||index<this.items.size())){this.items.removeClass(klass);item.addClass(klass);var delta=Math.floor(this.opts.size/2);var to=index-delta;if(to!==this.activeIndex){this.seekTo(to);}}},getStatus:function(){var len=this.items.size();return{size:this.opts.size,total:len,index:this.index,pages:Math.ceil(len/this.opts.size),page:Math.ceil(this.index/this.opts.size)};},seekTo:function(index,time){if(index<0){index=0;}
var max=Math.min(index,this.items.length-this.opts.size);if(index<=max){var item=this.items.eq(index);this.index=index;if(this.opts.horizontal){var left=this.wrap.offset().left-item.offset().left;this.wrap.animate({left:left},time||this.opts.speed);}else{var top=this.wrap.offset().top-item.offset().top;this.wrap.animate({top:top},time||this.opts.speed);}
Scrollable.current=this;}
if($.isFunction(this.opts.onSeek)){this.opts.onSeek.call(this);}
var navi=$(this.opts.navi,this.root);if(navi.length){var klass=this.opts.activeClass;var page=Math.ceil(index/this.opts.size);page=Math.min(page,navi.children().length-1);navi.children().removeClass(klass).eq(page).addClass(klass);}
this.activeIndex=index;return true;},move:function(offset,time){var to=this.index+offset;if(this.opts.loop&&to>(this.items.length-this.opts.size)){to=0;}
this.seekTo(to,time);},next:function(time){this.move(1,time);},prev:function(time){this.move(-1,time);},movePage:function(offset,time){this.move(this.opts.size*offset,time);},setPage:function(page,time){var size=this.opts.size;var index=size*page;var lastPage=index+size>=this.items.size();if(lastPage){index=this.items.size()-this.opts.size;}
this.seekTo(index,time);},prevPage:function(time){this.setPage(this.getStatus().page-1,time);},nextPage:function(time){this.setPage(this.getStatus().page+1,time);},begin:function(time){this.seekTo(0,time);},end:function(time){this.seekTo(this.items.size()-this.opts.size,time);}});$(window).bind("keypress.scrollable",function(evt){var el=Scrollable.current;if(!el){return;}
if(el.opts.horizontal&&(evt.keyCode==37||evt.keyCode==39)){el.move(evt.keyCode==37?-1:1);return evt.preventDefault();}
if(!el.opts.horizontal&&(evt.keyCode==38||evt.keyCode==40)){el.move(evt.keyCode==38?-1:1);return evt.preventDefault();}
return true;});jQuery.prototype.scrollable=function(opts,arg0,arg1){if(!opts||typeof opts=='number'){var index=opts||0;var el=$.data(this.get()[index],"scrollable");if(el){return el;}}
this.each(function(){if(typeof opts=="string"){var el=$.data(this,"scrollable");el[opts].apply(el,[arg0,arg1]);}else{var instance=new Scrollable(this,opts);$.data(this,"scrollable",instance);}});return this;};})(jQuery);(function($){$.event.special.mousewheel={setup:function(){var handler=$.event.special.mousewheel.handler;if($.browser.mozilla)
$(this).bind('mousemove.mousewheel',function(event){$.data(this,'mwcursorposdata',{pageX:event.pageX,pageY:event.pageY,clientX:event.clientX,clientY:event.clientY});});if(this.addEventListener)
this.addEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);else
this.onmousewheel=handler;},teardown:function(){var handler=$.event.special.mousewheel.handler;$(this).unbind('mousemove.mousewheel');if(this.removeEventListener)
this.removeEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);else
this.onmousewheel=function(){};$.removeData(this,'mwcursorposdata');},handler:function(event){var args=Array.prototype.slice.call(arguments,1);event=$.event.fix(event||window.event);$.extend(event,$.data(this,'mwcursorposdata')||{});var delta=0,returnValue=true;if(event.wheelDelta)delta=event.wheelDelta/120;if(event.detail)delta=-event.detail/3;if($.browser.opera)delta=-event.wheelDelta;event.data=event.data||{};event.type="mousewheel";args.unshift(delta);args.unshift(event);return $.event.handle.apply(this,args);}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel");},unmousewheel:function(fn){return this.unbind("mousewheel",fn);}});})(jQuery);;(function(G){var A="2.30";var B=G.browser.msie&&/MSIE 6.0/.test(navigator.userAgent);function D(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments,""))}}G.fn.cycle=function(I){var J=arguments[1];return this.each(function(){if(I===undefined||I===null){I={}}if(I.constructor==String){switch(I){case"stop":if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;G(this).data("cycle.opts","");return;case"pause":this.cyclePause=1;return;case"resume":this.cyclePause=0;if(J===true){I=G(this).data("cycle.opts");if(!I){D("options not found, can not resume");return}if(this.cycleTimeout){clearTimeout(this.cycleTimeout);this.cycleTimeout=0}E(I.elements,I,1,1)}return;default:I={fx:I}}}else{if(I.constructor==Number){var O=I;I=G(this).data("cycle.opts");if(!I){D("options not found, can not advance slide");return}if(O<0||O>=I.elements.length){D("invalid slide index: "+O);return}I.nextSlide=O;if(this.cycleTimeout){clearTimeout(this.cycleTimeout);this.cycleTimeout=0}E(I.elements,I,1,O>=I.currSlide);return}}if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var R=G(this);var P=I.slideExpr?G(I.slideExpr,this):R.children();var L=P.get();if(L.length<2){D("terminating; too few slides: "+L.length);return}var K=G.extend({},G.fn.cycle.defaults,I||{},G.metadata?R.metadata():G.meta?R.data():{});if(K.autostop){K.countdown=K.autostopCount||L.length}R.data("cycle.opts",K);K.container=this;K.elements=L;K.before=K.before?[K.before]:[];K.after=K.after?[K.after]:[];K.after.unshift(function(){K.busy=0});if(K.continuous){K.after.push(function(){E(L,K,0,!K.rev)})}if(B&&K.cleartype&&!K.cleartypeNoBg){C(P)}var T=this.className;K.width=parseInt((T.match(/w:(\d+)/)||[])[1])||K.width;K.height=parseInt((T.match(/h:(\d+)/)||[])[1])||K.height;K.timeout=parseInt((T.match(/t:(\d+)/)||[])[1])||K.timeout;if(R.css("position")=="static"){R.css("position","relative")}if(K.width){R.width(K.width)}if(K.height&&K.height!="auto"){R.height(K.height)}if(K.startingSlide){K.startingSlide=parseInt(K.startingSlide)}if(K.random){K.randomMap=[];for(var M=0;M<L.length;M++){K.randomMap.push(M)}K.randomMap.sort(function(V,U){return Math.random()-0.5});K.randomIndex=0;K.startingSlide=K.randomMap[0]}else{if(K.startingSlide>=L.length){K.startingSlide=0}}var N=K.startingSlide||0;P.css({position:"absolute",top:0,left:0}).hide().each(function(U){var V=N?U>=N?L.length-(U-N):N-U:L.length-U;G(this).css("z-index",V)});G(L[N]).css("opacity",1).show();if(G.browser.msie){L[N].style.removeAttribute("filter")}if(K.fit&&K.width){P.width(K.width)}if(K.fit&&K.height&&K.height!="auto"){P.height(K.height)}if(K.pause){R.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}var S=G.fn.cycle.transitions[K.fx];if(G.isFunction(S)){S(R,P,K)}else{if(K.fx!="custom"){D("unknown transition: "+K.fx)}}P.each(function(){var U=G(this);this.cycleH=(K.fit&&K.height)?K.height:U.height();this.cycleW=(K.fit&&K.width)?K.width:U.width()});K.cssBefore=K.cssBefore||{};K.animIn=K.animIn||{};K.animOut=K.animOut||{};P.not(":eq("+N+")").css(K.cssBefore);if(K.cssFirst){G(P[N]).css(K.cssFirst)}if(K.timeout){K.timeout=parseInt(K.timeout);if(K.speed.constructor==String){K.speed=G.fx.speeds[K.speed]||parseInt(K.speed)}if(!K.sync){K.speed=K.speed/2}while((K.timeout-K.speed)<250){K.timeout+=K.speed}}if(K.easing){K.easeIn=K.easeOut=K.easing}if(!K.speedIn){K.speedIn=K.speed}if(!K.speedOut){K.speedOut=K.speed}K.slideCount=L.length;K.currSlide=N;if(K.random){K.nextSlide=K.currSlide;if(++K.randomIndex==L.length){K.randomIndex=0}K.nextSlide=K.randomMap[K.randomIndex]}else{K.nextSlide=K.startingSlide>=(L.length-1)?0:K.startingSlide+1}var Q=P[N];if(K.before.length){K.before[0].apply(Q,[Q,Q,K,true])}if(K.after.length>1){K.after[1].apply(Q,[Q,Q,K,true])}if(K.click&&!K.next){K.next=K.click}if(K.next){G(K.next).bind("click",function(){return F(L,K,K.rev?-1:1)})}if(K.prev){G(K.prev).bind("click",function(){return F(L,K,K.rev?1:-1)})}if(K.pager){H(L,K)}K.addSlide=function(V,W){var U=G(V),X=U[0];if(!K.autostopCount){K.countdown++}L[W?"unshift":"push"](X);if(K.els){K.els[W?"unshift":"push"](X)}K.slideCount=L.length;U.css("position","absolute");U[W?"prependTo":"appendTo"](R);if(W){K.currSlide++;K.nextSlide++}if(B&&K.cleartype&&!K.cleartypeNoBg){C(U)}if(K.fit&&K.width){U.width(K.width)}if(K.fit&&K.height&&K.height!="auto"){P.height(K.height)}X.cycleH=(K.fit&&K.height)?K.height:U.height();X.cycleW=(K.fit&&K.width)?K.width:U.width();U.css(K.cssBefore);if(K.pager){G.fn.cycle.createPagerAnchor(L.length-1,X,G(K.pager),L,K)}if(typeof K.onAddSlide=="function"){K.onAddSlide(U)}};if(K.timeout||K.continuous){this.cycleTimeout=setTimeout(function(){E(L,K,0,!K.rev)},K.continuous?10:K.timeout+(K.delay||0))}})};function E(N,I,M,O){if(I.busy){return}var L=I.container,Q=N[I.currSlide],P=N[I.nextSlide];if(L.cycleTimeout===0&&!M){return}if(!M&&!L.cyclePause&&((I.autostop&&(--I.countdown<=0))||(I.nowrap&&!I.random&&I.nextSlide<I.currSlide))){if(I.end){I.end(I)}return}if(M||!L.cyclePause){if(I.before.length){G.each(I.before,function(R,S){S.apply(P,[Q,P,I,O])})}var J=function(){if(G.browser.msie&&I.cleartype){this.style.removeAttribute("filter")}G.each(I.after,function(R,S){S.apply(P,[Q,P,I,O])})};if(I.nextSlide!=I.currSlide){I.busy=1;if(I.fxFn){I.fxFn(Q,P,I,J,O)}else{if(G.isFunction(G.fn.cycle[I.fx])){G.fn.cycle[I.fx](Q,P,I,J)}else{G.fn.cycle.custom(Q,P,I,J,M&&I.fastOnEvent)}}}if(I.random){I.currSlide=I.nextSlide;if(++I.randomIndex==N.length){I.randomIndex=0}I.nextSlide=I.randomMap[I.randomIndex]}else{var K=(I.nextSlide+1)==N.length;I.nextSlide=K?0:I.nextSlide+1;I.currSlide=K?N.length-1:I.nextSlide-1}if(I.pager){G.fn.cycle.updateActivePagerLink(I.pager,I.currSlide)}}if(I.timeout&&!I.continuous){L.cycleTimeout=setTimeout(function(){E(N,I,0,!I.rev)},I.timeout)}else{if(I.continuous&&L.cyclePause){L.cycleTimeout=setTimeout(function(){E(N,I,0,!I.rev)},10)}}}G.fn.cycle.updateActivePagerLink=function(I,J){G(I).find("a").removeClass("activeSlide").filter("a:eq("+J+")").addClass("activeSlide")};function F(I,J,M){var L=J.container,K=L.cycleTimeout;if(K){clearTimeout(K);L.cycleTimeout=0}if(J.random&&M<0){J.randomIndex--;if(--J.randomIndex==-2){J.randomIndex=I.length-2}else{if(J.randomIndex==-1){J.randomIndex=I.length-1}}J.nextSlide=J.randomMap[J.randomIndex]}else{if(J.random){if(++J.randomIndex==I.length){J.randomIndex=0}J.nextSlide=J.randomMap[J.randomIndex]}else{J.nextSlide=J.currSlide+M;if(J.nextSlide<0){if(J.nowrap){return false}J.nextSlide=I.length-1}else{if(J.nextSlide>=I.length){if(J.nowrap){return false}J.nextSlide=0}}}}if(J.prevNextClick&&typeof J.prevNextClick=="function"){J.prevNextClick(M>0,J.nextSlide,I[J.nextSlide])}E(I,J,1,M>=0);return false}function H(J,K){var I=G(K.pager);G.each(J,function(L,M){G.fn.cycle.createPagerAnchor(L,M,I,J,K)});G.fn.cycle.updateActivePagerLink(K.pager,K.startingSlide)}G.fn.cycle.createPagerAnchor=function(K,L,I,J,M){var N=(typeof M.pagerAnchorBuilder=="function")?G(M.pagerAnchorBuilder(K,L)):G('<a href="#">'+(K+1)+"</a>");if(N.parents("body").length==0){N.appendTo(I)}N.bind(M.pagerEvent,function(){M.nextSlide=K;var P=M.container,O=P.cycleTimeout;if(O){clearTimeout(O);P.cycleTimeout=0}if(typeof M.pagerClick=="function"){M.pagerClick(M.nextSlide,J[M.nextSlide])}E(J,M,1,M.currSlide<K);return false});if(M.pauseOnPagerHover){N.hover(function(){M.container.cyclePause=1},function(){M.container.cyclePause=0})}};function C(K){function J(L){var L=parseInt(L).toString(16);return L.length<2?"0"+L:L}function I(N){for(;N&&N.nodeName.toLowerCase()!="html";N=N.parentNode){var L=G.css(N,"background-color");if(L.indexOf("rgb")>=0){var M=L.match(/\d+/g);return"#"+J(M[0])+J(M[1])+J(M[2])}if(L&&L!="transparent"){return L}}return"#ffffff"}K.each(function(){G(this).css("background-color",I(this))})}G.fn.cycle.custom=function(T,N,I,K,J){var S=G(T),O=G(N);O.css(I.cssBefore);var L=J?1:I.speedIn;var R=J?1:I.speedOut;var M=J?null:I.easeIn;var Q=J?null:I.easeOut;var P=function(){O.animate(I.animIn,L,M,K)};S.animate(I.animOut,R,Q,function(){if(I.cssAfter){S.css(I.cssAfter)}if(!I.sync){P()}});if(I.sync){P()}};G.fn.cycle.transitions={fade:function(J,K,I){K.not(":eq("+I.startingSlide+")").css("opacity",0);I.before.push(function(){G(this).show()});I.animIn={opacity:1};I.animOut={opacity:0};I.cssBefore={opacity:0};I.cssAfter={display:"none"};I.onAddSlide=function(L){L.hide()}}};G.fn.cycle.ver=function(){return A};G.fn.cycle.defaults={fx:"fade",timeout:4000,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,prevNextClick:null,pager:null,pagerClick:null,pagerEvent:"click",pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:0,nowrap:0,fastOnEvent:0}})(jQuery);(function(A){A.fn.cycle.transitions.scrollUp=function(C,D,B){C.css("overflow","hidden");B.before.push(function(G,E,F){A(this).show();F.cssBefore.top=E.offsetHeight;F.animOut.top=0-G.offsetHeight});B.cssFirst={top:0};B.animIn={top:0};B.cssAfter={display:"none"}};A.fn.cycle.transitions.scrollDown=function(C,D,B){C.css("overflow","hidden");B.before.push(function(G,E,F){A(this).show();F.cssBefore.top=0-E.offsetHeight;F.animOut.top=G.offsetHeight});B.cssFirst={top:0};B.animIn={top:0};B.cssAfter={display:"none"}};A.fn.cycle.transitions.scrollLeft=function(C,D,B){C.css("overflow","hidden");B.before.push(function(G,E,F){A(this).show();F.cssBefore.left=E.offsetWidth;F.animOut.left=0-G.offsetWidth});B.cssFirst={left:0};B.animIn={left:0}};A.fn.cycle.transitions.scrollRight=function(C,D,B){C.css("overflow","hidden");B.before.push(function(G,E,F){A(this).show();F.cssBefore.left=0-E.offsetWidth;F.animOut.left=G.offsetWidth});B.cssFirst={left:0};B.animIn={left:0}};A.fn.cycle.transitions.scrollHorz=function(C,D,B){C.css("overflow","hidden").width();B.before.push(function(I,G,H,F){A(this).show();var E=I.offsetWidth,J=G.offsetWidth;H.cssBefore=F?{left:J}:{left:-J};H.animIn.left=0;H.animOut.left=F?-E:E;D.not(I).css(H.cssBefore)});B.cssFirst={left:0};B.cssAfter={display:"none"}};A.fn.cycle.transitions.scrollVert=function(C,D,B){C.css("overflow","hidden");B.before.push(function(J,G,H,F){A(this).show();var I=J.offsetHeight,E=G.offsetHeight;H.cssBefore=F?{top:-E}:{top:E};H.animIn.top=0;H.animOut.top=F?I:-I;D.not(J).css(H.cssBefore)});B.cssFirst={top:0};B.cssAfter={display:"none"}};A.fn.cycle.transitions.slideX=function(C,D,B){B.before.push(function(G,E,F){A(G).css("zIndex",1)});B.onAddSlide=function(E){E.hide()};B.cssBefore={zIndex:2};B.animIn={width:"show"};B.animOut={width:"hide"}};A.fn.cycle.transitions.slideY=function(C,D,B){B.before.push(function(G,E,F){A(G).css("zIndex",1)});B.onAddSlide=function(E){E.hide()};B.cssBefore={zIndex:2};B.animIn={height:"show"};B.animOut={height:"hide"}};A.fn.cycle.transitions.shuffle=function(E,F,D){var B=E.css("overflow","visible").width();F.css({left:0,top:0});D.before.push(function(){A(this).show()});D.speed=D.speed/2;D.random=0;D.shuffle=D.shuffle||{left:-B,top:15};D.els=[];for(var C=0;C<F.length;C++){D.els.push(F[C])}for(var C=0;C<D.startingSlide;C++){D.els.push(D.els.shift())}D.fxFn=function(L,J,K,G,I){var H=I?A(L):A(J);H.animate(K.shuffle,K.speedIn,K.easeIn,function(){I?K.els.push(K.els.shift()):K.els.unshift(K.els.pop());if(I){for(var N=0,M=K.els.length;N<M;N++){A(K.els[N]).css("z-index",M-N)}}else{var O=A(L).css("z-index");H.css("z-index",parseInt(O)+1)}H.animate({left:0,top:0},K.speedOut,K.easeOut,function(){A(I?this:L).hide();if(G){G()}})})};D.onAddSlide=function(G){G.hide()}};A.fn.cycle.transitions.turnUp=function(C,D,B){B.before.push(function(G,E,F){A(this).show();F.cssBefore.top=E.cycleH;F.animIn.height=E.cycleH});B.onAddSlide=function(E){E.hide()};B.cssFirst={top:0};B.cssBefore={height:0};B.animIn={top:0};B.animOut={height:0};B.cssAfter={display:"none"}};A.fn.cycle.transitions.turnDown=function(C,D,B){B.before.push(function(G,E,F){A(this).show();F.animIn.height=E.cycleH;F.animOut.top=G.cycleH});B.onAddSlide=function(E){E.hide()};B.cssFirst={top:0};B.cssBefore={top:0,height:0};B.animOut={height:0};B.cssAfter={display:"none"}};A.fn.cycle.transitions.turnLeft=function(C,D,B){B.before.push(function(G,E,F){A(this).show();F.cssBefore.left=E.cycleW;F.animIn.width=E.cycleW});B.onAddSlide=function(E){E.hide()};B.cssBefore={width:0};B.animIn={left:0};B.animOut={width:0};B.cssAfter={display:"none"}};A.fn.cycle.transitions.turnRight=function(C,D,B){B.before.push(function(G,E,F){A(this).show();F.animIn.width=E.cycleW;F.animOut.left=G.cycleW});B.onAddSlide=function(E){E.hide()};B.cssBefore={left:0,width:0};B.animIn={left:0};B.animOut={width:0};B.cssAfter={display:"none"}};A.fn.cycle.transitions.zoom=function(C,D,B){B.cssFirst={top:0,left:0};B.cssAfter={display:"none"};B.before.push(function(G,E,F){A(this).show();F.cssBefore={width:0,height:0,top:E.cycleH/2,left:E.cycleW/2};F.cssAfter={display:"none"};F.animIn={top:0,left:0,width:E.cycleW,height:E.cycleH};F.animOut={width:0,height:0,top:G.cycleH/2,left:G.cycleW/2};A(G).css("zIndex",2);A(E).css("zIndex",1)});B.onAddSlide=function(E){E.hide()}};A.fn.cycle.transitions.fadeZoom=function(C,D,B){B.before.push(function(G,E,F){F.cssBefore={width:0,height:0,opacity:1,left:E.cycleW/2,top:E.cycleH/2,zIndex:1};F.animIn={top:0,left:0,width:E.cycleW,height:E.cycleH}});B.animOut={opacity:0};B.cssAfter={zIndex:0}};A.fn.cycle.transitions.blindX=function(D,E,C){var B=D.css("overflow","hidden").width();E.show();C.before.push(function(H,F,G){A(H).css("zIndex",1)});C.cssBefore={left:B,zIndex:2};C.cssAfter={zIndex:1};C.animIn={left:0};C.animOut={left:B}};A.fn.cycle.transitions.blindY=function(D,E,C){var B=D.css("overflow","hidden").height();E.show();C.before.push(function(H,F,G){A(H).css("zIndex",1)});C.cssBefore={top:B,zIndex:2};C.cssAfter={zIndex:1};C.animIn={top:0};C.animOut={top:B}};A.fn.cycle.transitions.blindZ=function(E,F,D){var C=E.css("overflow","hidden").height();var B=E.width();F.show();D.before.push(function(I,G,H){A(I).css("zIndex",1)});D.cssBefore={top:C,left:B,zIndex:2};D.cssAfter={zIndex:1};D.animIn={top:0,left:0};D.animOut={top:C,left:B}};A.fn.cycle.transitions.growX=function(C,D,B){B.before.push(function(G,E,F){F.cssBefore={left:this.cycleW/2,width:0,zIndex:2};F.animIn={left:0,width:this.cycleW};F.animOut={left:0};A(G).css("zIndex",1)});B.onAddSlide=function(E){E.hide().css("zIndex",1)}};A.fn.cycle.transitions.growY=function(C,D,B){B.before.push(function(G,E,F){F.cssBefore={top:this.cycleH/2,height:0,zIndex:2};F.animIn={top:0,height:this.cycleH};F.animOut={top:0};A(G).css("zIndex",1)});B.onAddSlide=function(E){E.hide().css("zIndex",1)}};A.fn.cycle.transitions.curtainX=function(C,D,B){B.before.push(function(G,E,F){F.cssBefore={left:E.cycleW/2,width:0,zIndex:1,display:"block"};F.animIn={left:0,width:this.cycleW};F.animOut={left:G.cycleW/2,width:0};A(G).css("zIndex",2)});B.onAddSlide=function(E){E.hide()};B.cssAfter={zIndex:1,display:"none"}};A.fn.cycle.transitions.curtainY=function(C,D,B){B.before.push(function(G,E,F){F.cssBefore={top:E.cycleH/2,height:0,zIndex:1,display:"block"};F.animIn={top:0,height:this.cycleH};F.animOut={top:G.cycleH/2,height:0};A(G).css("zIndex",2)});B.onAddSlide=function(E){E.hide()};B.cssAfter={zIndex:1,display:"none"}};A.fn.cycle.transitions.cover=function(E,F,D){var G=D.direction||"left";var B=E.css("overflow","hidden").width();var C=E.height();D.before.push(function(J,H,I){I.cssBefore=I.cssBefore||{};I.cssBefore.zIndex=2;I.cssBefore.display="block";if(G=="right"){I.cssBefore.left=-B}else{if(G=="up"){I.cssBefore.top=C}else{if(G=="down"){I.cssBefore.top=-C}else{I.cssBefore.left=B}}}A(J).css("zIndex",1)});if(!D.animIn){D.animIn={left:0,top:0}}if(!D.animOut){D.animOut={left:0,top:0}}D.cssAfter=D.cssAfter||{};D.cssAfter.zIndex=2;D.cssAfter.display="none"};A.fn.cycle.transitions.uncover=function(E,F,D){var G=D.direction||"left";var B=E.css("overflow","hidden").width();var C=E.height();D.before.push(function(J,H,I){I.cssBefore.display="block";if(G=="right"){I.animOut.left=B}else{if(G=="up"){I.animOut.top=-C}else{if(G=="down"){I.animOut.top=C}else{I.animOut.left=-B}}}A(J).css("zIndex",2);A(H).css("zIndex",1)});D.onAddSlide=function(H){H.hide()};if(!D.animIn){D.animIn={left:0,top:0}}D.cssBefore=D.cssBefore||{};D.cssBefore.top=0;D.cssBefore.left=0;D.cssAfter=D.cssAfter||{};D.cssAfter.zIndex=1;D.cssAfter.display="none"};A.fn.cycle.transitions.toss=function(E,F,D){var B=E.css("overflow","visible").width();var C=E.height();D.before.push(function(I,G,H){A(I).css("zIndex",2);H.cssBefore.display="block";if(!H.animOut.left&&!H.animOut.top){H.animOut={left:B*2,top:-C/2,opacity:0}}else{H.animOut.opacity=0}});D.onAddSlide=function(G){G.hide()};D.cssBefore={left:0,top:0,zIndex:1,opacity:1};D.animIn={left:0};D.cssAfter={zIndex:2,display:"none"}};A.fn.cycle.transitions.wipe=function(K,H,C){var J=K.css("overflow","hidden").width();var F=K.height();C.cssBefore=C.cssBefore||{};var D;if(C.clip){if(/l2r/.test(C.clip)){D="rect(0px 0px "+F+"px 0px)"}else{if(/r2l/.test(C.clip)){D="rect(0px "+J+"px "+F+"px "+J+"px)"}else{if(/t2b/.test(C.clip)){D="rect(0px "+J+"px 0px 0px)"}else{if(/b2t/.test(C.clip)){D="rect("+F+"px "+J+"px "+F+"px 0px)"}else{if(/zoom/.test(C.clip)){var L=parseInt(F/2);var E=parseInt(J/2);D="rect("+L+"px "+E+"px "+L+"px "+E+"px)"}}}}}}C.cssBefore.clip=C.cssBefore.clip||D||"rect(0px 0px 0px 0px)";var G=C.cssBefore.clip.match(/(\d+)/g);var L=parseInt(G[0]),B=parseInt(G[1]),I=parseInt(G[2]),E=parseInt(G[3]);C.before.push(function(T,O,R){if(T==O){return}var N=A(T).css("zIndex",2);var M=A(O).css({zIndex:3,display:"block"});var Q=1,P=parseInt((R.speedIn/13))-1;function S(){var V=L?L-parseInt(Q*(L/P)):0;var W=E?E-parseInt(Q*(E/P)):0;var X=I<F?I+parseInt(Q*((F-I)/P||1)):F;var U=B<J?B+parseInt(Q*((J-B)/P||1)):J;M.css({clip:"rect("+V+"px "+U+"px "+X+"px "+W+"px)"});(Q++<=P)?setTimeout(S,13):N.css("display","none")}S()});C.cssAfter={};C.animIn={left:0};C.animOut={left:0}}})(jQuery);jQuery.fn.extend({everyTime:function(interval,label,fn,times,belay){return this.each(function(){jQuery.timer.add(this,interval,label,fn,times,belay);});},oneTime:function(interval,label,fn){return this.each(function(){jQuery.timer.add(this,interval,label,fn,1);});},stopTime:function(label,fn){return this.each(function(){jQuery.timer.remove(this,label,fn);});}});jQuery.extend({timer:{guid:1,global:{},regex:/^([0-9]+)\s*(.*s)?$/,powers:{'ms':1,'cs':10,'ds':100,'s':1000,'das':10000,'hs':100000,'ks':1000000},timeParse:function(value){if(value==undefined||value==null)
return null;var result=this.regex.exec(jQuery.trim(value.toString()));if(result[2]){var num=parseInt(result[1],10);var mult=this.powers[result[2]]||1;return num*mult;}else{return value;}},add:function(element,interval,label,fn,times,belay){var counter=0;if(jQuery.isFunction(label)){if(!times)
times=fn;fn=label;label=interval;}
interval=jQuery.timer.timeParse(interval);if(typeof interval!='number'||isNaN(interval)||interval<=0)
return;if(times&&times.constructor!=Number){belay=!!times;times=0;}
times=times||0;belay=belay||false;if(!element.$timers)
element.$timers={};if(!element.$timers[label])
element.$timers[label]={};fn.$timerID=fn.$timerID||this.guid++;var handler=function(){if(belay&&this.inProgress)
return;this.inProgress=true;if((++counter>times&&times!==0)||fn.call(element,counter)===false)
jQuery.timer.remove(element,label,fn);this.inProgress=false;};handler.$timerID=fn.$timerID;if(!element.$timers[label][fn.$timerID])
element.$timers[label][fn.$timerID]=window.setInterval(handler,interval);if(!this.global[label])
this.global[label]=[];this.global[label].push(element);},remove:function(element,label,fn){var timers=element.$timers,ret;if(timers){if(!label){for(label in timers)
this.remove(element,label,fn);}else if(timers[label]){if(fn){if(fn.$timerID){window.clearInterval(timers[label][fn.$timerID]);delete timers[label][fn.$timerID];}}else{for(var fn in timers[label]){window.clearInterval(timers[label][fn]);delete timers[label][fn];}}
for(ret in timers[label])break;if(!ret){ret=null;delete timers[label];}}
for(ret in timers)break;if(!ret)
element.$timers=null;}}}});if(jQuery.browser.msie)
jQuery(window).one("unload",function(){var global=jQuery.timer.global;for(var label in global){var els=global[label],i=els.length;while(--i)
jQuery.timer.remove(els[i],label);}});(function($){$.fn.innerfade=function(options){return this.each(function(){$.innerfade(this,options);});};$.innerfade=function(container,options){var settings={'animationtype':'fade','speed':'normal','type':'sequence','timeout':2000,'containerheight':'auto','runningclass':'innerfade','children':null};if(options)
$.extend(settings,options);if(settings.children===null)
var elements=$(container).children();else
var elements=$(container).children(settings.children);if(elements.length>1){$(container).css('position','relative').css('height',settings.containerheight).addClass(settings.runningclass);for(var i=0;i<elements.length;i++){$(elements[i]).css('z-index',String(elements.length-i)).css('position','absolute').hide();};if(settings.type=="sequence"){setTimeout(function(){$.innerfade.next(elements,settings,1,0);},settings.timeout);$(elements[0]).show();}else if(settings.type=="random"){var last=Math.floor(Math.random()*(elements.length));setTimeout(function(){do{current=Math.floor(Math.random()*(elements.length));}while(last==current);$.innerfade.next(elements,settings,current,last);},settings.timeout);$(elements[last]).show();}else if(settings.type=='random_start'){settings.type='sequence';var current=Math.floor(Math.random()*(elements.length));setTimeout(function(){$.innerfade.next(elements,settings,(current+1)%elements.length,current);},settings.timeout);$(elements[current]).show();}else{alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');}}};$.innerfade.next=function(elements,settings,current,last){if(settings.animationtype=='slide'){$(elements[last]).slideUp(settings.speed);$(elements[current]).slideDown(settings.speed);}else if(settings.animationtype=='fade'){$(elements[last]).fadeOut(settings.speed);$(elements[current]).fadeIn(settings.speed,function(){removeFilter($(this)[0]);});}else
alert('Innerfade-animationtype must either be \'slide\' or \'fade\'');if(settings.type=="sequence"){if((current+1)<elements.length){current=current+1;last=current-1;}else{current=0;last=elements.length-1;}}else if(settings.type=="random"){last=current;while(current==last)
current=Math.floor(Math.random()*elements.length);}else
alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');setTimeout((function(){$.innerfade.next(elements,settings,current,last);}),settings.timeout);};})(jQuery);function removeFilter(element){if(element.style.removeAttribute){element.style.removeAttribute('filter');}}
function initHomepage(){var catName="Home Page Actions";$('#work-back-btn').click(function(){$.scrollTo('#page',600,'linear');return false;});$('#hd ul.nav .work a, #capabilities-back-btn').click(function(){$.scrollTo('#work',600,'linear');return false;});$('#hd ul.nav .capabilities a, #work-next-btn, #clients-back-btn').click(function(){$.scrollTo('#capabilities',600,'linear');return false;});$('#hd ul.nav .clients a, #capabilities-next-btn, #about-back-btn').click(function(){$.scrollTo('#clients',600,'linear');return false;});$('#hd ul.nav .about a, #clients-next-btn, #static-back-btn').click(function(){$.scrollTo('#about',600,'linear');return false;});$('#hd ul.nav .static a, #about-next-btn, #final-back-btn').click(function(){$.scrollTo('#static-back-btn',600,'linear');return false;});$('#static-next-btn').click(function(){$.scrollTo('#final-content',400,'linear');return false;});$('#work-back-btn').click(function(){$.galog.event(catName,'click',"Work Back Button");return false;});$('#work-next-btn').click(function(){$.galog.event(catName,'click',"Work Next Button");return false;});$('#capabilities-back-btn').click(function(){$.galog.event(catName,'click',"Capabilities Back Button");return false;});$('#capabilities-next-btn').click(function(){$.galog.event(catName,'click',"Capabilities Next Button");return false;});$('#clients-back-btn').click(function(){$.galog.event(catName,'click',"Clients Back Button");return false;});$('#clients-next-btn').click(function(){$.galog.event(catName,'click',"Clients Next Button");return false;});$('#about-back-btn').click(function(){$.galog.event(catName,'click',"About Back Button");return false;});$('#about-next-btn').click(function(){$.galog.event(catName,'click',"About Next Button");return false;});$('#static-back-btn').click(function(){$.galog.event(catName,'click',"Static Back Button");return false;});$('#static-next-btn').click(function(){$.galog.event(catName,'click',"Static Next Button");return false;});$('#final-back-btn').click(function(){$.galog.event(catName,'click',"Footer Back Button");return false;});$('#hd ul.nav .work a').click(function(){$.galog.event(catName,'click',"Work Top Nav Button");return false;});$('#hd ul.nav .capabilities a').click(function(){$.galog.event(catName,'click',"Capabilities Top Nav Button");return false;});$('#hd ul.nav .clients a').click(function(){$.galog.event(catName,'click',"Clients Top Nav Button");return false;});$('#hd ul.nav .about a').click(function(){$.galog.event(catName,'click',"About Top Nav Button");return false;});$('#hd ul.nav .static a').click(function(){$.galog.event(catName,'click',"Static Top Nav Button");return false;});$('#ft #home-footer-contact-form').submit(function(){$.galog.event(catName,'submit',"Footer Contact Form");var formData=$(this).serialize();var url=$('#ft #home-footer-contact-form').attr('action');$('#ft #home-footer-contact-form :submit').hide();$('#ft #home-footer-contact-form-submit-loading').fadeIn(300);$.post(url,formData,function(data){var errStrIndex=data.indexOf('[ERROR]');var message=data;var err=false;if(errStrIndex!=-1){err=true;message=data.substring(7);}
$('#ft .home-col1 p.error-message').hide();$('#ft .home-col1 p.error-message').html(message);$('#ft .home-col1 p.error-message').fadeIn();$('#ft #home-footer-contact-form-submit-loading').hide();$('#ft #home-footer-contact-form :submit').show();if(!err){$('#ft #home-footer-contact-form')[0].reset();}});return false;});}
var prevAboutLibDef;var currentAboutLibWordIndex=0;var currentWordTypeDefinition;var aboutLibsCatName="Madlib Actions";function initAbout(currentSubmissionId,useAjax){if(!$('#content .about #about-libs')){return;}
var wordsCompleted=false;useAjax=useAjax==undefined?true:useAjax;$('#content .about #about-libs').show();$('.word-entry:first').show();updateAboutLibsProgressBar(0);showWordTypeDefinition(0);$('#content .about #about-help-btn').click(function(){$.galog.event(aboutLibsCatName,'click',"Madlib Help Button");$(currentWordTypeDefinition+':hidden').fadeIn(100);});$('#content .about #about-help-btn').mouseout(function(){if($(currentWordTypeDefinition+':visible'))$(currentWordTypeDefinition).fadeOut(300);});$('#content .about #enter-word-fields').cycle({fx:'shuffle',shuffle:{top:-50,left:-30},speed:'fast',timeout:0,next:'#next-word-btn',nowrap:true,speed:350,after:function(){if(currentAboutLibWordIndex>0){$(this).children(':text').get(0).select();}},prevNextClick:function(isNext,zeroBasedSlideIndex,slideElement){var nexInputText=$('#content .about #enter-word-fields div:nth-child('+(zeroBasedSlideIndex+1)+') :text').attr('value');$('#content .about #enter-word-fields div:nth-child('+zeroBasedSlideIndex+')').css('background','#f1a32f');currentAboutLibWordIndex=zeroBasedSlideIndex+1;if(nexInputText&&nexInputText.length>0){$('#content .about #next-word-btn').show();}else{$('#content .about #next-word-btn').hide();}
showWordTypeDefinition(zeroBasedSlideIndex);var numEntries=parseInt($('#id_form-TOTAL_FORMS').attr('value'));updateAboutLibsProgressBar(zeroBasedSlideIndex);if(zeroBasedSlideIndex>=numEntries){$('#content .about #next-word-btn').hide();$('#content .about #static-submit-btn').show();$('#content .about #about-help-btn').hide();$('#content .about  #about-libs-words-head').text('Thats It! Please Provide Your Name.');}else{$('#content .about #about-help-btn').show();}}});$('#content .about #about-libs-form :text').keyup(function(event){var isNameField=($(this).attr('id')=='id_name_aboutlib');var text=$(this).attr('value')
switch(event.keyCode){case 13:if(text&&text!=''&&text.length>0){if(isNameField){$('#content .about #static-submit-btn').click();}else{$('#content .about #next-word-btn').click();}}
break;default:if(!isNameField){if(text&&text!=''&&text.length>0){$('#content .about #next-word-btn').show();}else{$('#content .about #next-word-btn').hide();}}}});$('#content .about #about-libs-form :text').attr('text','');$('#content .about #about-libs-form :text:first').keyup();$('#content .about #about-libs-form').submit(function(){if(!wordsCompleted)return false;return true;});$('#content .about #static-submit-btn').click(function(){$.galog.event(aboutLibsCatName,'submit',"Madlib Subbmitted");$('#content .about #static-submit-btn').hide();$('#content div.about #about-lib-submit-loading').fadeIn(300);if(useAjax){var formData=$('#content .about #about-libs-form').serialize();var url=$('#content .about #about-libs-form').attr('action');$.post(url,formData,function(data){$('#content .about #about-libs').hide();$('#content .about #about-libs').html(data);initAbout();$('#content .about #about-libs').fadeIn();});}else{wordsCompleted=true;$('#content .about #about-libs-form').submit();}
return false;});initRatingBox(currentSubmissionId);}
function updateAboutLibsProgressBar(i){var numEntries=parseInt($('#id_form-TOTAL_FORMS').attr('value'));var fullWidth=parseInt($('#content .about .progress-bar .bar').css('width'));var sizePerWord=fullWidth/numEntries;var newCoverWidth=sizePerWord*(numEntries-(i));$('#content .about .progress-bar .cover').animate({width:newCoverWidth},500);}
function showWordTypeDefinition(i){currentWordTypeDefinition='#content .about #def-'+i;var numEntries=parseInt($('#content .about #id_form-TOTAL_FORMS').attr('value'));if(i<numEntries){$('#content .about #progress-nums').html((i+1)+' of '+numEntries);}}
function initRatingBox(currentSubmissionId){$('#rate-about-lib-box #lame-btn').click(function(){$.galog.event(aboutLibsCatName,'click',"Madlib Rated Lame");var url=$(this).attr('href');$('#rate-about-lib-box #lame-btn').hide();$('#rate-about-lib-box #awesome-btn').hide();$('#content div.about #rating-submit-loading').show();$.get(url,{},function(data){$('#rating').html(data);$('#content div.about #rating-submit-loading').hide();$('#content div.about #voted-message').show();});return false;});$('#rate-about-lib-box #awesome-btn').click(function(){$.galog.event(aboutLibsCatName,'click',"Madlib Rated Awesome");var url=$(this).attr('href');$('#rate-about-lib-box #lame-btn').hide();$('#rate-about-lib-box #awesome-btn').hide();$('#content div.about #rating-submit-loading').show();$.get(url,{},function(data){$('#rating').html(data);$('#content div.about #rating-submit-loading').hide();$('#content div.about #voted-message').show()});return false;});$('#view-another-madlib-link').click(function(){if(currentSubmissionId){$.galog.event(aboutLibsCatName,'click',"View Another Madlib");var url='/about/submission/view_new/'+currentSubmissionId+'/';$.get(url,{},function(data){$('#view-submission-target').hide();$('#view-submission-target').html(data);$('#view-submission-target').fadeIn();});}
return false;});}
var workThumbCurrentIndex=0;var workProjectCurrentIndex=-1;var numMainThumbs;var previewId;var workProjectIds=[];var otherProjectsPage=2;var projectsScollable;var projectsPerPage=8;var workSectionCatName="Work Actions";function initWork(){$f("project-video-player","/media/flash/flowplayer.swf",{key:'#@402a23546ef10fa7f7d',clip:getProjectVideoClip(projectFirstItemVideo),plugins:{controls:null},play:{url:"/media/flash/playbutton.swf"}});initMainProject();$('#content .projects #paged-projects-more-btn').click(function(){var url='/work/get-page-of-projects/'+otherProjectsPage+'/'+projectsPerPage+'/';$.get(url,{},function(data){$.galog.event(workSectionCatName,'click',"View More Projects Button");var numItems=$('#content div.projects #other-projects li').length;$('#content div.projects #other-projects').append(data);var newItems=$('#content .projects #other-projects li:gt('+(numItems-1)+')');newItems.hide();newItems.fadeIn();$(newItems).filter('.project-image').mouseover(function(event){$(this).find('.project-hover').show();});$(newItems).filter('.project-image').mouseout(function(event){$(this).find('.project-hover').hide();});$.scrollTo('#content .projects #other-projects li:nth-child('+numItems+')',600,'linear');otherProjectsPage++;if(otherProjectsPage>totalOtherProjectsPages){$('#content div.projects #paged-projects-more-btn').hide();}
if($.browser.msie){$('#content div.home #capabilities').html($('#content div.home #capabilities').html());}});return false;});$('#content div.projects #see-more-form').hide();$('#content div.projects #see-more-form #see-more-form-close-btn').show();initRequestForm();if($("#testimonial")){$("#testimonial").innerfade({animationtype:'fade',speed:750,timeout:20000,type:'random',containerheight:'130px'});testimonialsInnerfadeRunning=true;}}
function initMainProject(){workThumbCurrentIndex=0;numMainThumbs=$('#content div.projects #main-thumbs .items li').length;$('#content div.projects .project-image').mouseover(function(event){$(this).find('.project-hover').show();});$('#content div.projects .project-image').mouseout(function(event){$(this).find('.project-hover').hide();});if(numMainThumbs>1){if($('#content div.projects #main-thumbs ul.items li').length>0){$('#content div.projects #main-thumbs').css('overflow','visible');if($.browser.msie){$('#content div.projects #main-thumbs ul.items li').css('height','76px');projectsScollable=$('#content div.projects #main-thumbs').scrollable({size:4,vertical:true});}else{projectsScollable=$('#content div.projects #main-thumbs').scrollable({size:4,vertical:true});}}}
if(numMainThumbs<5){$('#content .projects #main-thumbs').css('margin-left','0');$('#content .projects #main-thumbs div.navi').hide();}else{$('#content .projects #main-thumbs').css('margin-top','36px');$('#content div.projects #main-project div.social-bookmarking').css('margin-top','-37px');}
if(workProjectIds.length>1){if(workProjectCurrentIndex==-1){workProjectCurrentIndex=$.inArray(workInitialProjectId,workProjectIds);}
$('#content div.projects #project-info #prev-project-btn').show();$('#content div.projects #project-info #prev-project-btn').click(function(){$.galog.event(workSectionCatName,'click',"Previous Project Button");if(workProjectCurrentIndex>0){workProjectCurrentIndex--;}else{workProjectCurrentIndex=workProjectIds.length-1;}
getMainProject(workProjectIds[workProjectCurrentIndex]);});$('#content div.projects #project-info #next-project-btn').show();$('#content div.projects #project-info #next-project-btn').click(function(){$.galog.event(workSectionCatName,'click',"Next Project Button");if(workProjectCurrentIndex<workProjectIds.length-1){workProjectCurrentIndex++;}else{workProjectCurrentIndex=0;}
getMainProject(workProjectIds[workProjectCurrentIndex]);});}
if(projectFirstItemVideo.length>0){updateProjectVideo(projectFirstItemVideoInitialImage,projectFirstItemVideo,projectFirstItemVideoWidth,projectFirstItemVideoHeight);}
$('#content div.projects #project-info #project-view-website').click(function(){$.galog.event(workSectionCatName,'click',"View Website Button");});}
function getProjectVideoClip(url){var clip={onStart:function(){$.galog.event(workSectionCatName,'view',"Project Video Started: "+this.getClip().url);},onFinish:function(){$.galog.event(workSectionCatName,'view',"Project Video Finished: "+this.getClip().url);}};if(url&&url.length>0){clip.url=url;}
return clip;}
function initRequestForm(showForm){if(showForm){$('#content .projects #see-more-form').fadeIn(200);}
$('#content .projects #see-more-form-close-btn').click(function(){$.galog.event(workSectionCatName,'click',"Hide Private Preview Form");$('#content div.projects #work-show-private-request-btn').slideDown(200);$('#content div.projects #see-more-form').slideUp(200);$('#content div.projects #see-more-form-load-target :submit').show();});$('#content .projects #request-more-info-form-tag').submit(function(){$.galog.event(workSectionCatName,'submit',"Private Preview Form Submitted");var formData=$(this).serialize();var url=$('#content .projects #request-more-info-form-tag').attr('action');$('#content div.projects #see-more-form-load-target :submit').hide();$('#content div.projects #see-more-form-load-target :input').attr('disabled',true);$('#content div.projects #private-request-submit-loading').fadeIn(300);$.post(url,formData,function(data){$('#content div.projects #see-more-form-load-target').hide();$('#content div.projects #see-more-form-load-target').html(data);$('#content div.projects #see-more-form-load-target').fadeIn();initRequestForm(true);});return false;});$('#content .projects #work-show-private-request-btn').click(function(){$.galog.event(workSectionCatName,'click',"Show Private Preview Form");$(this).slideUp(200);$('#content .projects #see-more-form').slideDown(500);});}
function scrollWorkThumbsTo(i){$('#content div.projects #main-thumbs').scrollTo('li:eq('+i+')',300,{axis:'x'});}
function getMainProject(project_id,project_slug){var url;clearProjectVideo();if(previewId!=undefined){url='/preview_projects/'+previewId+'/get/'+project_id+'/';}else{url='/project/get/'+project_id+'/';if(project_slug){url+=project_slug+'/';}}
$.galog.event(workSectionCatName,'view',"View Project: "+url);$.scrollTo('#content .projects #main-project',300);$('#content div.projects #main-project-image-loading').fadeIn(500);$.get(url,{},function(data){$('#content div.projects #main-project-load-target').html(data);$('#content div.projects #main-project-load-target .fadeIn').hide();$('#content div.projects #main-project-load-target .fadeIn').fadeIn();initMainProject();tb_init('#content div.projects #main-project-load-target .thickbox');});workProjectCurrentIndex=$.inArray(project_id,workProjectIds);}
function updateProjectMainImage(src,srcFull,srcVideo,vidWidth,vidHeight){var curSrc=$('#content div.projects #main-project-image').attr('src');var mainImgSrc=src;if(mainImgSrc!=curSrc){$.galog.event(workSectionCatName,'click',"Click Thumb to View Project Image: "+src);$('#content div.projects #main-project-image-loading').fadeIn(500,function(){$('#content div.projects #main-project-image-container').unbind('click');if(srcVideo&&srcVideo.length>0){$('#content div.projects #main-project-image-container').removeAttr('href');}else if(srcFull&&srcFull.length>0){$('#content div.projects #main-project-image-container').attr('href',srcFull);$('#content div.projects #main-project-image-container').addClass('thickbox');tb_init('#content div.projects #main-project-load-target .thickbox');}else{$('#content div.projects #main-project-image-container').removeAttr('href');}
if(!srcVideo||srcVideo.length==0){clearProjectVideo();}
$('#content div.projects #main-project-image').attr('src',mainImgSrc);$('#content div.projects #main-project-image').bind('load',function(){$(this).unbind('load');$('#content div.projects #main-project-image-loading').fadeOut();if(srcVideo&&srcVideo.length>0){updateProjectVideo(srcFull,srcVideo,vidWidth,vidHeight);}});});}}
function clearProjectVideo(){$f('project-video-player').unload();$('#content div.projects #project-video-player-container').hide();}
function updateProjectVideo(initialImgSrc,srcVideo,vidWidth,vidHeight){$('#content div.projects #project-video-player-image').attr('src',initialImgSrc);$('#content div.projects #project-video-player').attr('href',srcVideo);$('#content div.projects #project-video-player').css('width',vidWidth+'px');$('#content div.projects #project-video-player').css('height',vidHeight+'px');$('#content div.projects #project-video-player-container').show();var player=$f('project-video-player');if(srcVideo.length>0){player.play(getProjectVideoClip(srcVideo));}}
var featuredLogos=[];var numLogos;var currentLogoIndex=0;function initClients(){if(featuredLogos.length>0){$('#content div.clients #featured-logos').show();replaceLogos();if(featuredLogos.length>3){$("#featured-logos").everyTime("10s",function(){replaceLogos();});}}
if(!testimonialsInnerfadeRunning){$("#testimonial").innerfade({animationtype:'fade',speed:750,timeout:20000,type:'random',containerheight:'150px'});}}
function replaceLogos(){$(".featured-logo > img").each(function(i){if(currentLogoIndex>featuredLogos.length-1){currentLogoIndex=0;}
$(this).fadeOut("slow",function(){if(currentLogoIndex<featuredLogos.length){$(this).attr('src',featuredLogos[currentLogoIndex++]).fadeIn("slow");}else if(featuredLogos.length>0){currentLogoIndex=0;$(this).attr('src',featuredLogos[currentLogoIndex++]).fadeIn("slow");}});});}
