// JavaScript Document

// -------------------------------------
// Main site/template initialization
// -------------------------------------

var navIndex = 0;
var subnavIndex = 0;

/*
 * jquery.tools 1.1.2 - The missing UI library for the Web
 * 
 * [tools.tabs-1.0.4, 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.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
 * 
 * -----
 * 
 * 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: Mon Jan 04 19:31:29 GMT 2010
 */
(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(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(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(b){function l(){if(b.browser.msie){var a=b(document).height(),d=b(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a-d<20?d:a]}return[b(window).width(),b(document).height()]}function i(a){if(a)return a.call(b.mask)}b.tools=b.tools||{version:"1.2.1"};var m;m=b.tools.expose={conf:{maskId:"exposeMask",loadSpeed:"slow",closeSpeed:"fast",closeOnClick:true,closeOnEsc:true,zIndex:9998,opacity:0.8,startOpacity:0,color:"#fff",onLoad:null,onClose:null}};var c,j,f,g,k;b.mask={load:function(a,d){if(f)return this;if(typeof a=="string")a={color:a};a=a||g;g=a=b.extend(b.extend({},m.conf),a);c=b("#"+a.maskId);if(!c.length){c=b("<div/>").attr("id",a.maskId);b("body").append(c)}var h=l();c.css({position:"absolute",top:0,left:0,width:h[0],height:h[1],display:"none",opacity:a.startOpacity,zIndex:a.zIndex});h=c.css("backgroundColor");if(!h||h=="transparent"||h=="rgba(0, 0, 0, 0)")c.css("backgroundColor",a.color);if(i(a.onBeforeLoad)===false)return this;a.closeOnEsc&&b(document).bind("keydown.mask",function(e){e.keyCode==27&&b.mask.close(e)});a.closeOnClick&&c.bind("click.mask",function(e){b.mask.close(e)});b(window).bind("resize.mask",function(){b.mask.fit()});if(d&&d.length){k=d.eq(0).css("zIndex");b.each(d,function(){var e=b(this);/relative|absolute|fixed/i.test(e.css("position"))||e.css("position","relative")});j=d.css({zIndex:Math.max(a.zIndex+1,k=="auto"?0:k)})}c.css({display:"block"}).fadeTo(a.loadSpeed,a.opacity,function(){b.mask.fit();i(a.onLoad)});f=true;return this},close:function(){if(f){if(i(g.onBeforeClose)===false)return this;c.fadeOut(g.closeSpeed,function(){i(g.onClose);j&&j.css({zIndex:k})});b(document).unbind("keydown.mask");c.unbind("click.mask");b(window).unbind("resize.mask");f=false}return this},fit:function(){if(f){var a=l();c.css({width:a[0],height:a[1]})}},getMask:function(){return c},isLoaded:function(){return f},getConf:function(){return g},getExposed:function(){return j}};b.fn.mask=function(a){b.mask.load(a);return this};b.fn.expose=function(a){b.mask.load(a,this);return this}})(jQuery);

// Center (http://plugins.jquery.com/project/elementcenter)
jQuery.fn.center=function(n){var o={vertical:true,horizontal:true};op=jQuery.extend(o,n);return this.each(function(){var a=jQuery(this);var b=a.width();var c=a.height();var d=parseInt(a.css("padding-top"));var e=parseInt(a.css("padding-bottom"));var f=parseInt(a.css("border-top-width"));var g=parseInt(a.css("border-bottom-width"));var h=(f+g)/2;var i=(d+e)/2;var j=a.parent().css("position");var k=(b/2)*(-1);var l=((c/2)*(-1))-i-h;var m={position:'absolute'};if(op.vertical){m.height=c;m.top='50%';m.marginTop=l}if(op.horizontal){m.width=b;m.left='50%';m.marginLeft=k}if(j=='static'){a.parent().css("position","relative")}a.css(m)})};

// cookie - http://plugins.jquery.com/files/jquery.cookie.js.txt
jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};

/* hoverIntent r5 // 2007.03.27 @author    Brian Cherne <brian@cherne.net> */
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);

// getUrlVars (http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html) 
$.extend({getUrlVars:function(){var a=[],hash;var b=window.location.href.slice(window.location.href.indexOf('?')+1).split('&');for(var i=0;i<b.length;i++){hash=b[i].split('=');a.push(hash[0]);a[hash[0]]=hash[1]}return a},getUrlVar:function(a){return $.getUrlVars()[a]}});

// homebaked doRedirect plugin
$.extend({doRedirect:function(newURL) { var c=window.location.href; if (c.indexOf(newURL)!=-1) {window.location.reload(true);} else {/*window.location.replace(newURL);*/window.location=newURL}; } });



// [begin 389] Includes externalized from contactform 
/*
 * jQuery autoResize (textarea auto-resizer)
 * @copyright James Padolsey http://james.padolsey.com
 * @version 1.04
 */
(function(a){a.fn.autoResize=function(j){var b=a.extend({onResize:function(){},animate:true,animateDuration:150,animateCallback:function(){},extraSpace:20,limit:1000},j);this.filter('textarea').each(function(){var c=a(this).css({resize:'none','overflow-y':'hidden'}),k=c.height(),f=(function(){var l=['height','width','lineHeight','textDecoration','letterSpacing'],h={};a.each(l,function(d,e){h[e]=c.css(e)});return c.clone().removeAttr('id').removeAttr('name').css({position:'absolute',top:0,left:-9999}).css(h).attr('tabIndex','-1').insertBefore(c)})(),i=null,g=function(){f.height(0).val(a(this).val()).scrollTop(10000);var d=Math.max(f.scrollTop(),k)+b.extraSpace,e=a(this).add(f);if(i===d){return}i=d;if(d>=b.limit){a(this).css('overflow-y','');return}b.onResize.call(this);b.animate&&c.css('display')==='block'?e.stop().animate({height:d},b.animateDuration,b.animateCallback):e.height(d)};c.unbind('.dynSiz').bind('keyup.dynSiz',g).bind('keydown.dynSiz',g).bind('change.dynSiz',g)});return this}})(jQuery);

 /*
 Uploadify v2.1.0	 Release Date: August 24, 2009
 Copyright (c) 2009 Ronnie Garcia, Travis Nickels
 MIT License <http://www.opensource.org/licenses/mit-license.php> 
 MODIFIED VERSION  (support for settings.flashvars, text cancel link, modified cancel order, use 'K' and 'M' instead of 'KB' and 'MB', removed fade).
 */
 if(jQuery){(function(a){a.extend(a.fn,{uploadify:function(b){a(this).each(function(){settings=a.extend({id:a(this).attr("id"),uploader:"uploadify.swf",script:"uploadify.php",expressInstall:null,folder:"",height:30,width:110,cancelImg:"cancel.png",wmode:"opaque",scriptAccess:"sameDomain",fileDataName:"Filedata",method:"POST",queueSizeLimit:999,simUploadLimit:1,queueID:false,displayData:"percentage",onInit:function(){},onSelect:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},b);var e=location.pathname;e=e.split("/");e.pop();e=e.join("/")+"/";var f={};f.uploadifyID=settings.id;f.pagepath=e;if(settings.buttonImg){f.buttonImg=escape(settings.buttonImg)}if(settings.buttonText){f.buttonText=escape(settings.buttonText)}if(settings.rollover){f.rollover=true}/**NEW**/if (settings.flashvars) { for (var sfv in settings.flashvars) f[sfv]=settings.flashvars[sfv]};/**END NEW **/f.script=settings.script;f.folder=escape(settings.folder);if(settings.scriptData){var g="";for(var d in settings.scriptData){g+="&"+d+"="+settings.scriptData[d]}f.scriptData=escape(g.substr(1))}f.width=settings.width;f.height=settings.height;f.wmode=settings.wmode;f.method=settings.method;f.queueSizeLimit=settings.queueSizeLimit;f.simUploadLimit=settings.simUploadLimit;if(settings.hideButton){f.hideButton=true}if(settings.fileDesc){f.fileDesc=settings.fileDesc}if(settings.fileExt){f.fileExt=settings.fileExt}if(settings.multi){f.multi=true}if(settings.auto){f.auto=true}if(settings.sizeLimit){f.sizeLimit=settings.sizeLimit}if(settings.checkScript){f.checkScript=settings.checkScript}if(settings.fileDataName){f.fileDataName=settings.fileDataName}if(settings.queueID){f.queueID=settings.queueID}if(settings.onInit()!==false){a(this).css("display","none");a(this).after('<div id="'+a(this).attr("id")+'Uploader"></div>');swfobject.embedSWF(settings.uploader,settings.id+"Uploader",settings.width,settings.height,"9.0.24",settings.expressInstall,f,{quality:"high",wmode:settings.wmode,allowScriptAccess:settings.scriptAccess});if(settings.queueID==false){a("#"+a(this).attr("id")+"Uploader").after('<div id="'+a(this).attr("id")+'Queue" class="uploadifyQueue"></div>')}}if(typeof(settings.onOpen)=="function"){a(this).bind("uploadifyOpen",settings.onOpen)}a(this).bind("uploadifySelect",{action:settings.onSelect,queueID:settings.queueID},function(j,h,i){if(j.data.action(j,h,i)!==false){var k=Math.round(i.size/1024*1 /*00*/ )* /*0.0*/ 1;var l="KB";l='K';if(k>1000){k=Math.round(k*0.001*100)*0.01;l="MB";l='M'}var m=k.toString().split(".");if(m.length>1){k=m[0]+"."+m[1].substr(0,2)}else{k=m[0]}if(i.name.length>20){fileName=i.name.substr(0,20)+"..."}else{fileName=i.name}queue="#"+a(this).attr("id")+"Queue";if(j.data.queueID){queue="#"+j.data.queueID}a(queue).append(
		 	'<div id="'+a(this).attr("id")+h+'" class="uploadifyQueueItem">' + 
				'<span class="error">Failed: </span>' +
	 			'<span class="fileName">'+fileName+' ('+k+l+')</span>' + 
		 		'<span class="percentage"></span>' + 
		 		'<span class="uploadifyProgress">' + 
		 			'<div id="'+a(this).attr("id")+h+'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div>' + 
		 		'</span>' + 
		 		'<div class="cancel"><a href="javascript:jQuery(\'#'+a(this).attr("id")+'\').uploadifyCancel(\''+h+'\')">'  + /*<!--<img src="'+settings.cancelImg+'" border="0" />-->*/ 
		 			'<span class="normalLabel">Cancel Upload</span>' +
		 			'<span class="errorLabel">Remove</span>' +
		 		'</a></div>' + 
		 	'</div>')}});if(typeof(settings.onSelectOnce)=="function"){a(this).bind("uploadifySelectOnce",settings.onSelectOnce)}a(this).bind("uploadifyQueueFull",{action:settings.onQueueFull},function(h,i){if(h.data.action(h,i)!==false){alert("The queue is full.  The max size is "+i+".")}});a(this).bind("uploadifyCheckExist",{action:settings.onCheck},function(m,l,k,j,o){var i=new Object();i=k;i.folder=e+j;if(o){for(var h in k){var n=h}}a.post(l,i,function(r){for(var p in r){if(m.data.action(m,l,k,j,o)!==false){var q=confirm("Do you want to replace the file "+r[p]+"?");if(!q){document.getElementById(a(m.target).attr("id")+"Uploader").cancelFileUpload(p,true,true)}}}if(o){document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(n,true)}else{document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(null,true)}},"json")});a(this).bind("uploadifyCancel",{action:settings.onCancel},function(l,h,k,m,j){if(l.data.action(l,h,k,m,j)!==false){var i=(j==true)?0:/*250*/0;a("#"+a(this).attr("id")+h).fadeOut(i,function(){a(this).remove()})}});if(typeof(settings.onClearQueue)=="function"){a(this).bind("uploadifyClearQueue",settings.onClearQueue)}var c=[];a(this).bind("uploadifyError",{action:settings.onError},function(l,h,k,j){if(l.data.action(l,h,k,j)!==false){var i=new Array(h,k,j);c.push(i);a("#"+a(this).attr("id")+h+" .percentage").text(" - "+j.type+" Error");a("#"+a(this).attr("id")+h).addClass("uploadifyError")}});a(this).bind("uploadifyProgress",{action:settings.onProgress,toDisplay:settings.displayData},function(j,h,i,k){if(j.data.action(j,h,i,k)!==false){a("#"+a(this).attr("id")+h+"ProgressBar").css("width",k.percentage+"%");if(j.data.toDisplay=="percentage"){displayData=" - "+k.percentage+"%"}if(j.data.toDisplay=="speed"){displayData=" - "+k.speed+"KB/s"}if(j.data.toDisplay==null){displayData=" "}a("#"+a(this).attr("id")+h+" .percentage").text(displayData)}});a(this).bind("uploadifyComplete",{action:settings.onComplete},function(k,h,j,i,l){if(k.data.action(k,h,j,unescape(i),l)!==false){a("#"+a(this).attr("id")+h+" .percentage").text(" - Completed");a("#"+a(this).attr("id")+h).fadeOut(/*250*/0,function(){a(this).remove()})}});if(typeof(settings.onAllComplete)=="function"){a(this).bind("uploadifyAllComplete",{action:settings.onAllComplete},function(h,i){if(h.data.action(h,i)!==false){c=[]}})}})},uploadifySettings:function(f,j,c){var g=false;a(this).each(function(){if(f=="scriptData"&&j!=null){if(c){var i=j}else{var i=a.extend(settings.scriptData,j)}var l="";for(var k in i){l+="&"+k+"="+escape(i[k])}j=l.substr(1)}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(f,j)});if(j==null){if(f=="scriptData"){var b=unescape(g).split("&");var e=new Object();for(var d=0;d<b.length;d++){var h=b[d].split("=");e[h[0]]=h[1]}g=e}return g}},uploadifyUpload:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").startFileUpload(b,false)})},uploadifyCancel:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").cancelFileUpload(b,true,false)})},uploadifyClearQueue:function(){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").clearFileUploadQueue(false)})}})})(jQuery)};
// [end 389]
		 	
// [Begin 390] Centralizing jquery plugins + minifying: supersleight.plugin.js, jquery.scrollTo-min.js, jqModal.js
	jQuery.fn.supersleight=function(a){a=jQuery.extend({imgs:true,backgrounds:true,shim:"/js/jquery/supersleight/x.gif",apply_positioning:true,allowUndo:true},a);return this.each(function(){if(jQuery.browser.msie&&parseInt(jQuery.browser.version,10)<7&&parseInt(jQuery.browser.version,10)>4){jQuery(this).find("*").andSelf().each(function(d,f){var b=jQuery(f);if(a.backgrounds&&b.css("background-image").match(/\.png/i)!==null){var c=b.css("background-image");var h=c.substring(5,c.length-2);var g=(b.css("background-repeat")=="no-repeat"?"crop":"scale");var e={filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+h+"', sizingMethod='"+g+"')","background-image":"url("+a.shim+")"};b.css(e);if(a.allowUndo){b.attr("supersleight-bg-applied","true")}}if(a.imgs&&b.is("img[src$=png]")){var e={width:b.width()+"px",height:b.height()+"px",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b.attr("src")+"', sizingMethod='scale')"};b.css(e).attr("src",a.shim)}if(a.apply_positioning&&b.is("a, input")&&(b.css("position")===""||b.css("position")=="static")){b.css("position","relative")}})}})};jQuery.fn.supersleightUndo=function(){return this.each(function(){if(jQuery.browser.msie&&parseInt(jQuery.browser.version,10)<7&&parseInt(jQuery.browser.version,10)>4){jQuery(this).find("[supersleight-bg-applied=true]").andSelf().each(function(b,d){var a=jQuery(d);var c={filter:"","background-image":""};a.css(c);a.attr("supersleight-bg-applied","false")})}})};
	/**
	 * jQuery.ScrollTo - Easy element scrolling using jQuery.
	 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
	 * Dual licensed under MIT and GPL.
	 * Date: 5/25/2009
	 * @author Ariel Flesler
	 * @version 1.4.2
	 *
	 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
	 */
	;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
	/**
	 * jQuery.LocalScroll - Animated scrolling navigation, using anchors.
	 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
	 * Dual licensed under MIT and GPL.
	 * Date: 3/11/2009
	 * @author Ariel Flesler
	 * @version 1.2.7
	 **/
	;(function($){var l=location.href.replace(/#.*/,'');var g=$.localScroll=function(a){$('body').localScroll(a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location.hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e)i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)}).end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this).is(b.filter))}};function i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore.call(b,a,f,h)===false)return;if(b.stop)h.stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$('<a> </a>').attr(j,d).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location=e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery);
	
	/*
	 * jqModal - Minimalist Modaling with jQuery
	 *   (http://dev.iceburg.net/jquery/jqModal/)
	 *
	 * Copyright (c) 2007,2008 Brice Burgess <bhb@iceburg.net>
	 * Dual licensed under the MIT and GPL licenses:
	 *   http://www.opensource.org/licenses/mit-license.php
	 *   http://www.gnu.org/licenses/gpl.html
	 * 
	 * $Version: 03/01/2009 +r14
	 */
	(function(d){d.fn.jqm=function(f){var e={overlay:50,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:o,ajaxText:"",target:o,modal:o,toTop:o,onShow:o,onHide:o,onLoad:o};return this.each(function(){if(this._jqm){return n[this._jqm].c=d.extend({},n[this._jqm].c,f)}p++;this._jqm=p;n[p]={c:d.extend(e,d.jqm.params,f),a:o,w:d(this).addClass("jqmID"+p),s:p};if(e.trigger){d(this).jqmAddTrigger(e.trigger)}})};d.fn.jqmAddClose=function(f){return l(this,f,"jqmHide")};d.fn.jqmAddTrigger=function(f){return l(this,f,"jqmShow")};d.fn.jqmShow=function(e){return this.each(function(){e=e||window.event;d.jqm.open(this._jqm,e)})};d.fn.jqmHide=function(e){return this.each(function(){e=e||window.event;d.jqm.close(this._jqm,e)})};d.jqm={hash:{},open:function(B,A){var m=n[B],q=m.c,i="."+q.closeClass,v=(parseInt(m.w.css("z-index"))),v=(v>0)?v:3000,f=d("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":v-1,opacity:q.overlay/100});if(m.a){return o}m.t=A;m.a=true;m.w.css("z-index",v);if(q.modal){if(!a[0]){k("bind")}a.push(B)}else{if(q.overlay>0){m.w.jqmAddClose(f)}else{f=o}}m.o=(f)?f.addClass(q.overlayClass).prependTo("body"):o;if(c){d("html,body").css({height:"100%",width:"100%"});if(f){f=f.css({position:"absolute"})[0];for(var w in {Top:1,Left:1}){f.style.setExpression(w.toLowerCase(),"(_=(document.documentElement.scroll"+w+" || document.body.scroll"+w+"))+'px'")}}}if(q.ajax){var e=q.target||m.w,x=q.ajax,e=(typeof e=="string")?d(e,m.w):d(e),x=(x.substr(0,1)=="@")?d(A).attr(x.substring(1)):x;e.html(q.ajaxText).load(x,function(){if(q.onLoad){q.onLoad.call(this,m)}if(i){m.w.jqmAddClose(d(i,m.w))}j(m)})}else{if(i){m.w.jqmAddClose(d(i,m.w))}}if(q.toTop&&m.o){m.w.before('<span id="jqmP'+m.w[0]._jqm+'"></span>').insertAfter(m.o)}(q.onShow)?q.onShow(m):m.w.show();j(m);return o},close:function(f){var e=n[f];if(!e.a){return o}e.a=o;if(a[0]){a.pop();if(!a[0]){k("unbind")}}if(e.c.toTop&&e.o){d("#jqmP"+e.w[0]._jqm).after(e.w).remove()}if(e.c.onHide){e.c.onHide(e)}else{e.w.hide();if(e.o){e.o.remove()}}return o},params:{}};var p=0,n=d.jqm.hash,a=[],c=d.browser.msie&&(d.browser.version=="6.0"),o=false,g=d('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),j=function(e){if(c){if(e.o){e.o.html('<p style="width:100%;height:100%"/>').prepend(g)}else{if(!d("iframe.jqm",e.w)[0]){e.w.prepend(g)}}}h(e)},h=function(f){try{d(":input:visible",f.w)[0].focus()}catch(e){}},k=function(e){d()[e]("keypress",b)[e]("keydown",b)[e]("mousedown",b)},b=function(m){var f=n[a[a.length-1]],i=(!d(m.target).parents(".jqmID"+f.s)[0]);if(i){h(f)}return !i},l=function(e,f,i){return e.each(function(){var m=this._jqm;d(f).each(function(){if(!this[i]){this[i]=[];d(this).click(function(){for(var q in {jqmShow:1,jqmHide:1}){for(var r in this[q]){if(n[this[q][r]]){n[this[q][r]].w[q](this)}}}return o})}this[i].push(m)})})}})(jQuery);

// [end 390]
	
// [start 391]
	/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
		is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
	*/
	var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();	
// [end 391]
	
// [i392]
	$(document).ready(function(){doResetPass=function(){var a=$("#tempDialog #rfb").serialize();$("#tempDialog #rfb .submitBtn").attr("disabled","disabled").attr("value","One Moment...");$("#tempDialog #rfb .infoSpan").text("");doAjax=function(){$.post("/ajax/users/generic.php?action=resetpass&nocache="+(new Date().getTime()),a,function(c,f,b){$("#tempDialog #rfb .submitBtn").removeAttr("disabled").attr("value","Reset Password");if(f=="success"){try{$("body").append('<div style="display: none;">'+c+"</div>")}catch(d){alert("Error communicating with server.  Please try again or reload the page.")}}else{$.prettyPopupShowError("Error occurred while communicating with server.  Please try again or reload the page.")}})};doAjax();return false};resetPassword=function(){var b=$.showPrettyPopup({width:300,height:120,addCloseButton:true,modal:true,top:20,zIndex:5000});var a=$("#resetPassPopupContents").html();$.prettyPopupSetContent(a);$("#rfb #reset_email").val($("#lfb #login_email").val());setTimeout("try { var f = $('#reset_email').get(0); f.focus(); f.select(0, f.value.length); } catch (e) {} ",700)}});
// [/i392]
	
// [i393]
	i393 = function(){$("#lfb").submit(function(){var b=$("#lfb").serialize();var a=$.showPrettyPopup({modal:true,width:450,height:200});doAjax=function(){var baseURL="/ajax/users/generic.php?action=login&nocache="+(new Date().getTime());$.postSWF('https://'+_httpHost+baseURL,baseURL,b,function(d,e,c){if(d&&d.indexOf("ajaxResponseSuccess")!=-1){$.prettyPopupSetContent(d)}else{$.prettyPopupShowError("Error occurred while communicating with server.  Please try again or reload the page.")}})};doAjax();return false});$("#sfb").submit(function(){var b=$("#sfb").serialize();var a=$.showPrettyPopup({modal:true,width:450,height:200});doAjax=function(){$.post("/ajax/users/generic.php?action=signup&nocache="+(new Date().getTime()),b,function(d,e,c){if(e=="success"){$.prettyPopupSetContent(d)}else{$.prettyPopupShowError("Error occurred while communicating with server.  Please try again or reload the page.")}})};doAjax();return false})};
// [/i393]
	
// [i394]
	i394 = function(pw, pacv)
	{
		if(pw=="myAccount"){$(".cf_myAccount .tbl2 tr").insertBefore(".cf_myAccount .tbl1 tr:last")}var formID="cf_"+pw;var attachID="fileAttach_"+pw;var wrapID="fileAttachWrap_"+pw;var queueWrapID="fileAttachQueueWrap_"+pw;var wrapPath="."+formID+" #"+wrapID;var queuePath="."+formID+" #"+queueWrapID;var jqFormPath="."+formID+" form";var hideUploader=function(b,a){$(b).css({width:"0px"});$(a).addClass("uploadInProgress")};var reshowUploader=function(b,a){$(b).css({width:"auto"});$(a).removeClass("uploadInProgress")};$("."+formID+" #"+attachID).uploadify({uploader:"/js/jquery/uploadify/uploadify.swf",script:"/ajax/contact/uploader.php",scriptData:{auth:pacv},flashvars:{testFV:"myFlashVrValue"},folder:"dummy",cancelImg:"/js/jquery/uploadify/cancel.png",multi:false,auto:true,sizeLimit:uploadMaxSize,buttonText:'<font color="'+(pw=="bottom"?"#CCCCCC":"#000000")+'" face="Lucida Grande,Lucida Sans Unicode,Lucida Sans,Verdana,Arial,sans-serif">Add File...</font>',hideButton:false,wmode:"transparent",width:110,height:20,onInit:function(){setTimeout(function(){var a="."+formID+" #"+attachID+"Queue";var b=queuePath;$(a).appendTo(b)},200)},onError:function(d,a,c,b){reshowUploader(wrapPath,jqFormPath);var e;if(b.status==404){e="Unable to contact server.  Try again or contact support."}else{if(b.type==="HTTP"){e="Unable to contact server.  Try again or contact support.\n\nDetails: "+b.type+" - "+b.status}else{if(b.type==="File Size"){e="The file you selected is too large.  Files must be under "+(Math.round(uploadMaxSize/1048576*100)/100)+" MB.\n\nIf you need to send a larger file, post the file to some alternate location (such as an FTP site or free file hosting service) and include the URL in your message."}else{e="Unable to contact server.  Try again or contact support.\n\nDetails: "+b.type+": "+b.text+" - "+b.info}}}alertMomentarily(e)},onCancel:function(d,b,c,a){reshowUploader(wrapPath,jqFormPath)},onOpen:function(c,a,b){hideUploader(wrapPath,jqFormPath)},onComplete:function(event,queueID,fileObj,response,xferInfo){reshowUploader(wrapPath,jqFormPath);var json={success:"false",message:"Unknown server error occurred.  Unable to process server response.  Try again or contact support."};try{json=eval("("+response+")")}catch(e){}if(json.success=="true"){var filename=json.filename;var file_id=json.file_id;var sizeStr=Math.ceil(fileObj.size/1024)+"K";if(uploadedFileIDs.indexOf(file_id)!=-1){return}else{uploadedFileIDs.push(file_id)}var uploadItemHTML="";uploadItemHTML+='<div class="uploadedItem">';uploadItemHTML+='<span class="filename">'+filename+"</span> ";uploadItemHTML+='<span class="filesize">('+sizeStr+")</span> ";uploadItemHTML+='<span class="removeLink"><a href="#">Remove</a></span>';uploadItemHTML+='<span style="display: none"><input type="hidden" name="attached_file_id[]" value="'+file_id+'" /></span>';uploadItemHTML+="</div>";$("."+formID+" .uploadedList").append(uploadItemHTML);$("."+formID+" .uploadedList .uploadedItem:last .removeLink a").click(function(){if(confirm("Are you sure you wish to remove this attachment?")){$(this).closest(".uploadedItem").remove()}return false})}else{alertMomentarily("Upload failed.  Details:\n\n"+json.message)}}});$("."+formID+" .attachNote").localScroll({onBefore:function(b,c){var a=$(b.target).attr("class");if(a=="myAccountLink"){$("#footerBox #accountSectionLink").click()}}});function selectTA(b,c,a){b.focus();if(b.setSelectionRange){b.setSelectionRange(c,a)}else{if(b.createTextRange){b=b.createTextRange();b.collapse(true);b.moveEnd("character",a);b.moveStart("character",c);b.select()}}}function selectAllTA(a){selectTA(a,0,a.val().length)}var msgTf=$("."+formID+" #cf_message");var initTfVal=msgTf.val();ignoreFocusCall=false;justFocused=false;msgTf.focus(function(){if(ignoreFocusCall){return}if(pw=="myAccount"){justFocused=true}if(msgTf.val()==initTfVal&&msgTf.css("width")=="294px"){msgTf.animate({width:394},"normal","linear",function(){justFocused=true;var a=function(){ignoreFocusCall=true;selectAllTA(msgTf);ignoreFocusCall=false};setTimeout(a,1)})}}).blur(function(){if((msgTf.val()==""||msgTf.val()==initTfVal)&&msgTf.css("width")=="394px"){msgTf.animate({width:294},"normal","linear",function(){msgTf.blur()})}});msgTf.focus(function(){if(msgTf.val()==initTfVal){msgTf.select()}}).blur(function(){if(msgTf.val()==""){msgTf.val(initTfVal)}});msgTf.keydown(function(){if(!justFocused){return}justFocused=false;if(msgTf.val()==initTfVal){msgTf.val("")}});msgTf.autoResize({animateDuration:150,extraSpace:20});var cf=$("."+formID+" form");cf.submit(function(){if(cf.hasClass("uploadInProgress")){alert("Please wait until all attachment uploads have completed before submitting your message.");return false}var b=cf.serialize();var a=$.showPrettyPopup({modal:true,width:400,height:200});doAjax=function(){$.post("/ajax/contact/send_message.php?where="+pw+"&nocache="+(new Date().getTime()),b,function(d,e,c){if(d&&d.indexOf("ajaxResponseSuccess")!=-1){$.prettyPopupSetContent(d)}else{$.prettyPopupShowError('<h4 style="font-size: 16px; margin-bottom: 12px; margin-top: -34px; ">Loading Error</h4><p>Unable to contact server.  Please try again or reload the page.</p>')}})};doAjax();return false});
	};
// [/i394]
	
// DWUStyleInjection (c) 2011 DWUser.com.  All rights reserved.
DWUStyleInjection=function(){var f="",g=0;$("style[data-dwutype=injection]").each(function(){var c=$(this),b=c.parent(),d="style_dwuinjection_uid"+g++;b.addClass(d);var e=d+"_hover",a=c.html().split(";").join(" !important;");if(a.indexOf("THIS:hover")!=-1){a=a.split("THIS:hover").join("."+e);b.bind("mouseenter",function(){b.addClass(e)}).bind("mouseleave",function(){b.removeClass(e)})}a=a.split("THIS").join("."+d);a=a.replace(/\[([^\]]+)\]:all/g,"$1, $1:link, $1:hover, $1:visited");a=a.replace(/\[([^\]]+)\]:allButHover/g,
"$1, $1:link, $1:visited");f+=a;c.remove()});$("head").append('<style type="text/css">'+f+"</style>")};

$(document).ready(function()
{
	
	// --------------------
	// Template stuff
	// --------------------
	
	// Fix the pngs for ie6
	$("#imgHolder").supersleight();
	$("#mainBox .theCap").supersleight();
	
	// Select a certain button (in this demo, btn0)
	selectBtn(navIndex);
	
	// Determine if is gte ie7... frickin' ie7 and 8 show a black border when fading transparent pngs, so can't have that...
	gteIE7 = (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) > 6);
	gteIE8 = (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) > 7);
	lteIE6 = (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) <= 6);
	
	// Add hover actions for all nav btns
	var btns = $("#mainNav .navBtn");
	btns.hoverIntent(function()
		{
			// Process btn hover
			var btn = $(this);
			var btnHoverClass = btn.find(".btnPartDD").length == 1 ? "hoverpage" : "hoverpageNoDD";
			
			if (btn.hasClass("curpage"))
				btn.removeClass("curpage");
			btn.find('*[class!=btnPartDD]').supersleightUndo();
			btn.addClass(btnHoverClass);
			// Fix ie6 hover
			btn.supersleight();
			
			var dd = btn.find(".btnPartDD");
			if (gteIE7)
				dd.slideDown(); //dd.show();
			else
				dd.slideDown(); //dd.fadeIn();

		},
		function()
		{
			// Process btn hover-out
			var btn = $(this);
			var btnHoverClass = btn.find(".btnPartDD").length == 1 ? "hoverpage" : "hoverpageNoDD";
			
			btn.removeClass(btnHoverClass);
			btn.find('*[class!=btnPartDD]').supersleightUndo();
			if (btn.hasClass("curpageOriginal"))
				btn.addClass("curpage");
			btn.addClass("wasHovered");
			
			// fix ie6 png again if needed
			btn.supersleight();
				
			var dd = btn.find(".btnPartDD");
			if (gteIE7)
				dd.slideUp('fast'); //dd.hide();
			else
				dd.slideUp('fast'); // dd.fadeOut('fast');

		}
	);
	
	// Preload dd imgs... onload
	$(window).load(function(){
		setTimeout(function(){
			// only need mid now.  all rest are sprites.  $(['ddbox_top.png','ddbox_mid.png','ddbox_foot.png','btnbg_hover_left.png','btnbg_hover_right.png','btnbg_hover_mid.png','btnbg_curpage_light_left.png','btnbg_curpage_light_right.png','btnbg_curpage_light_mid.png']).each(function(){
			$(['ddbox_mid.png']).each(function(){
				$('<img/>')[0].src = '/images/main_elements/mainnav/export/' + this;
			});
		}, 9000); // rest
	});


	// Fade out the cap stuff
	//if (!gteIE7) return;
	var fadedOutLevel = 0.6;
	/*
	 * [726] see bufile for details*/
	template_lightenRGB = function(color, percentWhite)
	{
		var nums = color.match(/(\d+),\s(\d+),\s(\d+)/);
		if (nums && nums.length == 4)
		{
			nums.shift();
			for (var i=0; i<nums.length; i++)
			{
				var cur = Number(nums[i]);
				if (percentWhite > 0)
					nums[i] = cur + Math.round((255-cur)*percentWhite);
				else if (percentWhite < 0) // darken
					nums[i] = Math.round(   cur*(1-Math.abs(percentWhite))   );
			}
			return ('rgb(' + nums.join(', ') + ')');
		}
		else { return color; }
	}
	var hexToRGB = function(hex)
	{
		if (hex.indexOf('#')!=0)
			return hex;
		hex = hex.substr(1);
		var l = hex.length;
		if (l != 6 && l != 3)
			return '#' + hex;
		var keys = [hex.substring(0,l/3), hex.substring(l/3,2*l/3), hex.substring(2*l/3)];
		for (var i=0; i<keys.length; i++)
		{
			var cur = keys[i];
			if (cur.length == 1) cur = cur + '' + cur;
			cur = Number(parseInt(cur, 16));
			keys[i] = cur;
		}
		return ('rgb(' + keys.join(', ') + ')');
	}
	template_capColorOrig = $('.theCap').css('background-color') || 'rgb(102,102,102)';  // e.g. rgb(102, 102, 102) ... this is inline style; make sure not undefined.
	if (template_capColorOrig.indexOf('rgb')!=0)
		template_capColorOrig = hexToRGB(template_capColorOrig);
	template_capColorFaded_top = template_lightenRGB(template_lightenRGB(template_capColorOrig, 0.25), fadedOutLevel);
	template_capColorFaded_bottom = template_lightenRGB(template_lightenRGB(template_capColorOrig, -0.2), fadedOutLevel);
	
	$("#capBreadcrumbs a").css({color:template_capColorFaded_top});
	$("#capBreadcrumbs .divider").css({color:template_capColorFaded_top});
	$("#capBreadcrumbs a").hover(
		function() {
			// fade in
			$(this).css({color:''});
		},
		function() {
			// fade back out
			$(this).css({color:template_capColorFaded_top});
		}
	);
	
	// Fade out the capSubnav, but leave one button alone (the current page)
	// moved to be global above... var subnavIndex = 0;
	$("#capSubnav a:nth-child(" + (subnavIndex+1) + ")").addClass("curpage");
	$("#capSubnav a:not(.curpage)").css({color:template_capColorFaded_bottom});
	$("#capSubnav a:not(.curpage)").hover(
		function() {
			// fade in
			$(this).css({color:''});
		},
		function() {
			// fade back out
			$(this).css({color:template_capColorFaded_bottom});
		}
	);
	
	
	// --- Setup the footer ---
	var footerBtns = $("#footerBox .boxTitles h4");
	var footerBoxes = $("#footerBox .boxHolder .box");
	footerBtns.click(function(){
		// Reset the other btns
		footerBtns.removeClass("titleActive").addClass("titleInactive");  
		footerBoxes.removeClass("curVisible");
		
		// Get the new btn ref and box ref
		var btnIndex = footerBtns.index(this);
		var newBtn = $(this);
		var newBox = $(footerBoxes.get(btnIndex));
		
		// Select the new btn
		newBtn.removeClass("titleInactive").addClass("titleActive");
		newBox.addClass("curVisible");
		
		// Hide all content
		var footerSpeed = footerInitialized ? "slow" : 0;
		footerInitialized = true;
		if (footerSpeed !== 0)
		{
			footerBoxes.parent().find(".box:not(.curVisible)").slideUp(footerSpeed, function()
			{
				// Show the new box
				newBox.slideDown(footerSpeed);
			});
		}
		else
		{
			// just show/hide
			footerBoxes.parent().find(".box:not(.curVisible)").hide();
			newBox.show();
		}
		
		
	});
	
	// Open the first box (or other if requested)
	footerInitialized = false;
	var footerBoxToOpen = parseInt($.getUrlVar('footerBox')); // default to 0
	if (isNaN(footerBoxToOpen)) footerBoxToOpen = 0;
	if (footerBoxToOpen > footerBtns.length-1) footerBoxToOpen = footerBtns.length-1;
	$(footerBtns.get(footerBoxToOpen)).click();
	
	// -------- IE fixes ----------
	
	// Fix all the freakin' links for ie6
	if (lteIE6)
	{
		var openLink = function(a)
		{
			var href = a.href;
			var target = a.target;
			if (target == '_blank')
				window.open(href);
			else
				window.location = href;
		};
		$("#mainNav a, #capBreadcrumbs a, #capSubnav a").each(function(i)
																	   {
																		   var a = $(this);
																		   var rawA = this;
																		   var offset = a.offset();
																		   var w = a.width();
																		   var h = a.height();
																		   
																		   // If this is one of the main links, correct the position
																		   if (a.is("#mainNav a"))
																		   {
																			   offset.top += 3;
																			   h += 2;
																		   }
																		   
																		   var newDiv = '<div class="ie6-link-fix" style="cursor: pointer; position: absolute; z-index: 1330; width: ' + w + 'px; height: ' + h + 'px; left: ' + offset.left + 'px; top: ' + offset.top + 'px;">' + 
																		   					'<img src="/js/jquery/supersleight/x.gif" width="' + w + '" height="' + h + '" />' + 
																						'</div>';
																		   $(newDiv).appendTo("body").click( function(){ a.click(); openLink(rawA); } ).hover( function(){a.mouseover()} , function(){a.mouseout()} );

																	   });
	}
	if (gteIE8)
	{
		// Fix the freakin' links for ie8 so the opacity will work properly.  But, this of course breaks the cleartype display.  To you-know-where with ie.
		//[726] [not needed due to color fix above] $("#capBreadcrumbs a, #capBreadcrumbs .divider, #capSubnav a").css({display:'inline-block', 'background-color':'transparent', zoom:'1'});
	}
	
	// Fix up friendly scroll links
	$('#mainNav').localScroll({onBefore:function(evt, tgt){
		var clickClass = $(evt.target).attr('class');
		if (clickClass == 'myAccountLink')
			// open act sect fast
			{
				footerInitialized = false;
				$("#footerBox #accountSectionLink").click();
			}
		if (clickClass == 'contactLink')
			// open contact sect fast
			{
				footerInitialized = false;
				$("#footerBox #contactSectionLink").click();
			}
	}});
	$('#legalWrapper').localScroll();
	
	// Activate superduperbox ... or jqmodal ...
	//$.superbox();
	var myOpen = function(hash) { hash.o.hide(); hash.o.fadeIn(300,    function(){ hash.w.fadeIn(300, function(){}); }     ); };
	var myClose = function(hash) { hash.w.fadeOut(300,    function(){ hash.o.fadeOut(300, function(){hash.o.remove();}); }     ); };
	var addClose = function(hash) {
		hash.w.prepend('<div class="close"><a class="jqmClose"><strong><span>Close</span></strong></a><div style="clear: both;">&nbsp;</div></div>');
	};
	$('#legalWrapper #refundPolicyPopupLink').click(function(e){
		$('#dialog').css({WASwidth:560, height:420}).jqm({onShow:myOpen, onHide:myClose, onLoad:addClose, ajax:'/popups/customer_satisfaction_refund_policy.php', ajaxText:'Loading...'}).jqmShow();
		return false;													  
	});
	$('#legalWrapper #privacyPolicyPopupLink').click(function(e){
		$('#dialog').css({WASwidth:460, height:420}).jqm({onShow:myOpen, onHide:myClose, onLoad:addClose, ajax:'/popups/privacy_policy.php?scroll=true', ajaxText:'Loading...'}).jqmShow();
		return false;													  
	});
	
	// Create global pretty-popup function
	var myOpen2 = function(hash) { hash.o.hide(); hash.o.fadeIn(300,    function(){ hash.w.fadeIn(300, function(){}); }     ); };
	var myClose2 = function(hash) { hash.w.fadeOut(300,    function(){ hash.o.fadeOut(300, function(){hash.o.remove();hash.w.remove()}); }     ); };
	var addClose2 = function(hash) {
		hash.w.removeClass('loading');
		hash.w.addClass('loaded');
		hash.w.prepend('<div class="close"><a class="jqmClose"><strong><span>Close</span></strong></a><div style="clear: both;">&nbsp;</div></div>');
	};
	
	$.showPrettyPopup = function(jqmOptions)
	{
		if (jqmOptions == null)
			jqmOptions = {};
		var opts = {onShow:myOpen2, onHide:myClose2, onLoad:addClose2};
		for (var i in jqmOptions)
			opts[i] = jqmOptions[i];
		var css = {height:420};
		if (opts.width != null && opts.height != null)
		{
			css.height = opts.height;
			css.width = opts.width;
			css.marginLeft = -(css.width / 2);
		}
		
		// support for opts.dialogID custom selector
		if (opts.dialogID == null)
			opts.dialogID = 'tempDialog';
		
		// apply z-index and custom top-offset
		if (opts.zIndex)
			css['z-index'] = opts.zIndex;
		if (opts.top)
			css.top = isNaN(opts.top) ? opts.top : opts.top + '%';
		
		var closeBtnText = opts.addCloseButton ? '<div class="close"><a class="jqmClose"><strong><span>Close</span></strong></a><div style="clear: both;">&nbsp;</div></div>' : '';
		var loadingText = '<div style="padding-top: 10px; padding-left: 7px;"><img height="16" width="16" src="/images/icons_misc/loaders/small_indicator.gif"/> <span style="line-height: 16px; padding: 0 5px; vertical-align: top;">Loading...</span></div>';
		if (opts.loadingText)
			loadingText = opts.loadingText;
		$('body').append('<div id="' + opts.dialogID + '" class="jqmWindow prettyPopup loading"><div class="innerWrapper">' + closeBtnText + '<div class="contentBox" style="text-align: left;">' + loadingText + '</div>  <div class="closeBottom"><a class="jqmClose"><strong><span>OK</span></strong></a></div>   </div></div>');
		if (opts.ok != true)
			$('#' + opts.dialogID + ' .closeBottom').hide();
		$('#' + opts.dialogID + ' .jqmClose').click(function() { $('#' + opts.dialogID + '').jqmHide(); });
		$('#' + opts.dialogID + '').css(css).jqm(opts).jqmShow();
		return $('#' + opts.dialogID + ' .contentBox');
	}
	$.prettyPopupAddOK = function()
	{
		//$('#tempDialog .closeBottom').show();
		$.prettyPopupSetButtons({'OK':'close'});
	}
	$.prettyPopupNuke = function()
	{
		$('#tempDialog').jqmHide();		
	}
	$.prettyPopupSetContent = function(html)
	{
		$('#tempDialog .contentBox').html(html);
	}
	$.prettyPopupExists = function()
	{
		return ($('#tempDialog').length > 0);
	}
	$.prettyPopupSetButtons = function(btnList) // btnList = {'OK':'close', 'Continue':function(){...}}
	{
		btnHolder = $('#tempDialog .closeBottom');
		btnHolder.html('');
		var btnHTML = '';
		for (var i in btnList)
		{
			var tempLabel = i;
			var tempAction = btnList[i];
			if (tempAction == 'close')
				tempAction = function() {  $.prettyPopupNuke();  };
			btnHTML = '<a><strong><span>' + tempLabel + '</span></strong></a>';
			btnHolder.append(btnHTML);
			var newBtn = $('#tempDialog .closeBottom a:last');
			newBtn.click(tempAction);
		}
		btnHolder.show();
	}
	$.prettyPopupShowError = function(msg)
	{
		$.prettyPopupSetContent(msg);
		$.prettyPopupAddOK();
	}
	
	// Login form popup (lfp)
	lfpShow = function()
	{
		// Create popup
		var popup = $.showPrettyPopup({dialogID:'lfpPopup', addCloseButton:true, width:450, height:250, modal:true});
		// Apply css, then load content
		popup.css({'margin-top':'-34px'});
		popup.load('/includes/template_content/popup_login.php?nocache=' + (new Date().getTime()), '', function(responseText/*, textStatus, xhr*/)
				{
					// Just test to see if we got the JS callback successfully
					if (responseText && responseText.indexOf('lfpCallback = function') != -1)
					{
						// Call function defined in the popup (this sets up all of the listeners, handlers, etc).
						lfpCallback($('#lfpPopup .contentBox'));
					}
					else
					{
						$('#lfpPopup .contentBox').html('<h4 style="font-size: 16px; margin-bottom: 12px;">Loading Error</h4><p>Unable to contact server.  Please try again or reload the page.</p>');
					}
				});
	};
	
	// Assign global ajax error handler
	$(document).ajaxError(function(event, request, settings) {
		//$(this).append("<li>Error requesting page " + settings.url + "</li>");
		
		// Attempt to show friendly error in the box; if this fails, just display a generic alert...
		var msg = '<h4 style="font-size: 16px; margin-bottom: 12px;">Error</h4>Error occurred while communicating with server.  Please try again or reload the page.';
		var msgPlain = 'Error occurred while communicating with server!  This can be caused by interrupting a page load.  Please try again or reload the page.';
		if ($.prettyPopupExists())
		{
			// Add OK button and some failure text...
			$.prettyPopupSetContent(msg);
			$.prettyPopupAddOK();
		}
		else
		{
			alert(msgPlain);
		}
	});
	
	// New 2-23-11: Initialize style injection
	DWUStyleInjection();
	
});

function selectBtn(index)
{
	var btn = $("#mainNav .navBtn:nth-child(" + (index+1) + ")");
	btn.addClass("curpage");
	btn.addClass("curpageOriginal");
	btn.supersleight(); // fix for ie6
}

function switchToBottomBox(index)
{
	footerInitialized = false;
	var link = '#footerBox #basketSectionLink';
	if (index == 0)
		link = '#footerBox #accountSectionLink';
	if (index == 1)
		link = '#footerBox #contactSectionLink';
	else
		link = '#footerBox #basketSectionLink';
	$(link).click();
	$.scrollTo(link, 800);
}

products_showPrice_index = 0;
function products_showPrice(prodNumber, quantity, spanID)
{
	if (!spanID)
	{
		var tempID = 'ajaxPrice' + (products_showPrice_index++);
		document.write('<span id="' + tempID + '">Loading...</span>');
	}
	else
		var tempID = spanID;
	$('#' + tempID).load('/ajax/products/productprice.php?prod_number=' + prodNumber + '&quantity=' + quantity);
}

products_showDWVersions_index = 0;
function products_showDWVersions()
{
	var tempID = 'ajaxDWVersion' + (products_showDWVersions_index++);
	document.write('<span id="' + tempID + '"><em>Loading...</em></span>');
	$('#' + tempID).load('/ajax/products/dreamweaver_version_mx_up.html');
}


// Store fns, externalized from footer shopping basket + minfied
store_reload=function(){$("#fsbAjaxWrap").fadeTo(0,0.5);$.get("/404?nocache="+(new Date().getTime()),function(f,h,a){if(!f){return}var d='<div id="fsb">';var c="</div> <!-- end #fsb -->";var g=f.indexOf(d);var e=f.indexOf(c);if(g!=-1&&e>g){var b=f.substring(g,e+c.length);$("#fsbAjaxWrap").html(b).fadeTo(0,1)}});$("#cosbAjaxWrap").fadeTo(0,0.5);$.get("/checkout/?nocache="+(new Date().getTime()),function(f,h,a){if(!f){return}var d='<div class="insetBox" id="cosb">';var c="</div> <!-- end #cosb -->";var g=f.indexOf(d);var e=f.indexOf(c);if(g!=-1&&e>g){var b=f.substring(g,e+c.length);$("#cosbAjaxWrap").html(b).fadeTo(0,1)}})};store_checkout=function(){$.doRedirect("/checkout/")};store_addItem=function(b,c){var a=$.showPrettyPopup({modal:true,width:450,height:200});doAjax=function(){$.post("/ajax/orders/order_ajax.php?action=additem&itemNumber="+b+"&quantity="+c+"&nocache="+(new Date().getTime()),function(e,f,d){if(e&&e.indexOf("ajaxResponseSuccess")!=-1){$.prettyPopupSetContent(e)}else{$.prettyPopupShowError("Error occurred while communicating with server.  Please try again or reload the page.")}})};doAjax();return false};store_addUpgradeItem=function(c,b){var a=$.showPrettyPopup({modal:true,width:450,height:200});doAjax=function(){$.post("/ajax/orders/order_ajax.php?action=addupgradeitem&itemNumber="+c+"&oldSerial="+b+"&nocache="+(new Date().getTime()),function(e,f,d){if(e&&e.indexOf("ajaxResponseSuccess")!=-1){$.prettyPopupSetContent(e)}else{$.prettyPopupShowError("Error occurred while communicating with server.  Please try again or reload the page.")}})};doAjax();return false};store_setQuantity=function(c,b){var a=$.showPrettyPopup({modal:true,width:450,height:200});doAjax=function(){$.post("/ajax/orders/order_ajax.php?action=setquantity&itemID="+c+"&quantity="+b+"&nocache="+(new Date().getTime()),function(e,f,d){if(e&&e.indexOf("ajaxResponseSuccess")!=-1){$.prettyPopupSetContent(e)}else{$.prettyPopupShowError("Error occurred while communicating with server.  Please try again or reload the page.")}})};doAjax();return false};store_applyDiscount=function(b){var a=$.showPrettyPopup({modal:true,width:450,height:200});doAjax=function(){$.post("/ajax/orders/order_ajax.php?action=applydiscount&code="+b+"&nocache="+(new Date().getTime()),function(d,e,c){if(d&&d.indexOf("ajaxResponseSuccess")!=-1){$.prettyPopupSetContent(d)}else{$.prettyPopupShowError("Error occurred while communicating with server.  Please try again or reload the page.")}})};doAjax();return false};store_removeItem=function(b){var a=$.showPrettyPopup({modal:true,width:450,height:200});doAjax=function(){$.post("/ajax/orders/order_ajax.php?action=removeitem&itemID="+b+"&nocache="+(new Date().getTime()),function(d,e,c){if(d&&d.indexOf("ajaxResponseSuccess")!=-1){$.prettyPopupSetContent(d)}else{$.prettyPopupShowError("Error occurred while communicating with server.  Please try again or reload the page.")}})};doAjax();return false};store_applyDiscount_start=function(b){var a=(b===true)?"#cosbDiscountCode":"#fsbDiscountCode";var c=$(a).val();if(c!=""){store_applyDiscount(c)}else{alert("Please enter a discount code in the box before submitting.");$(a).focus()}};

var postSWF_started = false;
var postSWF_available = false;
var postSWF_counter = 0;
$(function(){
	if (!postSWF_started)
	{
		$('body').append('<div id="postSWF_wrap" style="position: absolute; width:0; height:0; overflow: hidden;"><div id="postSWF_holder">&nbsp;</div></div>');
		swfobject.embedSWF('/js/jquery/https_xhr/caller.swf', 'postSWF_holder', '1', '1', '9.0.0');
	}
	postSWF_started = true;
});
jQuery_https_xhr_available = function(){ postSWF_available = true; }
$.postSWF = function(urlSecure, urlBackup, contents, callback)
{
	var doBackup = false;
	if ($.getUrlVar('secureform')=='0') doBackup=true;
	if (!doBackup && postSWF_available)
	{
		try
		{
		var callbackID = 'postSWF_callback_' + (postSWF_counter++);
		window[callbackID] = callback;
		swfobject.getObjectById('postSWF_holder').jQuery_https_xhr(urlSecure, contents, callbackID);
		}catch (e) { doBackup = true; }
	}
	else doBackup = true;
	
	if (doBackup)
		$.post(urlBackup, contents, callback);
}
gsEVT=function(a,b,c){try{/*GoSquared.DefaultTracker.TrackEvent(a,b||'(none)');*/ woopraTracker.pushEvent($.extend({name:a,detail:(b||'(none)')}, c||{})); }catch(e){if(window['console'])console.log(e);else $('body').append('<div style="display:none">error: ' + e + '</div>');}};

