var curDomain;
setURI();

/*
 * jquery.tools 1.1.2 - The missing UI library for the Web
 * 
 * [tools.tabs-1.0.4, tools.tabs.slideshow-1.0.2, tools.tabs.history-1.0.2, tools.tooltip-1.1.3, tools.tooltip.slide-1.0.0, tools.tooltip.dynamic-1.0.1, tools.scrollable-1.1.2, tools.scrollable.circular-0.5.1, tools.scrollable.autoscroll-1.0.1, tools.scrollable.navigator-1.0.2, tools.scrollable.mousewheel-1.0.1, tools.overlay-1.1.2, tools.overlay.gallery-1.0.0, tools.overlay.apple-1.0.1, tools.expose-1.0.5]
 * 
 * Copyright (c) 2009 Tero Piirainen
 * http://flowplayer.org/tools/
 *
 * Dual licensed under MIT and GPL 2+ licenses
 * http://www.opensource.org/licenses
 * 
 * -----
 * 
 * Flowplayer 3.1.4 - Flash Video Player for the Web
 * 
 * [flowplayer.core-3.1.4, flowplayer.controls-3.0.2, flowplayer.playlist-3.0.7, flowplayer.embed-3.0.2]
 * 
 * Copyright (c) 2009 Flowplayer Ltd
 * Licensed under GPL 3+ license
 * http://flowplayer.org/download/license_gpl.html
 * 
 * -----
 * 
 * jquery.event.wheel.js - rev 1 
 * Copyright (c) 2008, Three Dub Media (http://threedubmedia.com)
 * Liscensed under the MIT License (MIT-LICENSE.txt)
 * http://www.opensource.org/licenses/mit-license.php
 * Created: 2008-07-01 | Updated: 2008-07-14
 * 
 * -----
 * 
 * File generated: Thu Feb 25 23:23:52 GMT 2010
 */  
 
 if (curDomain.indexOf('support') == -1){

(function(d){d.tools=d.tools||{};d.tools.tabs={version:"1.0.4",conf:{tabs:"a",current:"current",onBeforeClick:null,onclick:null,effect:"default",initialIndex:0,event:"click",api:false,rotate:false},addEffect:function(e,f){c[e]=f}};var c={"default":function(f,e){this.getPanes().hide().eq(f).show();e.call()},fade:function(g,e){var f=this.getConf(),j=f.fadeOutSpeed,h=this.getPanes();if(j){h.fadeOut(j)}else{h.hide()}h.eq(g).fadeIn(f.fadeInSpeed,e)},slide:function(f,e){this.getPanes().slideUp(200);this.getPanes().eq(f).slideDown(400,e)},ajax:function(f,e){this.getPanes().eq(0).load(this.getTabs().eq(f).attr("href"),e)}};var b;d.tools.tabs.addEffect("horizontal",function(f,e){if(!b){b=this.getPanes().eq(0).width()}this.getCurrentPane().animate({width:0},function(){d(this).hide()});this.getPanes().eq(f).animate({width:b},function(){d(this).show();e.call()})});function a(g,h,f){var e=this,j=d(this),i;d.each(f,function(k,l){if(d.isFunction(l)){j.bind(k,l)}});d.extend(this,{click:function(k,n){var o=e.getCurrentPane();var l=g.eq(k);if(typeof k=="string"&&k.replace("#","")){l=g.filter("[href*="+k.replace("#","")+"]");k=Math.max(g.index(l),0)}if(f.rotate){var m=g.length-1;if(k<0){return e.click(m,n)}if(k>m){return e.click(0,n)}}if(!l.length){if(i>=0){return e}k=f.initialIndex;l=g.eq(k)}if(k===i){return e}n=n||d.Event();n.type="onBeforeClick";j.trigger(n,[k]);if(n.isDefaultPrevented()){return}c[f.effect].call(e,k,function(){n.type="onclick";j.trigger(n,[k])});n.type="onStart";j.trigger(n,[k]);if(n.isDefaultPrevented()){return}i=k;g.removeClass(f.current);l.addClass(f.current);return e},getConf:function(){return f},getTabs:function(){return g},getPanes:function(){return h},getCurrentPane:function(){return h.eq(i)},getCurrentTab:function(){return g.eq(i)},getIndex:function(){return i},next:function(){return e.click(i+1)},prev:function(){return e.click(i-1)},bind:function(k,l){j.bind(k,l);return e},onBeforeClick:function(k){return this.bind("onBeforeClick",k)},onclick:function(k){return this.bind("onclick",k)},unbind:function(k){j.unbind(k);return e}});g.each(function(k){d(this).bind(f.event,function(l){e.click(k,l);return false})});if(location.hash){e.click(location.hash)}else{if(f.initialIndex===0||f.initialIndex>0){e.click(f.initialIndex)}}h.find("a[href^=#]").click(function(k){e.click(d(this).attr("href"),k)})}d.fn.tabs=function(i,f){var g=this.eq(typeof f=="number"?f:0).data("tabs");if(g){return g}if(d.isFunction(f)){f={onBeforeClick:f}}var h=d.extend({},d.tools.tabs.conf),e=this.length;f=d.extend(h,f);this.each(function(l){var j=d(this);var k=j.find(f.tabs);if(!k.length){k=j.children()}var m=i.jquery?i:j.children(i);if(!m.length){m=e==1?d(i):j.parent().find(i)}g=new a(k,m,f);j.data("tabs",g)});return f.api?g:this}})(jQuery);
(function(b){var a=b.tools.tabs;a.plugins=a.plugins||{};a.plugins.slideshow={version:"1.0.2",conf:{next:".forward",prev:".backward",disabledClass:"disabled",autoplay:false,autopause:true,interval:3000,clickable:true,api:false}};b.prototype.slideshow=function(e){var f=b.extend({},a.plugins.slideshow.conf),c=this.length,d;e=b.extend(f,e);this.each(function(){var p=b(this),m=p.tabs(),i=b(m),o=m;b.each(e,function(t,u){if(b.isFunction(u)){m.bind(t,u)}});function n(t){return c==1?b(t):p.parent().find(t)}var s=n(e.next).click(function(){m.next()});var q=n(e.prev).click(function(){m.prev()});var h,j,l,g=false;b.extend(m,{play:function(){if(h){return}var t=b.Event("onBeforePlay");i.trigger(t);if(t.isDefaultPrevented()){return m}g=false;h=setInterval(m.next,e.interval);i.trigger("onPlay");m.next()},pause:function(){if(!h){return m}var t=b.Event("onBeforePause");i.trigger(t);if(t.isDefaultPrevented()){return m}h=clearInterval(h);l=clearInterval(l);i.trigger("onPause")},stop:function(){m.pause();g=true},onBeforePlay:function(t){return m.bind("onBeforePlay",t)},onPlay:function(t){return m.bind("onPlay",t)},onBeforePause:function(t){return m.bind("onBeforePause",t)},onPause:function(t){return m.bind("onPause",t)}});if(e.autopause){var k=m.getTabs().add(s).add(q).add(m.getPanes());k.hover(function(){m.pause();j=clearInterval(j)},function(){if(!g){j=setTimeout(m.play,e.interval)}})}if(e.autoplay){l=setTimeout(m.play,e.interval)}else{m.stop()}if(e.clickable){m.getPanes().click(function(){m.next()})}if(!m.getConf().rotate){var r=e.disabledClass;if(!m.getIndex()){q.addClass(r)}m.onBeforeClick(function(u,t){if(!t){q.addClass(r)}else{q.removeClass(r);if(t==m.getTabs().length-1){s.addClass(r)}else{s.removeClass(r)}}})}});return e.api?d:this}})(jQuery);(function(d){var a=d.tools.tabs;a.plugins=a.plugins||{};a.plugins.history={version:"1.0.2",conf:{api:false}};var e,b;function c(f){if(f){var g=b.contentWindow.document;g.open().close();g.location.hash=f}}d.fn.onHash=function(g){var f=this;if(d.browser.msie&&d.browser.version<"8"){if(!b){b=d("<iframe/>").attr("src","javascript:false;").hide().get(0);d("body").append(b);setInterval(function(){var i=b.contentWindow.document,j=i.location.hash;if(e!==j){d.event.trigger("hash",j);e=j}},100);c(location.hash||"#")}f.bind("click.hash",function(h){c(d(this).attr("href"))})}else{setInterval(function(){var j=location.hash;var i=f.filter("[href$="+j+"]");if(!i.length){j=j.replace("#","");i=f.filter("[href$="+j+"]")}if(i.length&&j!==e){e=j;d.event.trigger("hash",j)}},100)}d(window).bind("hash",g);return this};d.fn.history=function(g){var h=d.extend({},a.plugins.history.conf),f;g=d.extend(h,g);this.each(function(){var j=d(this).tabs(),i=j.getTabs();if(j){f=j}i.onHash(function(k,l){if(!l||l=="#"){l=j.getConf().initialIndex}j.click(l)});i.click(function(k){location.hash=d(this).attr("href").replace("#","")})});return g.api?f:this}})(jQuery);(function(c){var d=[];c.tools=c.tools||{};c.tools.tooltip={version:"1.1.3",conf:{effect:"toggle",fadeOutSpeed:"fast",tip:null,predelay:0,delay:30,opacity:1,lazy:undefined,position:["top","center"],offset:[0,0],cancelDefault:true,relative:false,oneInstance:true,events:{def:"mouseover,mouseout",input:"focus,blur",widget:"focus mouseover,blur mouseout",tooltip:"mouseover,mouseout"},api:false},addEffect:function(e,g,f){b[e]=[g,f]}};var b={toggle:[function(e){var f=this.getConf(),g=this.getTip(),h=f.opacity;if(h<1){g.css({opacity:h})}g.show();e.call()},function(e){this.getTip().hide();e.call()}],fade:[function(e){this.getTip().fadeIn(this.getConf().fadeInSpeed,e)},function(e){this.getTip().fadeOut(this.getConf().fadeOutSpeed,e)}]};function a(f,g){var p=this,k=c(this);f.data("tooltip",p);var l=f.next();if(g.tip){l=c(g.tip);if(l.length>1){l=f.nextAll(g.tip).eq(0);if(!l.length){l=f.parent().nextAll(g.tip).eq(0)}}}function o(u){var t=g.relative?f.position().top:f.offset().top,s=g.relative?f.position().left:f.offset().left,v=g.position[0];t-=l.outerHeight()-g.offset[0];s+=f.outerWidth()+g.offset[1];var q=l.outerHeight()+f.outerHeight();if(v=="center"){t+=q/2}if(v=="bottom"){t+=q}v=g.position[1];var r=l.outerWidth()+f.outerWidth();if(v=="center"){s-=r/2}if(v=="left"){s-=r}return{top:t,left:s}}var i=f.is(":input"),e=i&&f.is(":checkbox, :radio, select, :button"),h=f.attr("type"),n=g.events[h]||g.events[i?(e?"widget":"input"):"def"];n=n.split(/,\s*/);if(n.length!=2){throw"Tooltip: bad events configuration for "+h}f.bind(n[0],function(r){if(g.oneInstance){c.each(d,function(){this.hide()})}var q=l.data("trigger");if(q&&q[0]!=this){l.hide().stop(true,true)}r.target=this;p.show(r);n=g.events.tooltip.split(/,\s*/);l.bind(n[0],function(){p.show(r)});if(n[1]){l.bind(n[1],function(){p.hide(r)})}});f.bind(n[1],function(q){p.hide(q)});if(!c.browser.msie&&!i&&!g.predelay){f.mousemove(function(){if(!p.isShown()){f.triggerHandler("mouseover")}})}if(g.opacity<1){l.css("opacity",g.opacity)}var m=0,j=f.attr("title");if(j&&g.cancelDefault){f.removeAttr("title");f.data("title",j)}c.extend(p,{show:function(r){if(r){f=c(r.target)}clearTimeout(l.data("timer"));if(l.is(":animated")||l.is(":visible")){return p}function q(){l.data("trigger",f);var t=o(r);if(g.tip&&j){l.html(f.data("title"))}r=r||c.Event();r.type="onBeforeShow";k.trigger(r,[t]);if(r.isDefaultPrevented()){return p}t=o(r);l.css({position:"absolute",top:t.top,left:t.left});var s=b[g.effect];if(!s){throw'Nonexistent effect "'+g.effect+'"'}s[0].call(p,function(){r.type="onShow";k.trigger(r)})}if(g.predelay){clearTimeout(m);m=setTimeout(q,g.predelay)}else{q()}return p},hide:function(r){clearTimeout(l.data("timer"));clearTimeout(m);if(!l.is(":visible")){return}function q(){r=r||c.Event();r.type="onBeforeHide";k.trigger(r);if(r.isDefaultPrevented()){return}b[g.effect][1].call(p,function(){r.type="onHide";k.trigger(r)})}if(g.delay&&r){l.data("timer",setTimeout(q,g.delay))}else{q()}return p},isShown:function(){return l.is(":visible, :animated")},getConf:function(){return g},getTip:function(){return l},getTrigger:function(){return f},bind:function(q,r){k.bind(q,r);return p},onHide:function(q){return this.bind("onHide",q)},onBeforeShow:function(q){return this.bind("onBeforeShow",q)},onShow:function(q){return this.bind("onShow",q)},onBeforeHide:function(q){return this.bind("onBeforeHide",q)},unbind:function(q){k.unbind(q);return p}});c.each(g,function(q,r){if(c.isFunction(r)){p.bind(q,r)}})}c.prototype.tooltip=function(e){var f=this.eq(typeof e=="number"?e:0).data("tooltip");if(f){return f}var g=c.extend(true,{},c.tools.tooltip.conf);if(c.isFunction(e)){e={onBeforeShow:e}}else{if(typeof e=="string"){e={tip:e}}}e=c.extend(true,g,e);if(typeof e.position=="string"){e.position=e.position.split(/,?\s/)}if(e.lazy!==false&&(e.lazy===true||this.length>20)){this.one("mouseover",function(h){f=new a(c(this),e);f.show(h);d.push(f)})}else{this.each(function(){f=new a(c(this),e);d.push(f)})}return e.api?f:this}})(jQuery);
(function(b){var a=b.tools.tooltip;a.effects=a.effects||{};a.effects.slide={version:"1.0.0"};b.extend(a.conf,{direction:"up",bounce:false,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!b.browser.msie});var c={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};b.tools.tooltip.addEffect("slide",function(d){var f=this.getConf(),g=this.getTip(),h=f.slideFade?{opacity:f.opacity}:{},e=c[f.direction]||c.up;h[e[1]]=e[0]+"="+f.slideOffset;if(f.slideFade){g.css({opacity:0})}g.show().animate(h,f.slideInSpeed,d)},function(e){var g=this.getConf(),i=g.slideOffset,h=g.slideFade?{opacity:0}:{},f=c[g.direction]||c.up;var d=""+f[0];if(g.bounce){d=d=="+"?"-":"+"}h[f[1]]=d+"="+i;this.getTip().animate(h,g.slideOutSpeed,function(){b(this).hide();e.call()})})})(jQuery);(function(d){var c=d.tools.tooltip;c.plugins=c.plugins||{};c.plugins.dynamic={version:"1.0.1",conf:{api:false,classNames:"top right bottom left"}};function b(h){var e=d(window);var g=e.width()+e.scrollLeft();var f=e.height()+e.scrollTop();return[h.offset().top<=e.scrollTop(),g<=h.offset().left+h.width(),f<=h.offset().top+h.height(),e.scrollLeft()>=h.offset().left]}function a(f){var e=f.length;while(e--){if(f[e]){return false}}return true}d.fn.dynamic=function(g){var h=d.extend({},c.plugins.dynamic.conf),f;if(typeof g=="number"){g={speed:g}}g=d.extend(h,g);var e=g.classNames.split(/\s/),i;this.each(function(){if(d(this).tooltip().jquery){throw"Lazy feature not supported by dynamic plugin. set lazy: false for tooltip"}var j=d(this).tooltip().onBeforeShow(function(n,o){var m=this.getTip(),l=this.getConf();if(!i){i=[l.position[0],l.position[1],l.offset[0],l.offset[1],d.extend({},l)]}d.extend(l,i[4]);l.position=[i[0],i[1]];l.offset=[i[2],i[3]];m.css({visibility:"hidden",position:"absolute",top:o.top,left:o.left}).show();var k=b(m);if(!a(k)){if(k[2]){d.extend(l,g.top);l.position[0]="top";m.addClass(e[0])}if(k[3]){d.extend(l,g.right);l.position[1]="right";m.addClass(e[1])}if(k[0]){d.extend(l,g.bottom);l.position[0]="bottom";m.addClass(e[2])}if(k[1]){d.extend(l,g.left);l.position[1]="left";m.addClass(e[3])}if(k[0]||k[2]){l.offset[0]*=-1}if(k[1]||k[3]){l.offset[1]*=-1}}m.css({visibility:"visible"}).hide()});j.onShow(function(){var l=this.getConf(),k=this.getTip();l.position=[i[0],i[1]];l.offset=[i[2],i[3]]});j.onHide(function(){var k=this.getTip();k.removeClass(g.classNames)});f=j});return g.api?f:this}})(jQuery);
(function(b){b.tools=b.tools||{};b.tools.scrollable={version:"1.1.2",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var c;function a(o,m){var r=this,p=b(this),d=!m.vertical,e=o.children(),k=0,i;if(!c){c=r}b.each(m,function(s,t){if(b.isFunction(t)){p.bind(s,t)}});if(e.length>1){e=b(m.items,o)}function l(t){var s=b(t);return m.globalNav?s:o.parent().find(t)}o.data("finder",l);var f=l(m.prev),h=l(m.next),g=l(m.prevPage),n=l(m.nextPage);b.extend(r,{getIndex:function(){return k},getClickIndex:function(){var s=r.getItems();return s.index(s.filter("."+m.activeClass))},getConf:function(){return m},getSize:function(){return r.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/m.size)},getPageIndex:function(){return Math.ceil(k/m.size)},getNaviButtons:function(){return f.add(h).add(g).add(n)},getRoot:function(){return o},getItemWrap:function(){return e},getItems:function(){return e.children(m.item)},getVisibleItems:function(){return r.getItems().slice(k,k+m.size)},seekTo:function(s,w,t){if(s<0){s=0}if(k===s){return r}if(b.isFunction(w)){t=w}if(s>r.getSize()-m.size){return m.loop?r.begin():this.end()}var u=r.getItems().eq(s);if(!u.length){return r}var v=b.Event("onBeforeSeek");p.trigger(v,[s]);if(v.isDefaultPrevented()){return r}if(w===undefined||b.isFunction(w)){w=m.speed}function x(){if(t){t.call(r,s)}p.trigger("onSeek",[s])}if(d){e.animate({left:-u.position().left},w,m.easing,x)}else{e.animate({top:-u.position().top},w,m.easing,x)}c=r;k=s;v=b.Event("onStart");p.trigger(v,[s]);if(v.isDefaultPrevented()){return r}f.add(g).toggleClass(m.disabledClass,s===0);h.add(n).toggleClass(m.disabledClass,s>=r.getSize()-m.size);return r},move:function(u,t,s){i=u>0;return this.seekTo(k+u,t,s)},next:function(t,s){return this.move(1,t,s)},prev:function(t,s){return this.move(-1,t,s)},movePage:function(w,v,u){i=w>0;var s=m.size*w;var t=k%m.size;if(t>0){s+=(w>0?-t:m.size-t)}return this.move(s,v,u)},prevPage:function(t,s){return this.movePage(-1,t,s)},nextPage:function(t,s){return this.movePage(1,t,s)},setPage:function(t,u,s){return this.seekTo(t*m.size,u,s)},begin:function(t,s){i=false;return this.seekTo(0,t,s)},end:function(t,s){i=true;var u=this.getSize()-m.size;return u>0?this.seekTo(u,t,s):r},reload:function(){p.trigger("onReload");return r},focus:function(){c=r;return r},click:function(u){var v=r.getItems().eq(u),s=m.activeClass,t=m.size;if(u<0||u>=r.getSize()){return r}if(t==1){if(m.loop){return r.next()}if(u===0||u==r.getSize()-1){i=(i===undefined)?true:!i}return i===false?r.prev():r.next()}if(t==2){if(u==k){u--}r.getItems().removeClass(s);v.addClass(s);return r.seekTo(u,time,fn)}if(!v.hasClass(s)){r.getItems().removeClass(s);v.addClass(s);var x=Math.floor(t/2);var w=u-x;if(w>r.getSize()-t){w=r.getSize()-t}if(w!==u){return r.seekTo(w)}}return r},bind:function(s,t){p.bind(s,t);return r},unbind:function(s){p.unbind(s);return r}});b.each("onBeforeSeek,onStart,onSeek,onReload".split(","),function(s,t){r[t]=function(u){return r.bind(t,u)}});f.addClass(m.disabledClass).click(function(){r.prev()});h.click(function(){r.next()});n.click(function(){r.nextPage()});if(r.getSize()<m.size){h.add(n).addClass(m.disabledClass)}g.addClass(m.disabledClass).click(function(){r.prevPage()});var j=m.hoverClass,q="keydown."+Math.random().toString().substring(10);r.onReload(function(){if(j){r.getItems().hover(function(){b(this).addClass(j)},function(){b(this).removeClass(j)})}if(m.clickable){r.getItems().each(function(s){b(this).unbind("click.scrollable").bind("click.scrollable",function(t){if(b(t.target).is("a")){return}return r.click(s)})})}if(m.keyboard){b(document).unbind(q).bind(q,function(t){if(t.altKey||t.ctrlKey){return}if(m.keyboard!="static"&&c!=r){return}var u=m.keyboardSteps;if(d&&(t.keyCode==37||t.keyCode==39)){r.move(t.keyCode==37?-u:u);return t.preventDefault()}if(!d&&(t.keyCode==38||t.keyCode==40)){r.move(t.keyCode==38?-u:u);return t.preventDefault()}return true})}else{b(document).unbind(q)}});r.reload()}b.fn.scrollable=function(d){var e=this.eq(typeof d=="number"?d:0).data("scrollable");if(e){return e}var f=b.extend({},b.tools.scrollable.conf);d=b.extend(f,d);d.keyboardSteps=d.keyboardSteps||d.size;this.each(function(){e=new a(b(this),d);b(this).data("scrollable",e)});return d.api?e:this}})(jQuery);
(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.circular={version:"0.5.1",conf:{api:false,clonedClass:"cloned"}};b.fn.circular=function(e){var d=b.extend({},a.plugins.circular.conf),c;b.extend(d,e);this.each(function(){var i=b(this).scrollable(),n=i.getItems(),k=i.getConf(),f=i.getItemWrap(),j=0;if(i){c=i}if(n.length<k.size){return false}n.slice(0,k.size).each(function(o){b(this).clone().appendTo(f).click(function(){i.click(n.length+o)}).addClass(d.clonedClass)});var l=b.makeArray(n.slice(-k.size)).reverse();b(l).each(function(o){b(this).clone().prependTo(f).click(function(){i.click(-o-1)}).addClass(d.clonedClass)});var m=f.children(k.item);var h=k.hoverClass;if(h){m.hover(function(){b(this).addClass(h)},function(){b(this).removeClass(h)})}function g(o){var p=m.eq(o);if(k.vertical){f.css({top:-p.position().top})}else{f.css({left:-p.position().left})}}g(k.size);b.extend(i,{move:function(s,r,p,q){var u=j+s+k.size;var t=u>i.getSize()-k.size;if(u<=0||t){var o=j+k.size+(t?-n.length:n.length);g(o);u=o+s}if(q){m.removeClass(k.activeClass).eq(u+Math.floor(k.size/2)).addClass(k.activeClass)}if(u===j+k.size){return self}return i.seekTo(u,r,p)},begin:function(p,o){return this.seekTo(k.size,p,o)},end:function(p,o){return this.seekTo(n.length,p,o)},click:function(p,r,q){if(!k.clickable){return self}if(k.size==1){return this.next()}var s=p-j,o=k.activeClass;s-=Math.floor(k.size/2);return this.move(s,r,q,true)},getIndex:function(){return j},setPage:function(p,q,o){return this.seekTo(p*k.size+k.size,q,o)},getPageAmount:function(){return Math.ceil(n.length/k.size)},getPageIndex:function(){if(j<0){return this.getPageAmount()-1}if(j>=n.length){return 0}var o=(j+k.size)/k.size-1;return o},getVisibleItems:function(){var o=j+k.size;return m.slice(o,o+k.size)}});i.onStart(function(p,o){j=o-k.size;return false});i.getNaviButtons().removeClass(k.disabledClass)});return d.api?c:this}})(jQuery);
(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.autoscroll={version:"1.0.1",conf:{autoplay:true,interval:3000,autopause:true,steps:1,api:false}};b.fn.autoscroll=function(d){if(typeof d=="number"){d={interval:d}}var e=b.extend({},a.plugins.autoscroll.conf),c;b.extend(e,d);this.each(function(){var g=b(this).scrollable();if(g){c=g}var i,f,h=true;g.play=function(){if(i){return}h=false;i=setInterval(function(){g.move(e.steps)},e.interval);g.move(e.steps)};g.pause=function(){i=clearInterval(i)};g.stop=function(){g.pause();h=true};if(e.autopause){g.getRoot().add(g.getNaviButtons()).hover(function(){g.pause();clearInterval(f)},function(){if(!h){f=setTimeout(g.play,e.interval)}})}if(e.autoplay){setTimeout(g.play,e.interval)}});return e.api?c:this}})(jQuery);
(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.navigator={version:"1.0.2",conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,api:false,idPrefix:null}};b.fn.navigator=function(d){var e=b.extend({},a.plugins.navigator.conf),c;if(typeof d=="string"){d={navi:d}}d=b.extend(e,d);this.each(function(){var i=b(this).scrollable(),f=i.getRoot(),l=f.data("finder").call(null,d.navi),g=null,k=i.getNaviButtons();if(i){c=i}i.getNaviButtons=function(){return k.add(l)};function j(){if(!l.children().length||l.data("navi")==i){l.empty();l.data("navi",i);for(var m=0;m<i.getPageAmount();m++){l.append(b("<"+(d.naviItem||"a")+"/>"))}g=l.children().each(function(n){var o=b(this);o.click(function(p){i.setPage(n);return p.preventDefault()});if(d.indexed){o.text(n)}if(d.idPrefix){o.attr("id",d.idPrefix+n)}})}else{g=d.naviItem?l.find(d.naviItem):l.children();g.each(function(n){var o=b(this);o.click(function(p){i.setPage(n);return p.preventDefault()})})}g.eq(0).addClass(d.activeClass)}i.onStart(function(o,n){var m=d.activeClass;g.removeClass(m).eq(i.getPageIndex()).addClass(m)});i.onReload(function(){j()});j();var h=g.filter("[href="+location.hash+"]");if(h.length){i.move(g.index(h))}});return d.api?c:this}})(jQuery);
(function(b){b.fn.wheel=function(e){return this[e?"bind":"trigger"]("wheel",e)};b.event.special.wheel={setup:function(){b.event.add(this,d,c,{})},teardown:function(){b.event.remove(this,d,c)}};var d=!b.browser.mozilla?"mousewheel":"DOMMouseScroll"+(b.browser.version<"1.9"?" mousemove":"");function c(e){switch(e.type){case"mousemove":return b.extend(e.data,{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY});case"DOMMouseScroll":b.extend(e,e.data);e.delta=-e.detail/3;break;case"mousewheel":e.delta=e.wheelDelta/120;break}e.type="wheel";return b.event.handle.call(this,e,e.delta)}var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.mousewheel={version:"1.0.1",conf:{api:false,speed:50}};b.fn.mousewheel=function(f){var g=b.extend({},a.plugins.mousewheel.conf),e;if(typeof f=="number"){f={speed:f}}f=b.extend(g,f);this.each(function(){var h=b(this).scrollable();if(h){e=h}h.getRoot().wheel(function(i,j){h.move(j<0?1:-1,f.speed||50);return false})});return f.api?e:this}})(jQuery);(function(c){c.tools=c.tools||{};c.tools.overlay={version:"1.1.2",addEffect:function(e,f,g){b[e]=[f,g]},conf:{top:"10%",left:"center",absolute:false,speed:"normal",closeSpeed:"fast",effect:"default",close:null,oneInstance:true,closeOnClick:true,closeOnEsc:true,api:false,expose:null,target:null}};var b={};c.tools.overlay.addEffect("default",function(e){this.getOverlay().fadeIn(this.getConf().speed,e)},function(e){this.getOverlay().fadeOut(this.getConf().closeSpeed,e)});var d=[];function a(g,k){var o=this,m=c(this),n=c(window),j,i,h,e=k.expose&&c.tools.expose.version;var f=k.target||g.attr("rel");i=f?c(f):null||g;if(!i.length){throw"Could not find Overlay: "+f}if(g&&g.index(i)==-1){g.click(function(p){o.load(p);return p.preventDefault()})}c.each(k,function(p,q){if(c.isFunction(q)){m.bind(p,q)}});c.extend(o,{load:function(u){if(o.isOpened()){return o}var r=b[k.effect];if(!r){throw'Overlay: cannot find effect : "'+k.effect+'"'}if(k.oneInstance){c.each(d,function(){this.close(u)})}u=u||c.Event();u.type="onBeforeLoad";m.trigger(u);if(u.isDefaultPrevented()){return o}h=true;if(e){i.expose().load(u)}var t=k.top;var s=k.left;var p=i.outerWidth({margin:true});var q=i.outerHeight({margin:true});if(typeof t=="string"){t=t=="center"?Math.max((n.height()-q)/2,0):parseInt(t,10)/100*n.height()}if(s=="center"){s=Math.max((n.width()-p)/2,0)}if(!k.absolute){t+=n.scrollTop();s+=n.scrollLeft()}i.css({top:t,left:s,position:"absolute"});u.type="onStart";m.trigger(u);r[0].call(o,function(){if(h){u.type="onLoad";m.trigger(u)}});if(k.closeOnClick){c(document).bind("click.overlay",function(w){if(!o.isOpened()){return}var v=c(w.target);if(v.parents(i).length>1){return}c.each(d,function(){this.close(w)})})}if(k.closeOnEsc){c(document).unbind("keydown.overlay").bind("keydown.overlay",function(v){if(v.keyCode==27){c.each(d,function(){this.close(v)})}})}return o},close:function(q){if(!o.isOpened()){return o}q=q||c.Event();q.type="onBeforeClose";m.trigger(q);if(q.isDefaultPrevented()){return}h=false;b[k.effect][1].call(o,function(){q.type="onClose";m.trigger(q)});var p=true;c.each(d,function(){if(this.isOpened()){p=false}});if(p){c(document).unbind("click.overlay").unbind("keydown.overlay")}return o},getContent:function(){return i},getOverlay:function(){return i},getTrigger:function(){return g},getClosers:function(){return j},isOpened:function(){return h},getConf:function(){return k},bind:function(p,q){m.bind(p,q);return o},unbind:function(p){m.unbind(p);return o}});c.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(p,q){o[q]=function(r){return o.bind(q,r)}});if(e){if(typeof k.expose=="string"){k.expose={color:k.expose}}c.extend(k.expose,{api:true,closeOnClick:k.closeOnClick,closeOnEsc:false});var l=i.expose(k.expose);l.onBeforeClose(function(p){o.close(p)});o.onClose(function(p){l.close(p)})}j=i.find(k.close||".close");if(!j.length&&!k.close){j=c('<div class="close"></div>');i.prepend(j)}j.click(function(p){o.close(p)})}c.fn.overlay=function(e){var f=this.eq(typeof e=="number"?e:0).data("overlay");if(f){return f}if(c.isFunction(e)){e={onBeforeLoad:e}}var g=c.extend({},c.tools.overlay.conf);e=c.extend(true,g,e);this.each(function(){f=new a(c(this),e);d.push(f);c(this).data("overlay",f)});return e.api?f:this}})(jQuery);
(function(b){var a=b.tools.overlay;a.plugins=a.plugins||{};a.plugins.gallery={version:"1.0.0",conf:{imgId:"img",next:".next",prev:".prev",info:".info",progress:".progress",disabledClass:"disabled",activeClass:"active",opacity:0.8,speed:"slow",template:"<strong>${title}</strong> <span>Image ${index} of ${total}</span>",autohide:true,preload:true,api:false}};b.fn.gallery=function(d){var o=b.extend({},a.plugins.gallery.conf),m;b.extend(o,d);m=this.overlay();var r=this,j=m.getOverlay(),k=j.find(o.next),g=j.find(o.prev),e=j.find(o.info),c=j.find(o.progress),h=g.add(k).add(e).css({opacity:o.opacity}),s=m.getClosers(),l;function p(u){c.fadeIn();h.hide();s.hide();var t=u.attr("href");var v=new Image();v.onload=function(){c.fadeOut();var y=b("#"+o.imgId,j);if(!y.length){y=b("<img/>").attr("id",o.imgId).css("visibility","hidden");j.prepend(y)}y.attr("src",t).css("visibility","hidden");var z=v.width;var A=(b(window).width()-z)/2;l=r.index(r.filter('[href="'+t+'"]'));r.removeClass(o.activeClass).eq(l).addClass(o.activeClass);var w=o.disabledClass;h.removeClass(w);if(l===0){g.addClass(w)}if(l==r.length-1){k.addClass(w)}var B=o.template.replace("${title}",u.attr("title")||u.data("title")).replace("${index}",l+1).replace("${total}",r.length);var x=parseInt(e.css("paddingLeft"),10)+parseInt(e.css("paddingRight"),10);e.html(B).css({width:z-x});j.animate({width:z,height:v.height,left:A},o.speed,function(){y.hide().css("visibility","visible").fadeIn(function(){if(!o.autohide){h.fadeIn();s.show()}})})};v.onerror=function(){j.fadeIn().html("Cannot find image "+t)};v.src=t;if(o.preload){r.filter(":eq("+(l-1)+"), :eq("+(l+1)+")").each(function(){var w=new Image();w.src=b(this).attr("href")})}}function f(t,u){t.click(function(){if(t.hasClass(o.disabledClass)){return}var v=r.eq(i=l+(u?1:-1));if(v.length){p(v)}})}f(k,true);f(g);b(document).keydown(function(t){if(!j.is(":visible")||t.altKey||t.ctrlKey){return}if(t.keyCode==37||t.keyCode==39){var u=t.keyCode==37?g:k;u.click();return t.preventDefault()}return true});function q(){if(!j.is(":animated")){h.show();s.show()}}if(o.autohide){j.hover(q,function(){h.fadeOut();s.hide()}).mousemove(q)}var n;this.each(function(){var v=b(this),u=b(this).overlay(),t=u;u.onBeforeLoad(function(){p(v)});u.onClose(function(){r.removeClass(o.activeClass)})});return o.api?n:this}})(jQuery);(function(d){var b=d.tools.overlay;b.effects=b.effects||{};b.effects.apple={version:"1.0.1"};d.extend(b.conf,{start:{absolute:true,top:null,left:null},fadeInSpeed:"fast",zIndex:9999});function c(f){var g=f.offset();return[g.top+f.height()/2,g.left+f.width()/2]}var e=function(n){var k=this.getOverlay(),f=this.getConf(),i=this.getTrigger(),q=this,r=k.outerWidth({margin:true}),m=k.data("img");if(!m){var l=k.css("backgroundImage");if(!l){throw"background-image CSS property not set for overlay"}l=l.substring(l.indexOf("(")+1,l.indexOf(")")).replace(/\"/g,"");k.css("backgroundImage","none");m=d('<img src="'+l+'"/>');m.css({border:0,position:"absolute",display:"none"}).width(r);d("body").append(m);k.data("img",m)}var o=d(window),j=f.start.top||Math.round(o.height()/2),h=f.start.left||Math.round(o.width()/2);if(i){var g=c(i);j=g[0];h=g[1]}if(!f.start.absolute){j+=o.scrollTop();h+=o.scrollLeft()}m.css({top:j,left:h,width:0,zIndex:f.zIndex}).show();m.animate({top:k.css("top"),left:k.css("left"),width:r},f.speed,function(){k.css("zIndex",f.zIndex+1).fadeIn(f.fadeInSpeed,function(){if(q.isOpened()&&!d(this).index(k)){n.call()}else{k.hide()}})})};var a=function(f){var h=this.getOverlay(),i=this.getConf(),g=this.getTrigger(),l=i.start.top,k=i.start.left;h.hide();if(g){var j=c(g);l=j[0];k=j[1]}h.data("img").animate({top:l,left:k,width:0},i.closeSpeed,f)};b.addEffect("apple",e,a)})(jQuery);
(function(b){b.tools=b.tools||{};b.tools.expose={version:"1.0.5",conf:{maskId:null,loadSpeed:"slow",closeSpeed:"fast",closeOnClick:true,closeOnEsc:true,zIndex:9998,opacity:0.8,color:"#456",api:false}};function a(){if(b.browser.msie){var f=b(document).height(),e=b(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f-e<20?e:f]}return[b(window).width(),b(document).height()]}function c(h,g){var e=this,j=b(this),d=null,f=false,i=0;b.each(g,function(k,l){if(b.isFunction(l)){j.bind(k,l)}});b(window).resize(function(){e.fit()});b.extend(this,{getMask:function(){return d},getExposed:function(){return h},getConf:function(){return g},isLoaded:function(){return f},load:function(n){if(f){return e}i=h.eq(0).css("zIndex");if(g.maskId){d=b("#"+g.maskId)}if(!d||!d.length){var l=a();d=b("<div/>").css({position:"absolute",top:0,left:0,width:l[0],height:l[1],display:"none",opacity:0,zIndex:g.zIndex});if(g.maskId){d.attr("id",g.maskId)}b("body").append(d);var k=d.css("backgroundColor");if(!k||k=="transparent"||k=="rgba(0, 0, 0, 0)"){d.css("backgroundColor",g.color)}if(g.closeOnEsc){b(document).bind("keydown.unexpose",function(o){if(o.keyCode==27){e.close()}})}if(g.closeOnClick){d.bind("click.unexpose",function(o){e.close(o)})}}n=n||b.Event();n.type="onBeforeLoad";j.trigger(n);if(n.isDefaultPrevented()){return e}b.each(h,function(){var o=b(this);if(!/relative|absolute|fixed/i.test(o.css("position"))){o.css("position","relative")}});h.css({zIndex:Math.max(g.zIndex+1,i=="auto"?0:i)});var m=d.height();if(!this.isLoaded()){d.css({opacity:0,display:"block"}).fadeTo(g.loadSpeed,g.opacity,function(){if(d.height()!=m){d.css("height",m)}n.type="onLoad";j.trigger(n)})}f=true;return e},close:function(k){if(!f){return e}k=k||b.Event();k.type="onBeforeClose";j.trigger(k);if(k.isDefaultPrevented()){return e}d.fadeOut(g.closeSpeed,function(){k.type="onClose";j.trigger(k);h.css({zIndex:b.browser.msie?i:null})});f=false;return e},fit:function(){if(d){var k=a();d.css({width:k[0],height:k[1]})}},bind:function(k,l){j.bind(k,l);return e},unbind:function(k){j.unbind(k);return e}});b.each("onBeforeLoad,onLoad,onBeforeClose,onClose".split(","),function(k,l){e[l]=function(m){return e.bind(l,m)}})}b.fn.expose=function(d){var e=this.eq(typeof d=="number"?d:0).data("expose");if(e){return e}if(typeof d=="string"){d={color:d}}var f=b.extend({},b.tools.expose.conf);d=b.extend(f,d);this.each(function(){e=new c(b(this),d);b(this).data("expose",e)});return d.api?e:this}})(jQuery);(function(){function g(o){console.log("$f.fireEvent",[].slice.call(o))}function k(q){if(!q||typeof q!="object"){return q}var o=new q.constructor();for(var p in q){if(q.hasOwnProperty(p)){o[p]=k(q[p])}}return o}function m(t,q){if(!t){return}var o,p=0,r=t.length;if(r===undefined){for(o in t){if(q.call(t[o],o,t[o])===false){break}}}else{for(var s=t[0];p<r&&q.call(s,p,s)!==false;s=t[++p]){}}return t}function c(o){return document.getElementById(o)}function i(q,p,o){if(typeof p!="object"){return q}if(q&&p){m(p,function(r,s){if(!o||typeof s!="function"){q[r]=s}})}return q}function n(s){var q=s.indexOf(".");if(q!=-1){var p=s.substring(0,q)||"*";var o=s.substring(q+1,s.length);var r=[];m(document.getElementsByTagName(p),function(){if(this.className&&this.className.indexOf(o)!=-1){r.push(this)}});return r}}function f(o){o=o||window.event;if(o.preventDefault){o.stopPropagation();o.preventDefault()}else{o.returnValue=false;o.cancelBubble=true}return false}function j(q,o,p){q[o]=q[o]||[];q[o].push(p)}function e(){return"_"+(""+Math.random()).substring(2,10)}var h=function(t,r,s){var q=this;var p={};var u={};q.index=r;if(typeof t=="string"){t={url:t}}i(this,t,true);m(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){var v="on"+this;if(v.indexOf("*")!=-1){v=v.substring(0,v.length-1);var w="onBefore"+v.substring(2);q[w]=function(x){j(u,w,x);return q}}q[v]=function(x){j(u,v,x);return q};if(r==-1){if(q[w]){s[w]=q[w]}if(q[v]){s[v]=q[v]}}});i(this,{onCuepoint:function(x,w){if(arguments.length==1){p.embedded=[null,x];return q}if(typeof x=="number"){x=[x]}var v=e();p[v]=[x,w];if(s.isLoaded()){s._api().fp_addCuepoints(x,r,v)}return q},update:function(w){i(q,w);if(s.isLoaded()){s._api().fp_updateClip(w,r)}var v=s.getConfig();var x=(r==-1)?v.clip:v.playlist[r];i(x,w,true)},_fireEvent:function(v,y,w,A){if(v=="onLoad"){m(p,function(B,C){if(C[0]){s._api().fp_addCuepoints(C[0],r,B)}});return false}A=A||q;if(v=="onCuepoint"){var z=p[y];if(z){return z[1].call(s,A,w)}}if(y&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(v)!=-1){i(A,y);if(y.metaData){if(!A.duration){A.duration=y.metaData.duration}else{A.fullDuration=y.metaData.duration}}}var x=true;m(u[v],function(){x=this.call(s,A,y,w)});return x}});if(t.onCuepoint){var o=t.onCuepoint;q.onCuepoint.apply(q,typeof o=="function"?[o]:o);delete t.onCuepoint}m(t,function(v,w){if(typeof w=="function"){j(u,v,w);delete t[v]}});if(r==-1){s.onCuepoint=this.onCuepoint}};var l=function(p,r,q,t){var s={};var o=this;var u=false;if(t){i(s,t)}m(r,function(v,w){if(typeof w=="function"){s[v]=w;delete r[v]}});i(this,{animate:function(y,z,x){if(!y){return o}if(typeof z=="function"){x=z;z=500}if(typeof y=="string"){var w=y;y={};y[w]=z;z=500}if(x){var v=e();s[v]=x}if(z===undefined){z=500}r=q._api().fp_animate(p,y,z,v);return o},css:function(w,x){if(x!==undefined){var v={};v[w]=x;w=v}r=q._api().fp_css(p,w);i(o,r);return o},show:function(){this.display="block";q._api().fp_showPlugin(p);return o},hide:function(){this.display="none";q._api().fp_hidePlugin(p);return o},toggle:function(){this.display=q._api().fp_togglePlugin(p);return o},fadeTo:function(y,x,w){if(typeof x=="function"){w=x;x=500}if(w){var v=e();s[v]=w}this.display=q._api().fp_fadeTo(p,y,x,v);this.opacity=y;return o},fadeIn:function(w,v){return o.fadeTo(1,w,v)},fadeOut:function(w,v){return o.fadeTo(0,w,v)},getName:function(){return p},getPlayer:function(){return q},_fireEvent:function(w,v,x){if(w=="onUpdate"){var y=q._api().fp_getPlugin(p);if(!y){return}i(o,y);delete o.methods;if(!u){m(y.methods,function(){var A=""+this;o[A]=function(){var B=[].slice.call(arguments);var C=q._api().fp_invoke(p,A,B);return C==="undefined"||C===undefined?o:C}});u=true}}var z=s[w];if(z){z.apply(o,v);if(w.substring(0,1)=="_"){delete s[w]}}}})};function b(o,t,z){var E=this,y=null,x,u,p=[],s={},B={},r,v,w,D,A,q;i(E,{id:function(){return r},isLoaded:function(){return(y!==null)},getParent:function(){return o},hide:function(F){if(F){o.style.height="0px"}if(y){y.style.height="0px"}return E},show:function(){o.style.height=q+"px";if(y){y.style.height=A+"px"}return E},isHidden:function(){return y&&parseInt(y.style.height,10)===0},load:function(F){if(!y&&E._fireEvent("onBeforeLoad")!==false){m(a,function(){this.unload()});x=o.innerHTML;if(x&&!flashembed.isSupported(t.version)){o.innerHTML=""}flashembed(o,t,{config:z});if(F){F.cached=true;j(B,"onLoad",F)}}return E},unload:function(){if(x.replace(/\s/g,"")!==""){if(E._fireEvent("onBeforeUnload")===false){return E}try{if(y){y.fp_close();E._fireEvent("onUnload")}}catch(F){}y=null;o.innerHTML=x}return E},getClip:function(F){if(F===undefined){F=D}return p[F]},getCommonClip:function(){return u},getPlaylist:function(){return p},getPlugin:function(F){var H=s[F];if(!H&&E.isLoaded()){var G=E._api().fp_getPlugin(F);if(G){H=new l(F,G,E);s[F]=H}}return H},getScreen:function(){return E.getPlugin("screen")},getControls:function(){return E.getPlugin("controls")},getConfig:function(F){return F?k(z):z},getFlashParams:function(){return t},loadPlugin:function(I,H,K,J){if(typeof K=="function"){J=K;K={}}var G=J?e():"_";E._api().fp_loadPlugin(I,H,K,G);var F={};F[G]=J;var L=new l(I,null,E,F);s[I]=L;return L},getState:function(){return y?y.fp_getState():-1},play:function(G,F){function H(){if(G!==undefined){E._api().fp_play(G,F)}else{E._api().fp_play()}}if(y){H()}else{E.load(function(){H()})}return E},getVersion:function(){var G="flowplayer.js 3.1.4";if(y){var F=y.fp_getVersion();F.push(G);return F}return G},_api:function(){if(!y){throw"Flowplayer "+E.id()+" not loaded when calling an API method"}return y},setClip:function(F){E.setPlaylist([F]);return E},getIndex:function(){return w}});m(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","),function(){var F="on"+this;if(F.indexOf("*")!=-1){F=F.substring(0,F.length-1);var G="onBefore"+F.substring(2);E[G]=function(H){j(B,G,H);return E}}E[F]=function(H){j(B,F,H);return E}});m(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed").split(","),function(){var F=this;E[F]=function(H,G){if(!y){return E}var I=null;if(H!==undefined&&G!==undefined){I=y["fp_"+F](H,G)}else{I=(H===undefined)?y["fp_"+F]():y["fp_"+F](H)}return I==="undefined"||I===undefined?E:I}});E._fireEvent=function(O){if(typeof O=="string"){O=[O]}var P=O[0],M=O[1],K=O[2],J=O[3],I=0;if(z.debug){g(O)}if(!y&&P=="onLoad"&&M=="player"){y=y||c(v);A=y.clientHeight;m(p,function(){this._fireEvent("onLoad")});m(s,function(Q,R){R._fireEvent("onUpdate")});u._fireEvent("onLoad")}if(P=="onLoad"&&M!="player"){return}if(P=="onError"){if(typeof M=="string"||(typeof M=="number"&&typeof K=="number")){M=K;K=J}}if(P=="onContextMenu"){m(z.contextMenu[M],function(Q,R){R.call(E)});return}if(P=="onPluginEvent"){var F=M.name||M;var G=s[F];if(G){G._fireEvent("onUpdate",M);G._fireEvent(K,O.slice(3))}return}if(P=="onPlaylistReplace"){p=[];var L=0;m(M,function(){p.push(new h(this,L++,E))})}if(P=="onClipAdd"){if(M.isInStream){return}M=new h(M,K,E);p.splice(K,0,M);for(I=K+1;I<p.length;I++){p[I].index++}}var N=true;if(typeof M=="number"&&M<p.length){D=M;var H=p[M];if(H){N=H._fireEvent(P,K,J)}if(!H||N!==false){N=u._fireEvent(P,K,J,H)}}m(B[P],function(){N=this.call(E,M,K);if(this.cached){B[P].splice(I,1)}if(N===false){return false}I++});return N};function C(){if($f(o)){$f(o).getParent().innerHTML="";w=$f(o).getIndex();a[w]=E}else{a.push(E);w=a.length-1}q=parseInt(o.style.height,10)||o.clientHeight;if(typeof t=="string"){t={src:t}}r=o.id||"fp"+e();v=t.id||r+"_api";t.id=v;z.playerId=r;if(typeof z=="string"){z={clip:{url:z}}}if(typeof z.clip=="string"){z.clip={url:z.clip}}z.clip=z.clip||{};if(o.getAttribute("href",2)&&!z.clip.url){z.clip.url=o.getAttribute("href",2)}u=new h(z.clip,-1,E);z.playlist=z.playlist||[z.clip];var F=0;m(z.playlist,function(){var H=this;if(typeof H=="object"&&H.length){H={url:""+H}}m(z.clip,function(I,J){if(J!==undefined&&H[I]===undefined&&typeof J!="function"){H[I]=J}});z.playlist[F]=H;H=new h(H,F,E);p.push(H);F++});m(z,function(H,I){if(typeof I=="function"){if(u[H]){u[H](I)}else{j(B,H,I)}delete z[H]}});m(z.plugins,function(H,I){if(I){s[H]=new l(H,I,E)}});if(!z.plugins||z.plugins.controls===undefined){s.controls=new l("controls",null,E)}s.canvas=new l("canvas",null,E);t.bgcolor=t.bgcolor||"#000000";t.version=t.version||[9,0];t.expressInstall="http://www.flowplayer.org/swf/expressinstall.swf";function G(H){if(!E.isLoaded()&&E._fireEvent("onBeforeClick")!==false){E.load()}return f(H)}x=o.innerHTML;if(x.replace(/\s/g,"")!==""){if(o.addEventListener){o.addEventListener("click",G,false)}else{if(o.attachEvent){o.attachEvent("onclick",G)}}}else{if(o.addEventListener){o.addEventListener("click",f,false)}E.load()}}if(typeof o=="string"){flashembed.domReady(function(){var F=c(o);if(!F){throw"Flowplayer cannot access element: "+o}else{o=F;C()}})}else{C()}}var a=[];function d(o){this.length=o.length;this.each=function(p){m(o,p)};this.size=function(){return o.length}}window.flowplayer=window.$f=function(){var p=null;var o=arguments[0];if(!arguments.length){m(a,function(){if(this.isLoaded()){p=this;return false}});return p||a[0]}if(arguments.length==1){if(typeof o=="number"){return a[o]}else{if(o=="*"){return new d(a)}m(a,function(){if(this.id()==o.id||this.id()==o||this.getParent()==o){p=this;return false}});return p}}if(arguments.length>1){var r=arguments[1];var q=(arguments.length==3)?arguments[2]:{};if(typeof o=="string"){if(o.indexOf(".")!=-1){var t=[];m(n(o),function(){t.push(new b(this,k(r),k(q)))});return new d(t)}else{var s=c(o);return new b(s!==null?s:o,r,q)}}else{if(o){return new b(o,r,q)}}}return null};i(window.$f,{fireEvent:function(){var o=[].slice.call(arguments);var q=$f(o[0]);return q?q._fireEvent(o.slice(1)):null},addPlugin:function(o,p){b.prototype[o]=p;return $f},each:m,extend:i});if(typeof jQuery=="function"){jQuery.prototype.flowplayer=function(q,p){if(!arguments.length||typeof arguments[0]=="number"){var o=[];this.each(function(){var r=$f(this);if(r){o.push(r)}});return arguments.length?o[arguments[0]]:new d(o)}return this.each(function(){$f(this,k(q),p?k(p):{})})}}})();(function(){var e=typeof jQuery=="function";var i={width:"100%",height:"100%",allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:null,onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(e){jQuery.tools=jQuery.tools||{};jQuery.tools.flashembed={version:"1.0.4",conf:i}}function j(){if(c.done){return false}var l=document;if(l&&l.getElementsByTagName&&l.getElementById&&l.body){clearInterval(c.timer);c.timer=null;for(var k=0;k<c.ready.length;k++){c.ready[k].call()}c.ready=null;c.done=true}}var c=e?jQuery:function(k){if(c.done){return k()}if(c.timer){c.ready.push(k)}else{c.ready=[k];c.timer=setInterval(j,13)}};function f(l,k){if(k){for(key in k){if(k.hasOwnProperty(key)){l[key]=k[key]}}}return l}function g(k){switch(h(k)){case"string":k=k.replace(new RegExp('(["\\\\])',"g"),"\\$1");k=k.replace(/^\s?(\d+)%/,"$1pct");return'"'+k+'"';case"array":return"["+b(k,function(n){return g(n)}).join(",")+"]";case"function":return'"function()"';case"object":var l=[];for(var m in k){if(k.hasOwnProperty(m)){l.push('"'+m+'":'+g(k[m]))}}return"{"+l.join(",")+"}"}return String(k).replace(/\s/g," ").replace(/\'/g,'"')}function h(l){if(l===null||l===undefined){return false}var k=typeof l;return(k=="object"&&l.push)?"array":k}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function b(k,n){var m=[];for(var l in k){if(k.hasOwnProperty(l)){m[l]=n(k[l])}}return m}function a(r,t){var q=f({},r);var s=document.all;var n='<object width="'+q.width+'" height="'+q.height+'"';if(s&&!q.id){q.id="_"+(""+Math.random()).substring(9)}if(q.id){n+=' id="'+q.id+'"'}if(q.cachebusting){q.src+=((q.src.indexOf("?")!=-1?"&":"?")+Math.random())}if(q.w3c||!s){n+=' data="'+q.src+'" type="application/x-shockwave-flash"'}else{n+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'}n+=">";if(q.w3c||s){n+='<param name="movie" value="'+q.src+'" />'}q.width=q.height=q.id=q.w3c=q.src=null;for(var l in q){if(q[l]!==null){n+='<param name="'+l+'" value="'+q[l]+'" />'}}var o="";if(t){for(var m in t){if(t[m]!==null){o+=m+"="+(typeof t[m]=="object"?g(t[m]):t[m])+"&"}}o=o.substring(0,o.length-1);n+='<param name="flashvars" value=\''+o+"' />"}n+="</object>";return n}function d(m,p,l){var k=flashembed.getVersion();f(this,{getContainer:function(){return m},getConf:function(){return p},getVersion:function(){return k},getFlashvars:function(){return l},getApi:function(){return m.firstChild},getHTML:function(){return a(p,l)}});var q=p.version;var r=p.expressInstall;var o=!q||flashembed.isSupported(q);if(o){p.onFail=p.version=p.expressInstall=null;m.innerHTML=a(p,l)}else{if(q&&r&&flashembed.isSupported([6,65])){f(p,{src:r});l={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title};m.innerHTML=a(p,l)}else{if(m.innerHTML.replace(/\s/g,"")!==""){}else{m.innerHTML="<h2>Flash version "+q+" or greater is required</h2><h3>"+(k[0]>0?"Your version is "+k:"You have no flash plugin installed")+"</h3>"+(m.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='http://www.adobe.com/go/getflashplayer'>here</a></p>");if(m.tagName=="A"){m.onclick=function(){location.href="http://www.adobe.com/go/getflashplayer"}}}}}if(!o&&p.onFail){var n=p.onFail.call(this);if(typeof n=="string"){m.innerHTML=n}}if(document.all){window[p.id]=document.getElementById(p.id)}}window.flashembed=function(l,m,k){if(typeof l=="string"){var n=document.getElementById(l);if(n){l=n}else{c(function(){flashembed(l,m,k)});return}}if(!l){return}if(typeof m=="string"){m={src:m}}var o=f({},i);f(o,m);return new d(l,o,k)};f(window.flashembed,{getVersion:function(){var m=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var l=navigator.plugins["Shockwave Flash"].description;if(typeof l!="undefined"){l=l.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var n=parseInt(l.replace(/^(.*)\..*$/,"$1"),10);var r=/r/.test(l)?parseInt(l.replace(/^.*r(.*)$/,"$1"),10):0;m=[n,r]}}else{if(window.ActiveXObject){try{var p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(q){try{p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");m=[6,0];p.AllowScriptAccess="always"}catch(k){if(m[0]==6){return m}}try{p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(o){}}if(typeof p=="object"){l=p.GetVariable("$version");if(typeof l!="undefined"){l=l.replace(/^\S+\s+(.*)$/,"$1").split(",");m=[parseInt(l[0],10),parseInt(l[2],10)]}}}}return m},isSupported:function(k){var m=flashembed.getVersion();var l=(m[0]>k[0])||(m[0]==k[0]&&m[1]>=k[1]);return l},domReady:c,asString:g,getHTML:a});if(e){jQuery.fn.flashembed=function(l,k){var m=null;this.each(function(){m=flashembed(this,l,k)});return l.api===false?this:m}}})();$f.addPlugin("controls",function(wrap,options){function fixE(e){if(typeof e=='undefined'){e=window.event;}if(typeof e.layerX=='undefined'){e.layerX=e.offsetX;}if(typeof e.layerY=='undefined'){e.layerY=e.offsetY;}return e;}function w(e){return e.clientWidth;}function offset(e){return e.offsetLeft;}function Draggable(o,min,max,offset){var dragging=false;function foo(){}o.onDragStart=o.onDragStart||foo;o.onDragEnd=o.onDragEnd||foo;o.onDrag=o.onDrag||foo;function move(x){if(x>max){return false;}if(x<min){return false;}o.style.left=x+"px";return true;}function end(){document.onmousemove=null;document.onmouseup=null;o.onDragEnd(parseInt(o.style.left,10));dragging=false;}function drag(e){e=fixE(e);var x=e.clientX-offset;if(move(x)){dragging=true;o.onDrag(x);}return false;}o.onmousedown=function(e){e=fixE(e);o.onDragStart(parseInt(o.style.left,10));document.onmousemove=drag;document.onmouseup=end;return false;};this.dragTo=function(x){if(move(x)){o.onDragEnd(x);}};this.setMax=function(val){max=val;};this.isDragging=function(){return dragging;};return this;}function extend(to,from){if(from){for(key in from){if(key){to[key]=from[key];}}}}function byClass(name){var els=wrap.getElementsByTagName("*");var re=new RegExp("(^|\\s)"+name+"(\\s|$)");for(var i=0;i<els.length;i++){if(re.test(els[i].className)){return els[i];}}}function pad(val){val=parseInt(val,10);return val>=10?val:"0"+val;}function toTime(sec){var h=Math.floor(sec/3600);var min=Math.floor(sec/60);sec=sec-(min*60);if(h>=1){min-=h*60;return pad(h)+":"+pad(min)+":"+pad(sec);}return pad(min)+":"+pad(sec);}function getTime(time,duration){return"<span>"+toTime(time)+"</span> <strong>"+toTime(duration)+"</strong>";}var self=this;var opts={playHeadClass:'playhead',trackClass:'track',playClass:'play',pauseClass:'pause',bufferClass:'buffer',progressClass:'progress',timeClass:'time',muteClass:'mute',unmuteClass:'unmute',duration:0,template:'<a class="play">play</a>'+'<div class="track">'+'<div class="buffer"></div>'+'<div class="progress"></div>'+'<div class="playhead"></div>'+'</div>'+'<div class="time"></div>'+'<a class="mute">mute</a>'};extend(opts,options);if(typeof wrap=='string'){wrap=document.getElementById(wrap);}if(!wrap){return;}if(!wrap.innerHTML.replace(/\s/g,'')){wrap.innerHTML=opts.template;}var ball=byClass(opts.playHeadClass);var bufferBar=byClass(opts.bufferClass);var progressBar=byClass(opts.progressClass);var track=byClass(opts.trackClass);var time=byClass(opts.timeClass);var mute=byClass(opts.muteClass);time.innerHTML=getTime(0,opts.duration);var trackWidth=w(track);var ballWidth=w(ball);var head=new Draggable(ball,0,0,offset(wrap)+offset(track)+(ballWidth/2));track.onclick=function(e){e=fixE(e);if(e.target==ball){return false;}head.dragTo(e.layerX-ballWidth/2);};var play=byClass(opts.playClass);play.onclick=function(){if(self.isLoaded()){self.toggle();}else{self.play();}};mute.onclick=function(){if(self.getStatus().muted){self.unmute();}else{self.mute();}};var timer=null;function getMax(len,total){return parseInt(Math.min(len/total*trackWidth,trackWidth-ballWidth/2),10);}self.onStart(function(clip){var duration=clip.duration||0;clearInterval(timer);timer=setInterval(function(){var status=self.getStatus();if(status.time){time.innerHTML=getTime(status.time,clip.duration);}if(status.time===undefined){clearInterval(timer);return;}var x=getMax(status.bufferEnd,duration);bufferBar.style.width=x+"px";head.setMax(x);if(!self.isPaused()&&!head.isDragging()){x=getMax(status.time,duration);progressBar.style.width=x+"px";ball.style.left=(x-ballWidth/2)+"px";}},500);});self.onBegin(function(){play.className=opts.pauseClass;});self.onPause(function(){play.className=opts.playClass;});self.onResume(function(){play.className=opts.pauseClass;});self.onMute(function(){mute.className=opts.unmuteClass;});self.onUnmute(function(){mute.className=opts.muteClass;});self.onFinish(function(clip){clearInterval(timer);});self.onUnload(function(){time.innerHTML=getTime(0,opts.duration);});ball.onDragEnd=function(x){var to=parseInt(x/trackWidth*100,10)+"%";progressBar.style.width=x+"px";if(self.isLoaded()){self.seek(to);}};ball.onDrag=function(x){progressBar.style.width=x+"px";};return self;});(function(a){$f.addPlugin("playlist",function(d,o){var n=this;var b={playingClass:"playing",pausedClass:"paused",progressClass:"progress",template:'<a href="${url}">${title}</a>',loop:false,playOnClick:true,manual:false};a.extend(b,o);d=a(d);var j=n.getPlaylist().length<=1||b.manual;var k=null;function e(q){var p=m;a.each(q,function(r,s){if(!a.isFunction(s)){p=p.replace("${"+r+"}",s).replace("$%7B"+r+"%7D",s)}});return p}function i(){k=d.children().unbind("click.playlist").bind("click.playlist",function(){return h(a(this),k.index(this))})}function c(){d.empty();a.each(n.getPlaylist(),function(){d.append(e(this))});i()}function h(p,q){if(p.hasClass(b.playingClass)||p.hasClass(b.pausedClass)){n.toggle()}else{p.addClass(b.progressClass);n.play(q)}return false}function l(){if(j){k=d.children()}k.removeClass(b.playingClass);k.removeClass(b.pausedClass);k.removeClass(b.progressClass)}function f(p){return(j)?k.filter("[href="+p.originalUrl+"]"):k.eq(p.index)}if(!j){var m=d.is(":empty")?b.template:d.html();c()}else{k=d.children();if(a.isFunction(k.live)){a(d.selector+"> *").live("click",function(){var p=a(this);return h(p,p.attr("href"))})}else{k.click(function(){var p=a(this);return h(p,p.attr("href"))})}var g=n.getClip(0);if(!g.url&&b.playOnClick){g.update({url:k.eq(0).attr("href")})}}n.onBegin(function(p){l();f(p).addClass(b.playingClass)});n.onPause(function(p){f(p).removeClass(b.playingClass).addClass(b.pausedClass)});n.onResume(function(p){f(p).removeClass(b.pausedClass).addClass(b.playingClass)});if(!b.loop&&!j){n.onBeforeFinish(function(p){if(!p.isInStream&&p.index<k.length-1){return false}})}if(j&&b.loop){n.onBeforeFinish(function(q){var p=f(q);if(p.next().length){p.next().click()}else{k.eq(0).click()}return false})}n.onUnload(function(){l()});if(!j){n.onPlaylistReplace(function(){c()})}n.onClipAdd(function(q,p){k.eq(p).before(e(q));i()});return n})})(jQuery);(function(){function toAbsolute(url,base){if(url.substring(0,4)=="http"){return url;}if(base){return base+(base.substring(base.length-1)!="/"?"/":"")+url;}base=location.protocol+"//"+location.host;if(url.substring(0,1)=="/"){return base+url;}var path=location.pathname;path=path.substring(0,path.lastIndexOf("/"));return base+path+"/"+url;}$f.addPlugin("embed",function(options){var self=this;var conf=self.getConfig(true);var opts={width:self.getParent().clientWidth||'100%',height:self.getParent().clientHeight||'100%',url:toAbsolute(self.getFlashParams().src),index:-1,allowfullscreen:true,allowscriptaccess:'always'};$f.extend(opts,options);opts.src=opts.url;opts.w3c=true;delete conf.playerId;delete opts.url;delete opts.index;this.getEmbedCode=function(runnable,index){index=typeof index=='number'?index:opts.index;if(index>=0){conf.playlist=[self.getPlaylist()[index]];}index=0;$f.each(conf.playlist,function(){conf.playlist[index++].url=toAbsolute(this.url,this.baseUrl);});var html=flashembed.getHTML(opts,{config:conf});if(!runnable){html=html.replace(/\</g,"&lt;").replace(/\>/g,"&gt;");}return html;};return self;});})();};


// rss feed plugin code
(function($){$.fn.rssfeed=function(url,options,fn){var defaults={limit:10,header:true,titletag:'h4',date:true,content:true,snippet:true,showerror:true,errormsg:'',key:null,ssl:false,linktarget:'_self'};var options=$.extend(defaults,options);return this.each(function(i,e){var $e=$(e);var s='';if(options.ssl)s='s';if(!$e.hasClass('rssFeed'))$e.addClass('rssFeed');if(url==null)return false;var api="http"+s+"://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+encodeURIComponent(url);if(options.limit!=null)api+="&num="+options.limit;if(options.key!=null)api+="&key="+options.key;api+="&output=json_xml"
$.getJSON(api,function(data){if(data.responseStatus==200){_process(e,data.responseData,options);if($.isFunction(fn))fn.call(this,$e);}else{if(options.showerror);if(options.errormsg!=''){var msg=options.errormsg;}else{var msg=data.responseDetails;};$(e).html('<div class="rssError"><p>'+msg+'</p></div>');};});});};var _process=function(e,data,options){var feeds=data.feed;if(!feeds){return false;}
var html='';var row='odd';var xml=getXMLDocument(data.xmlString);var xmlEntries=xml.getElementsByTagName('item');if(options.header)
html+='<div class="rssHeader">'+'<a href="'+feeds.link+'" title="'+feeds.description+'">'+feeds.title+'</a>'+'</div>';html+='<div class="rssBody">'+'<ul>';for(var i=0;i<feeds.entries.length;i++){var entry=feeds.entries[i];var entryDate=new Date(entry.publishedDate);var pubDate=entryDate.toLocaleDateString()+' '+entryDate.toLocaleTimeString();html+='<li class="rssRow '+row+'">'+'<'+options.titletag+'><a href="'+entry.link+'" title="View this feed at '+feeds.title+'" target="'+options.linktarget+'">'+entry.title+'</a></'+options.titletag+'>';if(options.date)html+='<div>'+pubDate+'</div>';if(options.content){if(options.snippet&&entry.contentSnippet!=''){var content=entry.contentSnippet;}else{var content=entry.content;};html+='<p>'+content+'</p>'};if(xmlEntries.length>0){var xmlMedia=xmlEntries[i].getElementsByTagName('enclosure');if(xmlMedia.length>0){html+='<div class="rssMedia"><div>Media files</div><ul>';for(var m=0;m<xmlMedia.length;m++){var xmlUrl=xmlMedia[m].getAttribute("url");var xmlType=xmlMedia[m].getAttribute("type");var xmlSize=xmlMedia[m].getAttribute("length");html+='<li><a href="'+xmlUrl+'" title="Download this media">'+xmlUrl.split('/').pop()+'</a> ('+xmlType+', '+formatFilesize(xmlSize)+')</li>';};html+='</ul></div>'};html+='</li>';};if(row=='odd'){row='even';}else{row='odd';}}
html+='</ul>'+'</div>';$(e).html(html);};function formatFilesize(bytes){var s=['bytes','kb','MB','GB','TB','PB'];var e=Math.floor(Math.log(bytes)/Math.log(1024));return(bytes/Math.pow(1024,Math.floor(e))).toFixed(2)+" "+s[e];}
function getXMLDocument(string){var browser=navigator.appName;var xml;if(browser=='Microsoft Internet Explorer'){xml=new ActiveXObject('Microsoft.XMLDOM');xml.async='false';xml.loadXML(string);}else{xml=(new DOMParser()).parseFromString(string,'text/xml');};return xml;}})(jQuery);

/* Enable Cache */
$.ajaxSetup({ cache: true, async: true});

/* Facebook */
window.fbAsyncInit=function(){FB.init({appId:'217475818286321',status:false,cookie:false,logging:false,xfbml:true});};
var cookieTracker;
var pageTracker;

$(document).ready(function(){
  setInternalTracking();  
  
/***********************************
  Set gallery image incase it is not present
***********************************/
  if(document.getElementById("img")== null && document.getElementById("gallery")!= null){
    document.getElementById("gallery").innerHTML = '<img id="img">' + document.getElementById("gallery").innerHTML;
  };
      
/***********************************
  Hover for IE 6
***********************************/
  $("div.dd_wrapper").each(function (i){
    var $hoverDD = $(this)
    $hoverDD.hover(
      function () {
        $hoverDD.addClass("hover");
      },
      function () {
        $hoverDD.removeClass("hover");
      }
    );
  });

/***********************************
  Sets social bar
***********************************/  
  socialBar();
  
/***********************************
  gallery overlay
***********************************/
  if($(".gallery").attr("href")!= undefined){
    $("a.gallery").overlay({   
        target: '#gallery',
        oneInstance: false, 
        top:15,
        expose: {
          color: '#444',
          opacity: 0.5,
          maskId: 'gallery_mask'
        },
        onBeforeLoad: function(event){
          $('#gallery').addClass('gal');
        },
        onClose: function(event){
          $('#gallery').removeClass('gal');
        }
    }).gallery({
        speed: 800,
        autohide: false,
        opacity: 1
    });
  };

/***********************************
  overlay
***********************************/
	var vimeoTargetVid = $('a.vimeo_play').attr('rel');
	if (vimeoTargetVid){
		var trigger1 = $('a.vimeo_play').overlay({			 
			target: '#gallery',
			api: true,
			// optional exposing effect 
			expose: {
				color: '#444',
				opacity: 0.5,
				maskId: 'gallery_mask'
			},
			// when overlay is opened, load our player 
			onBeforeLoad: function() {
				$('#gallery').addClass('iframe_player');
				$('#iframe_player').attr('src',vimeoTargetVid);
			}, 
			// when overlay is closed, unload our player 
			onClose: function() { 
				$('#gallery').removeClass('iframe_player');
				$('#iframe_player').attr('src', akamaiJSVar+ '/a1/i/general_items/blank.gif');
			}
		});
	};

/***********************************
  gallery overlay (no border)
***********************************/
  if($(".gallery_noborder").attr("href")!= undefined){
    $("a.gallery_noborder").addClass('clickedGallery').overlay({   
        target: '#gallery',
        oneInstance: false, 
        top:15,
        expose: {
					color: '#444',
					opacity: 0.5,
					maskId: 'gallery_mask'
				},
        onBeforeLoad: function(event){
          $('#gallery').addClass('gal_noborder');
					if($('.clickedGallery').hasClass('clone')==true){
						var itemToClone = $('.clickedGallery').attr('rel');
						$('#gallery').append($('.'+itemToClone));						
					}
        },
        onClose: function(event){
          $('#img').attr('src', akamaiJSVar+ '/a1/i/general_items/blank.gif');
          $('#gallery').removeClass('gal_noborder');
					$('clickedGallery').removeClass('clickedGallery')
        }
    }).gallery({
        speed: 800 
    });
  };

/***********************************
  video overlay
***********************************/  
  $("a.video_play").each(function (i){  
    var targetVid = this.getAttribute('rel');
    var player=$f("player", {src: targetVid, wmode: 'opaque'}, { clip: {autoPlay: true, autoBuffering: true}});
		var targetVidTrackerId;
		var $Trigger = $(this)
		if(typeof vjsTrackerKit === 'object')
            targetVidTrackerId = vjsTrackerKit.VIDEO.getEmbedId(targetVid);
    $Trigger.overlay({       
      target: '#gallery',  
      oneInstance: false,   
      expose: {
          color: '#444',
          opacity: .4,
          maskId: 'gallery_mask'
      },       
      onBeforeLoad: function() {
				if ($Trigger.hasClass('Julie_Video'))
        	$('#gallery').addClass('julie_video');

        $('#gallery').addClass('video_gallery');
        player.load(); 
		if(targetVidTrackerId)
    		$('#player_api').attr('id',targetVidTrackerId);
      },
	  onBeforeClose: function(){
        if(targetVidTrackerId && typeof vjsTrackerKit === 'object')
            if(vjsTrackerKit.VIDEO.vts[targetVidTrackerId])
    			vjsTrackerKit.VIDEO.vts[targetVidTrackerId].sendData();
      },        	   
      onClose: function() { 
        player.unload(); 
        $('#gallery').removeClass('video_gallery');
        $('#gallery').removeClass('julie_video');
      }
    });
  });
 
/***********************************
  external links
***********************************/
  $('a[rel="external"]').attr('target','_blank');

/***********************************
  modal links
***********************************/
  $('a.vjs_modal').click(function(){showThankyou();});
  
  
/***********************************
  Quick Validation
***********************************/
	if (curDomain.indexOf('www.') != -1 || curDomain.indexOf('local.') != -1){
		$(":input").each(function (i){                             
			var input = $(this);
			var tempValue = input.attr('value');    
			if (tempValue != "" && input.attr('type') != 'radio' && input.attr('type') != 'checkbox'){
				inputCheck(input);
			};    
			input.blur(function() {
				inputCheck(input);
			});
		});
	};
  
  $("#formID").submit(function(){
		radioCollection = '';
    errMsg = '';
    $(this).find(":input").each(function (i) {
      inputCheck($(this));
    });
    if (errMsg.length > 0) {
        alert(errMsg);
        errMsg = '';
        return false;
    } else {
				setSubmitTracking("formID")
        return true;
    };
  });
  
/***********************************
  Left Nav
***********************************/
  var content_minheight = $('#left_nav').height()-10;

  if ($('#left_nav').height()!=null){
    $('#content_wrapper .section:first').css('minHeight', content_minheight);
  };

  checkActive();

/***********************************
  FAQ Show Hide
***********************************/
  $('#faq_showhide h4').click(function() {
    if($('#faq_showhide h4').hasClass('open') == true && $(this).hasClass('open') != true){
      $('#faq_showhide h4.open').next().slideUp(600);
      $('#faq_showhide h4.open').removeClass('open');
    };
    $(this).toggleClass('open');
    $(this).next().slideToggle(600);
  });

/***********************************
  Set return address for Forms
***********************************/
  if($('#retURL').attr('id') == 'retURL'){
    var patt=new RegExp('http://'+curDomain,'g');
    var retVal = $('#retURL').val().replace(patt, '');
    retVal = 'http://'+curDomain+retVal;
    $('#retURL').val(retVal);
    
    if (currentURI.indexOf('#thank-you') != -1){
      showThankyou();
    };
  };
	
	$('a[rel="#demoOverlay"]').attr('rel','').attr('href','http://www.volusion.com/free-trial/');

});/*end dom*/

$(window).load(function () {
/***********************************
  Tracking Code
***********************************/
  setGACrossDomainLinks(); //append GA cookie data to cross domain links

  if (curDomain.indexOf('local') == -1){      
    if (document.location.protocol == "https:"){
      //$.getScript("https://ssl.google-analytics.com/ga.js", function() {setGoogleCookieTrack();setGooglePageTracker();});
    } else{
      //$.getScript("http://www.google-analytics.com/ga.js", function() {setGoogleCookieTrack();setGooglePageTracker();});
    };
			$.getScript("//lct.salesforce.com/sfga.js", function() {try{__sfga();}catch(err){};});
  };
	//load facbook like btn
  $.getScript("//connect.facebook.net/en_US/all.js", function(){
    $.getScript("//ah8.facebook.com/js/conversions/tracking.js",function(){
      try{FB.Insights.impression({'id':6002472467858,'h':'646243bf75'})}catch(e){};
    });
    FB.Event.subscribe('edge.create', function(targetUrl) {
			pageTracker._trackSocial('facebook', 'like', targetUrl);
			$('.facebook').css('width','auto');
			$('.facebook').css('overflow','visible');		
		});
    FB.Event.subscribe('edge.remove', function(targetUrl) {pageTracker._trackSocial('facebook', 'unlike', targetUrl);});
  });
});

function socialBar(){
  var inPos = -($('#gs_bot').height());
  
  //if 0 undefined then bar isnt loaded and should return
  if (inPos == 0 || inPos == undefined || inPos == -1 || $('body').hasClass('noBar') == true) return;
  
  var gsLoaded = false;
  var sbsCount = 0;
  
  $('#gs_hidden .gs_show_wrap').click(function(){
    if (gsLoaded == false){
      gsLoaded = gsLoad();
    };
      toggleBar(inPos);
  });
  
  $('#gs_top .gs_show_wrap').click(function(){
    toggleBar(inPos, true);
  });

  $('#gs_top .hide_gs').click(function(){
      toggleBar(inPos, true);
  });
};

function gsLoad(inPos){

  $.getScript("//connect.facebook.net/en_US/all.js", function(){
    $.getScript("//ah8.facebook.com/js/conversions/tracking.js",function(){
      try{FB.Insights.impression({'id':6002472467858,'h':'646243bf75'})}catch(e){};
    });
    FB.Event.subscribe('edge.create', function(targetUrl) {pageTracker._trackSocial('facebook', 'like', targetUrl);});
    FB.Event.subscribe('edge.remove', function(targetUrl) {pageTracker._trackSocial('facebook', 'unlike', targetUrl);});
  });
  //load plus1
  $.getScript("//apis.google.com/js/plusone.js");
  $.ajax({
    url:"/tweets.xml",
    dataType: "xml",
    success: function(xml) {
      var tweets = "";
      $(xml).find('tweet').each(function(){
        var tweetUsername = $(this).find('username').text();
        var tweet = $(this).find('txt').text();
        tweets += '<div class="tweet"><span class="username">'+tweetUsername+'</span><span class="tweetTxt">'+tweet+'</span></div>';
      });
      $('#tweets').html(tweets);
    },
    complete: function() {
      rollTwits();
    }
  });

  if (document.location.protocol != "https:"){
    //load twitter btn (no ssl)
    $('.twitter').html('<a href="http://twitter.com/volusion" class="twitter-follow-button" data-text-color="#FFFFFF" data-link-color="#00AEFF">Follow @volusion</a>');
    $.getScript("//platform.twitter.com/widgets.js", function(event){
      twttr.events.bind('click', function(event) {
        if (event) {
          pageTracker._trackSocial('twitter', 'tweet', currentURI);
        };
      });
    });
    //load blog
    $('#blog_load').rssfeed('http://onlinebusiness.volusion.com/feed/rss2', {limit: 1, header: false, date: false});
  }else{
    //load twitter btn (ssl)
    $('.twitter').html('<a href="http://twitter.com/intent/user?screen_name=volusion" class="secure-follow-button" target="_blank"><span class="s_follow">Follow</span> @volusion</a>');    
  };
  
  return true;
};

function toggleBar(inPos){
	var $socialBar = $('#get_social');
	var $socialHidden = $('#gs_hidden');
	var $socialTop = $('#gs_top');
  if ($socialBar.hasClass('open_drawer') != true){
    $socialHidden.toggle();
    $socialTop.toggle();
    $socialBar.animate({
      bottom:0}, 400,'easeOutQuad', function() {
    });
  } else{
    $socialBar.animate({
      bottom:inPos}, 600,'easeInCubic', function() {
        $socialHidden.toggle();
        $socialTop.toggle();
    });
  };
  $socialBar.toggleClass('open_drawer');
};

function rollTwits(){
  var twitPos = [10]  
  var twitLength = $('.tweet').length-1;
	var $tweets = $('#tweets');
  
  for (var i=0;i<3;i++){
    $tweets.prepend($('.tweet:eq('+twitLength+')').clone());
  };
  
  $('.tweet').each(function (i){
    twitPos[i+1] = twitPos[i]+$(this).outerHeight();
  });
  var twitLength = $('.tweet').length-1;
  var cTweet = twitLength;

  $tweets.css('top',-twitPos[cTweet]);
  setInterval(function(){
    cTweet--;
    $tweets.animate({
      top: -twitPos[cTweet]
    }, 500,'easeOutQuad', function(){
      if (cTweet <= 0){
        cTweet = twitLength-2;
        $tweets.css('top',-twitPos[cTweet]);
      }
    });
  }, 8000);
};

// set Google analytics
function setGoogleCookieTrack(){
  cookieTracker=_gat._getTracker('UA-1399167-10');
try {
    cookieTracker._setReferrerOverride(realreferrer);}
catch (e){ ;}
  cookieTracker._setAllowHash(false);
  var tempDomain = curDomain.replace('www.','');
  cookieTracker._setDomainName(tempDomain);
  cookieTracker._setAllowLinker(true);
  cookieTracker._setAllowAnchor(true);
  cookieTracker._addIgnoredRef("volusion");
  cookieTracker._trackPageview();
  cookieTracker._setVar(ConversionWorks);
};


function setGooglePageTracker(){
  pageTracker=_gat._getTracker('UA-1399167-1');
try {
    pageTracker._setReferrerOverride(realreferrer);}
catch (e){ ;}
  pageTracker._setAllowHash(false);
  var tempDomain = curDomain.replace('www.','');
  cookieTracker._setDomainName(tempDomain);
  pageTracker._setAllowLinker(true);
  pageTracker._setAllowAnchor(true);
  pageTracker._addIgnoredRef("volusion");
  pageTracker._trackPageview();
  pageTracker._trackPageLoadTime();
};

// set Google analytics link tracking events
function setInternalTracking(parentSelector) {
  parentSelector = (parentSelector) ? parentSelector + ".track" : ".track";
	  
  //Get every instance of the class track and ad this code to it
  $(parentSelector).each(function(i){
    //Set the trackTitle that will later be called as the event category to the title of the current object title
    var $track = $(this);
	var trackTitle = $track.attr('track');
    //Call every anchor tag inside the current track (called by its indexed track class)
    $track.find('a').each(function(i){
      //set the target object that contains the data for the tracking event
      var oTarget = $(this);
      //Call the function with the linkname logic (that will be added to the label in the event
      oTarget.click(function() {
        setPageTrackerLink(oTarget,trackTitle);
        //return false; //uncommenty to stop the default action of leaving the page
      });  
    });
    
    //Call every anchor tag inside the current track (called by its indexed track class)
    $track.find('#faq_showhide h4').each(function(i){
      //set the target object that contains the data for the tracking event
      var oTarget = $(this);
      //Call the function with the linkname logic (that will be added to the label in the event
        oTarget.click(function() {
          if (!oTarget.hasClass('open')){
            setPageTrackerLink(oTarget,trackTitle,'FAQ S/H');
            //return false; //uncommenty to stop the default action of leaving the page
          };
        });
    });
  });
};

function setSubmitTracking(formID) {
	var oTarget = $('#'+formID+' input[type="submit"]');
	var oTrack = $('#'+formID);
	var bodyID = $('body').attr('id');
	var trackTitle;
	do{
		oTrack = oTrack.parent();
		if (oTrack.hasClass('track') == true){
			trackTitle = oTrack.attr('track');
		} else if (oTrack.parent().attr('id') == bodyID){
			trackTitle = 'noTitle';
		};
	} while(!trackTitle);
		
	setPageTrackerLink(oTarget,trackTitle,'Submit');
};

//appends GA cookie data to cross domain links
//**update required: filter out links to pdfs and links to akamai files
function setGACrossDomainLinks(){
	if (curDomain.indexOf('volusion.co.uk') != -1){
		$('a[href*="volusion.com"]').each(function(){
			var $templink = $(this);
			$templink.attr( 'href', pageTracker._getLinkerUrl($templink.attr('href')) );
		});
	}else if( curDomain.indexOf('volusion.com') != -1 ){
		$('a[href*="volusion.co.uk"]').each(function(){
			var $templink = $(this);
			$templink.attr( 'href', pageTracker._getLinkerUrl($templink.attr('href')) );
		});
	}
}

//sets the URI globaly on every page
function setURI() {
  var queryhash;  
  //set GLOBAL curDomain
  curDomain = window.location.host;
  //set GLOBAL currentURI with hash maintained and query removed
  currentURI = window.location.pathname;
  currentURI = currentURI.replace(/%252d/g,'-').replace(/%2d/g,'-');     
  //get hash
  queryhash = window.location.hash;
  //fix improperly formated hash strings - strip out the query (proper formating ?query#hash)
  queryhash = (queryhash.match(/\?/) != null) ? queryhash.split('?',1) : queryhash;
  //if the URI is empty then the URI is set to the current domain so that homepage events on subdomains dont all look the same
  currentURI  =  (currentURI == '/' || currentURI == '' || currentURI == '/default.asp') ? curDomain + '/' : currentURI;      
  //check to see if the current uri is not a file and if it isnt - make sure it is ended with a /
  currentURI  = (currentURI.match(/\/$/) == null && currentURI.match(/[\.a-z]{3,5}$/ == null)) ? currentURI + '/' : currentURI ;
  //remove file name/type if there is one so default.asp and / are not counted as 2 separate pages
  currentURI  = (currentURI.match(/[\.a-z]{3,5}$/) != null) ? currentURI.replace(/\/[\-a-z]+[\.a-z]{3,5}$/,'/') : currentURI ;  
  //append hash
  currentURI = currentURI + queryhash;
};

function setLinkName(oTarget) {
  //gets all of the text and text only inside the anchor
  var linkName = oTarget.text();
  //if there is an image inside of the ancor it gets the alt text instead
  if (oTarget.html().indexOf('<img')!=-1){
    oTarget.addClass('imgLink');
    linkName = $('.imgLink img').attr('alt')+ ' img';
    oTarget.removeClass('imgLink');
  };
  if (oTarget.html().indexOf('<option')!=-1){
    oTarget.addClass('trackSelect');
    linkName = oTarget.attr('name');
    linkName += ' - ' + $('.trackSelect option:selected').text();
    oTarget.removeClass('trackSelect');
  };
  if (oTarget.attr('type') == 'submit'){
    linkName = oTarget.val();
  };
  //removes everything but whitespaces, dashes, letters, and numbers
  linkName = linkName.replace(/[^\w\d -,]+/g,'');
  //removes all whitespaces and replaces them with spaces
  linkName = linkName.replace(/[\s]+/g,' ');
  return linkName;  
};

function setPageTrackerLink(oTarget,trackTitle,sAction) {
  
  var bodyID = $('body').attr('id');  
  var linkName = setLinkName(oTarget);
  var linkRelPath = oTarget.attr('rel');
  //sets the default action
  var GAaction = 'Element Click';
  //sets the action to something different depending on the class
  if (oTarget.hasClass('PV') == true){
    GAaction = 'Play Video';
	trackTitle = 'Videos'
  };
  if (sAction){
    GAaction = sAction;
  };
  //checks to see if the anchor is a Sub Link (SL) or SSL class (which defines the anchor as a Sub Link or Sub Sub Link)
  if (oTarget.hasClass('SL') == true){
    //iterates through the anchors parents until it finds the object with the Sub Link Title (SLT)
    do{
      oTarget = oTarget.parent();
      if (oTarget.hasClass('SLT') == true){
        parentTitle = oTarget.attr('track');
      } else if (oTarget.parent().attr('id') == bodyID){
        parentTitle = 'noTitle';
      };
    } while(!parentTitle);
    linkName = parentTitle+' - '+linkName;    
  } else if (oTarget.hasClass('SSL') == true){
    var parentTitle;
    var parentParentTitle;
    //iterates through the anchors parents until it finds the object with the Sub Link Title (SLT) and a Sub Sub Link Title (SSLT)
    do{
      do{
        oTarget = oTarget.parent();
        if (oTarget.hasClass('SSLT') == true){
          parentTitle = oTarget.attr('track');
        } else if (oTarget.parent().attr('id') == bodyID){
          parentTitle = 'noTitle';
        };
      } while(!parentTitle);
      oTarget = oTarget.parent();  
      if (oTarget.hasClass('SLT') == true){
        parentParentTitle = oTarget.attr('track');
      } else if (oTarget.parent().attr('id') == bodyID){
          parentTitle = 'noTitle';
        };
    } while(!parentParentTitle);
    linkName = parentParentTitle +' - '+parentTitle+' - '+linkName;
  };
  //removes duplicate -
  linkName = linkName.replace(/( - )+/g,' - ');
  
  //sets the ga event parameters for the video tracker of the target video
  if(typeof vjsTrackerKit === 'object'){ 
      var videoTrackerId = vjsTrackerKit.VIDEO.getEmbedId(linkRelPath);
	  if(videoTrackerId)
		vjsTrackerKit.VIDEO.setGAEventParams(videoTrackerId, '', currentURI+' '+linkName);
  }
  
  //calls the event method with the title of the wrapper as the category, the set action, and the label is the URI plus the link name
  try{pageTracker._trackEvent(trackTitle,GAaction,currentURI+' '+linkName);}
  catch(err){};
};

function plusone_vote( obj ) {
  pageTracker._trackSocial('plusone ',obj.state,currentURI);
};

function LaunchVolusionChat(auto) {
  var chat_width = 494;
  var chat_height = 418;
  var today = new Date();
  var request_url = 'https://livechat03.volusion.com/livechat.aspx?ID=24342&location=' + escape(document.URL.toLowerCase()) + '&auto=0&cookieGuid=rcorhn2jdb011v55qbcqex55&DeptID=10&Agent=&tType=';  
  window.open(request_url, today.getTime(), 'scroll=yes,scrollbars=yes,menubar=no,resizable=0,location=no,screenX=50,screenY=100,width=' + chat_width + ',height=' + chat_height);
}

/***********************************
  Form validation
***********************************/
var errMsg = '';
var radioCollection = 'Empty';

function inputCheck(input) {
  var inputType = input.attr('type');
  var required = input.hasClass('required');
  var inputTitle = input.attr('title');
  var inputValue = input.val();
  if (inputType == 'radio') {
    var inputName = input.attr('name');
    if (radioCollection != inputName) {
      var inputValue = $('input:radio[name=' + inputName + ']:checked').val();
      radioCollection = inputName;
      validateRadio(inputTitle, inputValue, input.parent(), required);
    };
  } else if (inputType == 'checkbox') {
		inputValue = input.attr('checked');
    validateCheckbox(inputTitle, inputValue, input, required);
  }else if (input.hasClass('v_textarea') == true) {
    validateTextarea(inputTitle, inputValue, input, required);
  } else if (input.hasClass('v_select') == true) {
    validateSelect(inputTitle, inputValue, input, required);          
  } else if (inputType == 'text' || inputType == 'password' || inputType == 'phone' || inputType == 'date' || inputType == 'number') {
    validateField(inputTitle, inputValue, input, required);
  };
};

function validateTextarea(name, value, textarea, required) {
    if (value == '' && (required == 'true' || required == true)) {
        errMsg += "Please enter a value " + name + ".\n";
        addInputClass(textarea,'empty');
    } else {
        removeInputClass(textarea,'empty');
    };
};

function validateSelect(name, value, selectList, required) {
    if (value == '' && (required == 'true' || required == true)) {
        errMsg += "Please select " + name + ".\n";
        addInputClass(selectList,'empty');
    } else {
        removeInputClass(selectList,'empty');
    };
    var selectName = selectList.attr('name');
    var selectNameNumber = $('[name="' + selectName + '"]').length;
    if (selectNameNumber != 1) {
        var selectID = selectList.attr('id');
        var selectHiddenID = selectID + '_Hidden';
        if (selectList.val() == 'Other') {
            var selectOtherID = selectID + '_Other';
            var selectValue = $('#' + selectOtherID).val();
            $('#' + selectHiddenID).val(selectValue);
        } else {
            $('#' + selectHiddenID).val(selectList.val());
        };
    };
};

function validateCheckbox(name, value, checkbox, required) {
    if ((value == undefined || value == '') && (required == 'true' || required == true)) {
        errMsg += "Please select " + name + ".\n";
         addInputClass(checkbox,'empty')
    } else {
         removeInputClass(checkbox,'empty');
    };
};

function validateRadio(name, value, radio, required) {
    if (value == undefined && (required == 'true' || required == true)) {
        errMsg += "Please select " + name + ".\n";
         addInputClass(radio,'empty')
    } else {
         removeInputClass(radio,'empty');
    };
};

var passwordVal = '';

function validateField(name, value, input, required) {
  var vtype = 'text';
  if (input.hasClass('v_numbers') == true) {
      vtype = 'numbers';
  } else if (input.hasClass('v_zip') == true) {
      vtype = 'zip';
  } else if (input.hasClass('v_phone') == true) {
      vtype = 'phone';
  } else if (input.hasClass('v_email') == true) {
      vtype = 'email';
  } else if (input.hasClass('v_URL') == true) {
      vtype = 'URL';
  } else if (input.hasClass('v_password') == true) {
      vtype = 'password';
  } else if (input.hasClass('v_dob') == true) {
      vtype = 'dob';
	};

  var invalidChar;
  var errMsgText;
  var invalidMsgText = "Please enter your a valid " + name + ".\n";
  switch (vtype) {
  case 'numbers':
    invalidChar = /[^0-9\s\-\.]/;
    errMsgText = "Please remove the letter or the invalid characters \/\|\!\@\#\$\%\^\&\*\(\)\+\=\{\}\?\:\"', from the " + name + " field.\n";
    break;
  case 'zip':
    invalidChar = /[^a-zA-Z0-9\s\-\.]/;
    errMsgText = "Please remove the letter or the invalid characters \/\|\!\@\#\$\%\^\&\*\(\)\+\=\{\}\?\:\"', from the " + name + " field.\n";
    break;
  case 'phone':
    invalidChar = /[^0-9\s\-\(\)\.\[\]\+ext]/;
    errMsgText = "Please remove the letter or the invalid characters \/\|\!\@\#\$\%\^\&\*\\,\+\=\{\}\?\:\"' from the " + name + " field.\n";
    break;
  case 'email':
    invalidChar = /^(?:[a-zA-Z0-9_.-])+@(?:[a-zA-Z0-9-])+\.(?:[a-zA-Z0-9_.]{2,8})+$/;
    errMsgText = "Please enter a valid e-mail address.\n";
    break;
  case 'URL':
    invalidChar = /^(?:ftp|http|https)?(?:\:)?(?:\/\/)?(?:[w]{0,3})?[0-9a-zA-Z\?\@\%\/]+\.[0-9a-zA-Z\?\@\%\.\/]+/;
    errMsgText = "Please enter a valid web address.\n";
    break;
  case 'password':
    invalidChar = /\|/;
    errMsgText = "Please choose another password without a '|'.\n";
    break;
  case 'dob':
    invalidChar = /[^0-9\/]/;
    errMsgText = "Please remove the letter or the invalid characters \/\|\!\@\#\$\%\^\&\*\(\)\+\=\{\}\?\:\"', from the " + name + " field.\n";
    break;
  case 'text':
    invalidChar = /[^a-zA-Z0-9\s\-.]/;
    errMsgText = "Please remove the invalid characters \/\|\!\@\#\$\%\^\&\*\(\)\,\+\=\{\}\?\:\"' from the " + name + " field.\n";
    break;
  default:
    invalidChar = /[^a-zA-Z0-9\s\-]/;
    errMsgText = "Please remove the invalid characters \/\|\!\@\#\$\%\^\&\*\(\)\,\+\=\{\}\?\:\"'from the " + name + " field.\n";
  };
	
	
  if ((value == "" || value == name) && (required == 'true' || required == true)) {
    errMsg += invalidMsgText;
    addInputClass(input,'empty');
    removeInputClass(input,'invalid');
    removeInputClass(input,'invalid_format');
  } else if (vtype == 'password') {
		if (input.hasClass('pMatch') == true && value != passwordVal){
			errMsg += "Passwords do not match";
			addInputClass(input,'invalid');
			removeInputClass(input,'empty');			
		} else if(value.length < 6) {
			errMsg += "Please enter a " + name + " of at least 6 characters.\n";
			addInputClass(input,'invalid');
			removeInputClass(input,'empty');
		} else {
			removeInputClass(input,'invalid');	
			removeInputClass(input,'empty');
			passwordVal = value;
		};
  } else if (value != "" && value != name) {
    var matchArray = value.match(invalidChar);
    if (vtype == 'email' && !matchArray) {
      errMsg += errMsgText;
      addInputClass(input,'invalid');
      removeInputClass(input,'empty');
    } else if (vtype == 'URL' && !matchArray) {
      errMsg += errMsgText;
      addInputClass(input,'invalid');
      removeInputClass(input,'empty');
    } else if (vtype == 'phone' && !matchArray) {
			var tempPhoneVal = value.replace(/[\.\- x]+/g,'').length;
			if (tempPhoneVal < 10){
				errMsg += invalidMsgText;
				removeInputClass(input,'invalid');
				addInputClass(input,'empty');
			} else{
				//Validates US with optional 1 and extentions of up to 5 digits
				var phoneReg =  /^(?:[+1]{2})?[-. \(]?(?:[0-9]{3})?[-. \)]?(?:[0-9]{3})[-. ]?(?:[0-9]{4})[-. ]?(?:[extEXT.]{1,4})?[-. ]?(?:[0-9]{1,5})?$/;
				var matchPhone = value.match(phoneReg);
				var matchCheck = false;
				if (!matchPhone){
					phoneReg = /^\+?(?:[0-9]{2})[-. \(]?(?:[0-9]{1,4})?[-. \(]?(?:[0-9]{1,4})?[-. \(]?(?:[0-9]{1,4})?[-. \(]?(?:[0-9]{1,8})[-. \(]?(?:[extEXT.]{1,4})?[-. ]?(?:[0-9]{1,5})?$/;
					matchPhone = value.match(phoneReg);
					if (!matchPhone){
						//Validate international phone numbers in EPP format
						phoneReg = /^\+?[0-9]{1,3}\.[0-9]{4,14}(?:x.+)?$/;
						matchPhone = value.match(phoneReg);
						if (!matchPhone){
							errMsg += invalidMsgText;
							removeInputClass(input,'invalid');
							addInputClass(input,'empty');
						} else{
							matchCheck = true;
						};
					} else{
						matchCheck = true;
					};
				} else{
					matchCheck = true;
				};
			};
			if (matchCheck == true){
				removeInputClass(input,'invalid');
				removeInputClass(input,'empty');
			};
		} else if (vtype != 'email' && vtype != 'URL' && matchArray) {
      errMsg += errMsgText;
      addInputClass(input,'invalid');
      removeInputClass(input,'empty');
		} else {
      removeInputClass(input,'invalid');
      removeInputClass(input,'empty');
    };
  };
};

function removeInputClass(input,classToggle){  
  input.removeClass(classToggle);
  input.parent().removeClass(classToggle+'_p');
};

function addInputClass(input,classToggle){  
  input.addClass(classToggle);
  input.parent().addClass(classToggle+'_p');
};

//Limit the number if characters in a textarea
function limitChars(textid,limit,infodiv){var text=$('#'+textid).val();var textlength=text.length;$('#'+infodiv).css('display','block');if(textlength>limit){$('#'+infodiv).html('Max Characters '+limit+' currently at '+limit);$('#'+textid).val(text.substr(0,limit));return false}else{$('#'+infodiv).html('Max Characters '+limit+' currently at '+textlength);return true}};

//Checks the left nav to see if the Link matches the URL
function checkActive(){$("#left_nav a").each(function(i){var compareHref=$(this).attr('href');var compareURI='/'+currentURI;if(compareURI==compareHref){$(this).addClass("active")}})};

//Checks the URL of form - if #thank-you is present this displays the thankyou overlay
function showThankyou(){var apiThankyou=$('div#gallery').overlay({target:'#gallery',oneInstance:false,api:true,top:15,onBeforeLoad:function(event){$('#gallery').addClass('ajaxLoad');$('#ajaxContent').load('thankyou.asp')},onClose:function(event){$('#gallery').removeClass('ajaxLoad');},expose:{color:'#949494',loadSpeed:200,maskId:'gallery_mask'}});apiThankyou.load()};

/*
 * jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php
 *
 * Uses the built In easIng capabilities added In jQuery 1.1
 * to offer multiple easIng options
 *
 * Copyright (c) 2007 George Smith
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 */

// t: current time, b: begInnIng value, c: change In value, d: duration

jQuery.extend(jQuery.easing,{easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b}});

var __reference="";var __searchme="";var __utmp="";var __medium="";function getcookie(c_name,special){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;var cookie_to_use=unescape(document.cookie.substring(c_start,c_end));if(special){return cookie_to_use.toLowerCase()};return cookie_to_use}};return""};function matchregex(regex){var patt=new RegExp(regex+"=([^|]+)");if(result=patt.exec(__utmp)){return result[1]};return null};function setcookie(c_name,value,expiredays,isSecure){var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);var thisDomain="volusion.com";if(document.domain!=''){thisDomain=document.domain.toLowerCase();thisDomain=thisDomain.replace('.qa1.adsqa','');domainArray=thisDomain.split('.');if(domainArray.length>1){thisDomain=thisDomain.replace(domainArray[0],'')}};var cookie=c_name+"="+value+";path=/;"+((expiredays==null)?"":"expires="+exdate.toGMTString())+((thisDomain=="")?"":";domain="+thisDomain);if(isSecure){cookie+=" secure"};document.cookie=cookie};function configurecwcookie(reference){if(__utmcw.length=="0"){setcookie("__utmcw",reference,182)}else{var searchme=__utmcw.match(reference);var workwith=__utmcw.split("|")+"<br />";var temp=new Array();temp=__utmcw.split('|');var templength=temp.length;var latest=temp[templength-1];if(templength>24){temp.splice(0,templength-5);var __utmcwTrimmed=temp.join('|');if(latest.replace(/^\s*/, "").replace(/\s*$/, "")!=reference.replace(/^\s*/, "").replace(/\s*$/, "")){setcookie("__utmcw",__utmcwTrimmed+" | "+reference,182)}else{setcookie("__utmcw",__utmcwTrimmed,182)}}else if(latest.replace(/^\s*/, "").replace(/\s*$/, "")!=reference.replace(/^\s*/, "").replace(/\s*$/, "")){setcookie("__utmcw",__utmcw+" | "+reference,182)}}};

var ConversionWorks="";var __utmp=getcookie('__utmz',true);var __ignore="www.ignore.co.uk";var __custom_referrer=document.referrer;if(__custom_referrer!=""){__custom_referrer=__custom_referrer.toLowerCase();if(__custom_referrer.indexOf("volusion.ca")>0){__ignore=".volusion.ca"}else if(__custom_referrer.indexOf("volusion.com")>0){__ignore=".volusion.com"}else if(__custom_referrer.indexOf("volusion.co.uk")>0){__ignore=".volusion.co.uk"}};var __searray=new Array();__searray["google"]="q";__searray["yahoo"]="p";__searray["msn"]="q";__searray["bing"]="q";__searray["aol"]="query";__searray["lycos"]="query";__searray["ask"]="q";__searray["altavista"]="q";__searray["netscape"]="query";__searray["cnn"]="query";__searray["looksmart"]="qt";__searray["about"]="terms";__searray["mamma"]="query";__searray["alltheweb"]="q";__searray["gigablast"]="q";__searray["voila"]="rdata";__searray["virgilio"]="qs";__searray["live"]="q";__searray["baidu"]="wd";__searray["alice"]="qs";__searray["yandex"]="text";__searray["najdi"]="q";__searray["club-internet"]="query";__searray["mama"]="query";__searray["seznam"]="q";__searray["search"]="q";__searray["wp"]="szukaj";__searray["onet"]="qt";__searray["netsprint"]="q";__searray["google.interia"]="q";__searray["szukacz"]="q";__searray["yam"]="k";__searray["pchome"]="q";__searray["kvasir"]="searchExpr";__searray["sesam"]="q";__searray["ozu"]="q";__searray["terra"]="query";__searray["nostrum"]="query";__searray["mynet"]="q";__searray["ekolay"]="q";__searray["search.ilse"]="search_for";if(__utmp.length>"0"){var __utmcw=getcookie("__utmcw",false);var __gclid=matchregex("utmgclid");var __medium=matchregex("utmcmd");var __source=matchregex("utmcsr");var __keyword=matchregex("utmctr");if(__medium=="(none)"){if(__source=="(direct)"){configurecwcookie("direct")}}else if(__medium!="(none)"&&document.referrer==""&&__source!="email"){configurecwcookie("direct")}else if(__source=="email"){configurecwcookie(__source+" ("+__medium+")")}else if(__medium=="referral"){var __source=matchregex("utmcsr");if(__source.match(/volusion\./)==""){configurecwcookie("referral ("+__source+")")}}else if(__medium=="organic"){var __source=matchregex("utmcsr");var __keyword=matchregex("utmctr");var __referrer=document.referrer;var refpatt=new RegExp("https?://([^/]*)/?");var __referrerDomain=refpatt.exec(__referrer);var __queryparam=__searray[__source];var patt=new RegExp("https?://.*"+__source+".*[?&]"+__queryparam+"=.*");if(result=patt.exec(__referrer)){configurecwcookie(__source+" ("+__medium+") ("+__keyword+")")}else{if(__referrerDomain[1].indexOf(__ignore)==-1){configurecwcookie("referral ("+__referrerDomain[1]+")")}}}else if(__medium=="cpc"||__medium=="ppc"||typeof __gclid!=null){var __source=matchregex("utmcsr");var __keyword=matchregex("utmctr");var __referrer=document.referrer;var __referrer=__referrer.toLowerCase();if(typeof __gclid!=null){__source="google";if(__referrer!=null){if(__referrer.indexOf(".bing.")>0){__source="bing"}else if(__referrer.indexOf(".aol.")>0){__source="aol";var __medium="cpc"}else if(__referrer.indexOf("search.aol.")>0){__source="aol";var __medium="cpc"}else if(__referrer.indexOf(".yahoo.")>0){__source="yahoo"}else if(__referrer.indexOf(".search.")>0){__source="search";var __medium="cpc"}else if(__referrer.indexOf(".ask.")>0){__source="ask"}else if(__referrer.indexOf(".baidu.")>0){__source="baidu"}else if(__referrer.indexOf("googleads.g.doubleclick.")>0){var __medium="cpc";__source="googleads.g.doubleclick";var keywordPatt=new RegExp("&url=([^&]+)&");var keywordMatch=keywordPatt.exec(__referrer);if(keywordMatch){if(keywordMatch[1]){__keyword=keywordMatch[1]}}}else{var __medium="cpc"}}};var refpatt=new RegExp("https?://([^/]*)/?");var __referrerDomain=refpatt.exec(__referrer);var __queryparam=__searray[__source];var patt=new RegExp("https?://.*"+__source+".*[?&]"+__queryparam+"=.*");if(result=patt.exec(__referrer)){configurecwcookie(__source+" ("+__medium+") ("+__keyword+")")}else if(__source=="googleads.g.doubleclick"){__source="google";configurecwcookie(__source+" ("+__medium+") ("+__keyword+")")}else{if(__referrerDomain[1].indexOf(__ignore)==-1){configurecwcookie("referral ("+__referrerDomain[1]+")")}}}};ConversionWorks=getcookie("__utmcw",false);
