/** Squeezebox **/
var SqueezeBox={presets:{onOpen:$empty,onClose:$empty,onUpdate:$empty,onResize:$empty,onMove:$empty,onShow:$empty,onHide:$empty,size:{x:600,y:450},sizeLoading:{x:200,y:150},marginInner:{x:20,y:20},marginImage:{x:50,y:75},handler:false,target:null,closable:true,closeBtn:true,zIndex:65555,overlayOpacity:0.7,classWindow:"",classOverlay:"",overlayFx:{},resizeFx:{},contentFx:{},parse:false,parseSecure:false,shadow:true,document:null,ajaxOptions:{}},initialize:function(a){if(this.options){return this}this.presets=$merge(this.presets,a);this.doc=this.presets.document||document;this.options={};this.setOptions(this.presets).build();this.bound={window:this.reposition.bind(this,[null]),scroll:this.checkTarget.bind(this),close:this.close.bind(this),key:this.onKey.bind(this)};this.isOpen=this.isLoading=false;return this},build:function(){this.overlay=new Element("div",{id:"sbox-overlay",styles:{display:"none",zIndex:this.options.zIndex}});this.win=new Element("div",{id:"sbox-window",styles:{display:"none",zIndex:this.options.zIndex+2}});if(this.options.shadow){if(Browser.Engine.webkit420){this.win.setStyle("-webkit-box-shadow","0 0 10px rgba(0, 0, 0, 0.7)")}else{if(!Browser.Engine.trident4){var b=new Element("div",{"class":"sbox-bg-wrap"}).inject(this.win);var a=function(c){this.overlay.fireEvent("click",[c])}.bind(this);["n","ne","e","se","s","sw","w","nw"].each(function(c){new Element("div",{"class":"sbox-bg sbox-bg-"+c}).inject(b).addEvent("click",a)})}}}this.content=new Element("div",{id:"sbox-content"}).inject(this.win);this.closeBtn=new Element("a",{id:"sbox-btn-close",href:"#"}).inject(this.win);
this.fx={overlay:new Fx.Tween(this.overlay,$merge({property:"opacity",onStart:Events.prototype.clearChain,duration:250,link:"cancel"},this.options.overlayFx)).set(0),win:new Fx.Morph(this.win,$merge({onStart:Events.prototype.clearChain,unit:"px",duration:750,transition:Fx.Transitions.Quint.easeOut,link:"cancel",unit:"px"},this.options.resizeFx)),content:new Fx.Tween(this.content,$merge({property:"opacity",duration:250,link:"cancel"},this.options.contentFx)).set(0)};$(this.doc.body).adopt(this.overlay,this.win)},assign:function(b,a){return($(b)||$$(b)).addEvent("click",function(){return !SqueezeBox.fromElement(this,a)})},open:function(c,b){this.initialize();if(this.element!=null){this.trash()}this.element=$(c)||false;this.setOptions($merge(this.presets,b||{}));if(this.element&&this.options.parse){var e=this.element.getProperty(this.options.parse);if(e&&(e=JSON.decode(e,this.options.parseSecure))){this.setOptions(e)}}this.url=((this.element)?(this.element.get("href")):c)||this.options.url||"";this.assignOptions();var d=d||this.options.handler;if(d){return this.setContent(d,this.parsers[d].call(this,true))}var a=false;return this.parsers.some(function(h,f){var g=h.call(this);if(g){a=this.setContent(f,g);return true}return false},this)},fromElement:function(b,a){return this.open(b,a)},assignOptions:function(){this.overlay.set("class",this.options.classOverlay);this.win.set("class",this.options.classWindow);if(Browser.Engine.trident4){this.win.addClass("sbox-window-ie6")}},close:function(b){var a=($type(b)=="event");if(a){b.stop()}if(!this.isOpen||(a&&!$lambda(this.options.closable).call(this,b))){return this}this.fx.overlay.start(0).chain(this.toggleOverlay.bind(this));this.win.setStyle("display","none");this.fireEvent("onClose",[this.content]);this.trash();this.toggleListeners();this.isOpen=false;return this},trash:function(){this.element=this.asset=null;this.content.empty();this.options={};this.removeEvents().setOptions(this.presets).callChain()},onError:function(){this.asset=null;this.setContent("string",this.options.errorMsg||"An error occurred")},setContent:function(a,b){if(!this.handlers[a]){return false}this.content.className="sbox-content-"+a;this.applyTimer=this.applyContent.delay(this.fx.overlay.options.duration,this,this.handlers[a].call(this,b));if(this.overlay.retrieve("opacity")){return this}this.toggleOverlay(true);this.fx.overlay.start(this.options.overlayOpacity);return this.reposition()},applyContent:function(b,a){if(!this.isOpen&&!this.applyTimer){return}this.applyTimer=$clear(this.applyTimer);this.hideContent();if(!b){this.toggleLoading(true)}else{if(this.isLoading){this.toggleLoading(false)}this.fireEvent("onUpdate",[this.content],20)}if(b){if(["string","array"].contains($type(b))){this.content.set("html",b)}else{if(!this.content.hasChild(b)){this.content.adopt(b)}}}this.callChain();if(!this.isOpen){this.toggleListeners(true);this.resize(a,true);this.isOpen=true;this.fireEvent("onOpen",[this.content])}else{this.resize(a)}},resize:function(c,b){this.showTimer=$clear(this.showTimer||null);var d=this.doc.getSize(),a=this.doc.getScroll();
this.size=$merge((this.isLoading)?this.options.sizeLoading:this.options.size,c);var e={width:this.size.x,height:this.size.y,left:(a.x+(d.x-this.size.x-this.options.marginInner.x)/2).toInt(),top:(a.y+(d.y-this.size.y-this.options.marginInner.y)/2).toInt()};this.hideContent();if(!b){this.fx.win.start(e).chain(this.showContent.bind(this))}else{this.win.setStyles(e).setStyle("display","");this.showTimer=this.showContent.delay(50,this)}return this.reposition()},toggleListeners:function(b){var a=(b)?"addEvent":"removeEvent";this.closeBtn[a]("click",this.bound.close);this.overlay[a]("click",this.bound.close);this.doc[a]("keydown",this.bound.key)[a]("mousewheel",this.bound.scroll);this.doc.getWindow()[a]("resize",this.bound.window)[a]("scroll",this.bound.window)},toggleLoading:function(a){this.isLoading=a;this.win[(a)?"addClass":"removeClass"]("sbox-loading");if(a){this.fireEvent("onLoading",[this.win])}},toggleOverlay:function(b){var a=this.doc.getSize().x;this.overlay.setStyle("display",(b)?"":"none");this.doc.body[(b)?"addClass":"removeClass"]("body-overlayed");if(b){this.scrollOffset=this.doc.getWindow().getSize().x-a;this.doc.body.setStyle("margin-right",this.scrollOffset)}else{this.doc.body.setStyle("margin-right","")}},showContent:function(){if(this.content.get("opacity")){this.fireEvent("onShow",[this.win])}this.fx.content.start(1)},hideContent:function(){if(!this.content.get("opacity")){this.fireEvent("onHide",[this.win])}this.fx.content.cancel().set(0)},onKey:function(a){switch(a.key){case"esc":this.close(a);case"up":case"down":return false}},checkTarget:function(a){return this.content.hasChild(a.target)},reposition:function(){var c=this.doc.getSize(),a=this.doc.getScroll(),b=this.doc.getScrollSize();this.overlay.setStyles({width:b.x+"px",height:b.y+"px"});this.win.setStyles({left:(a.x+(c.x-this.win.offsetWidth)/2-this.scrollOffset).toInt()+"px",top:(a.y+(c.y-this.win.offsetHeight)/2).toInt()+"px"});return this.fireEvent("onMove",[this.overlay,this.win])},removeEvents:function(a){if(!this.$events){return this}if(!a){this.$events=null}else{if(this.$events[a]){this.$events[a]=null}}return this},extend:function(a){return $extend(this,a)},handlers:new Hash(),parsers:new Hash()};SqueezeBox.extend(new Events($empty)).extend(new Options($empty)).extend(new Chain($empty));SqueezeBox.parsers.extend({image:function(a){return(a||(/\.(?:jpg|png|gif)$/i).test(this.url))?this.url:false},clone:function(a){if($(this.options.target)){return $(this.options.target)}if(this.element&&!this.element.parentNode){return this.element}var b=this.url.match(/#([\w-]+)$/);return(b)?$(b[1]):(a?this.element:false)},ajax:function(a){return(a||(this.url&&!(/^(?:javascript|#)/i).test(this.url)))?this.url:false},iframe:function(a){return(a||this.url)?this.url:false},string:function(a){return true}});SqueezeBox.handlers.extend({image:function(a){var c,b=new Image();this.asset=null;b.onload=b.onabort=b.onerror=(function(){b.onload=b.onabort=b.onerror=null;if(!b.width){this.onError.delay(10,this);return}var e=this.doc.getSize();e.x-=this.options.marginImage.x;e.y-=this.options.marginImage.y;c={x:b.width,y:b.height};for(var d=2;d--;){if(c.x>e.x){c.y*=e.x/c.x;c.x=e.x}else{if(c.y>e.y){c.x*=e.y/c.y;c.y=e.y}}}c.x=c.x.toInt();c.y=c.y.toInt();this.asset=$(b);b=null;this.asset.width=c.x;this.asset.height=c.y;this.applyContent(this.asset,c)}).bind(this);b.src=a;if(b&&b.onload&&b.complete){b.onload()}return(this.asset)?[this.asset,c]:null},clone:function(a){if(a){return a.clone()}return this.onError()},adopt:function(a){if(a){return a}return this.onError()},ajax:function(b){var a=this.options.ajaxOptions||{};this.asset=new Request.HTML($merge({method:"get",evalScripts:false},this.options.ajaxOptions)).addEvents({onSuccess:function(c){this.applyContent(c);if(a.evalScripts!==null&&!a.evalScripts){$exec(this.asset.response.javascript)}this.fireEvent("onAjax",[c,this.asset]);this.asset=null}.bind(this),onFailure:this.onError.bind(this)});this.asset.send.delay(10,this.asset,[{url:b}])},iframe:function(a){this.asset=new Element("iframe",$merge({src:a,frameBorder:0,width:this.options.size.x,height:this.options.size.y},this.options.iframeOptions));if(this.options.iframePreload){this.asset.addEvent("load",function(){this.applyContent(this.asset.setStyle("display",""))}.bind(this));this.asset.setStyle("display","none").inject(this.content);return false}return this.asset},string:function(a){return a}});SqueezeBox.handlers.url=SqueezeBox.handlers.ajax;SqueezeBox.parsers.url=SqueezeBox.parsers.ajax;SqueezeBox.parsers.adopt=SqueezeBox.parsers.clone;


SqueezeBox.parsers.swf = function(preset) {
 // return (preset || this.url.test(/\.swf/)) ? this.url : false;
	return (preset || (/\.swf/).test(this.url)) ? this.url : false;
};

var FLIR={version:"2.0b3",options:{path:"",defaultStyle:null,ignoredEls:"BR,HR,IMG,INPUT,SELECT",bkgCheckForBlock:false,onreplacing:null,onreplaced:null,onreplacingchild:null,onreplacedchild:null},findEmbededFonts:false,dpi:96,flirElements:{},flirPlugins:[],isIE6:true,isIE:true,hoverEnabled:false,debug:false,init:function(a){if(typeof a!="undefined"){for(var b in a){this.options[b]=a[b]}}if(this.options.defaultStyle==null){this.options.defaultStyle=new FLIRStyle()}this.detectBrowser();this.calcDPI();if((this.findEmbededFonts=(typeof FLIR.discoverEmbededFonts=="function"))){this.discoverEmbededFonts()}this.hoverEnabled=(typeof this.addHover=="function");FLIR.pcall("init",arguments)},install:function(a){this.flirPlugins.push(a)},pcall:function(d,c){var a=c;for(var b=0;b<this.flirPlugins.length;b++){if(typeof this.flirPlugins[b][d]=="function"){var e=this.flirPlugins[b][d](a);if(typeof e=="undefined"){continue}if(typeof e=="boolean"&&e==false){return false}if(typeof e!="boolean"){a=c}}}var a=typeof a!="object"?[a]:a;if(a.length&&a[0]&&a[0].callee){return a[0]}else{return a}},prepare:function(f,b){if(!(args=FLIR.pcall("prepare",arguments))){return}f=args[0];if(f&&f.hasChildNodes()&&f.childNodes.length>1){for(var c=0;c<f.childNodes.length;c++){var e=f.childNodes[c];if(e&&e.nodeType==3){if(b){trimreg=c==0?/^\s+/g:/\s+$/g;e.innerHTML=e.innerHTML.replace(trimreg,"")}var d=document.createElement("SPAN");d.style.margin=d.style.padding=d.style.border="0";d.className="flir-span";d.flirSpan=true;if(e.nodeValue.match(/^[\n\r]+$/)){continue}var a=e.nodeValue.replace(/[\t\n\r]/g," ").replace(/\s\s+/g," ");d.innerHTML=!FLIR.isIE?a:e.nodeValue.replace(/^\s+|\s+$/g,"&nbsp;");f.replaceChild(d,e)}}}},replace:function(c,b){if(!(args=FLIR.pcall("replace",arguments))){return}c=args[0];b=args[1];if(!c||c.flirReplaced){return}if(!this.isFStyle(b)&&typeof b=="object"){b=new FLIRStyle(b)}else{if(!this.isFStyle(b)){b=this.options.defaultStyle}}if(typeof c=="string"){c=this.getElements(c)}if(typeof c.length!="undefined"){if(c.length==0){return}for(var a=0;a<c.length;a++){this.replace(c[a],b)}return}c.flirStyle=b;if(typeof FLIR.options.onreplacing=="function"){c=FLIR.options.onreplacing(c,b)}c.flirMainObj=true;this.saveObject(c);if(this.findEmbededFonts&&typeof this.embededFonts[b.getFont(c,FLIR.getStyle(c,"font-family"))]!="undefined"){return}FLIR.prepare(c);this._replace_tree(c,b);if(typeof FLIR.options.onreplaced=="function"){FLIR.options.onreplaced(c,b)}},_replace_tree:function(e,c){var d=!e.hasChildNodes()||(e.hasChildNodes()&&e.childNodes.length==1&&e.childNodes[0].nodeType==3)?[e]:e.childNodes;var a;for(var b=0;b<d.length;b++){a=d[b];if(typeof FLIR.options.onreplacingchild=="function"){a=FLIR.options.onreplacingchild(a,c)}if(!a.innerHTML||a.nodeType!=1){continue}if(FLIR.isIgnoredEl(a)){continue}if(a.flirReplaced){continue}if(FLIR.hoverEnabled&&a.nodeName=="A"&&!a.flirHasHover){FLIR.addHover(a)}if(a.hasChildNodes()&&(a.childNodes.length>1||a.childNodes[0].nodeType!=3)){FLIR.prepare(a);FLIR._replace_tree(a,c);continue}if(a.innerHTML==""){continue}var f=c.options.output;if(FLIR.isIE6&&(a.flirIE6PNG=(f=="png"||(f=="auto"&&FLIR.getStyle(a,"background-color")=="transparent")))){FLIR._Rimg(a,c,true)}else{if(c.replaceBackground){FLIR._Rbkg(a,c)}else{FLIR._Rimg(a,c)}}a.className+=" flir-replaced";a.flirReplaced=true;if(typeof FLIR.options.onreplacedchild=="function"){FLIR.options.onreplacedchild(e,c)}}},_Rbkg:function(e,d){if(!(args=FLIR.pcall("replaceBackground",arguments))){return}e=args[0];d=args[1];var c=this.saveObject(e);var a=d.URL(e);if(FLIR.options.bkgCheckForBlock){if(FLIR.getStyle(e,"display")!="block"){e.style.display="block"}}var b=new Image();b.onload=function(){FLIR.flirElements[c].style.width=this.width+"px";FLIR.flirElements[c].style.height=this.height+"px";if(FLIR.hoverEnabled&&d!=d.hoverStyle){var f=new Image();e.flirHoverURL=f.src=d.hoverStyle.URL(e)}};b.src=a;e.style.background='url("'+a.replace(/ /g,"%20")+'") no-repeat';e.flirOrig=a;e.oldTextIndent=e.style.textIndent;e.style.textIndent="-9999px"},_Rimg:function(f,e,d){if(!(args=FLIR.pcall("replaceMethodOverlay",arguments))){return}f=args[0];e=args[1];var c=this.saveObject(f);var a=document.createElement("IMG");var b=e.URL(f);a.alt=f.innerHTML;if(FLIR.hoverEnabled&&e!=e.hoverStyle){a.onload=function(){var g=new Image();f.flirHoverURL=g.src=e.hoverStyle.URL(f,a.alt)}}if(a.onerror){a.onerror=function(){var g=document.createElement("SPAN");g.innerHTML=a.alt;try{f.replaceChild(g,a)}catch(h){}}}a.flirImage=true;a.className="flir-image";a.style.border="none";if(d){a.src=this.options.path+"spacer.png";if(f.offsetWidth){a.style.width=f.offsetWidth+"px";a.style.height=f.offsetHeight+"px"}a.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+b+'", sizingMethod="image")';f.flirOrig=b}else{a.src=b;f.flirOrig=a.src}f.innerHTML="";f.appendChild(a)},saveObject:function(a){if(typeof a.flirId=="undefined"){a.flirId=this.generateUID();this.flirElements[a.flirId]=a}return a.flirId},generateUID:function(){var a="flir-";if(typeof __flir_uid_count=="undefined"){__flir_uid_count=0}else{__flir_uid_count++}return a+__flir_uid_count},calcDPI:function(){if(screen.logicalXDPI){var b=parseInt(screen.logicalXDPI)}else{var d=document.cookie.match(/<dpi>(\d+)<\/dpi>/);if(d){this.dpi=d[1];return}var c=document.createElement("DIV");c.style.position="absolute";c.style.visibility="hidden";c.style.border=c.style.padding=c.style.margin="0";c.style.height=c.style.width="1in";document.body.appendChild(c);var b=parseInt(c.offsetHeight);document.body.removeChild(c);var a=new Date();a.setDate(new Date().getDate()+365);document.cookie="dpi=<dpi>"+this.dpi+"</dpi>;expires="+a.toGMTString()+";path=/"}if(b>0){this.dpi=b}},isIgnoredEl:function(a){return((","+this.options.ignoredEls+",").indexOf(","+a.nodeName+",")>-1)},sanitizeHTML:function(a){return a.replace(/<[^>]+>/g,"")},isFStyle:function(a){if(!a){return false}return(typeof a.cssMap!="undefined")}};__flirstyle_instances=0;function FLIRStyle(a,c){__flirstyle_instances++;this.uid=__flirstyle_instances;this.replaceBackground=false;this.hoverStyle=c&&FLIR.isFStyle(c)?c:this;this.options={};this.defaults={mode:"static",output:"auto",fixBaseline:false,hq:false,css:{}};this.cssMap={"background-color":"Background",color:"Color","font-family":"Font","font-size":"FontSize","letter-spacing":"Measurement","line-height":"LineHeight","text-align":"Default","font-stretch":"Default","font-style":"FontStyle","font-variant":"Default","font-weight":"Weight",opacity:"Default","text-decoration":"Default"};for(var b in this.defaults){this.options[b]=this.defaults[b]}if(a&&typeof a.css=="string"){a.css=this.parse_css_string(a.css)}this.loadopts(a)}FLIRStyle.prototype.loadopts=function(b){for(var c in this.cssMap){this.options.css[c]=null}if(typeof this.loadopts_compat=="function"){b=this.loadopts_compat(b)}if(typeof b!="undefined"){for(var c in b){if(b[c]==null){continue}if(typeof this[c]!="undefined"){this[c]=b[c]}else{if(c=="css"){for(var a in b[c]){prop=a.replace(/[A-Z]/g,function(d){return"-"+d.toLowerCase()});this.options[c][prop]=b[c][a]}}else{this.options[c]=b[c]}}}}};FLIRStyle.prototype.parse_css_string=function(c){var d=c.split(";");var a={};var e;for(var b=0;b<d.length;b++){if(d[b].indexOf(":")<0){continue}e=d[b].split(":");a[e[0].replace(/^\s+|\s+$/,"")]=e[1].replace(/^\s+|\s+$/,"")}return a};FLIRStyle.prototype.URL=function(d){var c=(arguments[1]?arguments[1]:d.innerHTML);var b=this.options.css["text-transform"];if(b==null){b=FLIR.getStyle(d,"text-transform")}switch(b){case"capitalize":c=c.replace(/\w+/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()});break;case"lowercase":c=c.toLowerCase();break;case"uppercase":c=c.toUpperCase().replace(/&[a-z0-9]+;/gi,function(e){return e.toLowerCase()});break}c=this.encodeText(c,d.flirIE6PNG);var a=FLIR.options.path+"generate.php?t="+c+"&h="+d.offsetHeight+"&w="+d.offsetWidth+"&c="+this.flattenCSS(d)+"&d="+FLIR.dpi+"&f="+this.serialize();if(FLIR.debug){a+="&rand="+(Math.random()*Math.random())}return a};FLIRStyle.prototype.encodeText=function(b,a){b=encodeURIComponent(b.replace(/&/g,"{*A}").replace(/\+/g,"{*P}").replace(/\(/g,"{*LP}").replace(/\)/g,"{*RP}"));if(a){b=escape(b)}return b};FLIRStyle.prototype.serialize=function(){var b="";for(var a in this.options){if(a=="css"){continue}b+=',"'+a+'":"'+this.options[a].toString().replace(/"/g,"'")+'"'}return encodeURIComponent("{"+b.substr(1)+"}")};FLIRStyle.prototype.flattenCSS=function(d){var a=this.copyObject(this.options.css);for(var c in this.cssMap){this.options.css[c]=this.get(d,c,this.cssMap[c])}var b="";for(var c in this.options.css){if(this.options.css[c]==null||typeof this.options.css[c]=="undefined"){this.options.css[c]=""}b+="|"+encodeURIComponent(this.options.css[c].toString().replace(/|/g,""))}b=b.substr(1);this.options.css=a;return b};FLIRStyle.prototype.get=function(g,a,d){var c="get"+d;while(g.flirSpan&&g!=document.body){g=FLIR.getParentNode(g)}var e=this.options.css[a];var f=!e||e==null?FLIR.getStyle(g,a):this.options.css[a];var b=typeof this[c]=="function"?this[c](g,f):f;return b=="normal"||b=="none"||b=="start"?"":b};FLIRStyle.prototype.getFontStyle=function(b,a){return(b.nodeName=="EM"||FLIR.getParentNode(b).nodeName=="EM"?"italic":a)=="italic"?"1":""};FLIRStyle.prototype.getBackground=function(d,c){if(this.options.output=="gif"&&c.search(/^(transparent|none)$/i)>-1){var b=FLIR.getParentNode(d);var a=FLIR.getStyle(b,"background-color");if(typeof __flirstyle_root_obj=="undefined"){__flirstyle_root_obj=FLIR.getParentNode(document.body)}while(a.search(/^(transparent|none)$/i)>-1&&b!=__flirstyle_root_obj){b=FLIR.getParentNode(b);a=FLIR.getStyle(b,"background-color")}return this.getColor(d,a)}else{return this.getColor(d,c)}};FLIRStyle.prototype.getWeight=function(c,b){var a=c.nodeName=="STRONG"||FLIR.getParentNode(c).nodeName=="STRONG"?"bold":b;switch(a.toString()){case"100":case"200":case"300":case"lighter":return"-1";case"400":case"normal":return"";case"500":case"600":case"700":case"bold":return"1";case"800":case"900":case"bolder":return"2"}};FLIRStyle.prototype.getLineHeight=function(c,b){var a=this.getMeasurement(c,b)/c.flirFontSize;return Math.round((a*100000))/100000};FLIRStyle.prototype.getFont=function(b,a){if(a.indexOf(",")){a=a.split(",")[0]}return a.replace(/['"]/g,"").toLowerCase()};FLIRStyle.prototype.getColor=function(b,a){switch(a){case"transparent":case"none":return"";default:if(a.substr(0,1)=="#"){a=a.substr(1)}return a.replace(/['"\(\) ]|rgba?/g,"").toLowerCase()}};FLIRStyle.prototype.getFontSize=function(o,val){var px=this.getMeasurement(o,val,true);var prepx=px;if("*/+-".indexOf(val[0])>-1){try{px=Math.round((parseFloat(eval(px.toString().concat(val))))*10000)/10000}catch(err){px=16}}o.flirFontSize=px;return px};FLIRStyle.prototype.getMeasurement=function(g,f,d){var c,b,a;if(f=="normal"||f=="none"){return""}if(f.indexOf("px")>-1){c=Math.round(parseFloat(f))}else{if(f.indexOf("pt")>-1){var e=parseFloat(f);c=e/(72/FLIR.dpi)}else{if((b=(f.indexOf("em")>-1))||(a=(f.indexOf("%")>-1))){if(!g.flirFontSize){var h=document.createElement("DIV");h.style.padding=h.style.border="0";h.style.position="absolute";h.style.visibility="hidden";if(d){h.style.lineHeight="100%"}h.innerHTML="FlirTest";g.appendChild(h);c=h.offsetHeight;g.removeChild(h)}else{c=g.flirFontSize}}}}return c};FLIRStyle.prototype.copyObject=function(b){var c={};for(var a in b){c[a]=b[a]}return c};FLIRStyle.prototype.toString=function(){return this.uid};FLIR.detectBrowser=function(){FLIR.isIE=(navigator.userAgent.toLowerCase().indexOf("msie")>-1&&!window.opera);FLIR.isIE6=(typeof document.body.style.maxHeight=="undefined")};FLIR.getElements=function(r){var q=[];if(document.querySelectorAll){var e=false;try{q=document.querySelectorAll(r);e=true}catch(f){e=false}if(e){return q}}var i,n,l,j,r,d,h,o,k;d=r;o=false;if(d.indexOf(" ")>-1){var g=d.split(" ");d=g[0];o=g[1]}else{if(d.substr(0,1)=="#"){return document.getElementById(d.substr(1))}}var c=false;if(d.indexOf("#")>-1){c=d.split("#")[1];r=d.split("#")[0]}var m=false;if(d.indexOf(".")>-1){m=d.split(".")[1];r=d.split(".")[0]}i=document.getElementsByTagName(r);for(var a=0;a<i.length;a++){if(i[a].nodeType!=1){continue}h=false;l=i[a].className?i[a].className:"";if(c&&i[a].id&&i[a].id==c){h=true}if(m&&FLIR.hasClass(i[a],m)){h=true}if(!c&&!m){h=true}if(!h){continue}n=false!=o?i[a].getElementsByTagName(o):[i[a]];for(var b=0;b<n.length;b++){k=n[b];q.push(k)}}return q};FLIR.getStyle=function(a,c){if(a.currentStyle){if(c.indexOf("-")>-1){c=c.split("-")[0]+c.split("-")[1].substr(0,1).toUpperCase()+c.split("-")[1].substr(1)}var b=a.currentStyle[c]}else{if(window.getComputedStyle){var b=document.defaultView.getComputedStyle(a,"").getPropertyValue(c)}}return b};FLIR.getChildren=function(c){var b=[];if(c&&c.hasChildNodes()){for(var a in c.childNodes){if(c.childNodes[a]&&c.childNodes[a].nodeType==1){b[b.length]=c.childNodes[a]}}}return b};FLIR.getParentNode=function(b){var a=b.parentNode;while(a!=document&&a.nodeType!=1){a=a.parentNode}return a};FLIR.hasClass=function(a,b){return(a&&a.className&&a.className.indexOf(b)>-1)};FLIR.evsrc=function(a){var b;if(a.target){b=a.target}else{if(a.srcElement){b=a.srcElement}}if(b.nodeType==3){b=b.parentNode}return b};FLIR.addHover=function(a){if(!(args=FLIR.pcall("addHover",arguments))){return}a=args[0];a.flirHasHover=true;if(a.addEventListener){a.addEventListener("mouseover",FLIR.hover,false);a.addEventListener("mouseout",FLIR.hover,false)}else{if(a.attachEvent){a.attachEvent("onmouseover",function(){FLIR.hover(window.event)});a.attachEvent("onmouseout",function(){FLIR.hover(window.event)})}}};FLIR.flirIERepObj=[];FLIR.flirIEHovEls=[];FLIR.flirIEHovStyles=[];FLIR.hover=function(m){var b=FLIR.evsrc(m);var p=b;var s=b.flirHasHover;var j=b;var n=(m.type=="mouseover");while(b!=document.body&&!b.flirMainObj){b=FLIR.getParentNode(b);if(!s){s=b.flirHasHover;j=b}}if(b==document.body){return}var c=b.flirStyle;if(n&&c!=c.hoverStyle){c=c.hoverStyle}if(!(args=FLIR.pcall("hover",[n,p,b,j]))){return}n=args[0];p=args[1];b=args[2];j=args[3];var k=FLIR.getChildren(j);if(k.length==0||(k.length==1&&(k[0].flirImage||k[0].flirHasHover))){k=[j]}else{if(k.length==1&&!FLIR.isIgnoredEl(k[0])){var f=FLIR.getChildren(k[0]);if(f.length>0){if((f.length==1&&!f[0].flirImage)||f.length>1){k=f}}}}var q;for(var h=0;h<k.length;h++){q=k[h];if(q.nodeName=="IMG"){continue}if(!q.innerHTML){continue}if(FLIR.isIE){var r=FLIR.flirIEHovEls.length;FLIR.flirIERepObj[r]=q;FLIR.flirIEHovStyles[r]=c;var l=c.options.output;if(FLIR.isIE6&&(q.flirIE6PNG=(l=="png"||(l=="auto"&&FLIR.getStyle(q,"background-color")=="transparent")))){FLIR.flirIEHovEls[r]=q.flirImage?q:FLIR.getChildren(q)[0];setTimeout("FLIR.flirIEHovEls["+r+"].style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"'+FLIR.flirIEHovStyles["+r+"].URL(FLIR.flirIERepObj["+r+"], FLIR.flirIEHovEls["+r+'].alt)+\'", sizingMethod="image")\';  ',0)}else{if(c.replaceBackground&&FLIR.getStyle(q,"display")=="block"){FLIR.flirIEHovEls[r]=q;setTimeout("FLIR.flirIERepObj["+r+'].style.background = "url("+('+n+" ? FLIR.flirIEHovStyles["+r+"].URL(FLIR.flirIERepObj["+r+"]) : FLIR.flirIERepObj["+r+'].flirOrig)+") no-repeat";',0)}else{FLIR.flirIEHovEls[r]=q.flirImage?q:FLIR.getChildren(q)[0];if(!FLIR.flirIEHovEls[r].flirOrigWidth){FLIR.flirIEHovEls[r].flirOrigWidth=FLIR.flirIEHovEls[r].width;FLIR.flirIEHovEls[r].flirOrigHeight=FLIR.flirIEHovEls[r].height}var d="FLIR.flirIEHovEls["+r+"].src = "+n+" ? FLIR.flirIEHovStyles["+r+"].URL(FLIR.flirIERepObj["+r+"], FLIR.flirIEHovEls["+r+"].alt) : FLIR.flirIERepObj["+r+"].flirOrig;";d+="FLIR.flirIEHovEls["+r+"].onload = function() { ";if(n&&!FLIR.flirIEHovEls[r].flirHoverWidth){d+="		FLIR.flirIEHovEls["+r+"].flirHoverWidth = this.width; ";d+="		FLIR.flirIEHovEls["+r+"].flirHoverHeight = this.height; "}d+="	this.style.width = FLIR.flirIEHovEls["+r+"]."+(n?"flirHoverWidth":"flirOrigWidth")+'+"px"; ';d+="	this.style.height = FLIR.flirIEHovEls["+r+"]."+(n?"flirHoverHeight":"flirOrigHeight")+'+"px"; ';d+="}; ";setTimeout(d,0)}}}else{if(c.replaceBackground){var a=q.flirHoverURL?q.flirHoverURL:c.URL(q);q.style.background="url("+(n?a:q.flirOrig)+") no-repeat"}else{var g=q.flirImage?q:FLIR.getChildren(q)[0];var a=q.flirHoverURL?q.flirHoverURL:c.URL(q,g.alt);g.src=n?a:q.flirOrig}}}};FLIRStyle.prototype.loadopts_compat=function(b){if(!b){return}if(!b.css){b.css={}}if(typeof b.realFontHeight!="undefined"){b.fixBaseline=b.realFontHeight?true:false}var a={cBackground:"background-color",cColor:"color",cFont:"font-family",cSize:"font-size",cSpacing:"letter-spacing",cLine:"line-height",cAlign:"text-align",cTransform:"text-transform",cStretch:"font-stretch",cFontStyle:"font-style",cVariant:"font-variant",cWeight:"font-weight",cOpacity:"opacity",cDecoration:"text-decoration"};var d;for(var c in a){if(typeof b[c]!="undefined"){switch(c){default:d=b[c];break;case"cSize":d=b[c]+"px";break;case"cColor":case"cBackground":d="#"+b[c];break}b.css[a[c]]=d;b[c]=null}}return b};FLIR.auto=function(a){FLIR.replace((!a?["h1","h2","h3","h4","h5"]:(a.indexOf&&a.indexOf(",")>-1?a.split(","):a)))};
SqueezeBox.handlers.swf = function(url) {
	var size = this.options.size;
	return new Swiff(url, {
		id: 'sbox-swf',
		width: size.x,
		height: size.y
	});
};

function Search() {
	SqueezeBox.open(
		$('search_form'), {
			handler: 'clone',
			size: {x: 300, y: 55},
			onOpen: function(){
				$$('#sbox-content input').each(function(el){
					(function(){ el.focus(); }).delay(100);					
				});
			}
		});
}

/**
 * @author csigler
 */

var Cycle;
var visibleFeature;
var spotFx;
var spotTextFx;
var featureFx;
var featureList = [];
var Rotater=new Class({Implements:[Options,Events],options:{slideInterval:4000,transitionDuration:1000,startIndex:0,autoplay:true},initialize:function(B,A){this.setOptions(A);this.slides=$$(B);this.createFx();this.showSlide(this.options.startIndex);if(this.slides.length<2){this.options.autoplay=false}if(this.options.autoplay){this.autoplay()}return this},toElement:function(){return this.container},createFx:function(){if(!this.slideFx){this.slideFx=new Fx.Elements(this.slides,{duration:this.options.transitionDuration})}this.slides.each(function(A){A.setStyle("opacity",0)})},showSlide:function(B){var A={};this.slides.each(function(C,D){if(D==B&&D!=this.currentSlide){A[D.toString()]={opacity:1}}else{A[D.toString()]={opacity:0}}},this);this.fireEvent("onShowSlide",B);this.currentSlide=B;this.slideFx.start(A);return this},autoplay:function(){this.slideshowInt=this.rotate.periodical(this.options.slideInterval,this);this.fireEvent("onAutoPlay");return this},stop:function(){$clear(this.slideshowInt);this.fireEvent("onStop");return this},rotate:function(){current=this.currentSlide;next=(current+1>=this.slides.length)?0:current+1;this.showSlide(next);this.fireEvent("onRotate",next);return this}});
window.addEvent('domready', function(){

	SqueezeBox.assign($$('a.boxed'), { parse: 'rel' });
 	SqueezeBox.assign($$('span.boxed'), { parse: 'rel' });
	var myMenu = new MenuMatic();

	var rotater = new Rotater('.twitters',{ 		//Class of elements that should rotate.
		slideInterval:timerTwitter, 				//Length of showing each element, in milliseconds
		transitionDuration:500 				//Length crossfading transition, in milliseconds
	});
	 
	$$('li.spot').addEvents({
        mouseenter: function(){
			selectFeature(this);
        }
    });
	$$('div.feature').each(function(el,index)
	{
		featureList[ el.id ] = index;
	});
	spotFx = new Fx.Elements($$('li.spot'), { duration: 100 });
//	spotTextFx = new Fx.Elements($$('div.spot a'), { duration: 1000, transition: Fx.Transitions.Elastic.easeOut });
	spotTextFx = new Fx.Elements($$('div.spot a'), { duration: 150 });
	featureFx = new Fx.Elements($$('div.feature'), { duration: 500 });
	$('Feature').addEvents({
		mouseenter: function() {
			$clear(Cycle);
		},
        mouseleave: function() {
			featureCycle();
		}
	});

	var tipMe = $$('.tipme');

	tipMe.each(function(element,index) {
		var content = element.get('title').split('::');
		element.store('tip:title', content[0]);
		element.store('tip:text', content[1]);
	});

    var tipEffect = new Tips(tipMe, {
		showDelay: 100,    //default is 100
 		hideDelay: 100,   //default is 100
 		className: 'tipper', //default is null
 		offsets: {
			'x': 10,       //default is 16
			'y': 10        //default is 16
		},
	 	fixed: false,      //default is false
		onShow: function(toolTipElement){
	    	toolTipElement.fade(1);
		},
		onHide: function(toolTipElement){
    		toolTipElement.fade(0);
		}
	});
    $$('div.feature.off').fade('hide').removeClass('off');
	featureCycle();

});


function selectFeature(feature)
{
	if (!feature)
	{
		feature = 'feature_' + featureNext();
	}
	else if (typeof feature == 'number') {
		feature = 'feature_' + feature;
	}
	else if (typeof feature != "string") {
		feature = feature.id;
	}
	id = feature.split('_');
	id = id[1];

	$$('li.spot.on').removeClass('on');
	$('spot_' + id).addClass('on');
	
	if (visibleFeature) {
	}
	optsSpotsText = {};
	$$('div.spot a').each(function(el, index) {
		optsSpotsText[index] = {
			fontSize: 12,
			marginLeft: 0
		}
	});
	optsSpots = {};
	$$('li.spot').each(function(el, index) {
		optsSpots[index] = {
			opacity: 1
		}
	});
	optsFeatures = {};
	$$('div.feature').each(function(el, index) {
		optsFeatures[index] = {
			opacity: 0
		}
	});
//	if (typeof visibleFeature != 'undefined') {
//			console.log('setting ' + index + ' to off')
//			if (el.id == 'feature_' + id) {
//			}
//		}

//		opts[featureList['feature_' + visibleFeature]] = {
//			opacity: 0
//		};
//	}
//	console.log('redefining ' + featureList['feature_' + id] + ' as on');
	featureId = featureList['feature_' + id];
	optsSpotsText[featureId] = {
		fontSize: 14,
		marginLeft: 5
	}
	optsSpots[featureId] = {
		opacity: .9
	}
	optsFeatures[featureList['feature_' + id]] = {
		opacity: 1
	}
	featureFx.cancel();
//	spotFx.cancel();
	spotTextFx.cancel();
	featureFx.start(optsFeatures);
//	spotFx.start(optsSpots);
	spotTextFx.start(optsSpotsText);
	
//	if (typeof visibleFeature != 'undefined') {
//		$('feature_' + visibleFeature).fade('out');
//	}
//	$('feature_' + id).fade('in');

	visibleFeature = id;
	$('feature_' + id).addClass('on');
	
}


function featureCycle()
{
	if (typeof Cycle != 'undefined') {
		$clear(Cycle);
	}
	else
	{
		selectFeature(1);
	}
	internalCycle = function() { selectFeature(); }
	Cycle = internalCycle.periodical(timer);

}

function featureNext()
{
	if (typeof visibleFeature == 'undefined')
	{
		return 1;
	}
	else
	{
		next = parseInt(visibleFeature) + 1;
	}

	if ($('feature_' + next))
	{
		return next;
	}
	else
	{
		return 1;
	}
}
