/*
 * Bildy site scripts
 * Copyright 2009 by Aisti Medialab Oy
 * This comment applies starting here until next comment or end of file
 */
var body=false;window.addEvent("domready",function(){body=$$("BODY")[0];setupSubnavi();setupContentTabs();setupInfoPictures()});function setupInfoPictures(){var a=$$(".infopicture");a.each(function(e){var d=e.getChildren()[0];var c=new Element("img",{"class":"zoom",src:"/files/images/shot_zoom.png"}).inject(e);c.addEvent("click",function(){d.fireEvent("click")});d.setStyles({width:"100%"});d.addEvent("click",function(){d.setStyle("width","");e.orginal={x:d.getSize().x,y:d.getSize().y};d.setStyle("width","100%");var f=$$(".infopictureViewer");f.each(function(l){l.getElement("img").fireEvent("click")});var g=new Element("div",{"class":"infopictureViewer"}).inject(body);var k=d.clone().inject(g);e.getElements(".pictureinfo").inject(g);e.setStyle("visibility","hidden");k.setStyles({cursor:"pointer"});g.setStyles({position:"absolute",top:e.getPosition().y,left:e.getPosition().x,width:e.getSize().x,height:e.getSize().y});var j=new Fx.Morph(g,{transition:Fx.Transitions.Sine.easeOut});var h=(body.getSize().x-e.orginal.x)/2;if(e.orginal.x<$("container").getSize().x){h=(e.getPosition().x+(e.getSize().x/2))-e.orginal.x/2;if(h<$("container").getPosition().x){h=$("container").getPosition().x}else{if(h+e.orginal.x>$("container").getPosition().x+$("container").getSize().x){h=$("container").getPosition().x+$("container").getSize().x-e.orginal.x}}}j.start({width:e.orginal.x,height:e.orginal.y,left:h});k.addEvent("click",function(){var l=new Fx.Morph(g,{transition:Fx.Transitions.Sine.easeOut,onComplete:function(){e.setStyle("visibility","visible");g.getElements(".pictureinfo").inject(e);g.destroy()}});l.start({top:e.getPosition().y,left:e.getPosition().x,width:e.getSize().x,height:e.getSize().y})})})});var b=$$(".pictureinfo");b.each(function(c){c.getChildren()[1].setStyle("top",(54-c.getChildren()[1].getSize().y)/2+8+"px");c.addEvent("mouseenter",function(){c.addClass("active")});c.addEvent("mouseleave",function(){c.removeClass("active")})})}function setupSubnavi(){var c=$("secondnavi");if(c){var a=c.getElements("LI UL");for(i=0;i<a.length;i++){var b=new Element("span",{"class":"opener"});if(a[i].hasClass("open")){b.addClass("open")}b.addEvent("click",function(){var e=this.getParent().getElement("ul");if(this.getParent().hasClass("open")){this.removeClass("open");this.getParent().removeClass("open");var f=new Fx.Tween(e,{duration:150,onComplete:function(){this.element.setStyle("height","");this.element.removeClass("open")}});f.start("height",0)}else{this.addClass("open");this.getParent().addClass("open");e.addClass("open");var d=e.getSize().y;var f=new Fx.Tween(e,{duration:200,onStart:function(){this.element.setStyle("height","0")},onComplete:function(){this.element.setStyle("height","")}});f.start("height",0,d)}});b.inject(a[i].getParent())}}$$(".dp-highlighter").each(function(e){if(e.getScrollSize().x<=e.getSize().x){return}e.store("effex",new Fx.Elements([e],{link:"cancel"}));var d=e.getSize().x;e.setStyle("position","relative");e.setStyle("height",e.getSize().y);e.addEvent("mouseleave",function(f){e.retrieve("effex").start({"0":{width:[e.getSize().x,d],left:[d-e.getSize().x,0]}})});e.addEvent("mouseenter",function(f){e.retrieve("effex").start({"0":{width:[e.getSize().x,d+280],left:[d-e.getSize().x,-280]}})})})}var openArea=false;function setupContentTabs(){$$(".tabbox.selected").each(function(a){a.onclick()})}function openContent(g,e){e.blur();var a=0;var f=$(g);var b=f.getParent();$$(".tabbox.selected",".mainbox.selected").removeClass("selected");$(e).addClass("selected");if(f==openArea){return false}b.setStyle("display","block");if(openArea){b.setStyle("height",b.getSize().y-16);a=openArea.getSize().y-20;openArea.setStyles({position:"absolute",top:8,width:928});openArea.tween("opacity",0);$$(".contentpointer").setStyle("display","none")}else{b.tween("opacity",[0,1]);f.setStyle("height","")}f.setStyles({display:"block",position:"relative",opacity:0,top:0,width:""});var c=f.getSize().y-20;f.setStyles({height:a});var d=new Fx.Morph(f,{transition:Fx.Transitions.Sine.easeOut});d.start({opacity:[0,1],height:[a,c]});e.getElement(".contentpointer").setStyles({opacity:0,display:"block"});e.getElement(".contentpointer").tween("opacity",[0,1]);b.setStyle("height","");openArea=f}function closeContent(){var a=openArea.getParent();a.tween("opacity",[1,0]);openArea.tween("height",0);$$(".tabbox.selected",".mainbox.selected").removeClass("selected");$$(".contentpointer").setStyle("display","none");openArea=false}var naviStartHeight=57;var lastPanel=false;function openHeader(a,c){a=$(a);if($("navi").getSize().y==57){var b=a.getSize().y+20;if(c){$("navi").setStyle("height",naviStartHeight+b)}else{$("navi").tween("height",naviStartHeight+b)}a.setStyle("visibility","visible");a.tween("opacity",1)}else{if(a==lastPanel){$("navi").tween("height",naviStartHeight);a.tween("opacity",0)}else{lastPanel.tween("opacity",0);a.tween("opacity",1);var b=a.getSize().y+20;$("navi").tween("height",naviStartHeight+b)}}lastPanel=a}
/*
 * This Javascript is written by Peter Velichkov (www.creonfx.com)
 * and is distributed under the following license : http://creativecommons.org/licenses/by-sa/3.0/
 * Use and modify all you want just keep this comment. Thanks
 * This comment applies starting here until next comment or end of file
 */
function fixPNG(){$$("*").each(function(c){var b,d,a;b=c.getStyle("background-image");d=b.length;if(b!="none"&&b.substring(d-5,d-2)=="png"){c.setStyles({background:"",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='crop', src='"+b.substring(5,d-2)+"')"})}if(c.get("tag")=="img"&&c.get("src").substring(c.get("src").length-3)=="png"){a=new Element("input",{styles:{filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='crop', src='"+c.getProperty("src")+"')",position:"relative",background:"transparent"},title:c.getProperty("alt")});a.setStyles(c.getStyles("padding","margin","border","height","width"));a.setProperties(c.getProperties("id","class"));a.disabled=true;c.replaceWith(a)}})}if(window.ie6){window.addEvent("domready",fixPNG);
/*
 * SyntaxHighlighter
 * http://alexgorbatchev.com/
 *
 * SyntaxHighlighter is donationware. If you are using it, please donate.
 * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
 *
 * @version
 * 2.0.320 (May 03 2009), modifications by Aisti Medialab (May 04 2009)
 * 
 * @copyright
 * Copyright (C) 2004-2009 Alex Gorbatchev.
 * Modifications Copyright 2009 Aisti Medialab Oy
 *
 * @license
 * The following portion of minified JS until next comment or end of file is part of SyntaxHighlighter.
 * 
 * SyntaxHighlighter is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * SyntaxHighlighter is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with SyntaxHighlighter.  If not, see <http://www.gnu.org/copyleft/lesser.html>.
 * 
 * NOTE: The modifications made by Aisti Medialab include only
 * different PHP tag handling (accepting <?php and <?php-cache and
 * not accepting <?=).
 *
 * Even if these modifications probably won't do you any good, if you wish
 * to receive the unminified version of this LGPL licensed script,
 * please contact support@thebildy.com.
 */
}if(!window.SyntaxHighlighter){var SyntaxHighlighter=function(){var a={defaults:{"class-name":"","first-line":1,highlight:null,"smart-tabs":true,"tab-size":4,ruler:false,gutter:true,toolbar:true,collapse:false,"auto-links":true,light:false,"wrap-lines":true},config:{clipboardSwf:null,toolbarItemWidth:16,toolbarItemHeight:16,bloggerMode:false,stripBrs:false,tagName:"pre",strings:{expandSource:"expand source",viewSource:"view source",copyToClipboard:"copy to clipboard",copyToClipboardConfirmation:"The code is in your clipboard now",print:"print",help:"?",alert:"SyntaxHighlighter\n\n",noBrush:"Can't find brush for: ",brushNotHtmlScript:"Brush wasn't configured for html-script option: ",aboutDialog:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>About SyntaxHighlighter</title></head><body style="font-family:Geneva,Arial,Helvetica,sans-serif;background-color:#fff;color:#000;font-size:1em;text-align:center;"><div style="text-align:center;margin-top:3em;"><div style="font-size:xx-large;">SyntaxHighlighter</div><div style="font-size:.75em;margin-bottom:4em;"><div>version 2.0.320 (May 03 2009)</div><div><a href="http://alexgorbatchev.com" target="_blank" style="color:#0099FF;text-decoration:none;">http://alexgorbatchev.com</a></div></div><div>JavaScript code syntax highlighter.</div><div>Copyright 2004-2009 Alex Gorbatchev.</div></div></body></html>'},debug:false},vars:{discoveredBrushes:null,spaceWidth:null,printFrame:null,highlighters:{}},brushes:{},regexLib:{multiLineCComments:/\/\*[\s\S]*?\*\//gm,singleLineCComments:/\/\/.*$/gm,singleLinePerlComments:/#.*$/gm,doubleQuotedString:/"(?:\.|(\\\")|[^\""\n])*"/g,singleQuotedString:/'(?:\.|(\\\')|[^\''\n])*'/g,multiLineDoubleQuotedString:/"(?:\.|(\\\")|[^\""])*"/g,multiLineSingleQuotedString:/'(?:\.|(\\\')|[^\''])*'/g,url:/\w+:\/\/[\w-.\/?%&=]*/g,phpScriptTags:{left:/(&lt;|<)\?(?:php(?:-cache)?)?/g,right:/\?(&gt;|>)/g},aspScriptTags:{left:/(&lt;|<)%=?/g,right:/%(&gt;|>)/g},scriptScriptTags:{left:/(&lt;|<)\s*script.*?(&gt;|>)/gi,right:/(&lt;|<)\/\s*script\s*(&gt;|>)/gi}},toolbar:{create:function(d){var h=document.createElement("DIV"),b=a.toolbar.items;h.className="toolbar";for(var c in b){var f=b[c],g=new f(d),e=g.create();d.toolbarCommands[c]=g;if(e==null){continue}if(typeof(e)=="string"){e=a.toolbar.createButton(e,d.id,c)}e.className+="item "+c;h.appendChild(e)}return h},createButton:function(f,c,g){var d=document.createElement("a"),j=d.style,e=a.config,h=e.toolbarItemWidth,b=e.toolbarItemHeight;d.href="#"+g;d.title=f;d.highlighterId=c;d.commandName=g;d.innerHTML=f;if(isNaN(h)==false){j.width=h+"px"}if(isNaN(b)==false){j.height=b+"px"}d.onclick=function(k){try{a.toolbar.executeCommand(this,k||window.event,this.highlighterId,this.commandName)}catch(k){a.utils.alert(k.message)}return false};return d},executeCommand:function(f,g,b,e,d){var c=a.vars.highlighters[b],h;if(c==null||(h=c.toolbarCommands[e])==null){return null}return h.execute(f,g,d)},items:{expandSource:function(b){this.create=function(){if(b.getParam("collapse")!=true){return}return a.config.strings.expandSource};this.execute=function(d,e,c){var f=b.div;d.parentNode.removeChild(d);f.className=f.className.replace("collapsed","")}},viewSource:function(b){this.create=function(){return a.config.strings.viewSource};this.execute=function(d,g,c){var f=a.utils.fixInputString(b.originalCode).replace(/</g,"&lt;"),e=a.utils.popup("","_blank",750,400,"location=0, resizable=1, menubar=0, scrollbars=1");f=a.utils.unindent(f);e.document.write("<pre>"+f+"</pre>");e.document.close()}},copyToClipboard:function(d){var e,c,b=d.id;this.create=function(){var g=a.config;if(g.clipboardSwf==null){return null}function m(p){var n="";for(var o in p){n+="<param name='"+o+"' value='"+p[o]+"'/>"}return n}function f(p){var n="";for(var o in p){n+=" "+o+"='"+p[o]+"'"}return n}var l={width:g.toolbarItemWidth,height:g.toolbarItemHeight,id:b+"_clipboard",type:"application/x-shockwave-flash",title:a.config.strings.copyToClipboard},k={allowScriptAccess:"always",wmode:"transparent",flashVars:"highlighterId="+b,menu:"false"},j=g.clipboardSwf,h;if(/msie/i.test(navigator.userAgent)){h="<object"+f({classid:"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"})+f(l)+">"+m(k)+m({movie:j})+"</object>"}else{h="<embed"+f(l)+f(k)+f({src:j})+"/>"}e=document.createElement("div");e.innerHTML=h;return e};this.execute=function(g,j,f){var k=f.command;switch(k){case"get":var h=a.utils.unindent(a.utils.fixInputString(d.originalCode).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&"));if(window.clipboardData){window.clipboardData.setData("text",h)}else{return a.utils.unindent(h)}case"ok":a.utils.alert(a.config.strings.copyToClipboardConfirmation);break;case"error":a.utils.alert(f.message);break}}},printSource:function(b){this.create=function(){return a.config.strings.print};this.execute=function(e,g,d){var f=document.createElement("IFRAME"),h=null;if(a.vars.printFrame!=null){document.body.removeChild(a.vars.printFrame)}a.vars.printFrame=f;f.style.cssText="position:absolute;width:0px;height:0px;left:-500px;top:-500px;";document.body.appendChild(f);h=f.contentWindow.document;c(h,window.document);h.write('<div class="'+b.div.className.replace("collapsed","")+' printing">'+b.div.innerHTML+"</div>");h.close();f.contentWindow.focus();f.contentWindow.print();function c(j,m){var k=m.getElementsByTagName("link");for(var l=0;l<k.length;l++){if(k[l].rel.toLowerCase()=="stylesheet"&&/shCore\.css$/.test(k[l].href)){j.write('<link type="text/css" rel="stylesheet" href="'+k[l].href+'"></link>')}}}}},about:function(b){this.create=function(){return a.config.strings.help};this.execute=function(c,e){var d=a.utils.popup("","_blank",500,250,"scrollbars=0"),f=d.document;f.write(a.config.strings.aboutDialog);f.close();d.focus()}}}},utils:{guid:function(b){return b+Math.round(Math.random()*1000000).toString()},merge:function(e,d){var b={},c;for(c in e){b[c]=e[c]}for(c in d){b[c]=d[c]}return b},toBoolean:function(b){switch(b){case"true":return true;case"false":return false}return b},popup:function(f,e,g,c,d){var b=(screen.width-g)/2,j=(screen.height-c)/2;d+=", left="+b+", top="+j+", width="+g+", height="+c;d=d.replace(/^,/,"");var h=window.open(f,e,d);h.focus();return h},addEvent:function(d,b,c){if(d.attachEvent){d["e"+b+c]=c;d[b+c]=function(){d["e"+b+c](window.event)};d.attachEvent("on"+b,d[b+c])}else{d.addEventListener(b,c,false)}},alert:function(b){alert(a.config.strings.alert+b)},findBrush:function(f,h){var g=a.vars.discoveredBrushes,b=null;if(g==null){g={};for(var d in a.brushes){var c=a.brushes[d].aliases;if(c==null){continue}for(var e=0;e<c.length;e++){g[c[e]]=d}}a.vars.discoveredBrushes=g}b=a.brushes[g[f]];if(b==null&&h!=false){a.utils.alert(a.config.strings.noBrush+f)}return b},eachLine:function(d,e){var b=d.split("\n");for(var c=0;c<b.length;c++){b[c]=e(b[c])}return b.join("\n")},createRuler:function(){var e=document.createElement("div"),d=document.createElement("div"),c=10,b=1;while(b<=150){if(b%c===0){e.innerHTML+=b;b+=(b+"").length}else{e.innerHTML+="&middot;";b++}}d.className="ruler line";d.appendChild(e);return d},trimFirstAndLastLines:function(b){return b.replace(/^[ ]*[\n]+|[\n]*[ ]*$/g,"")},parseParams:function(h){var d,c={},e=new XRegExp("^\\[(?<values>(.*?))\\]$"),f=new XRegExp("(?<name>[\\w-]+)\\s*:\\s*(?<value>[\\w-%#]+|\\[.*?\\]|\".*?\"|'.*?')\\s*;?","g");while((d=f.exec(h))!=null){var g=d.value.replace(/^['"]|['"]$/g,"");if(g!=null&&e.test(g)){var b=e.exec(g);g=b.values.length>0?b.values.split(/\s*,\s*/):[]}c[d.name]=g}return c},decorate:function(c,b){if(c==null||c.length==0||c=="\n"){return c}c=c.replace(/</g,"&lt;");c=c.replace(/ {2,}/g,function(d){var e="";for(var f=0;f<d.length-1;f++){e+="&nbsp;"}return e+" "});if(b!=null){c=a.utils.eachLine(c,function(d){if(d.length==0){return""}var e="";d=d.replace(/^(&nbsp;| )+/,function(f){e=f;return""});if(d.length==0){return e}return e+'<code class="'+b+'">'+d+"</code>"})}return c},padNumber:function(d,c){var b=d.toString();while(b.length<c){b="0"+b}return b},measureSpace:function(){var c=document.createElement("div"),h,k=0,f=document.body,d=a.utils.guid("measureSpace"),j='<div class="',g="</div>",e="</span>";c.innerHTML=j+'syntaxhighlighter">'+j+'lines">'+j+'line">'+j+'content"><span class="block"><span id="'+d+'">&nbsp;'+e+e+g+g+g+g;f.appendChild(c);h=document.getElementById(d);if(/opera/i.test(navigator.userAgent)){var b=window.getComputedStyle(h,null);k=parseInt(b.getPropertyValue("width"))}else{k=h.offsetWidth}f.removeChild(c);return k},processTabs:function(d,e){var c="";for(var b=0;b<e;b++){c+=" "}return d.replace(/\t/g,c)},processSmartTabs:function(f,g){var b=f.split("\n"),e="\t",c="";for(var d=0;d<50;d++){c+="                    "}function h(j,l,k){return j.substr(0,l)+c.substr(0,k)+j.substr(l+1,j.length)}f=a.utils.eachLine(f,function(j){if(j.indexOf(e)==-1){return j}var l=0;while((l=j.indexOf(e))!=-1){var k=g-l%g;j=h(j,l,k)}return j});return f},fixInputString:function(c){var b=/<br\s*\/?>|&lt;br\s*\/?&gt;/gi;if(a.config.bloggerMode==true){c=c.replace(b,"\n")}if(a.config.stripBrs==true){c=c.replace(b,"")}return c},trim:function(b){return b.replace(/\s*$/g,"").replace(/^\s*/,"")},unindent:function(j){var c=a.utils.fixInputString(j).split("\n"),h=new Array(),f=/^\s*/,e=1000;for(var d=0;d<c.length&&e>0;d++){var b=c[d];if(a.utils.trim(b).length==0){continue}var g=f.exec(b);if(g==null){return j}e=Math.min(g[0].length,e)}if(e>0){for(var d=0;d<c.length;d++){c[d]=c[d].substr(e)}}return c.join("\n")},matchesSortCallback:function(c,b){if(c.index<b.index){return -1}else{if(c.index>b.index){return 1}else{if(c.length<b.length){return -1}else{if(c.length>b.length){return 1}}}}return 0},getMatches:function(f,g){function h(j,k){return[new a.Match(j[0],j.index,k.css)]}var d=0,c=null,b=[],e=g.func?g.func:h;while((c=g.regex.exec(f))!=null){b=b.concat(e(c,g))}return b},processUrls:function(b){return b.replace(a.regexLib.url,function(c){return'<a href="'+c+'">'+c+"</a>"})}},highlight:function(g,e){function d(q){var o=[];for(var p=0;p<q.length;p++){o.push(q[p])}return o}var b=e?[e]:d(document.getElementsByTagName(a.config.tagName)),h="innerHTML",l=null;if(b.length===0){return}for(var f=0;f<b.length;f++){var j=b[f],c=a.utils.parseParams(j.className),m;c=a.utils.merge(g,c);m=c.brush;if(m==null){continue}if(c["html-script"]=="true"){l=new a.HtmlScript(m)}else{var k=a.utils.findBrush(m);if(k){l=new k()}else{continue}}l.highlight(j[h],c);var n=l.div;if(a.config.debug){n=document.createElement("textarea");n.value=l.div.innerHTML;n.style.width="70em";n.style.height="30em"}j.parentNode.replaceChild(n,j)}},all:function(b){a.utils.addEvent(window,"load",function(){a.highlight(b)})}};a.Match=function(d,b,c){this.value=d;this.index=b;this.length=d.length;this.css=c};a.Match.prototype.toString=function(){return this.value};a.HtmlScript=function(b){var c=a.utils.findBrush(b),g=new a.brushes.Xml(),f=null;if(c==null){return}c=new c();this.xmlBrush=g;if(c.htmlScript==null){a.utils.alert(a.config.strings.brushNotHtmlScript+b);return}g.regexList.push({regex:c.htmlScript.code,func:e});function d(k,l){for(var h=0;h<k.length;h++){k[h].index+=l}}function e(o,j){var h=o.code,n=[],m=c.regexList,k=o.index+o.left.length,p=c.htmlScript,q;for(var l=0;l<m.length;l++){q=a.utils.getMatches(h,m[l]);d(q,k);n=n.concat(q)}if(p.left!=null&&o.left!=null){q=a.utils.getMatches(o.left,p.left);d(q,o.index);n=n.concat(q)}if(p.right!=null&&o.right!=null){q=a.utils.getMatches(o.right,p.right);d(q,o.index+o[0].lastIndexOf(o.right));n=n.concat(q)}return n}};a.HtmlScript.prototype.highlight=function(b,c){this.xmlBrush.highlight(b,c);this.div=this.xmlBrush.div};a.Highlighter=function(){};a.Highlighter.prototype={getParam:function(d,c){var b=this.params[d];return a.utils.toBoolean(b==null?c:b)},create:function(b){return document.createElement(b)},findMatches:function(e,d){var b=[];if(e!=null){for(var c=0;c<e.length;c++){b=b.concat(a.utils.getMatches(d,e[c]))}}b=b.sort(a.utils.matchesSortCallback);return b},removeNestedMatches:function(){var f=this.matches;for(var e=0;e<f.length;e++){if(f[e]===null){continue}var b=f[e],d=b.index+b.length;for(var c=e+1;c<f.length&&f[e]!==null;c++){var g=f[c];if(g===null){continue}else{if(g.index>d){break}else{if(g.index==b.index&&g.length>b.length){this.matches[e]=null}else{if(g.index>=b.index&&g.index<d){this.matches[c]=null}}}}}}},createDisplayLines:function(b){var m=b.split(/\n/g),k=parseInt(this.getParam("first-line")),g=(k+m.length).toString().length,l=this.getParam("highlight",[]);b="";for(var f=0;f<m.length;f++){var n=m[f],c=/^(&nbsp;|\s)+/.exec(n),j="line alt"+(f%2==0?1:2),d=a.utils.padNumber(k+f,g),e=l.indexOf((k+f).toString())!=-1,h=null;if(c!=null){h=c[0].toString();n=n.substr(h.length);h=h.replace(/&nbsp;/g," ");c=a.vars.spaceWidth*h.length}else{c=0}n=a.utils.trim(n);if(n.length==0){n="&nbsp;"}if(e){j+=" highlighted"}b+='<div class="'+j+'"><code class="number">'+d+'.</code><span class="content">'+(h!=null?'<code class="spaces">'+h.replace(/\s/g,"&nbsp;")+"</code>":"")+'<span class="block" style="margin-left: '+c+'px !important;">'+n+"</span></span></div>"}return b},processMatches:function(e,f){var h=0,b="",g=a.utils.decorate;for(var d=0;d<f.length;d++){var c=f[d];if(c===null||c.length===0){continue}b+=g(e.substr(h,c.index-h),"plain")+g(c.value,c.css);h=c.index+c.length}b+=g(e.substr(h),"plain");return b},highlight:function(c,e){var k=a.config,l=a.vars,b,g,h,d="important";this.params={};this.div=null;this.lines=null;this.code=null;this.bar=null;this.toolbarCommands={};this.id=a.utils.guid("highlighter_");l.highlighters[this.id]=this;if(c===null){c=""}if(l.spaceWidth===null){l.spaceWidth=a.utils.measureSpace()}this.params=a.utils.merge(a.defaults,e||{});if(this.getParam("light")==true){this.params.toolbar=this.params.gutter=false}this.div=b=this.create("DIV");this.lines=this.create("DIV");this.lines.className="lines";className="syntaxhighlighter";b.id=this.id;if(this.getParam("collapse")){className+=" collapsed"}if(this.getParam("gutter")==false){className+=" nogutter"}if(this.getParam("wrap-lines")==false){this.lines.className+=" no-wrap"}className+=" "+this.getParam("class-name");b.className=className;this.originalCode=c;this.code=a.utils.trimFirstAndLastLines(c).replace(/\r/g," ");h=this.getParam("tab-size");this.code=this.getParam("smart-tabs")==true?a.utils.processSmartTabs(this.code,h):a.utils.processTabs(this.code,h);this.code=a.utils.unindent(this.code);if(this.getParam("toolbar")){this.bar=this.create("DIV");this.bar.className="bar";this.bar.appendChild(a.toolbar.create(this));b.appendChild(this.bar);var j=this.bar;function f(){j.className=j.className.replace("show","")}b.onmouseover=function(){f();j.className+=" show"};b.onmouseout=function(){f()}}if(this.getParam("ruler")){b.appendChild(a.utils.createRuler())}b.appendChild(this.lines);this.matches=this.findMatches(this.regexList,this.code);this.removeNestedMatches();c=this.processMatches(this.code,this.matches);c=this.createDisplayLines(a.utils.trim(c));if(this.getParam("auto-links")){c=a.utils.processUrls(c)}this.lines.innerHTML=c},getKeywords:function(b){b=b.replace(/^\s+|\s+$/g,"").replace(/\s+/g,"\\b|\\b");return"\\b"+b+"\\b"},forHtmlScript:function(b){this.htmlScript={left:{regex:b.left,css:"script"},right:{regex:b.right,css:"script"},code:new XRegExp("(?<left>"+b.left.source+")(?<code>.*?)(?<right>"+b.right.source+")","sgi")}}};return a}()}if(!Array.indexOf){Array.prototype.indexOf=function(a,c){c=Math.max(c||0,0);for(var b=c;b<this.length;b++){if(this[b]==a){return b}}return -1}}if(!window.XRegExp){(function(){var e={exec:RegExp.prototype.exec,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},d={part:/(?:[^\\([#\s.]+|\\(?!k<[\w$]+>|[pP]{[^}]+})[\S\s]?|\((?=\?(?!#|<[\w$]+>)))+|(\()(?:\?(?:(#)[^)]*\)|<([$\w]+)>))?|\\(?:k<([\w$]+)>|[pP]{([^}]+)})|(\[\^?)|([\S\s])/g,replaceVar:/(?:[^$]+|\$(?![1-9$&`']|{[$\w]+}))+|\$(?:([1-9]\d*|[$&`'])|{([$\w]+)})/g,extended:/^(?:\s+|#.*)+/,quantifier:/^(?:[?*+]|{\d+(?:,\d*)?})/,classLeft:/&&\[\^?/g,classRight:/]/g},b=function(j,g,h){for(var f=h||0;f<j.length;f++){if(j[f]===g){return f}}return -1},c=/()??/.exec("")[1]!==undefined,a={};XRegExp=function(p,j){if(p instanceof RegExp){if(j!==undefined){throw TypeError("can't supply flags when constructing one RegExp from another")}return p.addFlags()}var j=j||"",f=j.indexOf("s")>-1,l=j.indexOf("x")>-1,q=false,s=[],h=[],g=d.part,m,k,o,n,r;g.lastIndex=0;while(m=e.exec.call(g,p)){if(m[2]){if(!d.quantifier.test(p.slice(g.lastIndex))){h.push("(?:)")}}else{if(m[1]){s.push(m[3]||null);if(m[3]){q=true}h.push("(")}else{if(m[4]){n=b(s,m[4]);h.push(n>-1?"\\"+(n+1)+(isNaN(p.charAt(g.lastIndex))?"":"(?:)"):m[0])}else{if(m[5]){h.push(a.unicode?a.unicode.get(m[5],m[0].charAt(1)==="P"):m[0])}else{if(m[6]){if(p.charAt(g.lastIndex)==="]"){h.push(m[6]==="["?"(?!)":"[\\S\\s]");g.lastIndex++}else{k=XRegExp.matchRecursive("&&"+p.slice(m.index),d.classLeft,d.classRight,"",{escapeChar:"\\"})[0];h.push(m[6]+k+"]");g.lastIndex+=k.length+1}}else{if(m[7]){if(f&&m[7]==="."){h.push("[\\S\\s]")}else{if(l&&d.extended.test(m[7])){o=e.exec.call(d.extended,p.slice(g.lastIndex-1))[0].length;if(!d.quantifier.test(p.slice(g.lastIndex-1+o))){h.push("(?:)")}g.lastIndex+=o-1}else{h.push(m[7])}}}else{h.push(m[0])}}}}}}}r=RegExp(h.join(""),e.replace.call(j,/[sx]+/g,""));r._x={source:p,captureNames:q?s:null};return r};XRegExp.addPlugin=function(f,g){a[f]=g};RegExp.prototype.exec=function(k){var h=e.exec.call(this,k),g,j,f;if(h){if(c&&h.length>1){f=new RegExp("^"+this.source+"$(?!\\s)",this.getNativeFlags());e.replace.call(h[0],f,function(){for(j=1;j<arguments.length-2;j++){if(arguments[j]===undefined){h[j]=undefined}}})}if(this._x&&this._x.captureNames){for(j=1;j<h.length;j++){g=this._x.captureNames[j-1];if(g){h[g]=h[j]}}}if(this.global&&this.lastIndex>(h.index+h[0].length)){this.lastIndex--}}return h}})()}RegExp.prototype.getNativeFlags=function(){return(this.global?"g":"")+(this.ignoreCase?"i":"")+(this.multiline?"m":"")+(this.extended?"x":"")+(this.sticky?"y":"")};RegExp.prototype.addFlags=function(a){var b=new XRegExp(this.source,(a||"")+this.getNativeFlags());if(this._x){b._x={source:this._x.source,captureNames:this._x.captureNames?this._x.captureNames.slice(0):null}}return b};RegExp.prototype.call=function(a,b){return this.exec(b)};RegExp.prototype.apply=function(b,a){return this.exec(a[0])};XRegExp.cache=function(c,a){var b="/"+c+"/"+(a||"");return XRegExp.cache[b]||(XRegExp.cache[b]=new XRegExp(c,a))};XRegExp.escape=function(a){return a.replace(/[-[\]{}()*+?.\\^$|,#\s]/g,"\\$&")};XRegExp.matchRecursive=function(q,d,t,f,b){var b=b||{},w=b.escapeChar,l=b.valueNames,f=f||"",r=f.indexOf("g")>-1,c=f.indexOf("i")>-1,h=f.indexOf("m")>-1,v=f.indexOf("y")>-1,f=f.replace(/y/g,""),d=d instanceof RegExp?(d.global?d:d.addFlags("g")):new XRegExp(d,"g"+f),t=t instanceof RegExp?(t.global?t:t.addFlags("g")):new XRegExp(t,"g"+f),j=[],a=0,k=0,o=0,m=0,n,e,p,s,g,u;if(w){if(w.length>1){throw SyntaxError("can't supply more than one escape character")}if(h){throw TypeError("can't supply escape character when using the multiline flag")}g=XRegExp.escape(w);u=new RegExp("^(?:"+g+"[\\S\\s]|(?:(?!"+d.source+"|"+t.source+")[^"+g+"])+)+",c?"i":"")}while(true){d.lastIndex=t.lastIndex=o+(w?(u.exec(q.slice(o))||[""])[0].length:0);p=d.exec(q);s=t.exec(q);if(p&&s){if(p.index<=s.index){s=null}else{p=null}}if(p||s){k=(p||s).index;o=(p?d:t).lastIndex}else{if(!a){break}}if(v&&!a&&k>m){break}if(p){if(!a++){n=k;e=o}}else{if(s&&a){if(!--a){if(l){if(l[0]&&n>m){j.push([l[0],q.slice(m,n),m,n])}if(l[1]){j.push([l[1],q.slice(n,e),n,e])}if(l[2]){j.push([l[2],q.slice(e,k),e,k])}if(l[3]){j.push([l[3],q.slice(k,o),k,o])}}else{j.push(q.slice(e,k))}m=o;if(!r){break}}}else{d.lastIndex=t.lastIndex=0;throw Error("subject data contains unbalanced delimiters")}}if(k===o){o++}}if(r&&!v&&l&&l[0]&&q.length>m){j.push([l[0],q.slice(m),m,q.length])}d.lastIndex=t.lastIndex=0;return j};SyntaxHighlighter.brushes.Xml=function(){function a(e,j){var f=SyntaxHighlighter.Match,h=e[0],c=new XRegExp("(&lt;|<)[\\s\\/\\?]*(?<name>[:\\w-\\.]+)","xg").exec(h),b=[];if(e.attributes!=null){var d,g=new XRegExp("(?<name> [\\w:\\-\\.]+)\\s*=\\s*(?<value> \".*?\"|'.*?'|\\w+)","xg");while((d=g.exec(h))!=null){b.push(new f(d.name,e.index+d.index,"color1"));b.push(new f(d.value,e.index+d.index+d[0].indexOf(d.value),"string"))}}if(c!=null){b.push(new f(c.name,e.index+c[0].indexOf(c.name),"keyword"))}return b}this.regexList=[{regex:new XRegExp("(\\&lt;|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\&gt;|>)","gm"),css:"color2"},{regex:new XRegExp("(\\&lt;|<)!--\\s*.*?\\s*--(\\&gt;|>)","gm"),css:"comments"},{regex:new XRegExp("(&lt;|<)[\\s\\/\\?]*(\\w+)(?<attributes>.*?)[\\s\\/\\?]*(&gt;|>)","sg"),func:a}]};SyntaxHighlighter.brushes.Xml.prototype=new SyntaxHighlighter.Highlighter();SyntaxHighlighter.brushes.Xml.aliases=["xml","xhtml","xslt","html","xhtml"];SyntaxHighlighter.brushes.JScript=function(){var a="break case catch continue default delete do else false  for function if in instanceof new null return super switch this throw true try typeof var while with";this.regexList=[{regex:SyntaxHighlighter.regexLib.singleLineCComments,css:"comments"},{regex:SyntaxHighlighter.regexLib.multiLineCComments,css:"comments"},{regex:SyntaxHighlighter.regexLib.doubleQuotedString,css:"string"},{regex:SyntaxHighlighter.regexLib.singleQuotedString,css:"string"},{regex:/\s*#.*/gm,css:"preprocessor"},{regex:new RegExp(this.getKeywords(a),"gm"),css:"keyword"}];this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags)};SyntaxHighlighter.brushes.JScript.prototype=new SyntaxHighlighter.Highlighter();SyntaxHighlighter.brushes.JScript.aliases=["js","jscript","javascript"];SyntaxHighlighter.brushes.Php=function(){var a="abs acos acosh addcslashes addslashes array_change_key_case array_chunk array_combine array_count_values array_diff array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill array_filter array_flip array_intersect array_intersect_assoc array_intersect_key array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map array_merge array_merge_recursive array_multisort array_pad array_pop array_product array_push array_rand array_reduce array_reverse array_search array_shift array_slice array_splice array_sum array_udiff array_udiff_assoc array_udiff_uassoc array_uintersect array_uintersect_assoc array_uintersect_uassoc array_unique array_unshift array_values array_walk array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists closedir closelog copy cos cosh count count_chars date decbin dechex decoct deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br parse_ini_file parse_str parse_url passthru pathinfo readlink realpath rewind rewinddir rmdir round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime strtoupper strtr strval substr substr_compare";var c="and or xor array as break case cfunction class const continue declare default die do else elseif enddeclare endfor endforeach endif endswitch endwhile extends for foreach function include include_once global if new old_function return static switch use require require_once var while abstract interface public implements extends private protected throw";var b="__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__";this.regexList=[{regex:SyntaxHighlighter.regexLib.singleLineCComments,css:"comments"},{regex:SyntaxHighlighter.regexLib.multiLineCComments,css:"comments"},{regex:SyntaxHighlighter.regexLib.doubleQuotedString,css:"string"},{regex:SyntaxHighlighter.regexLib.singleQuotedString,css:"string"},{regex:/\$\w+/g,css:"variable"},{regex:new RegExp(this.getKeywords(a),"gmi"),css:"functions"},{regex:new RegExp(this.getKeywords(b),"gmi"),css:"constants"},{regex:new RegExp(this.getKeywords(c),"gm"),css:"keyword"}];this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags)};SyntaxHighlighter.brushes.Php.prototype=new SyntaxHighlighter.Highlighter();SyntaxHighlighter.brushes.Php.aliases=["php"];