VARS = {
   sharedropdownpath : "../pagetemplates/sharedropdown.html"
}

if(jQuery.browser.msie && parseInt(jQuery.browser.version) == 6 && this.XMLHttpRequest) {
	jQuery.browser.version = "7.0"
}
/* jQuery Cycle plugin*/
(function(F){var A="2.34";if(F.support==undefined){F.support={opacity:!(F.browser.msie&&/MSIE 6.0/.test(navigator.userAgent))}}function C(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments,""))}}F.fn.cycle=function(I){if(this.length==0){C("terminating; zero elements found by selector"+(F.isReady?"":" (DOM not ready)"));return this}var J=arguments[1];return this.each(function(){if(this.cycleStop==undefined){this.cycleStop=0}if(I===undefined||I===null){I={}}if(I.constructor==String){switch(I){case"stop":this.cycleStop++;if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;F(this).removeData("cycle.opts");return ;case"pause":this.cyclePause=1;return ;case"resume":this.cyclePause=0;if(J===true){I=F(this).data("cycle.opts");if(!I){C("options not found, can not resume");return }if(this.cycleTimeout){clearTimeout(this.cycleTimeout);this.cycleTimeout=0}D(I.elements,I,1,1)}return ;default:I={fx:I}}}else{if(I.constructor==Number){var R=I;I=F(this).data("cycle.opts");if(!I){C("options not found, can not advance slide");return }if(R<0||R>=I.elements.length){C("invalid slide index: "+R);return }I.nextSlide=R;if(this.cycleTimeout){clearTimeout(this.cycleTimeout);this.cycleTimeout=0}D(I.elements,I,1,R>=I.currSlide);return }}if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var W=F(this);var S=I.slideExpr?F(I.slideExpr,this):W.children();var N=S.get();if(N.length<2){C("terminating; too few slides: "+N.length);return }var K=F.extend({},F.fn.cycle.defaults,I||{},F.metadata?W.metadata():F.meta?W.data():{});if(K.autostop){K.countdown=K.autostopCount||N.length}W.data("cycle.opts",K);K.container=this;K.stopCount=this.cycleStop;K.elements=N;K.before=K.before?[K.before]:[];K.after=K.after?[K.after]:[];K.after.unshift(function(){K.busy=0});if(K.continuous){K.after.push(function(){D(N,K,0,!K.rev)})}if(!F.support.opacity&&K.cleartype&&!K.cleartypeNoBg){B(S)}var Y=this.className;K.width=parseInt((Y.match(/w:(\d+)/)||[])[1])||K.width;K.height=parseInt((Y.match(/h:(\d+)/)||[])[1])||K.height;K.timeout=parseInt((Y.match(/t:(\d+)/)||[])[1])||K.timeout;if(W.css("position")=="static"){W.css("position","relative")}if(K.width){W.width(K.width)}if(K.height&&K.height!="auto"){W.height(K.height)}if(K.startingSlide){K.startingSlide=parseInt(K.startingSlide)}if(K.random){K.randomMap=[];for(var O=0;O<N.length;O++){K.randomMap.push(O)}K.randomMap.sort(function(c,Z){return Math.random()-0.5});K.randomIndex=0;K.startingSlide=K.randomMap[0]}else{if(K.startingSlide>=N.length){K.startingSlide=0}}var Q=K.startingSlide||0;S.css({position:"absolute",top:0,left:0}).hide().each(function(Z){var a=Q?Z>=Q?N.length-(Z-Q):Q-Z:N.length-Z;F(this).css("z-index",a)});F(N[Q]).css("opacity",1).show();if(F.browser.msie){N[Q].style.removeAttribute("filter")}if(K.fit&&K.width){S.width(K.width)}if(K.fit&&K.height&&K.height!="auto"){S.height(K.height)}if(K.containerResize){var T=0,M=0;for(var O=0;O<N.length;O++){var L=F(N[O]),V=L.outerWidth(),P=L.outerHeight();T=V>T?V:T;M=P>M?P:M}W.css({width:T+"px",height:M+"px"})}if(K.pause){W.hover(function(){this.cyclePause++},function(){this.cyclePause--})}var X=F.fn.cycle.transitions[K.fx];if(F.isFunction(X)){X(W,S,K)}else{if(K.fx!="custom"){C("unknown transition: "+K.fx)}}S.each(function(){var Z=F(this);this.cycleH=(K.fit&&K.height)?K.height:Z.height();this.cycleW=(K.fit&&K.width)?K.width:Z.width()});K.cssBefore=K.cssBefore||{};K.animIn=K.animIn||{};K.animOut=K.animOut||{};S.not(":eq("+Q+")").css(K.cssBefore);if(K.cssFirst){F(S[Q]).css(K.cssFirst)}if(K.timeout){K.timeout=parseInt(K.timeout);if(K.speed.constructor==String){K.speed=F.fx.speeds[K.speed]||parseInt(K.speed)}if(!K.sync){K.speed=K.speed/2}while((K.timeout-K.speed)<250){K.timeout+=K.speed}}if(K.easing){K.easeIn=K.easeOut=K.easing}if(!K.speedIn){K.speedIn=K.speed}if(!K.speedOut){K.speedOut=K.speed}K.slideCount=N.length;K.currSlide=Q;if(K.random){K.nextSlide=K.currSlide;if(++K.randomIndex==N.length){K.randomIndex=0}K.nextSlide=K.randomMap[K.randomIndex]}else{K.nextSlide=K.startingSlide>=(N.length-1)?0:K.startingSlide+1}var U=S[Q];if(K.before.length){K.before[0].apply(U,[U,U,K,true])}if(K.after.length>1){K.after[1].apply(U,[U,U,K,true])}if(K.click&&!K.next){K.next=K.click}if(K.next){F(K.next).bind("click",function(){return E(N,K,K.rev?-1:1)})}if(K.prev){F(K.prev).bind("click",function(){return E(N,K,K.rev?1:-1)})}if(K.pager){H(N,K)}K.addSlide=function(a,b){var Z=F(a),c=Z[0];if(!K.autostopCount){K.countdown++}N[b?"unshift":"push"](c);if(K.els){K.els[b?"unshift":"push"](c)}K.slideCount=N.length;Z.css("position","absolute");Z[b?"prependTo":"appendTo"](W);if(b){K.currSlide++;K.nextSlide++}if(!F.support.opacity&&K.cleartype&&!K.cleartypeNoBg){B(Z)}if(K.fit&&K.width){Z.width(K.width)}if(K.fit&&K.height&&K.height!="auto"){S.height(K.height)}c.cycleH=(K.fit&&K.height)?K.height:Z.height();c.cycleW=(K.fit&&K.width)?K.width:Z.width();Z.css(K.cssBefore);if(K.pager){F.fn.cycle.createPagerAnchor(N.length-1,c,F(K.pager),N,K)}if(typeof K.onAddSlide=="function"){K.onAddSlide(Z)}};if(K.timeout||K.continuous){this.cycleTimeout=setTimeout(function(){D(N,K,0,!K.rev)},K.continuous?10:K.timeout+(K.delay||0))}})};function D(N,I,M,O){if(I.busy){return }var L=I.container,Q=N[I.currSlide],P=N[I.nextSlide];if(L.cycleStop!=I.stopCount||L.cycleTimeout===0&&!M){return }if(!M&&!L.cyclePause&&((I.autostop&&(--I.countdown<=0))||(I.nowrap&&!I.random&&I.nextSlide<I.currSlide))){if(I.end){I.end(I)}return }if(M||!L.cyclePause){if(I.before.length){F.each(I.before,function(R,S){if(L.cycleStop!=I.stopCount){return }S.apply(P,[Q,P,I,O])})}var J=function(){if(F.browser.msie&&I.cleartype){this.style.removeAttribute("filter")}F.each(I.after,function(R,S){if(L.cycleStop!=I.stopCount){return }S.apply(P,[Q,P,I,O])})};if(I.nextSlide!=I.currSlide){I.busy=1;if(I.fxFn){I.fxFn(Q,P,I,J,O)}else{if(F.isFunction(F.fn.cycle[I.fx])){F.fn.cycle[I.fx](Q,P,I,J)}else{F.fn.cycle.custom(Q,P,I,J,M&&I.fastOnEvent)}}}if(I.random){I.currSlide=I.nextSlide;if(++I.randomIndex==N.length){I.randomIndex=0}I.nextSlide=I.randomMap[I.randomIndex]}else{var K=(I.nextSlide+1)==N.length;I.nextSlide=K?0:I.nextSlide+1;I.currSlide=K?N.length-1:I.nextSlide-1}if(I.pager){F.fn.cycle.updateActivePagerLink(I.pager,I.currSlide)}}if(I.timeout&&!I.continuous){L.cycleTimeout=setTimeout(function(){D(N,I,0,!I.rev)},G(Q,P,I,O))}else{if(I.continuous&&L.cyclePause){L.cycleTimeout=setTimeout(function(){D(N,I,0,!I.rev)},10)}}}F.fn.cycle.updateActivePagerLink=function(I,J){F(I).find("a").removeClass("activeSlide").filter("a:eq("+J+")").addClass("activeSlide")};function G(M,K,L,J){if(L.timeoutFn){var I=L.timeoutFn(M,K,L,J);if(I!==false){return I}}return L.timeout}function E(I,J,M){var L=J.container,K=L.cycleTimeout;if(K){clearTimeout(K);L.cycleTimeout=0}if(J.random&&M<0){J.randomIndex--;if(--J.randomIndex==-2){J.randomIndex=I.length-2}else{if(J.randomIndex==-1){J.randomIndex=I.length-1}}J.nextSlide=J.randomMap[J.randomIndex]}else{if(J.random){if(++J.randomIndex==I.length){J.randomIndex=0}J.nextSlide=J.randomMap[J.randomIndex]}else{J.nextSlide=J.currSlide+M;if(J.nextSlide<0){if(J.nowrap){return false}J.nextSlide=I.length-1}else{if(J.nextSlide>=I.length){if(J.nowrap){return false}J.nextSlide=0}}}}if(J.prevNextClick&&typeof J.prevNextClick=="function"){J.prevNextClick(M>0,J.nextSlide,I[J.nextSlide])}D(I,J,1,M>=0);return false}function H(J,K){var I=F(K.pager);F.each(J,function(L,M){F.fn.cycle.createPagerAnchor(L,M,I,J,K)});F.fn.cycle.updateActivePagerLink(K.pager,K.startingSlide)}F.fn.cycle.createPagerAnchor=function(L,M,J,K,N){var I=(typeof N.pagerAnchorBuilder=="function")?N.pagerAnchorBuilder(L,M):'<a href="#">'+(L+1)+"</a>";if(!I){return }var O=F(I);if(O.parents("body").length==0){O.appendTo(J)}O.bind(N.pagerEvent,function(){N.nextSlide=L;var Q=N.container,P=Q.cycleTimeout;if(P){clearTimeout(P);Q.cycleTimeout=0}if(typeof N.pagerClick=="function"){N.pagerClick(N.nextSlide,K[N.nextSlide])}D(K,N,1,N.currSlide<L);return false});if(N.pauseOnPagerHover){O.hover(function(){N.container.cyclePause++},function(){N.container.cyclePause--})}};function B(K){function J(L){var L=parseInt(L).toString(16);return L.length<2?"0"+L:L}function I(N){for(;N&&N.nodeName.toLowerCase()!="html";N=N.parentNode){var L=F.css(N,"background-color");if(L.indexOf("rgb")>=0){var M=L.match(/\d+/g);return"#"+J(M[0])+J(M[1])+J(M[2])}if(L&&L!="transparent"){return L}}return"#ffffff"}K.each(function(){F(this).css("background-color",I(this))})}F.fn.cycle.custom=function(T,N,I,K,J){var S=F(T),O=F(N);O.css(I.cssBefore);var L=J?1:I.speedIn;var R=J?1:I.speedOut;var M=J?null:I.easeIn;var Q=J?null:I.easeOut;var P=function(){O.animate(I.animIn,L,M,K)};S.animate(I.animOut,R,Q,function(){if(I.cssAfter){S.css(I.cssAfter)}if(!I.sync){P()}});if(I.sync){P()}};F.fn.cycle.transitions={fade:function(J,K,I){K.not(":eq("+I.startingSlide+")").css("opacity",0);I.before.push(function(){F(this).show()});I.animIn={opacity:1};I.animOut={opacity:0};I.cssBefore={opacity:0};I.cssAfter={display:"none"};I.onAddSlide=function(L){L.hide()}}};F.fn.cycle.ver=function(){return A};F.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,prevNextClick:null,pager:null,pagerClick:null,pagerEvent:"click",pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:0,nowrap:0,fastOnEvent:0}})(jQuery);
/*jQuery UI 1.5.3*/
(function(C){C.ui={plugin:{add:function(E,F,H){var G=C.ui[E].prototype;for(var D in H){G.plugins[D]=G.plugins[D]||[];G.plugins[D].push([F,H[D]])}},call:function(D,F,E){var H=D.plugins[F];if(!H){return }for(var G=0;G<H.length;G++){if(D.options[H[G][0]]){H[G][1].apply(D.element,E)}}}},cssCache:{},css:function(D){if(C.ui.cssCache[D]){return C.ui.cssCache[D]}var E=C('<div class="ui-gen">').addClass(D).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[D]=!!((!(/auto|default/).test(E.css("cursor"))||(/^[1-9]/).test(E.css("height"))||(/^[1-9]/).test(E.css("width"))||!(/none/).test(E.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(E.css("backgroundColor"))));try{C("body").get(0).removeChild(E.get(0))}catch(F){}return C.ui.cssCache[D]},disableSelection:function(D){C(D).attr("unselectable","on").css("MozUserSelect","none")},enableSelection:function(D){C(D).attr("unselectable","off").css("MozUserSelect","")},hasScroll:function(G,E){var D=/top/.test(E||"top")?"scrollTop":"scrollLeft",F=false;if(G[D]>0){return true}G[D]=1;F=G[D]>0?true:false;G[D]=0;return F}};var B=C.fn.remove;C.fn.remove=function(){C("*",this).add(this).triggerHandler("remove");return B.apply(this,arguments)};function A(E,F,G){var D=C[E][F].getter||[];D=(typeof D=="string"?D.split(/,?\s+/):D);return(C.inArray(G,D)!=-1)}C.widget=function(E,D){var F=E.split(".")[0];E=E.split(".")[1];C.fn[E]=function(J){var H=(typeof J=="string"),I=Array.prototype.slice.call(arguments,1);if(H&&A(F,E,J)){var G=C.data(this[0],E);return(G?G[J].apply(G,I):undefined)}return this.each(function(){var K=C.data(this,E);if(H&&K&&C.isFunction(K[J])){K[J].apply(K,I)}else{if(!H){C.data(this,E,new C[F][E](this,J))}}})};C[F][E]=function(I,H){var G=this;this.widgetName=E;this.widgetBaseClass=F+"-"+E;this.options=C.extend({},C.widget.defaults,C[F][E].defaults,H);this.element=C(I).bind("setData."+E,function(L,J,K){return G.setData(J,K)}).bind("getData."+E,function(K,J){return G.getData(J)}).bind("remove",function(){return G.destroy()});this.init()};C[F][E].prototype=C.extend({},C.widget.prototype,D)};C.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(D){return this.options[D]},setData:function(D,E){this.options[D]=E;if(D=="disabled"){this.element[E?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")}},enable:function(){this.setData("disabled",false)},disable:function(){this.setData("disabled",true)}};C.widget.defaults={disabled:false};C.ui.mouse={mouseInit:function(){var D=this;this.element.bind("mousedown."+this.widgetName,function(E){return D.mouseDown(E)});if(C.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},mouseDestroy:function(){this.element.unbind("."+this.widgetName);(C.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},mouseDown:function(F){(this._mouseStarted&&this.mouseUp(F));this._mouseDownEvent=F;var E=this,G=(F.which==1),D=(typeof this.options.cancel=="string"?C(F.target).parents().add(F.target).filter(this.options.cancel).length:false);if(!G||D||!this.mouseCapture(F)){return true}this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){E._mouseDelayMet=true},this.options.delay)}if(this.mouseDistanceMet(F)&&this.mouseDelayMet(F)){this._mouseStarted=(this.mouseStart(F)!==false);if(!this._mouseStarted){F.preventDefault();return true}}this._mouseMoveDelegate=function(H){return E.mouseMove(H)};this._mouseUpDelegate=function(H){return E.mouseUp(H)};C(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false},mouseMove:function(D){if(C.browser.msie&&!D.button){return this.mouseUp(D)}if(this._mouseStarted){this.mouseDrag(D);return false}if(this.mouseDistanceMet(D)&&this.mouseDelayMet(D)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,D)!==false);(this._mouseStarted?this.mouseDrag(D):this.mouseUp(D))}return !this._mouseStarted},mouseUp:function(D){C(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(D)}return false},mouseDistanceMet:function(D){return(Math.max(Math.abs(this._mouseDownEvent.pageX-D.pageX),Math.abs(this._mouseDownEvent.pageY-D.pageY))>=this.options.distance)},mouseDelayMet:function(D){return this._mouseDelayMet},mouseStart:function(D){},mouseDrag:function(D){},mouseStop:function(D){},mouseCapture:function(D){return true}};C.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);


/*
 jQuery UI Accordion
 */
(function(jQuery) {

jQuery.widget("ui.accordion", {
	init: function() {
		var options = this.options;
		
		if ( options.navigation ) {
			var current = this.element.find("a").filter(options.navigationFilter);
			if ( current.length ) {
				if ( current.filter(options.header).length ) {
					options.active = current;
				} else {
					options.active = current.parent().parent().prev();
					current.addClass("current");
				}
			}
		}
		
		// calculate active if not specified, using the first header
		options.headers = this.element.find(options.header);
		options.active = findActive(options.headers, options.active);
		
		// IE7-/Win - Extra vertical space in Lists fixed
		if (jQuery.browser.msie) {
			this.element.find('a').css('zoom', '1');
		}

		this.element.addClass("ui-accordion");
		this.element.find("li:first-child").addClass("first")
		this.element.find("li:last-child").addClass("last")

		var maxHeight;
		if ( options.fillSpace ) {
			maxHeight = this.element.parent().height();
			options.headers.each(function() {
				maxHeight -= jQuery(this).outerHeight();
			});
			// Check to see if we're on the homepage and if so specify the slider height
			if(jQuery("#homepageflashwrapper").length > 0){
				maxHeight = 333;
				if(navigator.userAgent.indexOf('MSIE 6.0')+1){
				maxHeight = 318;
				}
			}
			
			
			var maxPadding = 0;
			options.headers.next().each(function() {
				maxPadding = Math.max(maxPadding, jQuery(this).innerHeight() - jQuery(this).height());
			}).height(maxHeight - maxPadding);
		} else if ( options.autoHeight ) {
			maxHeight = 0;
			options.headers.next().each(function() {
				maxHeight = Math.max(maxHeight, jQuery(this).outerHeight());
			}).height(maxHeight);
		}
	
		options.headers
			.not(options.active || "")
			.next()
			.hide();
		options.active.parent().andSelf().addClass(options.selectedClass);
		
		if (options.event) {
			this.element.bind((options.event) + ".accordion", clickHandler);
		}
	},
	activate: function(index) {
		// call clickHandler with custom event
		clickHandler.call(this.element[0], {
			target: findActive( this.options.headers, index )[0]
		});
	},
	destroy: function() {
		this.options.headers.next().css("display", "");
		if ( this.options.fillSpace || this.options.autoHeight ) {
			this.options.headers.next().css("height", "");
		}
		jQuery.removeData(this.element[0], "accordion");
		this.element.removeClass("ui-accordion").unbind(".accordion");
	}
});


function scopeCallback(b,a){return function(){return b.apply(a,arguments)}}function completed(c){if(!jQuery.data(this,"accordion")){return}var a=jQuery.data(this,"accordion");var b=a.options;b.running=c?0:--b.running;if(b.running){return}if(b.clearStyle){b.toShow.add(b.toHide).css({height:"",overflow:""})}jQuery(this).triggerHandler("accordionchange",[jQuery.event.fix({type:"accordionchange",target:a.element[0]}),b.data],b.change)}function toggle(a,e,f,d,g){var c=jQuery.data(this,"accordion").options;c.toShow=a;c.toHide=e;c.data=f;var b=scopeCallback(completed,this);c.running=e.size()===0?a.size():e.size();if(c.animated){if(!c.alwaysOpen&&d){jQuery.ui.accordion.animations[c.animated]({toShow:jQuery([]),toHide:e,complete:b,down:g,autoHeight:c.autoHeight})}else{jQuery.ui.accordion.animations[c.animated]({toShow:a,toHide:e,complete:b,down:g,autoHeight:c.autoHeight})}}else{if(!c.alwaysOpen&&d){a.toggle()}else{e.hide();a.show()}b(true)}}function clickHandler(f){var d=jQuery.data(this,"accordion").options;if(d.disabled){return false}if(!f.target&&!d.alwaysOpen){d.active.parent().andSelf().toggleClass(d.selectedClass);var c=d.active.next(),g={options:d,newHeader:jQuery([]),oldHeader:d.active,newContent:jQuery([]),oldContent:c},a=(d.active=jQuery([]));toggle.call(this,a,c,g);return false}var e=jQuery(f.target);e=jQuery(e.parents(d.header)[0]||e);var b=e[0]==d.active[0];if(d.running||(d.alwaysOpen&&b)){return false}if(!e.is(d.header)){return}d.active.parent().andSelf().toggleClass(d.selectedClass);if(!b){e.parent().andSelf().addClass(d.selectedClass)}var a=e.next(),c=d.active.next(),g={options:d,newHeader:e,oldHeader:d.active,newContent:a,oldContent:c},h=d.headers.index(d.active[0])>d.headers.index(e[0]);d.active=b?jQuery([]):e;toggle.call(this,a,c,g,b,h);return false}function findActive(b,a){return a!=undefined?typeof a=="number"?b.filter(":eq("+a+")"):b.not(b.not(a)):a===false?jQuery([]):b.filter(":eq(0)")}jQuery.extend(jQuery.ui.accordion,{defaults:{selectedClass:"selected",alwaysOpen:true,animated:"slide",event:"click",header:"a",autoHeight:true,running:0,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(a,c){a=jQuery.extend({easing:"swing",duration:300},a,c);if(!a.toHide.size()){a.toShow.animate({height:"show"},a);return}var b=a.toHide.height(),d=a.toShow.height(),e=d/b;a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate({height:"hide"},{step:function(f){var g=(b-f)*e;if(jQuery.browser.msie||jQuery.browser.opera){g=Math.ceil(g)}a.toShow.height(g)},duration:a.duration,easing:a.easing,complete:function(){if(!a.autoHeight){a.toShow.css("height","auto")}a.complete()}})}}});

jQuery.fn.activate = function(index) {
	return this.accordion("activate", index);
};

})(jQuery);

/*
 End Accordion
 */


var fieldtext=[];
function memorizeTextField(a,c){fieldtext[a]=c;var b=a;if(jQuery(a).val()==""){jQuery(a).val(fieldtext[a])}jQuery(a).bind("click",function(){if(jQuery(this).val()==fieldtext[b]){jQuery(this).val("")}});jQuery(a).bind("blur",function(){if(jQuery(this).val()==""){jQuery(this).val(fieldtext[b])}})}

sharearray = new Object();
sharearray["http://myjeeves.ask.com/mysearch/BookmarkIt"]="?v=1.2&t=webpages&url={url}&title={title}";
sharearray["http://www.backflip.com/add_page_pop.ihtml"]="?url={url}&title={title}";
sharearray["http://ballhype.com/post/url/"]="?url={url}&title={title}";
sharearray["http://bebo.com/c/share"]="?Url={url}&Title={title}";
sharearray["http://www.blinklist.com/index.php"]="?Action=Blink/addblink.php&Url={url}&Title={title}";
sharearray["http://blogmarks.net/my/new.php"]="?mini=1&simple=1&url={url}&title={title}";
sharearray["http://del.icio.us/post"]="?v=4&partner=[partner]&noui&url={url}&title={title}";
sharearray["http://digg.com/submit"]="?phase=2&partner=[partner]&url={url}&title={title}";
sharearray["http://www.diigo.com/post"]="?url={url}&title={title}";
sharearray["http://www.facebook.com/sharer.php"]="?u={url}&t={title}";
sharearray["http://cgi.fark.com/cgi/fark/submit.pl"]="?new_url={url}&new_comment={title}";
sharearray["http://bluedot.us/Authoring.aspx"]="?u={url}&t={title}";
sharearray["http://feedmelinks.com/categorize"]="?from=toolbar&op=submit&url={url}&name={title}";
sharearray["http://friendfeed.com/share"]="?url={url}&title={title}";
sharearray["http://www.furl.net/savedialog.jsp"]="?p=1&u={url}&t={title}&r=&v=1&c=";
sharearray["http://www.google.com/bookmarks/mark"]="?op=add&bkmk={url}&title={title}";
sharearray["http://www.kaboodle.com/grab/addItemWithUrl"]="?url={url}&pidOrRid=pid=&redirectToKPage=true";
sharearray["http://www.linkagogo.com/go/AddNoPopup"]="?url={url}&title={title}";
sharearray["http://www.linkedin.com/shareArticle"]="?mini=true&url={url}&title={title}&ro=false&summary=&source=";
sharearray["https://favorites.live.com/quickadd.aspx"]="?marklet=1&mkt=en-us&url={url}&title={title}&top=1";
sharearray["http://www.mister-wong.com/index.php"]="?action=addurl&bm_url={url}&bm_description={title}";
sharearray["http://www.mixx.com/submit"]="?page_url={url}";
sharearray["http://multiply.com/gus/journal/compose/"]="?body=&url={url}&subject={title}";
sharearray["http://favorites.my.aol.com/ffclient/AddBookmark"]="?url={url}&title={title}&favelet=true";
sharearray["http://www.myspace.com/Modules/PostTo/Pages/"]="?u={url}&t={title}&c=%20";
sharearray["http://netvouz.com/action/submitBookmark"]="?url={url}&title={title}&popup=no";
sharearray["http://www.newsvine.com/_tools/seed&save"]="?u={url}&h={title}";
sharearray["http://www.propeller.com/submit/"]="?U={url}&T={title}";
sharearray["http://reddit.com/submit"]="?url={url}&title={title}";
sharearray["http://segnalo.com/post.html.php"]="?url={url}&title={title}";
sharearray["http://www.simpy.com/simpy/LinkAdd.do"]="?href={url}&title={title}";
sharearray["http://slashdot.org/bookmark.pl"]="?url={url}";
sharearray["http://www.spurl.net/spurl.php"]="?url={url}&title={title}";
sharearray["http://www.stumbleupon.com/submit"]="?url={url}&title={title}";
sharearray["http://tailrank.com/share/"]="?link_href={url}&title={title}";
sharearray["http://technorati.com/faves/"]="?add={url}";
sharearray["http://twitter.com/home"]="?status={url}";
sharearray["http://bookmarks.yahoo.com/toolbar/savebm"]="?opener=tb&u={url}&t={title}";
sharearray["http://buzz.yahoo.com/submit"]="?submitUrl={url}&submitHeadline={title}";
sharearray["http://www.yardbarker.com/author/new/"]="?pUrl={url}";

var SHARE={init:function(){jQuery("#pagetools .share a").after("<div class='sharelist'><div class='inner1'><div class='inner2'></div></div></div>");jQuery("body").bind("click",function(){jQuery("#emaillink form,#pagetools .share .sharelist").hide()});jQuery("#pagetools .share .sharelist").hide().bind("click",function(a){return false});jQuery("#pagetools .share>a").bind("click",function(){jQuery("#pagetools .share .sharelist").show();return false});jQuery("#pagetools .share .inner2").load(VARS.sharedropdownpath,function(){jQuery("#pagetools .share #shareclose").bind("click",SHARE.closeDropDown);jQuery(".sharelist li a[id!=shareclose]").bind("click",SHARE.openLink);jQuery(".sharelist li a.more").bind("click",function(){jQuery(".sharelist li.extra").toggle();return false});})},closeDropDown:function(){jQuery(".share .sharelist").hide();return false},openLink:function(){var a=jQuery(this).attr("href")+sharearray[jQuery(this).attr("href")];var b=encodeURIComponent(self.location.href);var d=encodeURIComponent(jQuery("title:first").html());a=a.replace("{url}",b);a=a.replace("{title}",d);try{newwindow.focus()}catch(c){}return false}};

jQuery.noConflict();
jQuery(document).ready(function(){

  
   SHARE.init();
   
   jQuery("#pagetools .print a").bind("click", function(){
      window.print();
      this.blur();
      return false;
   })

   // Close Actions for overlays and dropdowns
      jQuery(document).keyup(function(e){
         if(e.keyCode == 27){
            SHARE.closeDropDown(); 
         }
      })


   memorizeTextField("#searchfield", "Enter Search Words");
 
   
// Set default for sliders to none, i.e. all closed
  myActive = "";
  
//Get id of h2 from query string
 if (location.search != ""){
  	myActive = location.search;
  	myActive= myActive.replace(/^\?/,''); // remove the leading ?
  	myActive="#sliders #"+myActive+"";
	} else {
	filename=location.href.substring(location.href.lastIndexOf('/')+1);
	if (filename =="io.html" || filename=="qa.html" || filename=="presentations.html"){
	myActive = '#sliders li:first h2';
	}
}

   if(jQuery('#sliders').length > 0){
      jQuery('#sliders').accordion({ 
         active: myActive,
         header: 'h2', 
         event: 'click',
         autoHeight: false,
         fillSpace: false
      });
   }
   
   /*Optimize body content area height*/
   if(jQuery("#sidebar").length> 0){
      sideheight = jQuery("#sidebar").height()
      if(sideheight > 52){
         jQuery("#maincontent .inner1 .inner2").css("min-height", (sideheight-52)+"px");
      }
   }
   
   if(jQuery.browser.version == "6.0"){
      try {
         document.execCommand('BackgroundImageCache', false, true);
      } catch(e) {}
   }
	

   if(jQuery("#maincontent ul.concertina").length > 0){
      jQuery("#maincontent ul.concertina a.customername").bind("click", function(){
         jQuery(this).parent(0).toggleClass("open");
         return false;
      })
      jQuery("#maincontent ul.concertina a.close").bind("click", function(){
         jQuery(jQuery(this).parent(0).parent(0)[0]).removeClass("open");
         return false;
      })
   }

})



/* Subnav menu width */
jQuery("#subnav").ready(function(){
   jQuery("#subnav").bind("mouseover", function(){jQuery("#at15s").hide()});
   jQuery("#subnav .children").each(function(){
      liwidth = jQuery(this).width();
      if(liwidth > 190){
         jQuery(this).find("ul a").css("width", liwidth-20+"px");
      }
      /* Fix left margin in Internet Explorer 6*/
      if(jQuery.browser.version == "6.0"){
         jQuery(this).find("ul").css("margin-left", "-"+liwidth+"px");
      }
   })
})
