

/*	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}}}}();

var fr_original_size = 100;
var fr_minimum_size = fr_original_size * 0.8;
var fr_maximum_size = fr_original_size * 1.6;
var fr_cookieName = 'fr_current_size';
var fr_cookieAge = 30; // days


function fr_resize( element, delta ) {
	var current_size;
	
	if ( current_size = readCookie(fr_cookieName) ) { // normal operation, when cookie has been set
		current_size = parseInt(current_size);
	} else if( element.style.fontSize ) { // after reset - no cookie, but fontsize is set
		current_size = parseInt(element.style.fontSize.replace("%",""));
	} else { // initial click of resize button - no cookie or fontsize
		current_size = fr_original_size;
	}

	var new_size = current_size + delta;

	if( new_size > fr_maximum_size ) {
		new_size = fr_maximum_size;
	} 
	
	if (new_size < fr_minimum_size) {
		new_size = fr_minimum_size;
	} 
	
	fr_setsize(element, new_size);
	
	if( new_size != current_size ) {
		fr_setcookie( new_size );
	}
}

function fr_reset( element )
{
// 	alert('reset to ' + fr_original_size);
	fr_setsize(element, fr_original_size);
	eraseCookie(fr_cookieName);
}

function fr_setsize(element, size) {
// 	alert('set size of ' + element + ' to ' + size); 
	element.style.fontSize = size + "%";
}

function fr_setcookie( size )
{
// 	alert('set cookie to ' + size);
	createCookie(fr_cookieName, size, fr_cookieAge);
}


/************************** HANDY COOKIE FUNCTIONS *****************************/
/*************** FROM http://www.quirksmode.org/js/cookies.html ****************/

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}


/* ------------------------------------------------------------------------
	Class: prettyPhoto
	Use: Lightbox clone for jQuery
	Author: Stephane Caron (http://www.no-margin-for-errors.com)
	Version: 2.5
------------------------------------------------------------------------- */
// DOCO: http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/
(function(a){a.prettyPhoto={version:"2.5"};a.fn.prettyPhoto=function(t){t=jQuery.extend({animationSpeed:"normal",padding:40,opacity:0.8,showTitle:true,allowresize:true,counter_separator_label:"/",theme:"light_rounded",callback:function(){}},t);if(a.browser.msie&&a.browser.version==6){t.theme="light_square"}if(a(".pp_overlay").size()==0){u()}else{o=a(".pp_pic_holder");x=a(".ppt")}var d=true,h=false,s,o,x,t,m,n,r,v,e="image",c=0,j=f();a(window).scroll(function(){j=f();i()});a(window).resize(function(){i();q()});a(document).keydown(function(y){switch(y.keyCode){case 37:a.prettyPhoto.changePage("previous");break;case 39:a.prettyPhoto.changePage("next");break;case 27:a.prettyPhoto.close();break}});a(this).each(function(){a(this).bind("click",function(){link=this;theRel=a(this).attr("rel");galleryRegExp=/\[(?:.*)\]/;theGallery=galleryRegExp.exec(theRel);images=new Array(),titles=new Array(),descriptions=new Array();if(theGallery){a("a[rel*="+theGallery+"]").each(function(y){if(a(this)[0]===a(link)[0]){c=y}images.push(a(this).attr("href"));titles.push(a(this).find("img").attr("alt"));descriptions.push(a(this).attr("title"))})}else{images=a(this).attr("href");titles=(a(this).find("img").attr("alt"))?a(this).find("img").attr("alt"):"";descriptions=a(this).attr("title")}a.prettyPhoto.open(images,titles,descriptions);return false})});a.prettyPhoto.open=function(A,z,y){if(a.browser.msie&&a.browser.version==6){a("select").css("visibility","hidden")}a("object,embed").css("visibility","hidden");if(A){images=a.makeArray(A)}if(z){titles=a.makeArray(z)}if(y){descriptions=a.makeArray(y)}if(a(".pp_overlay").size()==0){u()}else{o=a(".pp_pic_holder");x=a(".ppt")}o.attr("class","pp_pic_holder "+t.theme);isSet=(a(images).size()>0)?true:false;w(images[c]);i();g(a(images).size());a(".pp_loaderIcon").show();a("div.pp_overlay").show().fadeTo(t.animationSpeed,t.opacity,function(){o.fadeIn(t.animationSpeed,function(){o.find("p.currentTextHolder").text((c+1)+t.counter_separator_label+a(images).size());if(descriptions[c]){o.find(".pp_description").show().html(unescape(descriptions[c]))}else{o.find(".pp_description").hide().text("")}if(titles[c]&&t.showTitle){hasTitle=true;x.html(unescape(titles[c]))}else{hasTitle=false}if(e=="image"){imgPreloader=new Image();nextImage=new Image();if(isSet&&c>a(images).size()){nextImage.src=images[c+1]}prevImage=new Image();if(isSet&&images[c-1]){prevImage.src=images[c-1]}pp_typeMarkup='<img id="fullResImage" src="" />';o.find("#pp_full_res")[0].innerHTML=pp_typeMarkup;o.find(".pp_content").css("overflow","hidden");o.find("#fullResImage").attr("src",images[c]);imgPreloader.onload=function(){s=l(imgPreloader.width,imgPreloader.height);_showContent()};imgPreloader.src=images[c]}else{movie_width=(parseFloat(b("width",images[c])))?b("width",images[c]):"425";movie_height=(parseFloat(b("height",images[c])))?b("height",images[c]):"344";if(movie_width.indexOf("%")!=-1||movie_height.indexOf("%")!=-1){movie_height=(a(window).height()*parseFloat(movie_height)/100)-100;movie_width=(a(window).width()*parseFloat(movie_width)/100)-100;h=true}movie_height=parseFloat(movie_height);movie_width=parseFloat(movie_width);if(e=="quicktime"){movie_height+=13}s=l(movie_width,movie_height);if(e=="youtube"){pp_typeMarkup='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+s.width+'" height="'+s.height+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.youtube.com/v/'+b("v",images[c])+'" /><embed src="http://www.youtube.com/v/'+b("v",images[c])+'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+s.width+'" height="'+s.height+'"></embed></object>'}else{if(e=="quicktime"){pp_typeMarkup='<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="'+s.height+'" width="'+s.width+'"><param name="src" value="'+images[c]+'"><param name="autoplay" value="true"><param name="type" value="video/quicktime"><embed src="'+images[c]+'" height="'+s.height+'" width="'+s.width+'" autoplay="true" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>'}else{if(e=="flash"){flash_vars=images[c];flash_vars=flash_vars.substring(images[c].indexOf("flashvars")+10,images[c].length);filename=images[c];filename=filename.substring(0,filename.indexOf("?"));pp_typeMarkup='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+s.width+'" height="'+s.height+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="'+filename+"?"+flash_vars+'" /><embed src="'+filename+"?"+flash_vars+'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+s.width+'" height="'+s.height+'"></embed></object>'}else{if(e=="iframe"){movie_url=images[c];movie_url=movie_url.substr(0,movie_url.indexOf("iframe")-1);pp_typeMarkup='<iframe src ="'+movie_url+'" width="'+(s.width-10)+'" height="'+(s.height-10)+'" frameborder="no"></iframe>'}}}}_showContent()}})})};a.prettyPhoto.changePage=function(y){if(y=="previous"){c--;if(c<0){c=0;return}}else{if(a(".pp_arrow_next").is(".disabled")){return}c++}if(!d){d=true}k();a("a.pp_expand,a.pp_contract").fadeOut(t.animationSpeed,function(){a(this).removeClass("pp_contract").addClass("pp_expand");a.prettyPhoto.open()})};a.prettyPhoto.close=function(){o.find("object,embed").css("visibility","hidden");a("div.pp_pic_holder,div.ppt").fadeOut(t.animationSpeed);a("div.pp_overlay").fadeOut(t.animationSpeed,function(){a("div.pp_overlay,div.pp_pic_holder,div.ppt").remove();if(a.browser.msie&&a.browser.version==6){a("select").css("visibility","visible")}a("object,embed").css("visibility","visible");c=0;t.callback()});d=true};_showContent=function(){a(".pp_loaderIcon").hide();if(a.browser.opera){windowHeight=window.innerHeight;windowWidth=window.innerWidth}else{windowHeight=a(window).height();windowWidth=a(window).width()}projectedTop=j.scrollTop+((windowHeight/2)-(s.containerHeight/2));if(projectedTop<0){projectedTop=0+o.find(".ppt").height()}o.find(".pp_content").animate({height:s.contentHeight},t.animationSpeed);o.animate({top:projectedTop,left:((windowWidth/2)-(s.containerWidth/2)),width:s.containerWidth},t.animationSpeed,function(){o.width(s.containerWidth);o.find(".pp_hoverContainer,#fullResImage").height(s.height).width(s.width);o.find("#pp_full_res").fadeIn(t.animationSpeed);if(isSet&&e=="image"){o.find(".pp_hoverContainer").fadeIn(t.animationSpeed)}else{o.find(".pp_hoverContainer").hide()}o.find(".pp_details").fadeIn(t.animationSpeed);if(t.showTitle&&hasTitle){x.css({top:o.offset().top-20,left:o.offset().left+(t.padding/2),display:"none"});x.fadeIn(t.animationSpeed)}if(s.resized){a("a.pp_expand,a.pp_contract").fadeIn(t.animationSpeed)}if(e!="image"){o.find("#pp_full_res")[0].innerHTML=pp_typeMarkup}})};function k(){o.find(".pp_hoverContainer,.pp_details").fadeOut(t.animationSpeed);o.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden");o.find("#pp_full_res").fadeOut(t.animationSpeed,function(){a(".pp_loaderIcon").show()});x.fadeOut(t.animationSpeed)}function g(y){if(c==y-1){o.find("a.pp_next").css("visibility","hidden");o.find("a.pp_arrow_next").addClass("disabled").unbind("click")}else{o.find("a.pp_next").css("visibility","visible");o.find("a.pp_arrow_next.disabled").removeClass("disabled").bind("click",function(){a.prettyPhoto.changePage("next");return false})}if(c==0){o.find("a.pp_previous").css("visibility","hidden");o.find("a.pp_arrow_previous").addClass("disabled").unbind("click")}else{o.find("a.pp_previous").css("visibility","visible");o.find("a.pp_arrow_previous.disabled").removeClass("disabled").bind("click",function(){a.prettyPhoto.changePage("previous");return false})}if(y>1){a(".pp_nav").show()}else{a(".pp_nav").hide()}}function l(z,y){hasBeenResized=false;p(z,y);imageWidth=z;imageHeight=y;windowHeight=a(window).height();windowWidth=a(window).width();if(((v>windowWidth)||(r>windowHeight))&&d&&t.allowresize&&!h){hasBeenResized=true;notFitting=true;while(notFitting){if((v>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(y/z)*imageWidth}else{if((r>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(z/y)*imageHeight}else{notFitting=false}}r=imageHeight;v=imageWidth}p(imageWidth,imageHeight)}return{width:imageWidth,height:imageHeight,containerHeight:r,containerWidth:v,contentHeight:m,contentWidth:n,resized:hasBeenResized}}function p(z,y){o.find(".pp_details").width(z).find(".pp_description").width(z-parseFloat(o.find("a.pp_close").css("width")));m=y+o.find(".pp_details").height()+parseFloat(o.find(".pp_details").css("marginTop"))+parseFloat(o.find(".pp_details").css("marginBottom"));n=z;r=m+o.find(".ppt").height()+o.find(".pp_top").height()+o.find(".pp_bottom").height();v=z+t.padding}function w(y){if(y.match(/youtube\.com\/watch/i)){e="youtube"}else{if(y.indexOf(".mov")!=-1){e="quicktime"}else{if(y.indexOf(".swf")!=-1){e="flash"}else{if(y.indexOf("iframe")!=-1){e="iframe"}else{e="image"}}}}}function i(){if(a.browser.opera){windowHeight=window.innerHeight;windowWidth=window.innerWidth}else{windowHeight=a(window).height();windowWidth=a(window).width()}if(d){$pHeight=o.height();$pWidth=o.width();$tHeight=x.height();projectedTop=(windowHeight/2)+j.scrollTop-($pHeight/2);if(projectedTop<0){projectedTop=0+$tHeight}o.css({top:projectedTop,left:(windowWidth/2)+j.scrollLeft-($pWidth/2)});x.css({top:projectedTop-$tHeight,left:(windowWidth/2)+j.scrollLeft-($pWidth/2)+(t.padding/2)})}}function f(){if(self.pageYOffset){scrollTop=self.pageYOffset;scrollLeft=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){scrollTop=document.documentElement.scrollTop;scrollLeft=document.documentElement.scrollLeft}else{if(document.body){scrollTop=document.body.scrollTop;scrollLeft=document.body.scrollLeft}}}return{scrollTop:scrollTop,scrollLeft:scrollLeft}}function q(){a("div.pp_overlay").css({height:a(document).height(),width:a(window).width()})}function u(){toInject="";toInject+="<div class='pp_overlay'></div>";toInject+='<div class="pp_pic_holder"><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_loaderIcon"></div><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res"></div><div class="pp_details clearfix"><a class="pp_close" href="#">Close</a><p class="pp_description"></p><div class="pp_nav"><a href="#" class="pp_arrow_previous">Previous</a><p class="currentTextHolder">0'+t.counter_separator_label+'0</p><a href="#" class="pp_arrow_next">Next</a></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div>';toInject+='<div class="ppt"></div>';a("body").append(toInject);a("div.pp_overlay").css("opacity",0);o=a(".pp_pic_holder");x=a(".ppt");a("div.pp_overlay").css("height",a(document).height()).hide().bind("click",function(){a.prettyPhoto.close()});a("a.pp_close").bind("click",function(){a.prettyPhoto.close();return false});a("a.pp_expand").bind("click",function(){$this=a(this);if($this.hasClass("pp_expand")){$this.removeClass("pp_expand").addClass("pp_contract");d=false}else{$this.removeClass("pp_contract").addClass("pp_expand");d=true}k();o.find(".pp_hoverContainer, #pp_full_res, .pp_details").fadeOut(t.animationSpeed,function(){a.prettyPhoto.open()});return false});o.find(".pp_previous, .pp_arrow_previous").bind("click",function(){a.prettyPhoto.changePage("previous");return false});o.find(".pp_next, .pp_arrow_next").bind("click",function(){a.prettyPhoto.changePage("next");return false});o.find(".pp_hoverContainer").css({"margin-left":t.padding/2})}};function b(e,d){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c="[\\?&]"+e+"=([^&#]*)";var g=new RegExp(c);var f=g.exec(d);if(f==null){return""}else{return f[1]}}})(jQuery);


/* jQuery Origin Energy snippets */
//Check and Radio box replacement - http://www.filamentgroup.com/lab/accessible_custom_designed_checkbox_radio_button_inputs_styled_css_jquery

 $.fn.customInput = function(){
	$(this).each(function(i){	
		if($(this).is('[type="checkbox"],[type="radio"]')){
			var input = $(this);
			
			// get the associated label using the input's id
			var label = $('label[for="'+input.attr('id')+'"]');
			
			//get type, for classname suffix 
			var inputType = (input.is('[type="checkbox"]')) ? 'checkbox' : 'radio';
			
			// wrap the input + label in a div 
			$('<div class="custom-'+ inputType +'"></div>').insertBefore(input).append(input, label);
			
			// find all inputs in this set using the shared name attribute
			var allInputs = $('input[name="'+input.attr('name')+'"]');
			
			// necessary for browsers that don't support the :hover pseudo class on labels
			label.hover(
				function(){ 
					$(this).addClass('hover'); 
					if(inputType == 'checkbox' && input.is(':checked')){ 
						$(this).addClass('checkedHover'); 
					} 
				},
				function(){ $(this).removeClass('hover checkedHover'); }
			);
			
			//bind custom event, trigger it, bind click,focus,blur events					
			input.bind('updateState', function(){	
				if (input.is(':checked')) {
					if (input.is(':radio')) {				
						allInputs.each(function(){
							$('label[for="'+$(this).attr('id')+'"]').removeClass('checked');
						});		
					};
					label.addClass('checked');
				}
				else { label.removeClass('checked checkedHover checkedFocus'); }
										
			})
			.trigger('updateState')
			.click(function(){ 
				$(this).trigger('updateState'); 
			})
			.focus(function(){ 
				label.addClass('focus'); 
				if(inputType == 'checkbox' && input.is(':checked')){ 
					$(this).addClass('checkedFocus'); 
				} 
			})
			.blur(function(){ label.removeClass('focus checkedFocus'); });
		}
	});
};


$(function(){
	$('input').customInput();
});


//jQuery collapsible accordion content script 

jQuery().ready(function(){
		// first simple accordion with special markup
		jQuery('.collapse').accordion({
			header: 'div.title',
			active: false,
			alwaysOpen: false,
			animated: false,
			autoheight: false
		});

		// bind to change event of select to control first and seconds accordion
		// similar to tab's plugin triggerTab(), without an extra method
		var accordions = jQuery('.collapse');
		
		jQuery('#switch select').change(function() {
			accordions.accordion("activate", this.selectedIndex-1 );
		});
		jQuery('#close').click(function() {
			accordions.accordion("activate", -1);
		});
		jQuery('#switch2').change(function() {
			accordions.accordion("activate", this.value);
		});
		jQuery('#enable').click(function() {
			accordions.accordion("enable");
		});
		jQuery('#disable').click(function() {
			accordions.accordion("disable");
		});
		jQuery('#remove').click(function() {
			accordions.accordion("destroy");
			wizardButtons.unbind("click");
		});
	});


/*
 * jQuery UI Accordion 1.6
 * 
 * Copyright (c) 2007 Jörn Zaefferer
 *
 * http://docs.jquery.com/UI/Accordion
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.accordion.js 4876 2008-03-08 11:49:04Z joern.zaefferer $
 *
 */

;(function($) {
	
// If the UI scope is not available, add it
$.ui = $.ui || {};

$.fn.extend({
	accordion: function(options, data) {
		var args = Array.prototype.slice.call(arguments, 1);

		return this.each(function() {
			if (typeof options == "string") {
				var accordion = $.data(this, "ui-accordion");
				accordion[options].apply(accordion, args);
			// INIT with optional options
			} else if (!$(this).is(".ui-accordion"))
				$.data(this, "ui-accordion", new $.ui.accordion(this, options));
		});
	},
	// deprecated, use accordion("activate", index) instead
	activate: function(index) {
		return this.accordion("activate", index);
	}
});

$.ui.accordion = function(container, options) {
	
	// setup configuration
	this.options = options = $.extend({}, $.ui.accordion.defaults, options);
	this.element = container;
	
	$(container).addClass("ui-accordion");
	
	if ( options.navigation ) {
		var current = $(container).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 = $(container).find(options.header);
	options.active = findActive(options.headers, options.active);

	if ( options.fillSpace ) {
		var maxHeight = $(container).parent().height();
		options.headers.each(function() {
			maxHeight -= $(this).outerHeight();
		});
		var maxPadding = 0;
		options.headers.next().each(function() {
			maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());
		}).height(maxHeight - maxPadding);
	} else if ( options.autoheight ) {
		var maxHeight = 0;
		options.headers.next().each(function() {
			maxHeight = Math.max(maxHeight, $(this).outerHeight());
		}).height(maxHeight);
	}

	options.headers
		.not(options.active || "")
		.next()
		.hide();
	options.active.parent().andSelf().addClass(options.selectedClass);
	
	if (options.event)
		$(container).bind((options.event) + ".ui-accordion", clickHandler);
};

$.ui.accordion.prototype = {
	activate: function(index) {
		// call clickHandler with custom event
		clickHandler.call(this.element, {
			target: findActive( this.options.headers, index )[0]
		});
	},
	
	enable: function() {
		this.options.disabled = false;
	},
	disable: function() {
		this.options.disabled = true;
	},
	destroy: function() {
		this.options.headers.next().css("display", "");
		if ( this.options.fillSpace || this.options.autoheight ) {
			this.options.headers.next().css("height", "");
		}
		$.removeData(this.element, "ui-accordion");
		$(this.element).removeClass("ui-accordion").unbind(".ui-accordion");
	}
}

function scopeCallback(callback, scope) {
	return function() {
		return callback.apply(scope, arguments);
	};
}

function completed(cancel) {
	// if removed while animated data can be empty
	if (!$.data(this, "ui-accordion"))
		return;
	var instance = $.data(this, "ui-accordion");
	var options = instance.options;
	options.running = cancel ? 0 : --options.running;
	if ( options.running )
		return;
	if ( options.clearStyle ) {
		options.toShow.add(options.toHide).css({
			height: "",
			overflow: ""
		});
	}
	$(this).triggerHandler("change.ui-accordion", [options.data], options.change);
}

function toggle(toShow, toHide, data, clickedActive, down) {
	var options = $.data(this, "ui-accordion").options;
	options.toShow = toShow;
	options.toHide = toHide;
	options.data = data;
	var complete = scopeCallback(completed, this);
	
	// count elements to animate
	options.running = toHide.size() == 0 ? toShow.size() : toHide.size();
	
	if ( options.animated ) {
		if ( !options.alwaysOpen && clickedActive ) {
			$.ui.accordion.animations[options.animated]({
				toShow: jQuery([]),
				toHide: toHide,
				complete: complete,
				down: down,
				autoheight: options.autoheight
			});
		} else {
			$.ui.accordion.animations[options.animated]({
				toShow: toShow,
				toHide: toHide,
				complete: complete,
				down: down,
				autoheight: options.autoheight
			});
		}
	} else {
		if ( !options.alwaysOpen && clickedActive ) {
			toShow.toggle();
		} else {
			toHide.hide();
			toShow.show();
		}
		complete(true);
	}
}

function clickHandler(event) {
	var options = $.data(this, "ui-accordion").options;
	if (options.disabled)
		return false;
	
	// called only when using activate(false) to close all parts programmatically
	if ( !event.target && !options.alwaysOpen ) {
		options.active.parent().andSelf().toggleClass(options.selectedClass);
		var toHide = options.active.next(),
			data = {
				instance: this,
				options: options,
				newHeader: jQuery([]),
				oldHeader: options.active,
				newContent: jQuery([]),
				oldContent: toHide
			},
			toShow = options.active = $([]);
		toggle.call(this, toShow, toHide, data );
		return false;
	}
	// get the click target
	var clicked = $(event.target);
	
	// due to the event delegation model, we have to check if one
	// of the parent elements is our actual header, and find that
	if ( clicked.parents(options.header).length )
		while ( !clicked.is(options.header) )
			clicked = clicked.parent();
	
	var clickedActive = clicked[0] == options.active[0];
	
	// if animations are still active, or the active header is the target, ignore click
	if (options.running || (options.alwaysOpen && clickedActive))
		return false;
	if (!clicked.is(options.header))
		return;

	// switch classes
	options.active.parent().andSelf().toggleClass(options.selectedClass);
	if ( !clickedActive ) {
		clicked.parent().andSelf().addClass(options.selectedClass);
	}

	// find elements to show and hide
	var toShow = clicked.next(),
		toHide = options.active.next(),
		//data = [clicked, options.active, toShow, toHide],
		data = {
			instance: this,
			options: options,
			newHeader: clicked,
			oldHeader: options.active,
			newContent: toShow,
			oldContent: toHide
		},
		down = options.headers.index( options.active[0] ) > options.headers.index( clicked[0] );
	
	options.active = clickedActive ? $([]) : clicked;
	toggle.call(this, toShow, toHide, data, clickedActive, down );

	return false;
};

function findActive(headers, selector) {
	return selector != undefined
		? typeof selector == "number"
			? headers.filter(":eq(" + selector + ")")
			: headers.not(headers.not(selector))
		: selector === false
			? $([])
			: headers.filter(":eq(0)");
}

$.extend($.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(options, additions) {
			options = $.extend({
				easing: "swing",
				duration: 300
			}, options, additions);
			if ( !options.toHide.size() ) {
				options.toShow.animate({height: "show"}, options);
				return;
			}
			var hideHeight = options.toHide.height(),
				showHeight = options.toShow.height(),
				difference = showHeight / hideHeight;
			options.toShow.css({ height: 0, overflow: 'hidden' }).show();
			options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{
				step: function(now) {
					var current = (hideHeight - now) * difference;
					if ($.browser.msie || $.browser.opera) {
						current = Math.ceil(current);
					}
					options.toShow.height( current );
				},
				duration: options.duration,
				easing: options.easing,
				complete: function() {
					if ( !options.autoheight ) {
						options.toShow.css("height", "auto");
					}
					options.complete();
				}
			});
		},
		bounceslide: function(options) {
			this.slide(options, {
				easing: options.down ? "bounceout" : "swing",
				duration: options.down ? 1000 : 200
			});
		},
		easeslide: function(options) {
			this.slide(options, {
				easing: "easeinout",
				duration: 700
			})
		}
	}
});

})(jQuery);


/*END jQuery collapsible accordion content script */

