/**
 * jQuery Templates
 *
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Written by: Stan Lemon <stanlemon@mac.com>
 */
(function($){$.template=function(html,options){return new $.template.instance(html,options);};$.template.instance=function(html,options){if(options&&options.regx){options.regx=this.regx[options.regx];}this.options=$.extend({compile:false,regx:this.regx.standard},options||{});this.html=html;if(this.options.compile){this.compile();}this.isTemplate=true;};$.template.regx=$.template.instance.prototype.regx={jsp:/\$\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,ext:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,jtemplates:/\{\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}\}/g};$.template.regx.standard=$.template.regx.jsp;$.template.helpers=$.template.instance.prototype.helpers={substr:function(value,start,length){return String(value).substr(start,length);}};$.extend($.template.instance.prototype,{apply:function(values){if(this.options.compile){return this.compiled(values);}else{var tpl=this;var fm=this.helpers;var fn=function(m,name,format,args){if(format){if(format.substr(0,5)=="this."){return tpl.call(format.substr(5),values[name],values);}else{if(args){var re=/^\s*['"](.*)["']\s*$/;args=args.split(",");for(var i=0,len=args.length;i<len;i++){args[i]=args[i].replace(re,"$1");}args=[values[name]].concat(args);}else{args=[values[name]];}return fm[format].apply(fm,args);}}else{return values[name]!==undefined?values[name]:"";}};return this.html.replace(this.options.regx,fn);}},compile:function(){var sep=$.browser.mozilla?"+":",";var fm=this.helpers;var fn=function(m,name,format,args){if(format){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"(";}else{format='this.call("'+format.substr(5)+'", ';args=", values";}}else{args="";format="(values['"+name+"'] == undefined ? '' : ";}return"'"+sep+format+"values['"+name+"']"+args+")"+sep+"'";};var body;if($.browser.mozilla){body="this.compiled = function(values){ return '"+this.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.options.regx,fn)+"';};";}else{body=["this.compiled = function(values){ return ['"];body.push(this.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.options.regx,fn));body.push("'].join('');};");body=body.join("");}eval(body);return this;}});var $_old={domManip:$.fn.domManip,text:$.fn.text,html:$.fn.html};$.fn.domManip=function(args,table,reverse,callback){if(args[0].isTemplate){args[0]=args[0].apply(args[1]);delete args[1];}var r=$_old.domManip.apply(this,arguments);return r;};$.fn.html=function(value,o){if(value&&value.isTemplate){var value=value.apply(o);}var r=$_old.html.apply(this,[value]);return r;};$.fn.text=function(value,o){if(value&&value.isTemplate){var value=value.apply(o);}var r=$_old.text.apply(this,[value]);return r;};})(jQuery);
/*	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 Page = {};

Page.isIE  = false;
Page.isIE6 = false;
Page.isIE7 = false;
Page.isIE8 = false;

if(window.ActiveXObject){
	var rv = -1;
	var ua = navigator.userAgent;
	var re = new RegExp("Trident\/([0-9]{1,}[\.0-9]{0,})");
	if (re.exec(ua) != null) {
	    rv = parseFloat(RegExp.$1);
	}
	Page.isIE8 = (rv == 4);
	Page.isIE7 = ((window.XMLHttpRequest && !Page.isIE8) ? true : false);
	Page.isIE6 = !(Page.isIE7 || Page.isIE8);
	Page.isIE = true;
}

if(window.opera){
	jQuery(document).ready(function(){ $('body').addClass('opera'); });
}

var args = location.href.split('/');
while(args.length > 3){
    args.pop();
}
Page.location = args.join('/');

Page.isPrintMode = /mode\=print/.test(location.search);

jQuery.fn.doBlurAndHidefocus = function(){
	try {
		this.blur();                 // most browsers
		this.hideFocus = true;       // internet explorer
		this.style.outline = 'none'; // mozilla
	}catch(e){}
};

jQuery.fn.doBlur = function(){
	try {
		this.blur();                 // most browsers
		this.hideFocus = false;      // internet explorer
		this.style.outline = null;   // mozilla
	}catch(e) {}
};

function preventDefault(event){
 try { event.preventDefault(); } catch(error){ /* die silently */}
}
Page.content=function(g){var m=30;var i=250;var e={};e.playlist=g.template('<div class="element-aside playlist"><div class="content"><ul class="list">${content}</ul></div></div>');e.playlistElement=g.template('<li id="video-element-${id}"><h3 class="title"><a href="#">${title}</a></h3><p class="trackinfo">${duration}</p></li>');e.searchIngress=g.template('<div class="search-ingress"><p>${html}</p></div>');function h(){var s=g("#frm-search input").get(0);var u=g(s).val();var t="";g(s).addClass("placeholder");g(s).val(u);g(s).bind("focus",function(){if((g(s).val()==u)&&(t!=u)){g(s).val("");}g(s).removeClass("placeholder");});g(s).bind("blur",function(){t=g(s).val();if(g(s).val()==""){g(s).val(u);g(s).addClass("placeholder");}});}function c(){g(".element-aside .link").hover(function(){g(this).parent().find("h3").addClass("hover");Cufon.replace(".title span",{fontFamily:"crank"},true);},function(){g(this).parent().find("h3").removeClass("hover");Cufon.replace(".title span",{fontFamily:"crank"},true);});}function p(v){if(v.length>1){var x="",w,z;for(var u=0,s=v.length;u<s;u++){w=v[u];z=w.title;if(z.length>m){z=z.substr(0,m)+"…";}x+=e.playlistElement.apply({id:u+1,title:z,duration:w.duration});}g("#main-content .aside").prepend(e.playlist,{content:x});g("#main-content .aside #video-element-1").addClass("active");g(".playlist li").hover(function(){g(this).addClass("hover");},function(){g(this).removeClass("hover");});var y=g(".playlist li"),t;for(u=0;u<s;u++){t=y[u];w=v[u];g(t).data("video",w);g(t).click(q);}}}function q(t){var s=g(this).data("video");if(g(".playlist li.active").attr("id")==g(this).attr("id")){Statkraft.VideoPlayer.play();return;}Statkraft.VideoPlayer.setVideo(s);g(".playlist li.active").removeClass("active");g(this).addClass("active");}function f(){g(".faq .qa .answer").hide();g(".faq .qa .question").click(d);var x=g(".faq .qa .answer"),w,u;for(var v=0,t=x.length;v<t;v++){w=x[v];g(w).data("index",v);}var y=String(location.hash).replace("#","");if(y!=""){var s=".faq #"+y+".qa";if(g(s).get(0)){g(s).find(".answer").slideDown("slow");}}}function d(u){preventDefault(u);var s=g(this).next(".answer"),t=null,v="default";if(g(s).is(":hidden")){if(g(".faq .qa .answer:not(:hidden)").get(0)){t=g(".faq .qa .answer:not(:hidden)");if(g(t).data("index")<g(s).data("index")){v="before";}else{if(g(t).data("index")>g(s).data("index")){v="after";}}}switch(v){case"before":g(t).slideUp(i,function(){if(Page.isIE){g(t).parent().css("padding-bottom","2px");g(t).parent().css("padding-bottom","1px");}g(s).slideDown("normal",function(){if(Page.isIE){g(s).parent().css("padding-bottom","2px");g(s).parent().css("padding-bottom","1px");}});});break;case"after":g(s).slideDown("normal",function(){if(Page.isIE){g(s).parent().css("padding-bottom","2px");g(s).parent().css("padding-bottom","1px");}g(t).slideUp("normal",function(){if(Page.isIE){g(t).parent().css("padding-bottom","2px");g(t).parent().css("padding-bottom","1px");}});});break;case"default":g(s).slideDown();break;}}else{g(s).slideUp(i);}return false;}var r=60;function l(){if(Page.isIE6){return;}g("#page-menu .menu").addClass("animated");g("#page-menu .menu .selected").removeClass("collapsed");g("#page-menu .menu .collapsed:not(.selected) ul").hide();g("#page-menu .menu .collapsed:not(.selected)").addClass("animated");g("#page-menu .menu .collapsed:not(.selected)").removeClass("collapsed");var u=g("#page-menu .menu .animated:not(.selected)");for(var t=0,s=u.length;t<s;t++){g(u[t]).data("state","out");}g("#page-menu .menu .animated:not(.selected)[").hover(j,a);}function j(s){k(this,"over");}function a(s){k(this,"out");}function k(s,t){g(s).data("state",t);setTimeout(function(){o(s,t);},(t=="over"?10:r));}function o(s,t){if(t=="over"){if(/expand/.test(g(s).attr("class"))){return;}g(s).addClass("expanding");g(s).find("ul").slideDown("normal",function(){g(s).addClass("expanded");g(s).removeClass("expanding");if(g(s).data("state")=="out"){k(s,"out");}});}else{if(!g(s).hasClass("expanding")){g(s).find("ul").css("display","none");g(s).removeClass("expanded");}}}function n(){g(".gmini .two-col-container.page-content").after(e.searchIngress,{html:g(".gmini .search-ingress font").html()});if(g(".gmini .n td > a").get(0)){var v=g(".gmini .n td > span.i").get(0),u=g(v).html();var w=g(".gmini .n td > a");if(g(".gmini .n td > span.i").parent().next("td").find("> a").get(0)){g(v).html(u+",");w=g(w).slice(0,-1);}for(var t=0,s=w.length;t<s;t++){v=w[t];u=g(v).html();g(v).html(u+",");}}}function b(){var w=g("#main-content .featured-element"),u,v;for(var t=0,s=w.length;t<s;){u=w[t];v=g(u).next().get(0);g(u).addClass("featured-element-first");if(g(v).hasClass("featured-element")){g(v).addClass("featured-element-clear");t+=2;}else{g(u).addClass("featured-element-clear");t++;}}}return{init:function(){if(g("#frm-search input").get(0)){h();}if(g(".element-aside .link").get(0)){c();}if(g(".faq .qa").get(0)){f();}if(g("#page-menu .menu .collapsed:not(.selected)").get(0)){l();}if(g("#main-content .gmini").get(0)){n();}if(g("#main-content .featured-element").get(0)){b();}},onAfterVideosSet:function(s){p(s);}};}(jQuery);
/**
 * @name InfoBox
 * @version 1.0.2 [June 26, 2010]
 * @author Gary Little (inspired by proof-of-concept code from Pamela Fox of Google)
 * @copyright Copyright 2010 Gary Little [gary at luxcentral.com]
 * @fileoverview InfoBox extends the Google Maps JavaScript API V3 <tt>OverlayView</tt> class.
 */

/*
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function InfoBox(A){A=A||{};google.maps.OverlayView.apply(this,arguments);this.content_=A.content||"";this.disableAutoPan_=A.disableAutoPan||false;this.maxWidth_=A.maxWidth||0;this.pixelOffset_=A.pixelOffset||new google.maps.Size(0,0);this.position_=A.position||new google.maps.LatLng(0,0);this.zIndex_=A.zIndex||null;this.boxStyle_=A.boxStyle||{};this.closeBoxMargin_=A.closeBoxMargin||"2px";this.closeBoxURL_=A.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif";if(A.closeBoxURL===""){this.closeBoxURL_="";}this.infoBoxClearance_=A.infoBoxClearance||new google.maps.Size(1,1);this.isHidden_=A.isHidden||false;this.pane_=A.pane||"floatPane";this.enableEventPropagation_=A.enableEventPropagation||false;this.div_=null;this.closeListener_=null;this.eventListener1_=null;this.eventListener2_=null;this.eventListener3_=null;this.contextListener_=null;this.fixedWidthSet_=null;}function loadInfoBox(){InfoBox.prototype=new google.maps.OverlayView();InfoBox.prototype.createInfoBoxDiv_=function(){var D;var A=this;var B=function(E){E.cancelBubble=true;if(E.stopPropagation){E.stopPropagation();}};var C=function(E){E.returnValue=false;if(E.preventDefault){E.preventDefault();}if(!A.enableEventPropagation_){B(E);}};if(!this.div_){this.div_=document.createElement("div");this.setBoxStyle_();this.div_.style.position="absolute";this.div_.style.visibility="hidden";if(this.zIndex_!==null){this.div_.style.zIndex=this.zIndex_;}if(typeof this.content_.nodeType==="undefined"){this.div_.innerHTML=this.getCloseBoxImg_()+this.content_;}else{this.div_.innerHTML=this.getCloseBoxImg_();this.div_.appendChild(this.content_);}this.getPanes()[this.pane_].appendChild(this.div_);this.addClickHandler_();if(this.div_.style.width){this.fixedWidthSet_=true;}else{if(this.maxWidth_!==0&&this.div_.offsetWidth>this.maxWidth_){this.div_.style.width=this.maxWidth_;this.div_.style.overflow="auto";this.fixedWidthSet_=true;}else{D=this.getBoxWidths_();this.div_.style.width=(this.div_.offsetWidth-D.left-D.right)+"px";this.fixedWidthSet_=false;}}this.panBox_(this.disableAutoPan_);if(!this.enableEventPropagation_){this.eventListener1_=google.maps.event.addDomListener(this.div_,"mousedown",B);this.eventListener2_=google.maps.event.addDomListener(this.div_,"click",B);this.eventListener3_=google.maps.event.addDomListener(this.div_,"dblclick",B);}this.contextListener_=google.maps.event.addDomListener(this.div_,"contextmenu",C);google.maps.event.trigger(this,"domready");}};InfoBox.prototype.getCloseBoxImg_=function(){var A="";if(this.closeBoxURL_!==""){A="<img";A+=" src='"+this.closeBoxURL_+"'";A+=" align=right";A+=" style='";A+=" position: relative;";A+=" cursor: pointer;";A+=" margin: "+this.closeBoxMargin_+";";A+="'>";}return A;};InfoBox.prototype.addClickHandler_=function(){var A;if(this.closeBoxURL_!==""){A=this.div_.firstChild;this.closeListener_=google.maps.event.addDomListener(A,"click",this.getCloseClickHandler_());}else{this.closeListener_=null;}};InfoBox.prototype.getCloseClickHandler_=function(){var A=this;return function(){A.close();google.maps.event.trigger(A,"closeclick");};};InfoBox.prototype.panBox_=function(A){if(!A){var Y=this.getMap();var F=Y.getBounds();var S=Y.getDiv();var U=S.offsetWidth;var R=S.offsetHeight;var Z=F.toSpan();var T=Z.lng();var J=Z.lat();var M=T/U;var I=J/R;var H=F.getSouthWest().lng();var O=F.getNorthEast().lng();var X=F.getNorthEast().lat();var C=F.getSouthWest().lat();var a=this.position_;var G=this.pixelOffset_.width;var E=this.pixelOffset_.height;var N=this.infoBoxClearance_.width;var L=this.infoBoxClearance_.height;var B=a.lng()+(G-N)*M;var D=a.lng()+(G+this.div_.offsetWidth+N)*M;var Q=a.lat()-(E-L)*I;var K=a.lat()-(E+this.div_.offsetHeight+L)*I;var P=(B<H?H-B:0)+(D>O?O-D:0);var W=(Q>X?X-Q:0)+(K<C?C-K:0);if(!(W===0&&P===0)){var V=Y.getCenter();Y.setCenter(new google.maps.LatLng(V.lat()-W,V.lng()-P));}}};InfoBox.prototype.setBoxStyle_=function(){var A;var B=this.boxStyle_;for(A in B){if(B.hasOwnProperty(A)){this.div_.style[A]=B[A];}}if(typeof this.div_.style.opacity!=="undefined"){this.div_.style.filter="alpha(opacity="+(this.div_.style.opacity*100)+")";}};InfoBox.prototype.getBoxWidths_=function(){var A;var C={top:0,bottom:0,left:0,right:0};var B=this.div_;if(document.defaultView&&document.defaultView.getComputedStyle){A=B.ownerDocument.defaultView.getComputedStyle(B,"");if(A){C.top=parseInt(A.borderTopWidth,10)||0;C.bottom=parseInt(A.borderBottomWidth,10)||0;C.left=parseInt(A.borderLeftWidth,10)||0;C.right=parseInt(A.borderRightWidth,10)||0;}}else{if(document.documentElement.currentStyle){if(B.currentStyle){C.top=parseInt(B.currentStyle.borderTopWidth,10)||0;C.bottom=parseInt(B.currentStyle.borderBottomWidth,10)||0;C.left=parseInt(B.currentStyle.borderLeftWidth,10)||0;C.right=parseInt(B.currentStyle.borderRightWidth,10)||0;}}}return C;};InfoBox.prototype.onRemove=function(){if(this.div_){this.div_.parentNode.removeChild(this.div_);this.div_=null;}};InfoBox.prototype.draw=function(){this.createInfoBoxDiv_();var A=this.getProjection().fromLatLngToDivPixel(this.position_);this.div_.style.left=(A.x+this.pixelOffset_.width)+"px";this.div_.style.top=(A.y+this.pixelOffset_.height)+"px";if(this.isHidden_){this.div_.style.visibility="hidden";}else{this.div_.style.visibility="visible";}};InfoBox.prototype.setOptions=function(A){if(typeof A.boxStyle!=="undefined"){this.boxStyle_=A.boxStyle;this.setBoxStyle_();}if(typeof A.content!=="undefined"){this.setContent(A.content);}if(typeof A.disableAutoPan!=="undefined"){this.disableAutoPan_=A.disableAutoPan;}if(typeof A.maxWidth!=="undefined"){this.maxWidth_=A.maxWidth;}if(typeof A.pixelOffset!=="undefined"){this.pixelOffset_=A.pixelOffset;}if(typeof A.position!=="undefined"){this.setPosition(A.position);}if(typeof A.zIndex!=="undefined"){this.setZIndex(A.zIndex);}if(typeof A.closeBoxMargin!=="undefined"){this.closeBoxMargin_=A.closeBoxMargin;}if(typeof A.closeBoxURL!=="undefined"){this.closeBoxURL_=A.closeBoxURL;}if(typeof A.infoBoxClearance!=="undefined"){this.infoBoxClearance_=A.infoBoxClearance;}if(typeof A.isHidden!=="undefined"){this.isHidden_=A.isHidden;}if(typeof A.enableEventPropagation!=="undefined"){this.enableEventPropagation_=A.enableEventPropagation;}if(this.div_){this.draw();}};InfoBox.prototype.setContent=function(A){this.content_=A;if(this.div_){if(this.closeListener_){google.maps.event.removeListener(this.closeListener_);this.closeListener_=null;}if(!this.fixedWidthSet_){this.div_.style.width="";}if(typeof A.nodeType==="undefined"){this.div_.innerHTML=this.getCloseBoxImg_()+A;}else{this.div_.innerHTML=this.getCloseBoxImg_();this.div_.appendChild(A);}if(!this.fixedWidthSet_){this.div_.style.width=this.div_.offsetWidth+"px";this.div_.innerHTML=this.getCloseBoxImg_()+A;}this.addClickHandler_();}google.maps.event.trigger(this,"content_changed");};InfoBox.prototype.setPosition=function(A){this.position_=A;if(this.div_){this.draw();}google.maps.event.trigger(this,"position_changed");};InfoBox.prototype.setZIndex=function(A){this.zIndex_=A;if(this.div_){this.div_.style.zIndex=A;}google.maps.event.trigger(this,"zindex_changed");};InfoBox.prototype.getContent=function(){return this.content_;};InfoBox.prototype.getPosition=function(){return this.position_;};InfoBox.prototype.getZIndex=function(){return this.zIndex_;};InfoBox.prototype.show=function(){this.isHidden_=false;this.div_.style.visibility="visible";};InfoBox.prototype.hide=function(){this.isHidden_=true;this.div_.style.visibility="hidden";};InfoBox.prototype.open=function(B,A){if(A){this.position_=A.getPosition();}this.setMap(B);if(this.div_){this.panBox_();}};InfoBox.prototype.close=function(){if(this.closeListener_){google.maps.event.removeListener(this.closeListener_);this.closeListener_=null;}if(this.eventListener1_){google.maps.event.removeListener(this.eventListener1_);google.maps.event.removeListener(this.eventListener2_);google.maps.event.removeListener(this.eventListener3_);this.eventListener1_=null;this.eventListener2_=null;this.eventListener3_=null;}if(this.contextListener_){google.maps.event.removeListener(this.contextListener_);this.contextListener_=null;}this.setMap(null);};}
var Project=function(H){var R;var A;var P=125;var Y;var B;var S=[];var F;var C;var M="/images/project/marker.png";var E=new Image();if(E){E.src=M;}var J;var c;var Q;var V;var b=-1;var O=H.template('<div class="infoWindow"><div class="content"><h2><span>${name}</span></h2><a class="close" onclick="Project.closeInfoWindow();"><span>&nbsp;</span></a><div class="hr"><hr /></div><div class="wrap clearfix">${html}</div></div></div>');function X(d){R=d;}function N(d){return R;}function I(){if(Y){var d=N();d.mapTypeId=google.maps.MapTypeId.SATELLITE;C=new google.maps.Map(H("#map-canvas").get(0),N());Z();}B=true;}function Z(){if(C&&F){loadInfoBox();var f;for(var e=0,d=S.length;e<d;e++){f=S[e];a(f,e+1);}google.maps.event.addListener(C,"bounds_changed",function(){b--;if(b==0){C.panBy(28,102);window.setTimeout(K,P*2);}});}else{window.setTimeout(Z,P);}}function a(k,i){var e=new google.maps.LatLng(k.coord.lat,k.coord.lng);var g=new google.maps.Marker({position:e,map:C,icon:M});var h="";var d="project-"+i;if(k.image){h+='<div class="image-container"><img src="'+k.image+'" width="220" height="147" /></div>';}if(k.facts){h+=k.facts;}if(k.content){h+=k.content;}var j=O.apply({name:k.name,html:h});H(document.body).append('<div style="display: none;" id="'+d+'">'+j+"</div>");Cufon.replace("#"+d+" .infoWindow h2 span",{fontFamily:"crank"});var f=new InfoBox({"class":"infoWindow",content:j,width:210,height:285,pane:"mapPane",disableAutoPan:true});var l=Number(k.coord.zoom);google.maps.event.addListener(g,"click",function(){if(J&&c){try{J.close();}catch(m){}}J=Q=V=null;J=f;Q=g;V=k;b=2;C.setCenter(e);if(C.getZoom()==l){b=1;}else{C.setZoom(l);}});}function K(){J.open(C,Q);c=true;window.setTimeout(G,P);}function G(){if(H("#main-content .infoWindow").get(0)){H("#main-content .infoWindow").parent().parent().css("z-index",1000);H("#main-content .infoWindow").prev("img").css("display","none");}else{window.setTimeout(G,P);}}function U(h){var f="http://maps.google.com/maps/api/js?sensor=false&language="+h;try{document.write('<script type="text/javascript" src="'+f+'"><\/script>');}catch(g){var d=document.createElement("script");d.type="text/javascript";d.src=f;document.getElementsByTagName("head")[0].appendChild(d);}A=window.setInterval(T,P);}function D(d){H.ajax({type:"GET",url:d,dataType:"xml",contentType:"text/xml",success:L,error:W});}function L(j){var h=H(j).find("project"),f,k;var g=new RegExp("<p");for(var e=0,d=h.length;e<d;e++){f=h[e];k={};k.coord={};k.name=H(f).find("name").text();if(H(f).find("facts").get(0)){k.facts=H(f).find("facts").text();}if(H(f).find("content").get(0)){k.content=H(f).find("content").text();if(!g.test(k.content)){k.content="<p>"+k.content+"</p>";}}if(H(f).find("img").get(0)){k.image=H(f).find("img").attr("src");}if(H(f).find("coord").get(0)){k.coord.lat=H(f).find("coord lat").text();k.coord.lng=H(f).find("coord lng").text();k.coord.zoom=H(f).find("coord zoom").text();}S[S.length]=k;}F=true;}function W(d,f,e){}function T(){try{var e=N();e.center=new google.maps.LatLng(e.lat,e.lng);X(e);window.clearInterval(A);Y=true;if(B){I();}}catch(d){}}return{setup:function(h,f,g,e,d){d=d||{};d.zoom=g;d.lat=h;d.lng=f;d.language=d.language||"no";X(d);U(d.language);D(e);H(document).ready(I);},getMap:function(){return C;},closeInfoWindow:function(){try{J.close();c=false;}catch(d){}}};}(jQuery);
/* Statkraft namespace */
var Statkraft = {};
Statkraft.VideoPlayer=function(E){var G={onAfterSetVideos:E.noop,onAfterPlay:E.noop,onAfterPause:E.noop,onAfterStop:E.noop};var I=null,H=null;var F=10;function A(M){H=M;}function D(M,N){M=C(M);if(typeof (G[M])!="undefined"){G[M]=N;}}function L(M){M=C(M);J(G[M],G[M],Array.prototype.slice.apply(arguments,[1]));}function C(M){return"onAfter"+M.substr(0,1).toUpperCase()+M.substr(1,M.length);}function B(M){I=M;}function K(M){J(I[M],I,Array.prototype.slice.apply(arguments,[1]));}function J(O,N,M){setTimeout(function(){O.apply(N,M);},F);}return{addCallback:function(M,N){D(M,N);},setVideos:function(Q){var R=E("object"),P;for(var O=0,M=R.length;O<M;O++){P=R[O];try{P=swfobject.getObjectById(E(P).attr("id"));P.playNoop();B(P);break;}catch(N){}}A(Q);L("setVideos",Q);},setVideo:function(M){K("setVideo",M);},play:function(){K("play");},pause:function(){K("pause");},stop:function(){K("stop");}};}(jQuery);

Cufon.replace('.title span', { fontFamily: 'crank' });
Cufon.replace('.aside .menu a span', { fontFamily: 'crank'});
Cufon.replace('.description span', { fontFamily: 'crank_light' });
Cufon.replace('#context-nav a span', { fontFamily: 'crank_light', hover: true, hoverables: { span: true }});
Cufon.replace('#featured h3 span', { fontFamily: 'crank' });
Cufon.replace('#featured p span', { fontFamily: 'crank' });
Cufon.replace('.ingress span', { fontFamily: 'crank_light' });
Cufon.replace('#main-content form h2', { fontFamily: 'crank_light' });
Statkraft.VideoPlayer.addCallback("setVideos", Page.content.onAfterVideosSet);
jQuery(document).ready(function(){
  Page.content.init();
});

