/* jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
/* jQuery.LocalScroll - Animated scrolling navigation, using anchors.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/11/2009
 * @author Ariel Flesler
 * @version 1.2.7
 **/
;(function($){var l=location.href.replace(/#.*/,'');var g=$.localScroll=function(a){$('body').localScroll(a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location.hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e)i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)}).end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this).is(b.filter))}};function i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore.call(b,a,f,h)===false)return;if(b.stop)h.stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$('<a> </a>').attr(j,d).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location=e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery);

/* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 * TERMS OF USE - jQuery Easing
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g);},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a;},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a;},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a;}return -h/2*((--f)*(f-2)-1)+a;}});

// Back to Top and Sidebar Scroller Easer
$(document).ready(function(){$.localScroll({duration:500,easing:"easeInOutQuad"});});$(function(){var b=$("#sidebar").offset();var a=25;$(window).scroll(function(){if($(window).scrollTop()>b.top){$("#sidebar").stop().animate({marginTop:$(window).scrollTop()-b.top+a,},300);}else{$("#sidebar").stop().animate({marginTop:0});}});});

// Quicktime
var gArgCountErr='The "%%" function requires an even number of arguments.\nArguments should be in the form "atttributeName", "attributeValue", ...';var gTagAttrs=null;var gQTGeneratorVersion=1.2;var gQTBehaviorID="qt_event_source";var gQTEventsEnabled=false;function AC_QuickTimeVersion(){return gQTGeneratorVersion;}function _QTComplain(b,a){a=a.replace("%%",b);alert(a);}function _QTIsMSIE(){var b=navigator.userAgent.toLowerCase();var a=/msie/.test(b)&&!/opera/.test(b);return a;}function _QTGenerateBehavior(){return objTag='<!--[if IE]><object id="'+gQTBehaviorID+'" classid="clsid:CB927D12-4FF7-4a9e-A169-56E4B8A75598"></object><![endif]-->';}function _QTPageHasBehaviorObject(f,b){var c=false;var d=document.getElementsByTagName("object");for(var a=0,e;e=d[a];a++){if(e.getAttribute("classid")=="clsid:CB927D12-4FF7-4a9e-A169-56E4B8A75598"){if(e.getAttribute("id")==gQTBehaviorID){c=false;}break;}}return c;}function _QTShouldInsertBehavior(){var a=false;if(gQTEventsEnabled&&_QTIsMSIE()&&!_QTPageHasBehaviorObject()){a=true;}return a;}function _QTAddAttribute(d,a,b){var c;c=gTagAttrs[d+a];if(null==c){c=gTagAttrs[a];}if(null!=c){if(0==a.indexOf(d)&&(null==b)){b=a.substring(d.length);}if(null==b){b=a;}return" "+b+'="'+c+'"';}else{return"";}}function _QTAddObjectAttr(a,b){if(0==a.indexOf("emb#")){return"";}if(0==a.indexOf("obj#")&&(null==b)){b=a.substring(4);}return _QTAddAttribute("obj#",a,b);}function _QTAddEmbedAttr(a,b){if(0==a.indexOf("obj#")){return"";}if(0==a.indexOf("emb#")&&(null==b)){b=a.substring(4);}return _QTAddAttribute("emb#",a,b);}function _QTAddObjectParam(a,d){var e;var c="";var b=(d)?" />":">";if(-1==a.indexOf("emb#")){e=gTagAttrs["obj#"+a];if(null==e){e=gTagAttrs[a];}if(0==a.indexOf("obj#")){a=a.substring(4);}if(null!=e){c='<param name="'+a+'" value="'+e+'"'+b;}}return c;}function _QTDeleteTagAttrs(){for(var a=0;a<arguments.length;a++){var b=arguments[a];delete gTagAttrs[b];delete gTagAttrs["emb#"+b];delete gTagAttrs["obj#"+b];}}function _QTGenerate(b,c,f){if(f.length<4||(0!=(f.length%2))){_QTComplain(b,gArgCountErr);return"";}gTagAttrs=new Object();gTagAttrs.src=f[0];gTagAttrs.width=f[1];gTagAttrs.height=f[2];gTagAttrs.classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";gTagAttrs.pluginspage="http://www.apple.com/quicktime/download/";var a=f[3];if((null==a)||(""==a)){a="7,3,0,0";}gTagAttrs.codebase="http://www.apple.com/qtactivex/qtplugin.cab#version="+a;var g,e;for(var i=4;i<f.length;i+=2){g=f[i].toLowerCase();e=f[i+1];gTagAttrs[g]=e;if(("postdomevents"==g)&&(e.toLowerCase()!="false")){gQTEventsEnabled=true;if(_QTIsMSIE()){gTagAttrs["obj#style"]="behavior:url(#"+gQTBehaviorID+")";}}}var h="<object "+_QTAddObjectAttr("classid")+_QTAddObjectAttr("width")+_QTAddObjectAttr("height")+_QTAddObjectAttr("codebase")+_QTAddObjectAttr("name")+_QTAddObjectAttr("id")+_QTAddObjectAttr("tabindex")+_QTAddObjectAttr("hspace")+_QTAddObjectAttr("vspace")+_QTAddObjectAttr("border")+_QTAddObjectAttr("align")+_QTAddObjectAttr("class")+_QTAddObjectAttr("title")+_QTAddObjectAttr("accesskey")+_QTAddObjectAttr("noexternaldata")+_QTAddObjectAttr("obj#style")+">"+_QTAddObjectParam("src",c);var d="<embed "+_QTAddEmbedAttr("src")+_QTAddEmbedAttr("width")+_QTAddEmbedAttr("height")+_QTAddEmbedAttr("pluginspage")+_QTAddEmbedAttr("name")+_QTAddEmbedAttr("id")+_QTAddEmbedAttr("align")+_QTAddEmbedAttr("tabindex");_QTDeleteTagAttrs("src","width","height","pluginspage","classid","codebase","name","tabindex","hspace","vspace","border","align","noexternaldata","class","title","accesskey","id","style");for(var g in gTagAttrs){e=gTagAttrs[g];if(null!=e){d+=_QTAddEmbedAttr(g);h+=_QTAddObjectParam(g,c);}}return h+d+"></embed></object>";}function QT_GenerateOBJECTText(){var a=_QTGenerate("QT_GenerateOBJECTText",false,arguments);if(_QTShouldInsertBehavior()){a=_QTGenerateBehavior()+a;}return a;}function QT_GenerateOBJECTText_XHTML(){var a=_QTGenerate("QT_GenerateOBJECTText_XHTML",true,arguments);if(_QTShouldInsertBehavior()){a=_QTGenerateBehavior()+a;}return a;}function QT_WriteOBJECT(){var a=_QTGenerate("QT_WriteOBJECT",false,arguments);if(_QTShouldInsertBehavior()){document.writeln(_QTGenerateBehavior());}document.writeln(a);}function QT_WriteOBJECT_XHTML(){var a=_QTGenerate("QT_WriteOBJECT_XHTML",true,arguments);if(_QTShouldInsertBehavior()){document.writeln(_QTGenerateBehavior());}document.writeln(a);}function QT_GenerateBehaviorOBJECT(){return _QTGenerateBehavior();}function QT_ReplaceElementContents(){var d=arguments[0];var c=[];for(var b=1;b<arguments.length;b++){c.push(arguments[b]);}var a=_QTGenerate("QT_ReplaceElementContents",false,c);if(a.length>0){d.innerHTML=a;}}function QT_ReplaceElementContents_XHTML(){var d=arguments[0];var c=[];for(var b=1;b<arguments.length;b++){c.push(arguments[b]);}var a=_QTGenerate("QT_ReplaceElementContents_XHTML",true,c);if(a.length>0){d.innerHTML=a;}}function _FixIEController(b){if(navigator.appName!="Microsoft Internet Explorer"){return;}var a=b.lastChild;if(!a.GetControllerVisible()){}setTimeout(function(){a.SetControllerVisible(true);},100);}function _FixOperaOpacity(a){if(navigator.appName!="Opera"){return;}a.style.opacity="1.0";}function QT_ReplaceWithPoster(){var c=Array.prototype.slice.call(arguments);var b=c.shift();var h=c.shift();var d=c.shift();var g=c[0];var e=c[1];var a=c[2];if(navigator.platform.indexOf("iPhone")>-1){QT_ReplaceElementContents(d,h,e,a,"","href",g,"target","myself","controller","false","autoplay","true","scale","aspect");}else{d.style.position="relative";d.style.width=e+"px";d.style.height=a+"px";d.style.textAlign="center";d.style.backgroundImage="url("+h+")";d.style.backgroundRepeat="no-repeat";d.style.backgroundPosition="top center";d.args=c;var f=d.appendChild(document.createElement("span"));f.innerHTML=b;f.className="playButton";_FixOperaOpacity(f);d.onclick=function(){d.onclick="";f.style.display="none";var i=d.appendChild(document.createElement("div"));i.className="playBackground";i.style.opacity="0";i.style.width=d.style.width;i.style.height=d.style.height;var j=setInterval(function(){var k=parseFloat(i.style.opacity);k=Math.min(1,k+0.2);i.style.opacity=k;i.style.filter="alpha(opacity="+(k*100)+")";},25);setTimeout(function(){clearInterval(j);d.style.backgroundImage="";d.style.backgroundColor="rgb(0,0,0)";i.style.opacity="1.";i.style.filter="alpha(opacity=100)";var k=_QTGenerate("QT_WriteOBJECT_XHTML",true,c);if(k.length>0){d.innerHTML=k;}_FixIEController(this);},250);};}}function QT_WritePoster_XHTML(){var f=Array.prototype.slice.call(arguments);var g=f.shift();var i=f.shift();var a=f[0];var c=f[1];var h=f[2];if(navigator.platform.indexOf("iPhone")>-1){QT_WriteOBJECT_XHTML(i,c,h,"","href",a,"target","myself","controller","false","autoplay","true","scale","aspect");}else{var b="qtp_poster_div_id_"+Math.random();document.writeln('<div id="'+b+'"></div>');var e=document.getElementById(b);e.id="";e.style.position="relative";e.style.width=c+"px";e.style.height=h+"px";e.style.textAlign="left";e.style.backgroundImage="url("+i+")";e.style.backgroundRepeat="no-repeat";e.style.backgroundPosition="top center";var d=e.appendChild(document.createElement("span"));d.innerHTML=g;d.className="playButton";_FixOperaOpacity(d);e.onclick=function(){e.onclick="";d.style.display="none";var j=e.appendChild(document.createElement("div"));j.className="playBackground";j.style.opacity="0";j.style.width=e.style.width;j.style.height=e.style.height;var k=setInterval(function(){var l=parseFloat(j.style.opacity);l=Math.min(1,l+0.2);j.style.opacity=l;j.style.filter="alpha(opacity="+(l*100)+")";},25);setTimeout(function(){clearInterval(k);e.style.backgroundImage="";e.style.backgroundColor="rgb(0,0,0)";j.style.opacity="1.";j.style.filter="alpha(opacity=100)";var l=_QTGenerate("QT_WriteOBJECT_XHTML",true,f);if(l.length>0){e.innerHTML=l;}_FixIEController(e);},250);};}}
