
var Shadowbox=function(){var ua=navigator.userAgent.toLowerCase(),S={version:"3.0b",adapter:null,current:-1,gallery:[],cache:[],content:null,dimensions:null,plugins:null,path:"",options:{adapter:null,animate:true,animateFade:true,autoplayMovies:true,autoDimensions:false,continuous:false,counterLimit:10,counterType:"default",displayCounter:true,displayNav:true,ease:function(x){return 1+Math.pow(x-1,3)},enableKeys:true,errors:{fla:{name:"Flash",url:"http://www.adobe.com/products/flashplayer/"},qt:{name:"QuickTime",url:"http://www.apple.com/quicktime/download/"},wmp:{name:"Windows Media Player",url:"http://www.microsoft.com/windows/windowsmedia/"},f4m:{name:"Flip4Mac",url:"http://www.flip4mac.com/wmv_download.htm"}},ext:{img:["png","jpg","jpeg","gif","bmp"],swf:["swf"],flv:["flv"],qt:["dv","mov","moov","movie","mp4"],wmp:["asf","wm","wmv"],qtwmp:["avi","mpg","mpeg"],iframe:["asp","aspx","cgi","cfm","htm","html","jsp","pl","php","php3","php4","php5","phtml","rb","rhtml","shtml","txt","vbs"]},fadeDuration:0.35,flashParams:{bgcolor:"#000000",allowFullScreen:true},flashVars:{},flashVersion:"9.0.115",handleOversize:"resize",handleUnsupported:"link",initialHeight:160,initialWidth:320,language:"en",modal:false,onChange:null,onClose:null,onFinish:null,onOpen:null,overlayColor:"#000",overlayOpacity:0.8,players:["img"],resizeDuration:0.35,showOverlay:true,showMovieControls:true,skipSetup:false,slideshowDelay:0,useSizzle:true,viewportPadding:20},client:{isIE:ua.indexOf("msie")>-1,isIE6:ua.indexOf("msie 6")>-1,isIE7:ua.indexOf("msie 7")>-1,isGecko:ua.indexOf("gecko")>-1&&ua.indexOf("safari")==-1,isWebkit:ua.indexOf("applewebkit/")>-1,isWindows:ua.indexOf("windows")>-1||ua.indexOf("win32")>-1,isMac:ua.indexOf("macintosh")>-1||ua.indexOf("mac os x")>-1,isLinux:ua.indexOf("linux")>-1},regex:{domain:/:\/\/(.*?)[:\/]/,inline:/#(.+)$/,rel:/^(light|shadow)box/i,gallery:/^(light|shadow)box\[(.*?)\]/i,unsupported:/^unsupported-(\w+)/,param:/\s*([a-z_]*?)\s*=\s*(.+)\s*/},libraries:{Prototype:"prototype",jQuery:"jquery",MooTools:"mootools",YAHOO:"yui",dojo:"dojo",Ext:"ext"},applyOptions:function(opts){if(opts){default_options=apply({},S.options);apply(S.options,opts)}},buildCacheObj:function(link,opts){var href=link.href,obj={el:link,title:link.getAttribute("title"),options:apply({},opts||{}),content:href};each(["player","title","height","width","gallery"],function(o){if(typeof obj.options[o]!="undefined"){obj[o]=obj.options[o];delete obj.options[o]}});if(!obj.player){obj.player=getPlayer(href)}var rel=link.getAttribute("rel");if(rel){var m=rel.match(S.regex.gallery);if(m){obj.gallery=escape(m[2])}each(rel.split(";"),function(p){m=p.match(S.regex.param);if(m){if(m[1]=="options"){eval("apply(obj.options,"+m[2]+")")}else{obj[m[1]]=m[2]}}})}return obj},change:function(n){if(!S.gallery){return}if(!S.gallery[n]){if(!S.options.continuous){return}else{n=n<0?S.gallery.length-1:0}}S.current=n;if(typeof slide_timer=="number"){clearTimeout(slide_timer);slide_timer=null;slide_delay=slide_start=0}if(S.options.onChange){S.options.onChange()}loadContent()},clearCache:function(){each(S.cache,function(obj){if(obj.el){S.lib.removeEvent(obj.el,"click",handleClick)}});S.cache=[]},close:function(){if(!active){return}active=false;listenKeys(false);if(S.content){S.content.remove();S.content=null}if(typeof slide_timer=="number"){clearTimeout(slide_timer)}slide_timer=null;slide_delay=0;if(S.options.onClose){S.options.onClose()}S.skin.onClose();S.revertOptions();each(v_cache,function(c){c[0].style.visibility=c[1]})},contentId:function(){return content_id},getCounter:function(){var len=S.gallery.length;if(S.options.counterType=="skip"){var c=[],i=0,end=len,limit=parseInt(S.options.counterLimit)||0;if(limit<len&&limit>2){var h=Math.floor(limit/2);i=S.current-h;if(i<0){i+=len}end=S.current+(limit-h);if(end>len){end-=len}}while(i!=end){if(i==len){i=0}c.push(i++)}}else{var c=(S.current+1)+" "+S.lang.of+" "+len}return c},getCurrent:function(){return S.current>-1?S.gallery[S.current]:null},hasNext:function(){return S.gallery.length>1&&(S.current!=S.gallery.length-1||S.options.continuous)},init:function(opts){if(initialized){return}initialized=true;opts=opts||{};init_options=opts;if(opts){apply(S.options,opts)}for(var e in S.options.ext){S.regex[e]=new RegExp(".("+S.options.ext[e].join("|")+")s*$","i")}if(!S.path){var path_re=/(.+)shadowbox\.js/i,path;each(document.getElementsByTagName("script"),function(s){if((path=path_re.exec(s.src))!=null){S.path=path[1];return false}})}if(S.options.adapter){S.adapter=S.options.adapter}else{for(var lib in S.libraries){if(typeof window[lib]!="undefined"){S.adapter=S.libraries[lib];break}}if(!S.adapter){S.adapter="base"}}if(S.options.useSizzle&&!window.Sizzle){U.include(S.path+"libraries/sizzle/sizzle.js")}if(!S.lang){U.include(S.path+"languages/shadowbox-"+S.options.language+".js")}each(S.options.players,function(p){if((p=="swf"||p=="flv")&&!window.swfobject){U.include(S.path+"libraries/swfobject/swfobject.js")}if(!S[p]){U.include(S.path+"players/shadowbox-"+p+".js")}});if(!S.lib){U.include(S.path+"adapters/shadowbox-"+S.adapter+".js")}},isActive:function(){return active},isPaused:function(){return slide_timer=="paused"},load:function(){if(S.skin.options){apply(S.options,S.skin.options);apply(S.options,init_options)}var markup=S.skin.markup.replace(/\{(\w+)\}/g,function(m,p){return S.lang[p]});S.lib.append(document.body,markup);if(S.skin.init){S.skin.init()}var id;S.lib.addEvent(window,"resize",function(){if(id){clearTimeout(id);id=null}if(active){id=setTimeout(function(){if(S.skin.onWindowResize){S.skin.onWindowResize()}var c=S.content;if(c&&c.onWindowResize){c.onWindowResize()}},50)}});if(!S.options.skipSetup){S.setup()}},next:function(){S.change(S.current+1)},open:function(obj){if(U.isLink(obj)){obj=S.buildCacheObj(obj)}if(obj.constructor==Array){S.gallery=obj;S.current=0}else{if(!obj.gallery){S.gallery=[obj];S.current=0}else{S.current=null;S.gallery=[];each(S.cache,function(c){if(c.gallery&&c.gallery==obj.gallery){if(S.current==null&&c.content==obj.content&&c.title==obj.title){S.current=S.gallery.length}S.gallery.push(c)}});if(S.current==null){S.gallery.unshift(obj);S.current=0}}}obj=S.getCurrent();if(obj.options){S.revertOptions();S.applyOptions(obj.options)}var g,r,m,s,a,oe=S.options.errors,msg,el;for(var i=0;i<S.gallery.length;++i){g=S.gallery[i]=apply({},S.gallery[i]);r=false;if(g.player=="unsupported"){r=true}else{if(m=S.regex.unsupported.exec(g.player)){if(S.options.handleUnsupported=="link"){g.player="html";switch(m[1]){case"qtwmp":s="either";a=[oe.qt.url,oe.qt.name,oe.wmp.url,oe.wmp.name];break;case"qtf4m":s="shared";a=[oe.qt.url,oe.qt.name,oe.f4m.url,oe.f4m.name];break;default:s="single";if(m[1]=="swf"||m[1]=="flv"){m[1]="fla"}a=[oe[m[1]].url,oe[m[1]].name]}msg=S.lang.errors[s].replace(/\{(\d+)\}/g,function(m,n){return a[n]});g.content='<div class="sb-message">'+msg+"</div>"}else{r=true}}else{if(g.player=="inline"){m=S.regex.inline.exec(g.content);if(m){var el=U.get(m[1]);if(el){g.content=el.innerHTML}else{throw"Cannot find element with id "+m[1]}}else{throw"Cannot find element id for inline content"}}else{if(g.player=="swf"||g.player=="flv"){var version=(g.options&&g.options.flashVersion)||S.options.flashVersion;if(!swfobject.hasFlashPlayerVersion(version)){g.width=310;g.height=177}}}}}if(r){S.gallery.splice(i,1);if(i<S.current){--S.current}else{if(i==S.current){S.current=i>0?i-1:i}}--i}}if(S.gallery.length){if(!active){if(typeof S.options.onOpen=="function"&&S.options.onOpen(obj)===false){return}v_cache=[];each(["select","object","embed","canvas"],function(tag){each(document.getElementsByTagName(tag),function(el){v_cache.push([el,el.style.visibility||"visible"]);el.style.visibility="hidden"})});var h=S.options.autoDimensions&&"height"in obj?obj.height:S.options.initialHeight;var w=S.options.autoDimensions&&"width"in obj?obj.width:S.options.initialWidth;S.skin.onOpen(h,w,loadContent)}else{loadContent()}active=true}},pause:function(){if(typeof slide_timer!="number"){return}var time=new Date().getTime();slide_delay=Math.max(0,slide_delay-(time-slide_start));if(slide_delay){clearTimeout(slide_timer);slide_timer="paused";if(S.skin.onPause){S.skin.onPause()}}},play:function(){if(!S.hasNext()){return}if(!slide_delay){slide_delay=S.options.slideshowDelay*1000}if(slide_delay){slide_start=new Date().getTime();slide_timer=setTimeout(function(){slide_delay=slide_start=0;S.next()},slide_delay);if(S.skin.onPlay){S.skin.onPlay()}}},previous:function(){S.change(S.current-1)},revertOptions:function(){apply(S.options,default_options)},setDimensions:function(height,width,max_h,max_w,tb,lr,resizable){var h=height=parseInt(height),w=width=parseInt(width),pad=parseInt(S.options.viewportPadding)||0;var extra_h=2*pad+tb;if(h+extra_h>=max_h){h=max_h-extra_h}var extra_w=2*pad+lr;if(w+extra_w>=max_w){w=max_w-extra_w}var resize_h=height,resize_w=width,change_h=(height-h)/height,change_w=(width-w)/width,oversized=(change_h>0||change_w>0);if(resizable&&oversized&&S.options.handleOversize=="resize"){if(change_h>change_w){w=Math.round((width/height)*h)}else{if(change_w>change_h){h=Math.round((height/width)*w)}}resize_w=w;resize_h=h}S.dimensions={height:h+tb,width:w+lr,inner_h:h,inner_w:w,top:(max_h-(h+extra_h))/2+pad,left:(max_w-(w+extra_w))/2+pad,oversized:oversized,resize_h:resize_h,resize_w:resize_w};return S.dimensions},setup:function(links,opts){if(!links){var links=[],rel;each(document.getElementsByTagName("a"),function(a){rel=a.getAttribute("rel");if(rel&&S.regex.rel.test(rel)){links.push(a)}})}else{var len=links.length;if(len){if(window.Sizzle){if(typeof links=="string"){links=Sizzle(links)}else{if(len==2&&links.push&&typeof links[0]=="string"&&links[1].nodeType){links=Sizzle(links[0],links[1])}}}}else{links=[links]}}each(links,function(link){if(typeof link.shadowboxCacheKey=="undefined"){link.shadowboxCacheKey=S.cache.length;S.lib.addEvent(link,"click",handleClick)}S.cache[link.shadowboxCacheKey]=S.buildCacheObj(link,opts)})}},U=S.util={animate:function(el,p,to,d,cb){var from=parseFloat(S.lib.getStyle(el,p));if(isNaN(from)){from=0}var delta=to-from;if(delta==0){if(cb){cb()}return}var op=p=="opacity";function fn(ease){var to=from+ease*delta;if(op){U.setOpacity(el,to)}else{el.style[p]=to+"px"}}if(!d||(!op&&!S.options.animate)||(op&&!S.options.animateFade)){fn(1);if(cb){cb()}return}d*=1000;var begin=new Date().getTime(),end=begin+d,time,timer=setInterval(function(){time=new Date().getTime();if(time>=end){clearInterval(timer);fn(1);if(cb){cb()}}else{fn(S.options.ease((time-begin)/d))}},10)},apply:function(o,e){for(var p in e){o[p]=e[p]}return o},clearOpacity:function(el){var s=el.style;if(window.ActiveXObject){if(typeof s.filter=="string"&&(/alpha/i).test(s.filter)){s.filter=s.filter.replace(/[\w\.]*alpha\(.*?\);?/i,"")}}else{s.opacity=""}},each:function(obj,fn,scope){for(var i=0,len=obj.length;i<len;++i){if(fn.call(scope||obj[i],obj[i],i,obj)===false){return}}},get:function(id){return document.getElementById(id)},include:function(){var includes={};return function(file){if(includes[file]){return}includes[file]=true;document.write('<script type="text/javascript" src="'+file+'"><\/script>')}}(),isLink:function(obj){if(!obj||!obj.tagName){return false}var up=obj.tagName.toUpperCase();return up=="A"||up=="AREA"},removeChildren:function(el){while(el.firstChild){el.removeChild(el.firstChild)}},setOpacity:function(el,o){var s=el.style;if(window.ActiveXObject){s.zoom=1;s.filter=(s.filter||"").replace(/\s*alpha\([^\)]*\)/gi,"")+(o==1?"":" alpha(opacity="+(o*100)+")")}else{s.opacity=o}}},apply=U.apply,each=U.each,init_options,initialized=false,default_options={},content_id="sb-content",active=false,slide_timer,slide_start,slide_delay=0,v_cache=[];if(navigator.plugins&&navigator.plugins.length){var names=[];each(navigator.plugins,function(p){names.push(p.name)});names=names.join();var detectPlugin=function(n){return names.indexOf(n)>-1};var f4m=detectPlugin("Flip4Mac");S.plugins={fla:detectPlugin("Shockwave Flash"),qt:detectPlugin("QuickTime"),wmp:!f4m&&detectPlugin("Windows Media"),f4m:f4m}}else{function detectPlugin(n){try{var axo=new ActiveXObject(n)}catch(e){}return!!axo}S.plugins={fla:detectPlugin("ShockwaveFlash.ShockwaveFlash"),qt:detectPlugin("QuickTime.QuickTime"),wmp:detectPlugin("wmplayer.ocx"),f4m:false}}function getPlayer(url){var re=S.regex,p=S.plugins,m=url.match(re.domain),d=m&&document.domain==m[1];if(url.indexOf("#")>-1&&d){return"inline"}var q=url.indexOf("?");if(q>-1){url=url.substring(0,q)}if(re.img.test(url)){return"img"}if(re.swf.test(url)){return p.fla?"swf":"unsupported-swf"}if(re.flv.test(url)){return p.fla?"flv":"unsupported-flv"}if(re.qt.test(url)){return p.qt?"qt":"unsupported-qt"}if(re.wmp.test(url)){if(p.wmp){return"wmp"}if(p.f4m){return"qt"}if(S.client.isMac){return p.qt?"unsupported-f4m":"unsupported-qtf4m"}return"unsupported-wmp"}if(re.qtwmp.test(url)){if(p.qt){return"qt"}if(p.wmp){return"wmp"}return S.client.isMac?"unsupported-qt":"unsupported-qtwmp"}if(!d||re.iframe.test(url)){return"iframe"}return"unsupported"}function handleClick(e){var link;if(U.isLink(this)){link=this}else{link=S.lib.getTarget(e);while(!U.isLink(link)&&link.parentNode){link=link.parentNode}}if(link){var key=link.shadowboxCacheKey;if(typeof key!="undefined"&&typeof S.cache[key]!="undefined"){link=S.cache[key]}S.open(link);if(S.gallery.length){S.lib.preventDefault(e)}}}function listenKeys(on){if(!S.options.enableKeys){return}S.lib[(on?"add":"remove")+"Event"](document,"keydown",handleKey)}function handleKey(e){var code=S.lib.keyCode(e);S.lib.preventDefault(e);switch(code){case 81:case 88:case 27:S.close();break;case 37:S.previous();break;case 39:S.next();break;case 32:S[(typeof slide_timer=="number"?"pause":"play")]()}}function loadContent(){var obj=S.getCurrent();if(!obj){return}var p=obj.player=="inline"?"html":obj.player;if(typeof S[p]!="function"){throw"Unknown player: "+p}var change=false;if(S.content){S.content.remove();change=true;S.revertOptions();if(obj.options){S.applyOptions(obj.options)}}U.removeChildren(S.skin.bodyEl());S.content=new S[p](obj);listenKeys(false);S.skin.onLoad(S.content,change,function(){if(!S.content){return}if(typeof S.content.ready!="undefined"){var id=setInterval(function(){if(S.content){if(S.content.ready){clearInterval(id);id=null;S.skin.onReady(contentReady)}}else{clearInterval(id);id=null}},100)}else{S.skin.onReady(contentReady)}});if(S.gallery.length>1){var next=S.gallery[S.current+1]||S.gallery[0];if(next.player=="img"){var a=new Image();a.src=next.content}var prev=S.gallery[S.current-1]||S.gallery[S.gallery.length-1];if(prev.player=="img"){var b=new Image();b.src=prev.content}}}function contentReady(){if(!S.content){return}S.content.append(S.skin.bodyEl(),content_id,S.dimensions);S.skin.onFinish(finishContent)}function finishContent(){if(!S.content){return}if(S.content.onLoad){S.content.onLoad()}if(S.options.onFinish){S.options.onFinish()}if(!S.isPaused()){S.play()}listenKeys(true)}return S}();Shadowbox.skin=function(){var e=Shadowbox,d=e.util,o=false,k=["sb-nav-close","sb-nav-next","sb-nav-play","sb-nav-pause","sb-nav-previous"];function l(){d.get("sb-container").style.top=document.documentElement.scrollTop+"px"}function g(p){var q=d.get("sb-overlay"),r=d.get("sb-container"),t=d.get("sb-wrapper");if(p){if(e.client.isIE6){l();e.lib.addEvent(window,"scroll",l)}if(e.options.showOverlay){o=true;q.style.backgroundColor=e.options.overlayColor;d.setOpacity(q,0);if(!e.options.modal){e.lib.addEvent(q,"click",e.close)}t.style.display="none"}r.style.visibility="visible";if(o){var s=parseFloat(e.options.overlayOpacity);d.animate(q,"opacity",s,e.options.fadeDuration,p)}else{p()}}else{if(e.client.isIE6){e.lib.removeEvent(window,"scroll",l)}e.lib.removeEvent(q,"click",e.close);if(o){t.style.display="none";d.animate(q,"opacity",0,e.options.fadeDuration,function(){r.style.display="";t.style.display="";d.clearOpacity(q)})}else{r.style.visibility="hidden"}}}function b(r,p){var q=d.get("sb-nav-"+r);if(q){q.style.display=p?"":"none"}}function i(r,q){var t=d.get("sb-loading"),v=e.getCurrent().player,u=(v=="img"||v=="html");if(r){function s(){d.clearOpacity(t);if(q){q()}}d.setOpacity(t,0);t.style.display="";if(u){d.animate(t,"opacity",1,e.options.fadeDuration,s)}else{s()}}else{function s(){t.style.display="none";d.clearOpacity(t);if(q){q()}}if(u){d.animate(t,"opacity",0,e.options.fadeDuration,s)}else{s()}}}function a(s){var u=e.getCurrent();d.get("sb-title-inner").innerHTML=u.title||"";var x,r,t,y,q;if(e.options.displayNav){x=true;var w=e.gallery.length;if(w>1){if(e.options.continuous){r=q=true}else{r=(w-1)>e.current;q=e.current>0}}if(e.options.slideshowDelay>0&&e.hasNext()){y=!e.isPaused();t=!y}}else{x=r=t=y=q=false}b("close",x);b("next",r);b("play",t);b("pause",y);b("previous",q);var x="";if(e.options.displayCounter&&e.gallery.length>1){var v=e.getCounter();if(typeof v=="string"){x=v}else{d.each(v,function(p){x+='<a onclick="Shadowbox.change('+p+');"';if(p==e.current){x+=' class="sb-counter-current"'}x+=">"+(p+1)+"</a>"})}}d.get("sb-counter").innerHTML=x;s()}function h(r,q){var w=d.get("sb-wrapper"),z=d.get("sb-title"),s=d.get("sb-info"),p=d.get("sb-title-inner"),x=d.get("sb-info-inner"),y=parseInt(e.lib.getStyle(p,"height"))||0,v=parseInt(e.lib.getStyle(x,"height"))||0;function u(){p.style.visibility=x.style.visibility="hidden";a(q)}if(r){d.animate(z,"height",0,0.35);d.animate(s,"height",0,0.35);d.animate(w,"paddingTop",y,0.35);d.animate(w,"paddingBottom",v,0.35,u)}else{z.style.height=s.style.height="0px";w.style.paddingTop=y+"px";w.style.paddingBottom=v+"px";u()}}function j(r){var q=d.get("sb-wrapper"),u=d.get("sb-title"),s=d.get("sb-info"),x=d.get("sb-title-inner"),w=d.get("sb-info-inner"),v=parseInt(e.lib.getStyle(x,"height"))||0,p=parseInt(e.lib.getStyle(w,"height"))||0;x.style.visibility=w.style.visibility="";if(x.innerHTML!=""){d.animate(u,"height",v,0.35);d.animate(q,"paddingTop",0,0.35)}d.animate(s,"height",p,0.35);d.animate(q,"paddingBottom",0,0.35,r)}function c(q,x,w,p){var y=d.get("sb-body"),v=d.get("sb-wrapper"),u=parseInt(q),r=parseInt(x);if(w){d.animate(y,"height",u,e.options.resizeDuration);d.animate(v,"top",r,e.options.resizeDuration,p)}else{y.style.height=u+"px";v.style.top=r+"px";if(p){p()}}}function f(u,x,v,p){var t=d.get("sb-wrapper"),r=parseInt(u),q=parseInt(x);if(v){d.animate(t,"width",r,e.options.resizeDuration);d.animate(t,"left",q,e.options.resizeDuration,p)}else{t.style.width=r+"px";t.style.left=q+"px";if(p){p()}}}function n(p){var r=e.content;if(!r){return}var q=m(r.height,r.width,r.resizable);switch(e.options.animSequence){case"hw":c(q.inner_h,q.top,true,function(){f(q.width,q.left,true,p)});break;case"wh":f(q.width,q.left,true,function(){c(q.inner_h,q.top,true,p)});break;default:f(q.width,q.left,true);c(q.inner_h,q.top,true,p)}}function m(p,s,r){var q=d.get("sb-body-inner");sw=d.get("sb-wrapper"),so=d.get("sb-overlay"),tb=sw.offsetHeight-q.offsetHeight,lr=sw.offsetWidth-q.offsetWidth,max_h=so.offsetHeight,max_w=so.offsetWidth;return e.setDimensions(p,s,max_h,max_w,tb,lr,r)}return{markup:'<div id="sb-container"><div id="sb-overlay"></div><div id="sb-wrapper"><div id="sb-title"><div id="sb-title-inner"></div></div><div id="sb-body"><div id="sb-body-inner"></div><div id="sb-loading"><a onclick="Shadowbox.close()">{cancel}</a></div></div><div id="sb-info"><div id="sb-info-inner"><div id="sb-counter"></div><div id="sb-nav"><a id="sb-nav-close" title="{close}" onclick="Shadowbox.close()"></a><a id="sb-nav-next" title="{next}" onclick="Shadowbox.next()"></a><a id="sb-nav-play" title="{play}" onclick="Shadowbox.play()"></a><a id="sb-nav-pause" title="{pause}" onclick="Shadowbox.pause()"></a><a id="sb-nav-previous" title="{previous}" onclick="Shadowbox.previous()"></a></div><div style="clear:both"></div></div></div></div></div>',options:{animSequence:"sync"},init:function(){if(e.client.isIE6){d.get("sb-body").style.zoom=1;var r,p,q=/url\("(.*\.png)"\)/;d.each(k,function(s){r=d.get(s);if(r){p=e.lib.getStyle(r,"backgroundImage").match(q);if(p){r.style.backgroundImage="none";r.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src="+p[1]+",sizingMethod=scale);"}}})}},bodyEl:function(){return d.get("sb-body-inner")},onOpen:function(r,q,p){d.get("sb-container").style.display="block";var s=m(r,q);c(s.inner_h,s.top,false);f(s.width,s.left,false);g(p)},onLoad:function(q,r,p){i(true);h(r,function(){if(!q){return}if(!r){d.get("sb-wrapper").style.display=""}p()})},onReady:function(p){n(function(){j(p)})},onFinish:function(p){i(false,p)},onClose:function(){g(false)},onPlay:function(){b("play",false);b("pause",true)},onPause:function(){b("pause",false);b("play",true)},onWindowResize:function(){var r=e.content;if(!r){return}var q=m(r.height,r.width,r.resizable);f(q.width,q.left,false);c(q.inner_h,q.top,false);var p=d.get(e.contentId());if(p){if(r.resizable&&e.options.handleOversize=="resize"){p.height=q.resize_h;p.width=q.resize_w}}}}}();if(typeof Shadowbox=='undefined')
throw'Unable to load Shadowbox language file, Shadowbox not found.';Shadowbox.lang={code:'pt-BR',of:'de',loading:'carregando',cancel:'Cancelar',next:'PrÃ³ximo',previous:'Anterior',play:'Play',pause:'Pause',close:'Fechar',errors:{single:'VocÃª precisa instalar o plugin <a href="{0}">{1}</a> para visualizar o conteÃºdo.',shared:'VocÃª precisa instalar os plugins <a href="{0}">{1}</a> e <a href="{2}">{3}</a>, para visualizar o conteÃºdo.',either:'VocÃª precisa instalar o plugin <a href="{0}">{1}</a> ou o plugin <a href="{2}">{3}</a>, para visualizar o conteÃºdo.'}};(function(h){var e=h.util,i,k,j="sb-drag-layer",d;function b(){i={x:0,y:0,start_x:null,start_y:null}}function c(m,o,l){if(m){b();var n=["position:absolute","height:"+o+"px","width:"+l+"px","cursor:"+(h.client.isGecko?"-moz-grab":"move"),"background-color:"+(h.client.isIE?"#fff;filter:alpha(opacity=0)":"transparent")].join(";");h.lib.append(h.skin.bodyEl(),'<div id="'+j+'" style="'+n+'"></div>');h.lib.addEvent(e.get(j),"mousedown",g)}else{var p=e.get(j);if(p){h.lib.removeEvent(p,"mousedown",g);h.lib.remove(p)}k=null}}function g(m){h.lib.preventDefault(m);var l=h.lib.getPageXY(m);i.start_x=l[0];i.start_y=l[1];k=e.get(h.contentId());h.lib.addEvent(document,"mousemove",f);h.lib.addEvent(document,"mouseup",a);if(h.client.isGecko){e.get(j).style.cursor="-moz-grabbing"}}function a(){h.lib.removeEvent(document,"mousemove",f);h.lib.removeEvent(document,"mouseup",a);if(h.client.isGecko){e.get(j).style.cursor="-moz-grab"}}function f(o){var q=h.content,p=h.dimensions,n=h.lib.getPageXY(o);var m=n[0]-i.start_x;i.start_x+=m;i.x=Math.max(Math.min(0,i.x+m),p.inner_w-q.width);k.style.left=i.x+"px";var l=n[1]-i.start_y;i.start_y+=l;i.y=Math.max(Math.min(0,i.y+l),p.inner_h-q.height);k.style.top=i.y+"px"}h.img=function(m){this.obj=m;this.resizable=true;this.ready=false;var l=this;d=new Image();d.onload=function(){l.height=m.height?parseInt(m.height,10):d.height;l.width=m.width?parseInt(m.width,10):d.width;l.ready=true;d.onload="";d=null};d.src=m.content};h.img.prototype={append:function(l,o,n){this.id=o;var m=document.createElement("img");m.id=o;m.src=this.obj.content;m.style.position="absolute";m.setAttribute("height",n.resize_h);m.setAttribute("width",n.resize_w);l.appendChild(m)},remove:function(){var l=e.get(this.id);if(l){h.lib.remove(l)}c(false);if(d){d.onload="";d=null}},onLoad:function(){var l=h.dimensions;if(l.oversized&&h.options.handleOversize=="drag"){c(true,l.resize_h,l.resize_w)}},onWindowResize:function(){if(k){var p=h.content,o=h.dimensions,n=parseInt(h.lib.getStyle(k,"top")),m=parseInt(h.lib.getStyle(k,"left"));if(n+p.height<o.inner_h){k.style.top=o.inner_h-p.height+"px"}if(m+p.width<o.inner_w){k.style.left=o.inner_w-p.width+"px"}}}}})(Shadowbox);if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(){var b=Shadowbox.client,a=document.defaultView,d;if(b.isIE6){d=[];function c(){var h;for(var g=0,f=d.length;g<f;++g){h=d[g];h[0].detachEvent("on"+h[1],h[2])}window.detachEvent("onunload",c)}window.attachEvent("onunload",c)}return{getStyle:a&&a.getComputedStyle?function(h,g){var e,f;if(g=="float"){g="cssFloat"}if(e=h.style[g]){return e}if(f=a.getComputedStyle(h,"")){return f[g]}return null}:function(i,h){var f,g;if(h=="opacity"){if(typeof i.style.filter=="string"){var e=i.style.filter.match(/alpha\(opacity=(.+)\)/i);if(e){var j=parseFloat(e[1]);if(!isNaN(j)){return(j?j/100:0)}}}return 1}if(h=="float"){h="styleFloat"}if(f=i.style[h]){return f}if(g=i.currentStyle){return g[h]}return null},remove:function(e){e.parentNode.removeChild(e)},getTarget:function(g){var f=g.target?g.target:g.srcElement;return f.nodeType==3?f.parentNode:f},getPageXY:function(g){var f=g.pageX||(g.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));var h=g.pageY||(g.clientY+(document.documentElement.scrollTop||document.body.scrollTop));return[f,h]},preventDefault:function(f){if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}},keyCode:function(f){return f.which?f.which:f.keyCode},addEvent:function(g,e,f){if(d){d[d.length]=arguments}if(g.addEventListener){g.addEventListener(e,f,false)}else{if(g.attachEvent){g.attachEvent("on"+e,f)}}},removeEvent:function(g,e,f){if(g.removeEventListener){g.removeEventListener(e,f,false)}else{if(g.detachEvent){g.detachEvent("on"+e,f)}}},append:function(g,f){if(g.insertAdjacentHTML){g.insertAdjacentHTML("BeforeEnd",f)}else{if(g.lastChild){var e=g.ownerDocument.createRange();e.setStartAfter(g.lastChild);var h=e.createContextualFragment(f);g.appendChild(h)}else{g.innerHTML=f}}}}}();(function(){var c,b=false;function a(){if(b){return}b=true;if(c){window.clearInterval(c)}Shadowbox.load()}if(document.addEventListener){if(Shadowbox.client.isWebkit){c=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){a()}},0)}else{document.addEventListener("DOMContentLoaded",a,false)}}else{document.write("<script id=__onDOMReady defer src=//:><\/script>");document.getElementById("__onDOMReady").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;a()}}}Shadowbox.lib.addEvent(window,"load",a)})();function arrayFind(ary,element){for(var i=0;i<ary.length;i++){if(ary[i]==element){return i;}}
return-1;}
var pImg=new Array();var fotoAtual=new Object();function abreFoto(pasta,id,nr,tamanho){var Img=document.getElementById('foto');var srcImg='/arquivos/'+pasta+'/'+id+'/'+nr+'/'+tamanho+'/foto.jpg';Img.src=srcImg;fotoAtual={secao:pasta,id:id,nr:nr};if(arrayFind(pImg,Img.src)==-1){pImg.push(Img.src);mostrar('loadingFoto');}}
function abreFotoGrande(){var srcImgG='/arquivos/'+fotoAtual.secao+'/'+fotoAtual.id+'/'+fotoAtual.nr+'.jpg';;abrirImagemShadowbox(srcImgG);}
function abrirSlideshow(){}
function abreFotoFim(){esconder('loadingFoto');}
function ampliarFoto(){var foto=getElement('fotoGrande');var img='<img src="/arquivos/'+fotoAtual.secao+'/'+fotoAtual.id+'/'+fotoAtual.nr+'.jpg" />';foto.innerHTML=img;foto.style.display='block';}
function ampliarFotoFechar(){var foto=getElement('fotoGrande');foto.style.display='none';}
function abrirSecao(nome,args){if(args==undefined)xabrirSecao(nome);else xabrirSecao(nome,args);}
function mostrarCarregando(){var secao=getElement('conteudoSecao');var loading=getElement('loadingAjax');var altura=parseInt(secao.style.height);if(altura>600)loading.style.height=altura+'px';secao.style.display='none';loading.style.display='block';}
function mostrarSecao(){var secao=getElement('conteudoSecao');var loading=getElement('loadingAjax');loading.style.display='none';secao.style.display='block';}
function fadeOut(target,time){if(time==undefined)time=0.05;alpha=100;timer=(time*1000)/50;var i=setInterval(function(){if(alpha<=0)
clearInterval(i);setAlpha(target,alpha);alpha-=2;},timer);target.style.display='none';}
function fadeIn(target,time){if(time==undefined)time=0.1;target.style.display='block';alpha=0;timer=(time*1000)/50;var i=setInterval(function(){if(alpha>=100)
clearInterval(i);setAlpha(target,alpha);alpha+=2;},timer);}
function setAlpha(target,alpha){target.style.filter="alpha(opacity="+alpha+")";target.style.opacity=alpha/100;}
function abrirSwf(id){if(id==2)id=5;xabrirSecao('swf',id);}
function iniciarBox(){Shadowbox.path="/js/box/";Shadowbox.init({language:"pt-br",players:["img"],enableKeys:true,useSizzle:false,showMovieControls:true,slideshowDelay:3.5});}
function abrirImagemShadowbox(){var fotos=[];var i;for(i=0;i<arguments.length;i++){var src=arguments[i];var img={player:'img',content:src};fotos[i]=img;}
var config={gallery:'imagem',continuous:true,animSequence:'sync'};Shadowbox.open(fotos,config);Shadowbox.play();}function somenteNumerosi(Tecla){var wTecla=(Tecla.which)?Tecla.which:Tecla.keyCode;return somenteNumeros(wTecla);}
function somenteNumeros(charCode){if(charCode>31&&(charCode<48||charCode>57))return false;return true;}
function deixarSomenteLetras(Valor){var Letras='ABCDEFGHIJLMNOPQRSTUVXZYWK';Letras+=Letras.toLowerCase();var novoValor='';for(i=0;i<=Valor.length;i++){var Letra=Valor.charAt(i);if(Letras.indexOf(Letra)>=0){novoValor+=Letra;}}
return novoValor;}
function FormataAno(Input){var Valor=Input.value;var Tamanho=Valor.length;if(Tamanho==2){if(Valor>=70)
Valor='19'+Valor;else
Valor='20'+Valor;}
Input.value=Valor;}
function FormataUsuario(Campo,Evento){var Valor=Campo.value;var whichCode=(Evento.which)?Evento.which:Evento.keyCode;var novoCaractere=String.fromCharCode(whichCode);if(whichCode==13||whichCode==9||whichCode==8)return true;Valor=deixarSomenteLetras(Valor+novoCaractere);Campo.value=Valor.toLowerCase();return false;}
function getSelecao(){if(window.getSelection)
return window.getSelection();if(document.getSelection)
return document.getSelection();if(document.selection)
return document.selection.createRange().text;}
function FormataReais(Campo,e,MaxNumeros,nCasasDec,Moeda,Comp){var Selecao=getSelecao();Campo.value=Campo.value.replace(Selecao,'');var milSep='.';var decSep=',';var campoValor=Campo.value;var Numero=numeroMeio=numeroPronto='';var sep=0;var key='';var i=j=r=0;var len=len2=0;var strCheck='0123456789';var whichCode=(e.which)?e.which:e.keyCode;if(whichCode==13||whichCode==9)return true;key=String.fromCharCode(whichCode);if(whichCode==8)key='0';if(strCheck.indexOf(key)==-1)return false;for(r=0;r<Moeda.length;r++){campoValor=campoValor.replace(Moeda.charAt(r),"");}
len=campoValor.length;for(i=0;i<len;i++){if((campoValor.charAt(i)!='0')&&(campoValor.charAt(i)!=decSep))
break;}
Numero='';for(;i<len;i++){var Carac=campoValor.charAt(i);if(strCheck.indexOf(Carac)!=-1)
Numero+=Carac;}
if(whichCode==8)
Numero=Numero.substr(0,Numero.length-1);else
Numero+=key;len=Numero.length;if(len>(MaxNumeros+nCasasDec))return false;numeroPronto='';if(nCasasDec>=1){if(len==0)numeroPronto='0'+decSep+'00';if(len==1)numeroPronto='0'+decSep+'0'+Numero;if(len==2)numeroPronto='0'+decSep+Numero;}else{decSep='';}
if(len>2||nCasasDec<1){numeroMeio='';for(j=0,i=len-(nCasasDec+1);i>=0;i--){if(j==3){numeroMeio+=milSep;j=0;}
numeroMeio+=Numero.charAt(i);j++;}
len2=numeroMeio.length;for(i=len2-1;i>=0;i--){numeroPronto+=numeroMeio.charAt(i);}
numeroPronto+=decSep+Numero.substr(len-nCasasDec,len);}
if(numeroPronto){Campo.value=Moeda+numeroPronto+(Comp?' '+Comp:'');}else{Campo.value='';}
return false;}
function FormataData(pCampo,pTeclaPres){var wTecla=(pTeclaPres.which)?pTeclaPres.which:pTeclaPres.keyCode;if(!somenteNumeros(wTecla))return false;wVr=pCampo.value;wVr=wVr.replace(".","");wVr=wVr.replace("/","");wVr=wVr.replace("/","");wVr=wVr.replace("/","");wTam=wVr.length+1;if(wTecla!=9&&wTecla!=8){if(wTam>2&&wTam<5)
pCampo.value=wVr.substr(0,wTam-2)+'/'+wVr.substr(wTam-2,wTam);if(wTam>=5&&wTam<=10)
pCampo.value=wVr.substr(0,2)+'/'+wVr.substr(2,2)+'/'+wVr.substr(4,4);}}
function FormataHora(pCampo,pTeclaPres){var wTecla=(pTeclaPres.which)?pTeclaPres.which:pTeclaPres.keyCode;if(!somenteNumeros(wTecla))return false;wVr=pCampo.value;wVr=wVr.replace(".","");wVr=wVr.replace(":","");wVr=wVr.replace(":","");wVr=wVr.replace(":","");wTam=wVr.length+1;if(wTecla!=9&&wTecla!=8){if(wTam>2&&wTam<5)
pCampo.value=wVr.substr(0,wTam-2)+':'+wVr.substr(wTam-2,wTam);if(wTam>=5&&wTam<=10)
pCampo.value=wVr.substr(0,2)+':'+wVr.substr(2,2)+':'+wVr.substr(4,4);}}
function formatar(mascara,documento,event){var wTecla=(event.which)?event.which:event.keyCode;if(wTecla==13||wTecla==9||wTecla==8)return true;var i=documento.value.length;var saida=mascara.substring(0,1);var texto=mascara.substring(i);if(texto.substring(0,1)!=saida){documento.value+=texto.substring(0,1);}}
function FormataDadoCNPJ(pCampo,pTeclaPres){var wTecla=(pTeclaPres.which)?pTeclaPres.which:pTeclaPres.keyCode;if(!somenteNumeros(wTecla))return false;formatar('##.###.###/####-##',pCampo,pTeclaPres);}
function FormataDadoCPF(pCampo,pTeclaPres){var wTecla=(pTeclaPres.which)?pTeclaPres.which:pTeclaPres.keyCode;if(!somenteNumeros(wTecla))return false;formatar('###.###.###-##',pCampo,pTeclaPres);}
function FormataCEP(pCampo,pTeclaPres){var wTecla=(pTeclaPres.which)?pTeclaPres.which:pTeclaPres.keyCode;if(!somenteNumeros(wTecla))return false;formatar('#####-###',pCampo,pTeclaPres);}
function FormataCampo(Mascara,pCampo,pTeclaPres){var wTecla=(pTeclaPres.which)?pTeclaPres.which:pTeclaPres.keyCode;if(!somenteNumeros(wTecla))return false;formatar(Mascara,pCampo,pTeclaPres);}
function FormataCampoString(Mascara,pCampo,pTeclaPres){formatar(Mascara,pCampo,pTeclaPres);}
function FormataTEL(pCampo,pTeclaPres){var wTecla=(pTeclaPres.which)?pTeclaPres.which:pTeclaPres.keyCode;if(!somenteNumeros(wTecla))return false;if(wTecla==13||wTecla==9)return true;var wTam;wVr=pCampo.value;wVr=wVr.replace(" ","");wVr=wVr.replace("(","");wVr=wVr.replace(")","");wVr=wVr.replace("-","");wTam=wVr.length+1;wVr=wVr.substr(0,9);if(wTecla!=9&&wTecla!=8){var Valor='';if(wTam<=7)
Valor=wVr.substr(0,3)+'-'+wVr.substr(3,4);if(wTam>7&&wTam<=8)
Valor=wVr.substr(0,4)+'-'+wVr.substr(4,4);if(wTam>8)
Valor='('+wVr.substr(0,2)+')'+' '+wVr.substr(2,4)+'-'+wVr.substr(6,4);pCampo.value=Valor;}}
function restringeCarac(Input,Max,Carro){var Tamanho=Input.value.length;getElement(Carro).innerHTML=(Max-Tamanho);if(Tamanho>=Max){Input.value=Input.value.substring(0,Max-1);return false;}}function confirma(msg){var agree=confirm(msg);if(agree)
return true;else
return false;}
function abrir(dochtml,altura,largura,scrollbar){if(navigator.appName=="Netscape"){sec=window.open(dochtml,'_blank','scrollbars='+scrollbar+',toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,fullscreen=no,copyhistory=no,height='+largura+',width='+altura+',top=51,left=5');window.sec.focus();}
else{window.open(dochtml,'_blank','scrollbars='+scrollbar+',toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,fullscreen=no,copyhistory=no,height='+largura+',width='+altura+',center=yes');}}
function ir(url){location.href=url;}
function ir2(url){window.open(url,'_blank');}
function switchImage(imgName,imgSrc){if(document.images){if(imgSrc!="none"){document.images[imgName].src=imgSrc;}}}
function mudarimg(id,pasta,ex,selObj){switchImage(id,pasta+selObj.options[selObj.selectedIndex].value+ex);}
function mudarimg1(id,caminho){switchImage(id,caminho);}
function MudaCor(Obj,Color){Obj.style.backgroundColor=Color;}
function MudaClasse(Obj,Class){Obj.className=Class;}
function mudaclass(id,cclass){document.getElementById(id).className=cclass;}
function checkInput(obj,palavra){if(obj.value.length==palavra.length){if(obj.value==palavra){document.getElementById('botaoi').disabled=true;document.getElementById('concursoi').submit();}else{alert('A palavra não coincide!');document.getElementById('botaoi').disabled=false;obj.value='';obj.focus();}}else{return false;}}
function esconder(id){document.getElementById(id).style.display='none';}
function mostrar(id){document.getElementById(id).style.display='block';}
function destroi(id){esconder(id);document.getElementById(id).innerHTML='';}
function addOption(selectId,txt,val,sel){var Select=getElement(selectId);var objOption=new Option(txt,val);Select.options.add(objOption);if(sel==undefined)sel='';Select.value=sel;}
function resetOption(selectId){var selectElemRef=document.getElementById(selectId);while(selectElemRef.length>0){selectElemRef.remove(0);}}
function fenable(Id){var Item=document.getElementById(Id);Item.disabled=false;}
function fdisable(Id){var Item=document.getElementById(Id);Item.disabled=true;}
function igetValue(Item){var Tipo=Item.type;if(Tipo=='select-one'||Tipo=='select-multiple'){var Indice=Item.selectedIndex;var Valor=Item.options[Indice].value;return Valor;}else if(Tipo=='checkbox'){if(Item.checked){return Item.value;}
else{return 0;}}else{return Item.value;}}
function getValue(Id){var Item=document.getElementById(Id);return igetValue(Item);}
function igetValueRadio(itens){var i;var value=false;var item;for(i=0;i<itens.length;i++){item=itens[i];if(item.checked)value=item.value;}
return value;}
function getElement(Id){var Item=document.getElementById(Id);return Item;}
if(Browser==undefined)
{var Browser={isIE:function(){return(window.ActiveXObject&&document.all&&navigator.userAgent.toLowerCase().indexOf("msie")>-1&&navigator.userAgent.toLowerCase().indexOf("opera")==-1)?true:false;}};}
var Flash=function(movie,id,width,height,initParams)
{this.html="";this.variables=new Array();this.flashversion=(typeof initParams!="undefined"&&typeof initParams.flashversion!="undefined")?initParams.flashversion:"7,0,0,0";this.attributes={"classid":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000","codebase":"http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version="+this.flashversion,"type":"application/x-shockwave-flash"};this.params={"pluginurl":"http://www.macromedia.com/go/getflashplayer"};if(movie)
{this.addAttribute("data",movie);this.addParameter("movie",movie);}
if(id&&id!=null&&(this.id=id))
{this.addAttribute("id",this.id);this.addAttribute("name",this.id);}
else
{this.id=null;}
if(width)this.addAttribute("width",width);if(height)this.addAttribute("height",height);if(initParams!=undefined)
{for(var i in initParams)this.addParameter(i.toString(),initParams[i]);}};Flash.version="v1.8";Flash.prototype.getObject=function()
{if(this.id==null)return null;try
{if(window.document[this.id])
{return window.document[this.id];}
else
{return document.getElementById(window.document[this.id]);}}
catch(e){return null;}};Flash.getObjectByExceptions=function(obj,excep)
{var tempObj={};for(var i in obj)
{var EOF=false;for(var j=0;j<excep.length;j++)if(excep[j]==i.toString()){EOF=true;break;};if(!EOF)tempObj[i]=obj[i];}
return tempObj;};Flash.prototype.addAttribute=function(prop,val){this.attributes[prop]=val;};Flash.prototype.addParameter=function(prop,val){this.params[prop]=val;};Flash.prototype.addVariable=function(prop,val){this.variables.push([prop,val]);};Flash.prototype.getFlashVars=function()
{for(var i=0,tempString=new Array();i<this.variables.length;i++)tempString.push(this.variables[i].join("="));return tempString.join("&");};Flash.prototype.toString=function()
{this.params.flashVars=this.getFlashVars();if(Browser.isIE())
{this.html="<ob"+"ject";var attr=Flash.getObjectByExceptions(this.attributes,["type","data"]);for(var i in attr)if(i.toString()!="extend")this.html+=" "+i.toString()+" = \""+attr[i]+"\"";this.html+="> ";var params=Flash.getObjectByExceptions(this.params,["pluginurl","extend"]);for(var i in params)if(i.toString()!="extend")this.html+="<param name=\""+i.toString()+"\" value=\""+params[i]+"\" /> ";this.html+=" </obj"+"ect>";}
else
{this.html="<!--[if !IE]> <--> <obj"+"ect";var attr=Flash.getObjectByExceptions(this.attributes,["classid","codebase"]);for(var i in attr)if(i.toString()!="extend")this.html+=" "+i.toString()+" = \""+attr[i]+"\"";this.html+="> ";var params=Flash.getObjectByExceptions(this.params,["extend"]);for(var i in params)if(i.toString()!="extend")this.html+="<param name=\""+i.toString()+"\" value=\""+params[i]+"\" /> ";this.html+=" </obj"+"ect> <!--> <![endif]-->";}
return this.html;};Flash.prototype.write=Flash.prototype.writeIn=function(w)
{if(typeof w=="string"&&(w=document.getElementById(w)));if(w!=null){w.innerHTML=this.toString();}
else if(w==undefined){document.write(this.toString());}
else{return false;}};Flash.correctAll=function()
{if(!/msie/.test(navigator.userAgent.toLowerCase())||!document.getElementsByTagName)return false;for(var i=0,objects=document.getElementsByTagName("OBJECT");i<objects.length;(objects[i].outerHTML?(objects[i].outerHTML=objects[i].outerHTML,objects[i].style.visibility="visible"):null),i++);};Flash.automatic=function(r)
{if(r&&window.attachEvent)
{for(var i=0,objects=document.getElementsByTagName("OBJECT");i<objects.length;(objects[i].style.visibility="hidden"),i++);window.attachEvent("onload",Flash.correctAll);window.attachEvent("onunload",function(){window.detachEvent("onload",Flash.correctAll);});}
else
{Flash.correctAll();}};Array.prototype.containsValue=function(valueToCheck){for(var i=0;i<this.length;i++){if(this[i]==valueToCheck)return true;}
return false;}
function Xajax(){this.DebugMessage=function(text){if(text.length>1000)text=text.substr(0,1000)+"...\n[long response]\n...";try{if(this.debugWindow==undefined||this.debugWindow.closed==true){this.debugWindow=window.open('about:blank','xajax-debug','width=800,height=600,scrollbars=1,resizable,status');this.debugWindow.document.write('<html><head><title>Xajax debug output</title></head><body><h2>Xajax debug output</h2><div id="debugTag"></div></body></html>');}
text=text.replace(/&/g,"&amp;")
text=text.replace(/</g,"&lt;")
text=text.replace(/>/g,"&gt;")
debugTag=this.debugWindow.document.getElementById('debugTag');debugTag.innerHTML=('<b>'+(new Date()).toString()+'</b>: '+text+'<hr/>')+debugTag.innerHTML;}catch(e){alert("Xajax Debug:\n "+text);}};this.workId='xajaxWork'+new Date().getTime();this.depth=0;this.responseErrorsForAlert=["400","401","402","403","404","500","501","502","503"];this.getRequestObject=function(){if(xajaxDebug)this.DebugMessage("Initializing Request Object..");var req=null;if(typeof XMLHttpRequest!="undefined")
req=new XMLHttpRequest();if(!req&&typeof ActiveXObject!="undefined"){try{req=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{req=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e2){try{req=new ActiveXObject("Msxml2.XMLHTTP.4.0");}
catch(e3){req=null;}}}}
if(!req&&window.createRequest)
req=window.createRequest();if(!req)this.DebugMessage("Request Object Instantiation failed.");return req;}
this.$=function(sId){if(!sId){return null;}
var returnObj=document.getElementById(sId);if(!returnObj&&document.all){returnObj=document.all[sId];}
if(xajaxDebug&&!returnObj&&sId!=this.workId){this.DebugMessage("Element with the id \""+sId+"\" not found.");}
return returnObj;}
this.include=function(sFileName){var objHead=document.getElementsByTagName('head');var objScript=document.createElement('script');objScript.type='text/javascript';objScript.src=sFileName;objHead[0].appendChild(objScript);}
this.stripOnPrefix=function(sEventName){sEventName=sEventName.toLowerCase();if(sEventName.indexOf('on')==0){sEventName=sEventName.replace(/on/,'');}
return sEventName;}
this.addOnPrefix=function(sEventName){sEventName=sEventName.toLowerCase();if(sEventName.indexOf('on')!=0){sEventName='on'+sEventName;}
return sEventName;}
this.addHandler=function(sElementId,sEvent,sFunctionName){if(window.addEventListener){sEvent=this.stripOnPrefix(sEvent);eval("this.$('"+sElementId+"').addEventListener('"+sEvent+"',"+sFunctionName+",false);");}
else{sAltEvent=this.addOnPrefix(sEvent);eval("this.$('"+sElementId+"').attachEvent('"+sAltEvent+"',"+sFunctionName+",false);");}}
this.removeHandler=function(sElementId,sEvent,sFunctionName){if(window.addEventListener){sEvent=this.stripOnPrefix(sEvent);eval("this.$('"+sElementId+"').removeEventListener('"+sEvent+"',"+sFunctionName+",false);");}
else{sAltEvent=this.addOnPrefix(sEvent);eval("this.$('"+sElementId+"').detachEvent('"+sAltEvent+"',"+sFunctionName+",false);");}}
this.create=function(sParentId,sTag,sId){var objParent=this.$(sParentId);objElement=document.createElement(sTag);objElement.setAttribute('id',sId);if(objParent)
objParent.appendChild(objElement);}
this.insert=function(sBeforeId,sTag,sId){var objSibling=this.$(sBeforeId);objElement=document.createElement(sTag);objElement.setAttribute('id',sId);objSibling.parentNode.insertBefore(objElement,objSibling);}
this.insertAfter=function(sAfterId,sTag,sId){var objSibling=this.$(sAfterId);objElement=document.createElement(sTag);objElement.setAttribute('id',sId);objSibling.parentNode.insertBefore(objElement,objSibling.nextSibling);}
this.getInput=function(sType,sName,sId){var Obj;if(!window.addEventListener){Obj=document.createElement('<input type="'+sType+'" id="'+sId+'" name="'+sName+'">');}
else{Obj=document.createElement('input');Obj.setAttribute('type',sType);Obj.setAttribute('name',sName);Obj.setAttribute('id',sId);}
return Obj;}
this.createInput=function(sParentId,sType,sName,sId){var objParent=this.$(sParentId);var objElement=this.getInput(sType,sName,sId);if(objParent&&objElement)
objParent.appendChild(objElement);}
this.insertInput=function(sBeforeId,sType,sName,sId){var objSibling=this.$(sBeforeId);var objElement=this.getInput(sType,sName,sId);if(objElement&&objSibling&&objSibling.parentNode)
objSibling.parentNode.insertBefore(objElement,objSibling);}
this.insertInputAfter=function(sAfterId,sType,sName,sId){var objSibling=this.$(sAfterId);var objElement=this.getInput(sType,sName,sId);if(objElement&&objSibling&&objSibling.parentNode){objSibling.parentNode.insertBefore(objElement,objSibling.nextSibling);}}
this.remove=function(sId){objElement=this.$(sId);if(objElement&&objElement.parentNode&&objElement.parentNode.removeChild){objElement.parentNode.removeChild(objElement);}}
this.replace=function(sId,sAttribute,sSearch,sReplace){var bFunction=false;if(sAttribute=="innerHTML")
sSearch=this.getBrowserHTML(sSearch);eval("var txt=this.$('"+sId+"')."+sAttribute);if(typeof txt=="function"){txt=txt.toString();bFunction=true;}
if(txt.indexOf(sSearch)>-1){var newTxt='';while(txt.indexOf(sSearch)>-1){x=txt.indexOf(sSearch)+sSearch.length+1;newTxt+=txt.substr(0,x).replace(sSearch,sReplace);txt=txt.substr(x,txt.length-x);}
newTxt+=txt;if(bFunction){eval('this.$("'+sId+'").'+sAttribute+'=newTxt;');}
else if(this.willChange(sId,sAttribute,newTxt)){eval('this.$("'+sId+'").'+sAttribute+'=newTxt;');}}}
this.getFormValues=function(frm){var objForm;var submitDisabledElements=false;if(arguments.length>1&&arguments[1]==true)
submitDisabledElements=true;var prefix="";if(arguments.length>2)
prefix=arguments[2];if(typeof(frm)=="string")
objForm=this.$(frm);else
objForm=frm;var sXml="<xjxquery><q>";if(objForm&&objForm.tagName=='FORM'){var formElements=objForm.elements;for(var i=0;i<formElements.length;i++){if(!formElements[i].name)
continue;if(formElements[i].name.substring(0,prefix.length)!=prefix)
continue;if(formElements[i].type&&(formElements[i].type=='radio'||formElements[i].type=='checkbox')&&formElements[i].checked==false)
continue;if(formElements[i].disabled&&formElements[i].disabled==true&&submitDisabledElements==false)
continue;var name=formElements[i].name;if(name){if(sXml!='<xjxquery><q>')
sXml+='&';if(formElements[i].type=='select-multiple'){for(var j=0;j<formElements[i].length;j++){if(formElements[i].options[j].selected==true)
sXml+=name+"="+encodeURIComponent(formElements[i].options[j].value)+"&";}}
else{sXml+=name+"="+encodeURIComponent(formElements[i].value);}}}}
sXml+="</q></xjxquery>";return sXml;}
this.objectToXML=function(obj){var sXml="<xjxobj>";for(i in obj){try{if(i=='constructor')
continue;if(obj[i]&&typeof(obj[i])=='function')
continue;var key=i;var value=obj[i];if(value&&typeof(value)=="object"&&this.depth<=50){this.depth++;value=this.objectToXML(value);this.depth--;}
sXml+="<e><k>"+key+"</k><v>"+value+"</v></e>";}
catch(e){if(xajaxDebug)this.DebugMessage(e.name+": "+e.message);}}
sXml+="</xjxobj>";return sXml;}
this._nodeToObject=function(node){if(node.nodeName=='#cdata-section'){var data="";for(var j=0;j<node.parentNode.childNodes.length;j++){data+=node.parentNode.childNodes[j].data;}
return data;}
else if(node.nodeName=='xjxobj'){var data=new Array();for(var j=0;j<node.childNodes.length;j++){var child=node.childNodes[j];var key;var value;if(child.nodeName=='e'){for(var k=0;k<child.childNodes.length;k++){if(child.childNodes[k].nodeName=='k'){key=child.childNodes[k].firstChild.data;}
else if(child.childNodes[k].nodeName=='v'){value=this._nodeToObject(child.childNodes[k].firstChild);}}
if(key!=null&&value!=null){data[key]=value;key=value=null;}}}
return data;}}
this.loadingFunction=function(){};this.doneLoadingFunction=function(){};var loadingTimeout;this.call=function(sFunction,aArgs,sRequestType){var i,r,postData;if(document.body&&xajaxWaitCursor)
document.body.style.cursor='wait';if(xajaxStatusMessages==true)window.status='Sending Request...';clearTimeout(loadingTimeout);loadingTimeout=setTimeout("xajax.loadingFunction();",400);if(xajaxDebug)this.DebugMessage("Starting xajax...");if(sRequestType==null){var xajaxRequestType=xajaxDefinedPost;}
else{var xajaxRequestType=sRequestType;}
var uri=xajaxRequestUri;var value;switch(xajaxRequestType){case xajaxDefinedGet:{var uriGet=uri.indexOf("?")==-1?"?xajax="+encodeURIComponent(sFunction):"&xajax="+encodeURIComponent(sFunction);if(aArgs){for(i=0;i<aArgs.length;i++){value=aArgs[i];if(typeof(value)=="object")
value=this.objectToXML(value);uriGet+="&xajaxargs[]="+encodeURIComponent(value);}}
uriGet+="&xajaxr="+new Date().getTime();uri+=uriGet;postData=null;}break;case xajaxDefinedPost:{postData="xajax="+encodeURIComponent(sFunction);postData+="&xajaxr="+new Date().getTime();if(aArgs){for(i=0;i<aArgs.length;i++){value=aArgs[i];if(typeof(value)=="object")
value=this.objectToXML(value);postData=postData+"&xajaxargs[]="+encodeURIComponent(value);}}}break;default:alert("Illegal request type: "+xajaxRequestType);return false;break;}
r=this.getRequestObject();if(!r)return false;r.open(xajaxRequestType==xajaxDefinedGet?"GET":"POST",uri,true);if(xajaxRequestType==xajaxDefinedPost){try{r.setRequestHeader("Method","POST "+uri+" HTTP/1.1");r.setRequestHeader("Content-Type","application/x-www-form-urlencoded");}
catch(e){alert("Your browser does not appear to  support asynchronous requests using POST.");return false;}}
r.onreadystatechange=function(){if(r.readyState!=4)
return;if(r.status==200){if(xajaxDebug)xajax.DebugMessage("Received:\n"+r.responseText);if(r.responseXML&&r.responseXML.documentElement)
xajax.processResponse(r.responseXML);else{var errorString="Error: the XML response that was returned from the server is invalid.";errorString+="\nReceived:\n"+r.responseText;trimmedResponseText=r.responseText.replace(/^\s+/g,"");trimmedResponseText=trimmedResponseText.replace(/\s+$/g,"");if(trimmedResponseText!=r.responseText)
errorString+="\nYou have whitespace in your response.";alert(errorString);document.body.style.cursor='default';if(xajaxStatusMessages==true)window.status='Invalid XML response error';}}
else{if(xajax.responseErrorsForAlert.containsValue(r.status)){var errorString="Error: the server returned the following HTTP status: "+r.status;errorString+="\nReceived:\n"+r.responseText;alert(errorString);}
document.body.style.cursor='default';if(xajaxStatusMessages==true)window.status='Invalid XML response error';}
delete r;r=null;}
if(xajaxDebug)this.DebugMessage("Calling "+sFunction+" uri="+uri+" (post:"+postData+")");r.send(postData);if(xajaxStatusMessages==true)window.status='Waiting for data...';delete r;return true;}
this.getBrowserHTML=function(html){tmpXajax=this.$(this.workId);if(!tmpXajax){tmpXajax=document.createElement("div");tmpXajax.setAttribute('id',this.workId);tmpXajax.style.display="none";tmpXajax.style.visibility="hidden";document.body.appendChild(tmpXajax);}
tmpXajax.innerHTML=html;var browserHTML=tmpXajax.innerHTML;tmpXajax.innerHTML='';return browserHTML;}
this.willChange=function(element,attribute,newData){if(!document.body){return true;}
if(attribute=="innerHTML"){newData=this.getBrowserHTML(newData);}
elementObject=this.$(element);if(elementObject){var oldData;eval("oldData=this.$('"+element+"')."+attribute);if(newData!==oldData)
return true;}
return false;}
this.viewSource=function(){return"<html>"+document.getElementsByTagName("HTML")[0].innerHTML+"</html>";}
this.processResponse=function(xml){clearTimeout(loadingTimeout);this.doneLoadingFunction();if(xajaxStatusMessages==true)window.status='Processing...';var tmpXajax=null;xml=xml.documentElement;if(xml==null)
return;var skipCommands=0;for(var i=0;i<xml.childNodes.length;i++){if(skipCommands>0){skipCommands--;continue;}
if(xml.childNodes[i].nodeName=="cmd"){var cmd;var id;var property;var data;var search;var type;var before;var objElement=null;for(var j=0;j<xml.childNodes[i].attributes.length;j++){if(xml.childNodes[i].attributes[j].name=="n"){cmd=xml.childNodes[i].attributes[j].value;}
else if(xml.childNodes[i].attributes[j].name=="t"){id=xml.childNodes[i].attributes[j].value;}
else if(xml.childNodes[i].attributes[j].name=="p"){property=xml.childNodes[i].attributes[j].value;}
else if(xml.childNodes[i].attributes[j].name=="c"){type=xml.childNodes[i].attributes[j].value;}}
if(xml.childNodes[i].childNodes.length>1&&xml.childNodes[i].firstChild.nodeName=="#cdata-section"){data="";for(var j=0;j<xml.childNodes[i].childNodes.length;j++){data+=xml.childNodes[i].childNodes[j].data;}}
else if(xml.childNodes[i].firstChild&&xml.childNodes[i].firstChild.nodeName=='xjxobj'){data=this._nodeToObject(xml.childNodes[i].firstChild);objElement="XJX_SKIP";}
else if(xml.childNodes[i].childNodes.length>1){for(var j=0;j<xml.childNodes[i].childNodes.length;j++){if(xml.childNodes[i].childNodes[j].childNodes.length>1&&xml.childNodes[i].childNodes[j].firstChild.nodeName=="#cdata-section"){var internalData="";for(var k=0;k<xml.childNodes[i].childNodes[j].childNodes.length;k++){internalData+=xml.childNodes[i].childNodes[j].childNodes[k].nodeValue;}}else{var internalData=xml.childNodes[i].childNodes[j].firstChild.nodeValue;}
if(xml.childNodes[i].childNodes[j].nodeName=="s"){search=internalData;}
if(xml.childNodes[i].childNodes[j].nodeName=="r"){data=internalData;}}}
else if(xml.childNodes[i].firstChild)
data=xml.childNodes[i].firstChild.nodeValue;else
data="";if(objElement!="XJX_SKIP")objElement=this.$(id);var cmdFullname;try{if(cmd=="cc"){cmdFullname="addConfirmCommands";var confirmResult=confirm(data);if(!confirmResult){skipCommands=id;}}
if(cmd=="al"){cmdFullname="addAlert";alert(data);}
else if(cmd=="js"){cmdFullname="addScript/addRedirect";eval(data);}
else if(cmd=="jc"){cmdFullname="addScriptCall";var scr=id+'(';if(data[0]!=null){scr+='data[0]';for(var l=1;l<data.length;l++){scr+=',data['+l+']';}}
scr+=');';eval(scr);}
else if(cmd=="in"){cmdFullname="addIncludeScript";this.include(data);}
else if(cmd=="as"){cmdFullname="addAssign/addClear";if(this.willChange(id,property,data)){eval("objElement."+property+"=data;");}}
else if(cmd=="ap"){cmdFullname="addAppend";eval("objElement."+property+"+=data;");}
else if(cmd=="pp"){cmdFullname="addPrepend";eval("objElement."+property+"=data+objElement."+property);}
else if(cmd=="rp"){cmdFullname="addReplace";this.replace(id,property,search,data)}
else if(cmd=="rm"){cmdFullname="addRemove";this.remove(id);}
else if(cmd=="ce"){cmdFullname="addCreate";this.create(id,data,property);}
else if(cmd=="ie"){cmdFullname="addInsert";this.insert(id,data,property);}
else if(cmd=="ia"){cmdFullname="addInsertAfter";this.insertAfter(id,data,property);}
else if(cmd=="ci"){cmdFullname="addCreateInput";this.createInput(id,type,data,property);}
else if(cmd=="ii"){cmdFullname="addInsertInput";this.insertInput(id,type,data,property);}
else if(cmd=="iia"){cmdFullname="addInsertInputAfter";this.insertInputAfter(id,type,data,property);}
else if(cmd=="ev"){cmdFullname="addEvent";property=this.addOnPrefix(property);eval("this.$('"+id+"')."+property+"= function(){"+data+";}");}
else if(cmd=="ah"){cmdFullname="addHandler";this.addHandler(id,property,data);}
else if(cmd=="rh"){cmdFullname="addRemoveHandler";this.removeHandler(id,property,data);}}
catch(e){if(xajaxDebug)
alert("While trying to '"+cmdFullname+"' (command number "+i+"), the following error occured:\n"
+e.name+": "+e.message+"\n"
+(id&&!objElement?"Object with id='"+id+"' wasn't found.\n":""));}
delete objElement;delete cmd;delete cmdFullname;delete id;delete property;delete search;delete data;delete type;delete before;delete internalData;delete j;delete k;}}
delete xml;delete i;document.body.style.cursor='default';if(xajaxStatusMessages==true)window.status='Done';}}
var xajax=new Xajax();xajaxLoaded=true;var idLoadingAjax="loading";xajax.loadingFunction=function(){xajax.$(idLoadingAjax).style.display='block';};xajax.doneLoadingFunction=function(){xajax.$(idLoadingAjax).style.display='none';};