/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (MIT_LICENSE.txt)
 * and GPL Version 2 (GPL_LICENSE.txt) licenses.
 */
(function(a){a.extend(a.fn,{livequery:function(e,d,c){var b=this,f;if(a.isFunction(e)){c=d,d=e,e=undefined}a.each(a.livequery.queries,function(g,h){if(b.selector==h.selector&&b.context==h.context&&e==h.type&&(!d||d.$lqguid==h.fn.$lqguid)&&(!c||c.$lqguid==h.fn2.$lqguid)){return(f=h)&&false}});f=f||new a.livequery(this.selector,this.context,e,d,c);f.stopped=false;f.run();return this},expire:function(e,d,c){var b=this;if(a.isFunction(e)){c=d,d=e,e=undefined}a.each(a.livequery.queries,function(f,g){if(b.selector==g.selector&&b.context==g.context&&(!e||e==g.type)&&(!d||d.$lqguid==g.fn.$lqguid)&&(!c||c.$lqguid==g.fn2.$lqguid)&&!this.stopped){a.livequery.stop(g.id)}});return this}});a.livequery=function(b,d,f,e,c){this.selector=b;this.context=d;this.type=f;this.fn=e;this.fn2=c;this.elements=[];this.stopped=false;this.id=a.livequery.queries.push(this)-1;e.$lqguid=e.$lqguid||a.livequery.guid++;if(c){c.$lqguid=c.$lqguid||a.livequery.guid++}return this};a.livequery.prototype={stop:function(){var b=this;if(this.type){this.elements.unbind(this.type,this.fn)}else{if(this.fn2){this.elements.each(function(c,d){b.fn2.apply(d)})}}this.elements=[];this.stopped=true},run:function(){if(this.stopped){return}var d=this;var e=this.elements,c=a(this.selector,this.context),b=c.not(e);this.elements=c;if(this.type){b.bind(this.type,this.fn);if(e.length>0){a.each(e,function(f,g){if(a.inArray(g,c)<0){a.event.remove(g,d.type,d.fn)}})}}else{b.each(function(){d.fn.apply(this)});if(this.fn2&&e.length>0){a.each(e,function(f,g){if(a.inArray(g,c)<0){d.fn2.apply(g)}})}}}};a.extend(a.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if(a.livequery.running&&a.livequery.queue.length){var b=a.livequery.queue.length;while(b--){a.livequery.queries[a.livequery.queue.shift()].run()}}},pause:function(){a.livequery.running=false},play:function(){a.livequery.running=true;a.livequery.run()},registerPlugin:function(){a.each(arguments,function(c,d){if(!a.fn[d]){return}var b=a.fn[d];a.fn[d]=function(){var e=b.apply(this,arguments);a.livequery.run();return e}})},run:function(b){if(b!=undefined){if(a.inArray(b,a.livequery.queue)<0){a.livequery.queue.push(b)}}else{a.each(a.livequery.queries,function(c){if(a.inArray(c,a.livequery.queue)<0){a.livequery.queue.push(c)}})}if(a.livequery.timeout){clearTimeout(a.livequery.timeout)}a.livequery.timeout=setTimeout(a.livequery.checkQueue,20)},stop:function(b){if(b!=undefined){a.livequery.queries[b].stop()}else{a.each(a.livequery.queries,function(c){a.livequery.queries[c].stop()})}}});a.livequery.registerPlugin("append","prepend","after","before","wrap","attr","removeAttr","addClass","removeClass","toggleClass","empty","remove","html");a(function(){a.livequery.play()})})(jQuery);


/////////////// WICKEDWEB INLINE FLASH REPLACEMENT (WWIFR) v1.3 | COPYRIGHT WICKEDWEB ///////////////

if(document.createStyleSheet){document.createStyleSheet("/static/css/wwifr.css")}else{$("head").append('<link href="/static/css/wwifr.css" rel="stylesheet" type="text/css" />')}function setDimensions(a,b,c){$("#"+c).height(a).attr("height",a).width(b).attr("width",b)}function toHex(a){if(a===null){return"00"}a=parseInt(a);if(a===0||isNaN(a)){return"00"}a=Math.max(0,a);a=Math.min(a,255);a=Math.round(a);return"0123456789ABCDEF".charAt((a-a%16)/16)+"0123456789ABCDEF".charAt(a%16)}function RGBtoHex(b,a,c){return"#"+toHex(b)+toHex(a)+toHex(c)}function RGB(b){var a="";if(b.indexOf("#")<=-1){for(i=0;i<b.length;i++){if(parseInt(b.charAt(i))%1===0||b.charAt(i)==","){a+=b.charAt(i)}}nc=a.split(",");b=RGBtoHex(nc[0],nc[1],nc[2])}return b}function rgbHTML(a){a=a.replace(/rgb\((.*?)\)/g,function(b,d){return RGB(d)});return a}function reformHTML(e){e=e.replace(/< *\/?(\w+)/g,function(h){return h.toLowerCase()});var g=/<\w+[^>]+>/g;var d,c="",b="",f="",a=0;while((d=g.exec(e))!==null){c+=e.substring(a,d.index);b=d[0];if(/; *charset *=/i.test(b)===false){b=b.replace(/\= *([^"\s]+(?=[ >]))/g,'="$1"')}b=b.replace(/[\w-]+ *\= */g,function(h){return h.toLowerCase()});b=b.replace(/style *\= *"[^"]+/g,function(h){if(h.charAt(h.length-1)!=";"){h+=";"}h=h.replace(/: /gi,":").replace(/:(.*?);/gi,'="$1"').replace(/font-size/gi,"size");return h.toLowerCase()});c+=b;a=g.lastIndex}c+=e.substring(a);c=c.replace(/<span style="(.*?)">/g,"<font $1>").replace(/<\/span>/g,"</font>").replace(/&nbsp;/g," ").replace(/<em>(.*?)<\/em>/g,"<i>$1</i>").replace(/<strong>(.*?)<\/strong>/g,"<b>$1</b>").replace(/\+/g,"&#43;").replace(/%/g,"&#37;");return c}var wwifrCount=0;function replaceText(a,g,k,h,m,e,o,j,n,l,c,f,d,b){$(a).livequery(function(p){if($.flash.hasVersion(8)){$(this).not(g).each(function(x){wwifrCount+=1;a=a.replace(/[^a-zA-Z 0-9]+/g,"");var y="wwifr"+wwifrCount;var t=$(this).html();var A=t;var z=$(this).parent().width();var s=$(this).height();var r=$(this).attr("href");var v=$(this).css("text-align");var u=$(this).css("font-size").replace(/[a-z]/g,"");var q=rgbHTML($(this).css("color"));if(m==""||m===null){m=$(this).css("font-weight")}if(document.location.href.indexOf("file:///")>-1){var w=false}else{var w=true}t=reformHTML(t);t=rgbHTML(t);Flash=$.flash.create({swf:h+k+".swf",width:z,height:s,expressInstaller:h+"expressInstall.swf",flashvars:{ID:y,Text:t,Link:r,Width:z,Height:s,Size:u,Colour:q,LinkColour:e,LinkHoverColour:o,LinkDecoration:j,LinkHoverDecoration:n,Weight:m,LineHeight:l,Spacing:c,Align:v,Zoom:f,OffsetX:d,OffsetY:b,Live:w},params:{wmode:"transparent"}});$(this).html(Flash);if(w===true){$(this).find("object").attr("id",y).attr("name",y);$(this).mouseover(function(){$(this).find("object").focus()});$(this).mouseout(function(){$(this).find("object").flash(function(){this.SetVariable("resetvar",0)});$(this).find("object").blur()})}$(this).append('<span class="wwifr">'+A+"</span>");$(this).css("visibility","visible")})}else{$(theClass).css("visibility","visible")}})};


// selector*, not, font*, path*, fontWeight, linkColor, linkHoverColor, linkDecoration, linkHoverDecoration, lineHeight(0 = normal)*, letterSpacing(0 = normal), zoom(1 = 100%), xOffset, yOffset* //

replaceText('#navigation .navoff', '', 'helvetica', '/static/flash/', 'bold', '#FFFFFF', '#000000', '', '', '0', '0', '1', '-2', '-2');
replaceText('#navigation .navon', '', 'helvetica', '/static/flash/', 'bold', '#000000', '#000000', '', '', '0', '0', '1', '-2', '-2');
replaceText('#navigation .navparent', '', 'helvetica', '/static/flash/', 'bold', '#000000', '#000000', '', '', '0', '0', '1', '-2', '-2');
replaceText('.title', '', 'helvetica', '/static/flash/', 'bold', '', '', '', '', '0', '0', '1', '-2', '-2');
replaceText('.titleSlider', '', 'helvetica', '/static/flash/', 'bold', '', '', '', '', '0', '0', '1', '-2', '-2');
replaceText('.text', '', 'helvetica', '/static/flash/', 'bold', '', '', '', '', '0', '0', '1', '-2', '-2');
replaceText('h2', '', 'helvetica', '/static/flash/', 'bold', '', '', '', '', '0', '0', '1', '-2', '-2');
replaceText('h3', '', 'helvetica', '/static/flash/', 'bold', '', '', '', '', '0', '0', '1', '-2', '-2');
replaceText('.weatherFactor', '', 'helvetica', '/static/flash/', 'bold', '#FFFFFF', '#000000', '', '', '0', '0', '1', '-2', '-2');