window.addEvent("domready",function(){kwbWindow=new kwbWindow();kwbPortfolio=new kwbPortfolio();kwbWindow.loading();var b=["/images/logo.png","/images/about.jpg","/images/portfolio.jpg","/images/contact.jpg","/images/brujinet.jpg","/brujinet/botonda.jpg","/brujinet/botonflickr.jpg","/brujinet/botonartproj.jpg","/brujinet/botonmyspac.jpg","/brujinet/botonflog.jpg","/brujinet/botonvf.jpg"];if(window.getScrollWidth()>=1280){b.include("/images/background1280.jpg");var a=new Asset.images(b,{onComplete:function(){$("siteBody").addClass("siteBody1280");kwbWindow.wellcome();kwbWindow.display(0)}})}else{b.include("/images/background1024.jpg");var a=new Asset.images(b,{onComplete:function(){$("siteBody").addClass("siteBody1024");kwbWindow.wellcome();kwbWindow.display(0)}})}$("soundControl").addEvent("click",function(c){c.stop();soundManager.togglePause("mySound")})});
var kwbWindow=new Class({Implements:[Chain],getOptions:function(){return{name:"kwbWindow",zIndex:65555,onReturn:false,onReturnFunction:$empty,BoxStyles:{width:550},defaultLeft:2,defaultTop:2,showDuration:200,showEffect:Fx.Transitions.linear,closeDuration:100,closeEffect:Fx.Transitions.linear,moveDuration:500,moveEffect:Fx.Transitions.Back.easeOut,onShowStart:$empty,onShowComplete:$empty,onCloseStart:$empty,onCloseComplete:function(a){this.options.onReturnFunction(this.options.onReturn)}.bind(this)}},initialize:function(a){this.i=0;this.setOptions(this.getOptions(),a);this.Content=new Element("div",{id:this.options.name+"-BoxContent"});this.Contenedor=new Element("div",{id:this.options.name+"-BoxContenedor"}).adopt(this.Content);this.InBox=new Element("div",{id:this.options.name+"-InBox"}).adopt(this.Contenedor);this.siteThumbs=new Element("div",{"class":"siteThumbs"});this.Box=new Element("div",{id:this.options.name+"-Box",styles:{display:"none","z-index":this.options.zIndex+2,position:"absolute",top:"0",left:"0",width:this.options.BoxStyles.width+"px",color:"#000000"}}).adopt(this.InBox);this.Box.injectInside(document.body);this.preloadImages();window.addEvent("resize",function(){if(this.options.display==1){this.replaceBox()}}.bind(this));this.Box.addEvent("keydown",function(b){if(b.key=="esc"){this.options.onReturn=false;this.display(0)}}.bind(this));window.addEvent("scroll",this.replaceBox.bind(this))},preloadImages:function(){var a=new Array(2);a[0]=new Image();a[1]=new Image();a[2]=new Image();a[0].src=this.Box.getStyle("background-image").replace(new RegExp("url\\('?([^']*)'?\\)","gi"),"$1");a[1].src=this.InBox.getStyle("background-image").replace(new RegExp("url\\('?([^']*)'?\\)","gi"),"$1");a[2].src=this.Contenedor.getStyle("background-image").replace(new RegExp("url\\('?([^']*)'?\\)","gi"),"$1")},display:function(a){if(this.Transition){this.Transition.cancel()}if(this.options.display==0&&a!=0||a==1){if(Browser.Engine.trident4){$$("select","object","embed").each(function(b){b.style.visibility="hidden"})}this.options.display=1;sizes=window.getSize();scrollito=window.getScroll();this.Box.setStyles({display:"block",left:(scrollito.x+(sizes.x-this.options.BoxStyles.width)/2).toInt()});this.replaceBox()}else{if(Browser.Engine.trident4){$$("select","object","embed").each(function(b){b.style.visibility="visible"})}this.queue.delay(500,this);this.Box.setStyles({display:"none",top:0});this.Content.empty();this.options.display=0}},replaceBox:function(){if(this.options.display==1){sizes=window.getSize();scrollito=window.getScroll();if(this.MoveBox){this.MoveBox.cancel()}this.MoveBox=new Fx.Morph(this.Box,{duration:this.options.moveDuration,transition:this.options.moveEffect}).start({left:(scrollito.x+(sizes.x-this.options.BoxStyles.width)/this.options.defaultLeft).toInt(),top:(scrollito.y+(sizes.y-this.Box.offsetHeight)/this.options.defaultTop).toInt()})}},queue:function(){this.i--;this.callChain()},loading:function(){this.options.defaultLeft=2;this.options.defaultTop=2;this.options.BoxStyles={width:550};this.chain(function(){var a=new Element("div",{"class":"siteLoading"}).adopt(new Element("span",{text:"Loading..."}));this.Content.adopt(a);this.display(1)});this.i++;if(this.i==1){this.callChain()}},wellcome:function(){this.options.defaultLeft=2;this.options.defaultTop=3;this.options.BoxStyles={width:550};this.chain(function(){var a=new Element("div",{"class":"siteLogo"}).adopt(new Element("img",{src:"/images/logo.png","class":"imagePNG"}));var c=new Element("div",{"class":"siteWellcome"});var b=new Element("div",{"class":"siteSpanish"}).adopt(new Element("a",{text:"Español",href:"/"}).addEvent("click",function(f){f.stop();soundManager.play("camera");kwbWindow.mainmenu("es");kwbWindow.display(0)}));var d=new Element("div",{"class":"siteEnglish"}).adopt(new Element("a",{text:"English",href:"/"}).addEvent("click",function(f){f.stop();soundManager.play("camera");kwbWindow.mainmenu("en");kwbWindow.display(0)}));c.adopt(b,a,d);this.Content.adopt(c);this.display(1)});this.i++;if(this.i==1){this.callChain()}},mainmenu:function(a){this.options.defaultLeft=1.1;this.options.defaultTop=2;this.options.BoxStyles={width:550};this.chain(function(){var b=new Element("div",{"class":"siteImage"}).adopt(new Element("img",{src:"/images/about.jpg",style:"width:120px;height:70px"}).addEvents({mouseover:function(){this.set("morph",{duration:1000,transition:"bounce:out"});this.morph({width:140,height:82});if(a=="es"){g.adopt(new Element("span",{style:"color:#fff",text:"Sobre mí"}))}else{if(a=="en"){g.adopt(new Element("span",{style:"color:#fff",text:"About me"}))}}},mouseout:function(){this.set("morph",{duration:1000,transition:"bounce:out"});this.morph({width:120,height:70});g.empty()},click:function(i){i.stop();soundManager.play("camera");kwbWindow.about(a);kwbWindow.display(0)}}));var e=new Element("div",{"class":"siteImage"}).adopt(new Element("img",{src:"/images/portfolio.jpg",style:"width:120px;height:70px"}).addEvents({mouseover:function(){this.set("morph",{duration:1000,transition:"bounce:out"});this.morph({width:140,height:82});if(a=="es"){g.adopt(new Element("span",{style:"color:#fff",text:"Portafolio"}))}else{if(a=="en"){g.adopt(new Element("span",{style:"color:#fff",text:"Portfolio"}))}}},mouseout:function(){this.set("morph",{duration:1000,transition:"bounce:out"});this.morph({width:120,height:70});g.empty()},click:function(i){i.stop();soundManager.play("camera");kwbWindow.portfolio(a);kwbWindow.display(0)}}));var h=new Element("div",{"class":"siteImage"}).adopt(new Element("img",{src:"/images/contact.jpg",style:"width:120px;height:70px"}).addEvents({mouseover:function(){this.set("morph",{duration:1000,transition:"bounce:out"});this.morph({width:140,height:82});if(a=="es"){g.adopt(new Element("span",{style:"color:#fff",text:"Contactame"}))}else{if(a=="en"){g.adopt(new Element("span",{style:"color:#fff",text:"Contact me"}))}}},mouseout:function(){this.set("morph",{duration:1000,transition:"bounce:out"});this.morph({width:120,height:70});g.empty()},click:function(i){i.stop();soundManager.play("camera");kwbWindow.contact(a);kwbWindow.display(0)}}));var f=new Element("div",{"class":"siteImage"}).adopt(new Element("img",{src:"/images/brujinet.jpg",style:"width:120px;height:70px"}).addEvents({mouseover:function(){this.set("morph",{duration:1000,transition:"bounce:out"});this.morph({width:140,height:82});if(a=="es"){g.adopt(new Element("span",{style:"color:#fff",text:"Bruji en la red"}))}else{if(a=="en"){g.adopt(new Element("span",{style:"color:#fff",text:"Bruji Network"}))}}},mouseout:function(){this.set("morph",{duration:1000,transition:"bounce:out"});this.morph({width:120,height:70});g.empty()},click:function(i){i.stop();soundManager.play("camera");kwbWindow.brujinet(a);kwbWindow.display(0)}}));var g=new Element("div",{"class":"siteName"});var c=new Element("div",{"class":"siteMenu"}).adopt(new Element("img",{src:"/images/logo.png","class":"imagePNG"}).addEvent("click",function(i){i.stop();soundManager.play("camera");kwbWindow.wellcome();kwbWindow.display(0)}));var d=new Element("div",{"class":"siteMenu"}).adopt(c,g,b,e,h,f);this.Content.adopt(d);this.display(1)});this.i++;if(this.i==1){this.callChain()}},about:function(a){this.options.defaultLeft=1.1;this.options.defaultTop=3;this.options.BoxStyles={width:550};this.chain(function(){if(a=="es"){var b="Patricia Bru Jilla (19 de octubre, 1989) nace en Valencia, fue criada en un pueblo cercano a la capital y a los 17 años volvió de nuevo a la ciudad de las fallas para realizar sus estudios universitarios. Actualmente estudia Comunicación Audiovisual en la Universidad de Valencia, posee el título de Diseñadora Gráfica gracias a un curso intensivo creado por la Academia de estudios CEI Valencia y tiene en mente la realización del segundo ciclo de la carrera de Publicidad y Relaciones  Públicas.<br /><br />A los 15 años empezó a interesarse por el mundo de la fotografía, recorriendo webs e inspirándose en sus ídolos, tras 2 años realizando múltiples sesiones  fotográficas a sus amigas con la cámara familiar, sus padres le compran su primera cámara réflex digital, la cual poco a poco ha ido completando.<br /><br />Su mayor sueño: tener un estudio fotográfico propio y dedicarse principalmente a la fotografía publicitaria."}else{var b="Patricia Bru Jilla (October 19, 1989) was born in Valencia, was raised in a village near the capital and 17 years once again returned to the city of faults for college. She is currently studying  Cinema and Comunication at the University of Valencia, she has the degree in Graphic Design through an intensive course created by the Academy of Valencia CEI and she  have in mind the completion her studies with the second cycle of Advertising and Race Relations<br /><br />When she has 15 she began to get interested in photography world, visiting websites and inspired by their idols, after 2 years conducting multiple shoots her friends with the family camera, his parents bought her first digital SLR, which has gradually completing.<br /><br />Her biggest dream: having a photographic studio and devoted herself mainly advertising photography."}var c=new Element("div",{"class":"siteHome"}).adopt(new Element("img",{src:"/images/logo.png","class":"imagePNG"}).addEvent("click",function(f){f.stop();soundManager.play("camera");kwbWindow.mainmenu(a);kwbWindow.display(0)}));var d=new Element("div",{"class":"siteMenu"}).adopt(new Element("p",{style:"padding-left:20px",html:'<img src="/images/about.jpg" style="float:right;padding:5px">'+b}));this.Content.adopt(c,d);this.display(1)});this.i++;if(this.i==1){this.callChain()}},portfolio:function(a){this.options.defaultLeft=1.1;this.options.defaultTop=8;this.chain(function(){var b=new Element("div",{"class":"siteRight"}).adopt(new Element("img",{src:"/images/logo.png","class":"imagePNG"}).addEvent("click",function(d){d.stop();soundManager.play("camera");kwbWindow.mainmenu(a);kwbWindow.display(0)}));var c=new Element("div",{"class":"siteMenu"});new Request.JSON({url:"/api.php",onComplete:function(e){if(e.status=="success"){var d=e.content.split(";");d.each(function(g){var f=g.split(":");new Element("div",{style:"width:140px;height:140px;float:left"}).adopt(new Element("span",{text:f[1],style:"background:#fff;padding:1px 3px;margin:3px 3px 0px 3px;font-color:#000;font-weight:bold"}),new Element("img",{src:"/pictures/thumbs/"+f[3],style:"border:1px solid #fff;padding:3px;margin:3px"}).addEvent("click",function(h){h.stop();soundManager.play("camera");kwbWindow.showalbum(a,f[0]);kwbWindow.display(0)})).inject(c)})}else{alert("error")}}}).send("show=albums");this.Content.adopt(b,c);this.display(1)});this.i++;if(this.i==1){this.callChain()}},contact:function(a){this.options.defaultLeft=2;this.options.defaultTop=2;this.options.BoxStyles={width:550};this.chain(function(){if(a=="es"){var n='Puede ponerse en contacto conmigo a traves de mi dirección de<br />correo electrónico "info@brujillapatri.com" o mediante el siguiente formulario';var r="Nombre y Apellidos [Obligatorio]";var g="Correo electrónico [Obligatorio]";var k="Teléfono de contacto [Opcional]";var p="Contenido del mensaje [Obligatorio]";var c="Enviar";var j="Conectando con el servidor de correo...";var i="Su mensaje se ha enviado a mi bandeja de entrada<br />En la mayor brevedad posible recibirá una respuesta por mi parte. Gracias";var q="Se ha producido un error"}else{if(a=="en"){var n='You can contact me by email to "info@brujillapatri.com" or with the next formulary.';var r="First and Last Name [Required]";var g="Electronic mail [Required]";var k="Phone number [Optional]";var p="Message content [Required]";var c="Send";var j="Connecting to mail server...";var i="Your message has been sent to my inbox.<br />At the earliest possible date will receive a response from me. Thank you.";var q="There was an error"}}var o=new Element("div",{"class":"siteMenu"}).adopt(new Element("p",{style:"padding-bottom:10px",html:n}));var b=new Element("form",{id:"formulary",style:"background:#000;border:1px solid #303030;padding:10px"}).addEvent("submit",function(v){v.stop();var u=false;$("contactName").set("style","color:white");$("contactMail").set("style","color:white");$("contactMessage").set("style","color:white");if($("formName").get("value")==""){$("contactName").set("style","color:red");u=true}if($("formMail").get("value")==""){$("contactMail").set("style","color:red");u=true}if($("formMessage").get("value")==""){$("contactMessage").set("style","color:red");u=true}if(!u){new Request.JSON({url:"/api.php",onComplete:function(w){if(w.status=="success"){soundManager.play("camera");$("formulary").empty();$("formulary").adopt(new Element("p",{html:i}))}else{soundManager.play("camera");$("formulary").empty();$("formulary").adopt(new Element("p",{html:q+": "+w.status}))}}}).send("show=contact&"+this.toQueryString());$("formulary").empty();$("formulary").adopt(new Element("p",{html:j}))}});var f=new Element("img",{src:"/images/contact.jpg",style:"width:140px;height:82px;float:right"});var s=new Element("div",{"class":"contactValue"}).adopt(new Element("p",{id:"contactName",text:r}),new Element("input",{id:"formName",type:"text",name:"name"}));var h=new Element("div",{"class":"contactValue"}).adopt(new Element("p",{id:"contactMail",text:g}),new Element("input",{id:"formMail",type:"text",name:"mail"}));var t=new Element("div",{"class":"contactValue"}).adopt(new Element("p",{id:"contactPhone",text:k}),new Element("input",{id:"formPhone",type:"text",name:"phone"}));var e=new Element("div",{"class":"contactValue"}).adopt(new Element("p",{id:"contactMessage",text:p}),new Element("textarea",{id:"formMessage",style:"width:95%;height:120px",name:"message"}));var d=new Element("div",{"class":"contactValue"}).adopt(new Element("input",{type:"submit",style:"float:right",value:c}));var m=new Element("div",{"class":"siteCenter"}).adopt(new Element("img",{src:"/images/logo.png","class":"imagePNG"}).addEvent("click",function(u){u.stop();soundManager.play("camera");kwbWindow.mainmenu(a);kwbWindow.display(0)}));b.adopt(s,h,t,e,d);var l=new Element("div",{"class":"siteMenu"}).adopt(o,b);this.Content.adopt(m,l);this.display(1)});this.i++;if(this.i==1){this.callChain()}},brujinet:function(a){this.options.defaultLeft=1.1;this.options.defaultTop=2;this.options.BoxStyles={width:550};this.chain(function(){var d=new Element("div",{"class":"siteImage"}).adopt(new Element("img",{src:"/brujinet/botonda.jpg",style:"width:250px;height:125px"}).addEvents({click:function(j){j.stop();soundManager.play("camera");window.open("http://brujillapatri.deviantart.com/")}}));var b=new Element("div",{"class":"siteImage"}).adopt(new Element("img",{src:"/brujinet/botonflickr.jpg",style:"width:250px;height:125px"}).addEvents({click:function(j){j.stop();soundManager.play("camera");window.open("http://www.flickr.com/photos/85158635@N00/")}}));var e=new Element("div",{"class":"siteImage"}).adopt(new Element("img",{src:"/brujinet/botonartproj.jpg",style:"width:250px;height:125px"}).addEvents({click:function(j){j.stop();soundManager.play("camera");window.open("http://www.artworkproject.com/profile/Brujilla_Patri")}}));var h=new Element("div",{"class":"siteImage"}).adopt(new Element("img",{src:"/brujinet/botonmyspac.jpg",style:"width:250px;height:125px"}).addEvents({click:function(j){j.stop();soundManager.play("camera");window.open("http://www.myspace.com/brujillapatri")}}));var g=new Element("div",{"class":"siteImage"}).adopt(new Element("img",{src:"/brujinet/botonflog.jpg",style:"width:250px;height:125px"}).addEvents({click:function(j){j.stop();soundManager.play("camera");window.open("http://www.fotolog.com/brujilla_patri")}}));var i=new Element("div",{"class":"siteImage"}).adopt(new Element("img",{src:"/brujinet/botonvf.jpg",style:"width:250px;height:125px"}).addEvents({click:function(j){j.stop();soundManager.play("camera");window.open("http://vampirefreaks.com/u/brujilla_patri")}}));var c=new Element("div",{"class":"siteCenter"}).adopt(new Element("img",{src:"/images/logo.png","class":"imagePNG"}).addEvent("click",function(j){j.stop();soundManager.play("camera");kwbWindow.mainmenu(a);kwbWindow.display(0)}));var f=new Element("div",{"class":"siteBrujinet"}).adopt(d,b,e,h,g,i);this.Content.adopt(c,f);this.display(1)});this.i++;if(this.i==1){this.callChain()}},previousPage:function(){this.siteThumbs.empty();this.changeValue=this.currentValue-5;kwbPortfolio.loadPicture(kwbWindow.sources[this.changeValue].itemIndex,kwbWindow.sources[this.changeValue].itemPath,kwbWindow.sources[this.changeValue].itemTitle,true)},nextPage:function(){this.siteThumbs.empty();this.changeValue=this.currentValue+5;kwbPortfolio.loadPicture(kwbWindow.sources[this.changeValue].itemIndex,kwbWindow.sources[this.changeValue].itemPath,kwbWindow.sources[this.changeValue].itemTitle,true)},loadPage:function(b,a){a=$extend({moveBox:true},a||{});this.totValues=kwbWindow.sources.length-1;this.currentValue=b;new Element("img",{src:"/images/left.gif",style:"padding:3px;margin:3px"}).addEvent("click",function(c){c.stop();if(kwbWindow.currentValue>0){soundManager.play("camera");kwbWindow.previousPage()}}).inject(kwbWindow.siteThumbs);if(b<=this.totValues){itemIndex_1=kwbWindow.sources[b].itemIndex;itemPath_1=kwbWindow.sources[b].itemPath;itemTitle_1=kwbWindow.sources[b].itemTitle;new Element("img",{src:"/pictures/thumbs/"+itemPath_1,style:"border:1px solid #fff;padding:3px;margin:3px"}).addEvent("click",function(c){c.stop();soundManager.play("camera");kwbPortfolio.loadPicture(itemIndex_1,itemPath_1,itemTitle_1,true)}).inject(kwbWindow.siteThumbs);b++;if(b<=this.totValues){itemIndex_2=this.sources[b].itemIndex;itemPath_2=this.sources[b].itemPath;itemTitle_2=this.sources[b].itemTitle;new Element("img",{src:"/pictures/thumbs/"+itemPath_2,style:"border:1px solid #fff;padding:3px;margin:3px"}).addEvent("click",function(c){c.stop();soundManager.play("camera");kwbPortfolio.loadPicture(itemIndex_2,itemPath_2,itemTitle_2,true)}).inject(this.siteThumbs);b++;if(b<=this.totValues){itemIndex_3=this.sources[b].itemIndex;itemPath_3=this.sources[b].itemPath;itemTitle_3=this.sources[b].itemTitle;new Element("img",{src:"/pictures/thumbs/"+itemPath_3,style:"border:1px solid #fff;padding:3px;margin:3px"}).addEvent("click",function(c){c.stop();soundManager.play("camera");kwbPortfolio.loadPicture(itemIndex_3,itemPath_3,itemTitle_3,true)}).inject(this.siteThumbs);b++;if(b<=this.totValues){itemIndex_4=this.sources[b].itemIndex;itemPath_4=this.sources[b].itemPath;itemTitle_4=this.sources[b].itemTitle;new Element("img",{src:"/pictures/thumbs/"+itemPath_4,style:"border:1px solid #fff;padding:3px;margin:3px"}).addEvent("click",function(c){c.stop();soundManager.play("camera");kwbPortfolio.loadPicture(itemIndex_4,itemPath_4,itemTitle_4,true)}).inject(this.siteThumbs);b++;if(b<=this.totValues){itemIndex_5=this.sources[b].itemIndex;itemPath_5=this.sources[b].itemPath;itemTitle_5=this.sources[b].itemTitle;new Element("img",{src:"/pictures/thumbs/"+itemPath_5,style:"border:1px solid #fff;padding:3px;margin:3px"}).addEvent("click",function(c){c.stop();soundManager.play("camera");kwbPortfolio.loadPicture(itemIndex_5,itemPath_5,itemTitle_5,true)}).inject(this.siteThumbs)}}}}}new Element("img",{src:"/images/right.gif",style:"padding:3px;margin:3px"}).addEvent("click",function(c){c.stop();if(kwbWindow.totValues>=(kwbWindow.currentValue+5)){soundManager.play("camera");kwbWindow.nextPage()}}).inject(kwbWindow.siteThumbs);if(a.moveBox){this.replaceBox()}},showalbum:function(b,a){this.options.defaultLeft=2;this.options.defaultTop=1.1;this.options.BoxStyles={width:740};this.chain(function(){this.sources=new Array();new Request.JSON({url:"/api.php",onComplete:function(f){if(f.status=="success"){var e=0;function d(i,g,h){this.itemIndex=i;this.itemTitle=g;this.itemPath=h}var c=f.content.split(";");c.each(function(j,i){var k=j.split(":");var g=k[0];var h=k[1];kwbWindow.sources[e]=new d(i,g,h);e++});kwbPortfolio.startAlbum(b,kwbWindow.sources);kwbPortfolio.openPicture(kwbWindow.sources[0].itemIndex,kwbWindow.sources[0].itemPath,kwbWindow.sources[0].itemTitle);kwbWindow.loadPage(0)}else{alert("error")}}}).send("show=pictures&album="+a);this.Content.adopt(this.siteThumbs);this.display(1)});this.i++;if(this.i==1){this.callChain()}}});kwbWindow.implement(new Events,new Options);
var kwbPortfolio=new Class({Implements:[Chain],getOptions:function(){return{name:"kwbPortfolio",zIndex:65555,onReturn:false,openPicture:false,onReturnFunction:$empty,BoxStyles:{width:938},OverlayStyles:{"background-color":"#000",opacity:0.5},showDuration:200,showEffect:Fx.Transitions.linear,closeDuration:100,closeEffect:Fx.Transitions.linear,moveDuration:200,moveEffect:Fx.Transitions.Back.easeOut,onShowStart:$empty,onShowComplete:$empty,onCloseStart:$empty,onCloseComplete:function(a){this.options.onReturnFunction(this.options.onReturn)}.bind(this)}},initialize:function(a){this.i=0;this.setOptions(this.getOptions(),a);this.Overlay=new Element("div",{id:"BoxOverlay",styles:{display:"none",position:"absolute",top:"0",left:"0",opacity:0,"z-index":this.options.zIndex,"background-color":this.options.OverlayStyles["background-color"],height:window.getScrollHeight()+"px",width:window.getScrollWidth()+"px"}});this.Content=new Element("div",{"class":this.options.name+"-BoxContent"});this.Box=new Element("div",{id:this.options.name+"-Box",styles:{display:"none","z-index":this.options.zIndex+2,position:"absolute",top:"0",left:"0",width:this.options.BoxStyles.width+"px"}}).adopt(this.Content);this.Overlay.injectInside(document.body);this.Box.injectInside(document.body);window.addEvent("resize",function(){if(this.options.display==1){this.Overlay.setStyles({height:window.getScrollHeight()+"px",width:window.getScrollWidth()+"px"});this.replaceBox()}}.bind(this));window.addEvent("keydown",function(b){if(this.options.openPicture){if(b.key=="esc"){soundManager.play("camera");this.options.onReturn=false;this.display(0);kwbWindow.portfolio(this.language);kwbWindow.display(0)}else{if(b.key=="left"||b.key=="down"){soundManager.play("camera");this.previousPicture()}else{if(b.key=="right"||b.key=="up"){soundManager.play("camera");this.nextPicture()}}}}}.bind(this));window.addEvent("scroll",this.replaceBox.bind(this))},display:function(a){if(this.Transition){this.Transition.cancel()}if(this.options.display==0&&a!=0||a==1){this.options.openPicture=true;this.Overlay.setStyle("display","block");this.options.display=1;this.fireEvent("onShowStart",[this.Overlay]);this.Transition=new Fx.Tween(this.Overlay,{property:"opacity",duration:this.options.showDuration,transition:this.options.showEffect,onComplete:function(){sizes=window.getSize();scrollito=window.getScroll();this.Box.setStyles({display:"block",left:(scrollito.x+(sizes.x-this.options.BoxStyles.width)/2).toInt()});this.replaceBox();this.fireEvent("onShowComplete",[this.Overlay])}.bind(this)}).start(this.options.OverlayStyles.opacity)}else{this.options.openPicture=false;this.queue.delay(500,this);this.Box.setStyles({display:"none",top:0});this.Content.empty();this.options.display=0;this.fireEvent("onCloseStart",[this.Overlay]);if(this.i==1){this.Transition=new Fx.Tween(this.Overlay,{property:"opacity",duration:this.options.closeDuration,transition:this.options.closeEffect,onComplete:function(){this.fireEvent("onCloseComplete",[this.Overlay])}.bind(this)}).start(0)}}},replaceBox:function(){if(this.options.display==1){sizes=window.getSize();scrollito=window.getScroll();if(this.MoveBox){this.MoveBox.cancel()}this.MoveBox=new Fx.Morph(this.Box,{duration:this.options.moveDuration,transition:this.options.moveEffect}).start({left:(scrollito.x+(sizes.x-this.options.BoxStyles.width)/2).toInt(),top:(scrollito.y+(sizes.y-this.Box.offsetHeight)/5).toInt()});this.focusin.delay(this.options.moveDuration,this)}},focusin:function(){if($chk($("BoxCloseBtn"))){$("BoxCloseBtn").focus()}},queue:function(){this.i--;this.callChain()},startAlbum:function(b,a){this.language=b;this.pictures=a;this.current=1},previousPicture:function(){if(this.current>0){this.changeValue=this.current-1;this.loadPicture(this.pictures[this.changeValue].itemIndex,this.pictures[this.changeValue].itemPath,this.pictures[this.changeValue].itemTitle,true)}else{if(this.current==0){this.changeValue=this.pictures.length-1;this.loadPicture(this.pictures[this.changeValue].itemIndex,this.pictures[this.changeValue].itemPath,this.pictures[this.changeValue].itemTitle,true)}}},nextPicture:function(){var a=this.pictures.length-1;if(this.current<a){this.changeValue=this.current+1;this.loadPicture(this.pictures[this.changeValue].itemIndex,this.pictures[this.changeValue].itemPath,this.pictures[this.changeValue].itemTitle,true)}else{this.loadPicture(this.pictures[0].itemIndex,this.pictures[0].itemPath,this.pictures[0].itemTitle,true)}},loadPicture:function(a,i,d,g){this.current=a;var c=kwbWindow.currentValue+5;if(g){if(this.current==kwbWindow.currentValue){}else{if((c)<=this.current){kwbWindow.siteThumbs.empty();kwbWindow.currentValue++;kwbWindow.loadPage(c,{moveBox:false})}else{if(this.current<kwbWindow.currentValue){kwbWindow.siteThumbs.empty();kwbWindow.currentValue=0;kwbWindow.loadPage(kwbWindow.currentValue,{moveBox:false})}}}}if(this.language=="es"){var b="Anterior";var e="Volver";var f="Siguiente"}else{var b="Previous";var e="Go Back";var f="Next"}this.PreviousBtn=new Element("input",{id:"PreviousBtn",type:"submit",value:b,styles:{width:"70px",background:"transparent",border:"0px solid transparent",padding:"2px 5px",display:"inline","font-weight":"bold","font-family":"Tahoma","font-size":"1.0em",color:"#fff"}}).addEvent("click",function(){soundManager.play("camera");this.previousPicture()}.bind(this));this.CloseBtn=new Element("input",{id:"BoxCloseBtn",type:"submit",value:e,styles:{width:"50px",background:"transparent",border:"0px solid transparent",padding:"2px 5px",display:"inline","font-weight":"bold","font-family":"Tahoma","font-size":"1.0em",color:"#fff"}}).addEvent("click",function(){soundManager.play("camera");this.options.onReturn=true;this.display(0);kwbWindow.portfolio(this.language);kwbWindow.display(0)}.bind(this));this.NextBtn=new Element("input",{id:"BoxNextBtn",type:"submit",value:f,styles:{width:"70px",background:"transparent",border:"0px solid transparent",margin:"0px 0px 0px 8px",padding:"2px 5px",display:"inline","font-weight":"bold","font-family":"Tahoma","font-size":"1.0em",color:"#fff"}}).addEvent("click",function(){soundManager.play("camera");this.nextPicture()}.bind(this));this.InBox=new Element("div",{"class":this.options.name+"-InBox"}).adopt(this.PreviousBtn,this.CloseBtn,this.NextBtn);this.Content.empty();this.Loading=new Element("div",{"class":this.options.name+"-Loading"}).adopt(new Element("p",{html:"<strong><small>Carregant...</small></strong>",style:"color:#fff"}));this.Content.adopt(this.Loading);this.replaceBox();var h=new Asset.images(["/pictures/"+i],{onComplete:function(){var l=new Element("img",{id:"SexyPicture",src:"/pictures/"+i});var k=new Element("div",{"class":kwbPortfolio.options.name+"-InBox"}).adopt(new Element("div",{html:"<strong><small>"+d+"</small></strong>"}));var j=new Element("div",{"class":kwbPortfolio.options.name+"-Picture"}).adopt(l,k);kwbPortfolio.Content.empty();kwbPortfolio.Content.adopt(kwbPortfolio.InBox,j);kwbPortfolio.replaceBox()}})},openPicture:function(d,b,a,c){this.chain(function(){c=$extend({textBoxBtnOk:"OK",textBoxBtnCancel:"Cancelar",textBoxInputPrompt:null,password:false,onComplete:$empty},c||{});this.options.onReturnFunction=c.onComplete;this.loadPicture(d,b,a,false);this.display(1)});this.i++;if(this.i==1){this.callChain()}}});kwbPortfolio.implement(new Events,new Options);
var soundManager=null;function SoundManager(b,a){this.flashVersion=9;this.debugMode=false;this.useConsole=false;this.consoleOnly=false;this.waitForWindowLoad=false;this.nullURL="null.mp3";this.allowPolling=true;this.useMovieStar=true;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashLoadTimeout=750;this.defaultOptions={autoLoad:true,stream:true,autoPlay:false,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5000,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,position:null,pan:0,volume:100};this.flash9Options={onbufferchange:null,isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false};this.movieStarOptions={onmetadata:null,useVideo:false};var f=null;var e=this;this.version=null;this.versionNumber="V2.94a.20090206";this.movieURL=null;this.url=null;this.altURL=null;this.swfLoaded=false;this.enabled=false;this.o=null;this.id=(a||"sm2movie");this.oMC=null;this.sounds={};this.soundIDs=[];this.muted=false;this.wmode=null;this.isIE=(navigator.userAgent.match(/MSIE/i));this.isSafari=(navigator.userAgent.match(/safari/i));this.isGecko=(navigator.userAgent.match(/gecko/i));this.debugID="soundmanager-debug";this._debugOpen=true;this._didAppend=false;this._appendSuccess=false;this._didInit=false;this._disabled=false;this._windowLoaded=false;this._hasConsole=(typeof console!="undefined"&&typeof console.log!="undefined");this._debugLevels=["log","info","warn","error"];this._defaultFlashVersion=8;this._oRemoved=null;this._oRemovedHTML=null;var g=function(h){return document.getElementById(h)};this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.filePattern=null;this.features={buffering:false,peakData:false,waveformData:false,eqData:false,movieStar:false};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local + internet access)"},description:null,noRemote:null,noLocal:null};this._setVersionInfo=function(){if(e.flashVersion!=8&&e.flashVersion!=9){alert('soundManager.flashVersion must be 8 or 9. "'+e.flashVersion+'" is invalid. Reverting to '+e._defaultFlashVersion+".");e.flashVersion=e._defaultFlashVersion}e.version=e.versionNumber+(e.flashVersion==9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(e.flashVersion>8){e.defaultOptions=e._mergeObjects(e.defaultOptions,e.flash9Options);e.features.buffering=true}if(e.flashVersion>8&&e.useMovieStar){e.defaultOptions=e._mergeObjects(e.defaultOptions,e.movieStarOptions);e.filePatterns.flash9=new RegExp("\\.(mp3|"+e.netStreamTypes.join("|")+")(\\?.*)?$","i");e.features.movieStar=true}else{e.useMovieStar=false;e.features.movieStar=false}e.filePattern=e.filePatterns[(e.flashVersion!=8?"flash9":"flash8")];e.movieURL=(e.flashVersion==8?"soundmanager2.swf":"soundmanager2_flash9.swf");e.features.peakData=e.features.waveformData=e.features.eqData=(e.flashVersion==9)};this._overHTTP=(document.location?document.location.protocol.match(/http/i):null);this._waitingforEI=false;this._initPending=false;this._tryInitOnFocus=(this.isSafari&&typeof document.hasFocus=="undefined");this._isFocused=(typeof document.hasFocus!="undefined"?document.hasFocus():null);this._okToDisable=!this._tryInitOnFocus;this.useAltURL=!this._overHTTP;var d="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html";this.supported=function(){return(e._didInit&&!e._disabled)};this.getMovie=function(h){return e.isIE?window[h]:(e.isSafari?g(h)||document[h]:g(h))};this.loadFromXML=function(h){try{e.o._loadFromXML(h)}catch(i){e._failSafely();return true}};this.createSound=function(i){if(!e._didInit){throw new Error("soundManager.createSound(): Not loaded yet - wait for soundManager.onload() before calling sound-related methods")}if(arguments.length==2){i={id:arguments[0],url:arguments[1]}}var j=e._mergeObjects(i);var h=j;e._wD("soundManager.createSound(): "+h.id+" ("+h.url+")",1);if(e._idCheck(h.id,true)){e._wD("soundManager.createSound(): "+h.id+" exists",1);return e.sounds[h.id]}if(e.flashVersion>8&&e.useMovieStar){if(h.isMovieStar===null){h.isMovieStar=(h.url.match(e.netStreamPattern)?true:false)}if(h.isMovieStar){e._wD("soundManager.createSound(): using MovieStar handling")}if(h.isMovieStar&&(h.usePeakData||h.useWaveformData||h.useEQData)){e._wD("Warning: peak/waveform/eqData features unsupported for non-MP3 formats");h.usePeakData=false;h.useWaveformData=false;h.useEQData=false}}e.sounds[h.id]=new f(h);e.soundIDs[e.soundIDs.length]=h.id;if(e.flashVersion==8){e.o._createSound(h.id,h.onjustbeforefinishtime)}else{e.o._createSound(h.id,h.url,h.onjustbeforefinishtime,h.usePeakData,h.useWaveformData,h.useEQData,h.isMovieStar,(h.isMovieStar?h.useVideo:false))}if(h.autoLoad||h.autoPlay){if(e.sounds[h.id]){e.sounds[h.id].load(h)}}if(h.autoPlay){e.sounds[h.id].play()}return e.sounds[h.id]};this.createVideo=function(h){if(arguments.length==2){h={id:arguments[0],url:arguments[1]}}if(e.flashVersion>=9){h.isMovieStar=true;h.useVideo=true}else{e._wD("soundManager.createVideo(): flash 9 required for video. Exiting.",2);return false}if(!e.useMovieStar){e._wD("soundManager.createVideo(): MovieStar mode not enabled. Exiting.",2)}return e.createSound(h)};this.destroySound=function(j,h){if(!e._idCheck(j)){return false}for(var k=0;k<e.soundIDs.length;k++){if(e.soundIDs[k]==j){e.soundIDs.splice(k,1);continue}}e.sounds[j].unload();if(!h){e.sounds[j].destruct()}delete e.sounds[j]};this.destroyVideo=this.destroySound;this.load=function(h,i){if(!e._idCheck(h)){return false}e.sounds[h].load(i)};this.unload=function(h){if(!e._idCheck(h)){return false}e.sounds[h].unload()};this.play=function(h,i){if(!e._idCheck(h)){if(typeof i!="Object"){i={url:i}}if(i&&i.url){e._wD('soundController.play(): attempting to create "'+h+'"',1);i.id=h;e.createSound(i)}else{return false}}e.sounds[h].play(i)};this.start=this.play;this.setPosition=function(h,i){if(!e._idCheck(h)){return false}e.sounds[h].setPosition(i)};this.stop=function(h){if(!e._idCheck(h)){return false}e._wD("soundManager.stop("+h+")",1);e.sounds[h].stop()};this.stopAll=function(){e._wD("soundManager.stopAll()",1);for(var h in e.sounds){if(e.sounds[h] instanceof f){e.sounds[h].stop()}}};this.pause=function(h){if(!e._idCheck(h)){return false}e.sounds[h].pause()};this.pauseAll=function(){for(var h=e.soundIDs.length;h--;){e.sounds[e.soundIDs[h]].pause()}};this.resume=function(h){if(!e._idCheck(h)){return false}e.sounds[h].resume()};this.resumeAll=function(){for(var h=e.soundIDs.length;h--;){e.sounds[e.soundIDs[h]].resume()}};this.togglePause=function(h){if(!e._idCheck(h)){return false}e.sounds[h].togglePause()};this.setPan=function(h,i){if(!e._idCheck(h)){return false}e.sounds[h].setPan(i)};this.setVolume=function(i,h){if(!e._idCheck(i)){return false}e.sounds[i].setVolume(h)};this.mute=function(h){if(typeof h!="string"){h=null}if(!h){e._wD("soundManager.mute(): Muting all sounds");for(var j=e.soundIDs.length;j--;){e.sounds[e.soundIDs[j]].mute()}e.muted=true}else{if(!e._idCheck(h)){return false}e._wD('soundManager.mute(): Muting "'+h+'"');e.sounds[h].mute()}};this.muteAll=function(){e.mute()};this.unmute=function(h){if(typeof h!="string"){h=null}if(!h){e._wD("soundManager.unmute(): Unmuting all sounds");for(var j=e.soundIDs.length;j--;){e.sounds[e.soundIDs[j]].unmute()}e.muted=false}else{if(!e._idCheck(h)){return false}e._wD('soundManager.unmute(): Unmuting "'+h+'"');e.sounds[h].unmute()}};this.unmuteAll=function(){e.unmute()};this.getMemoryUse=function(){if(e.flashVersion==8){return 0}if(e.o){return parseInt(e.o._getMemoryUse(),10)}};this.setPolling=function(h){if(!e.o||!e.allowPolling){return false}e.o._setPolling(h)};this.disable=function(j){if(typeof j=="undefined"){j=false}if(e._disabled){return false}e._disabled=true;e._wD("soundManager.disable(): Shutting down",1);for(var h=e.soundIDs.length;h--;){e._disableObject(e.sounds[e.soundIDs[h]])}e.initComplete(j)};this.canPlayURL=function(h){return(h?(h.match(e.filePattern)?true:false):null)};this.getSoundById=function(i,j){if(!i){throw new Error("SoundManager.getSoundById(): sID is null/undefined")}var h=e.sounds[i];if(!h&&!j){e._wD('"'+i+'" is an invalid sound ID.',2)}return h};this.onload=function(){soundManager._wD("<em>Warning</em>: soundManager.onload() is undefined.",2)};this.onerror=function(){};this._idCheck=this.getSoundById;var c=function(){return false};c._protected=true;this._disableObject=function(i){for(var h in i){if(typeof i[h]=="function"&&typeof i[h]._protected=="undefined"){i[h]=c}}h=null};this._failSafely=function(h){if(typeof h=="undefined"){h=false}if(!e._disabled||h){e._wD("soundManager: Failed to initialise.",2);e.disable(h)}};this._normalizeMovieURL=function(h){var i=null;if(h){if(h.match(/\.swf(\?.*)?$/i)){i=h.substr(h.toLowerCase().lastIndexOf(".swf?")+4);if(i){return h}}else{if(h.lastIndexOf("/")!=h.length-1){h=h+"/"}}}return(h&&h.lastIndexOf("/")!=-1?h.substr(0,h.lastIndexOf("/")+1):"./")+e.movieURL};this._getDocument=function(){return(document.body?document.body:(document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]))};this._getDocument._protected=true;this._createMovie=function(A,p){if(e._didAppend&&e._appendSuccess){return false}if(window.location.href.indexOf("debug=1")+1){e.debugMode=true}e._didAppend=true;e._setVersionInfo();var z=(p?p:e.url);var u=(e.altURL?e.altURL:z);e.url=e._normalizeMovieURL(e._overHTTP?z:u);p=e.url;var v=null;if(e.useHighPerformance&&e.useMovieStar){v="Note: disabling highPerformance, not applicable with movieStar mode on";e.useHighPerformance=false}e.wmode=(e.useHighPerformance&&!e.useMovieStar?"transparent":"");var C={name:A,id:A,src:p,width:"100%",height:"100%",quality:"high",allowScriptAccess:"always",bgcolor:e.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:e.wmode};var j={id:A,data:p,type:"application/x-shockwave-flash",width:"100%",height:"100%",wmode:e.wmode};var h={movie:p,AllowScriptAccess:"always",quality:"high",bgcolor:e.bgColor,wmode:e.wmode};var q=null;var D=null;if(e.isIE){q=document.createElement("div");var w='<object id="'+A+'" data="'+p+'" type="application/x-shockwave-flash" width="100%" height="100%"><param name="movie" value="'+p+'" /><param name="AllowScriptAccess" value="always" /><param name="quality" value="high" />'+(e.useHighPerformance&&!e.useMovieStar?'<param name="wmode" value="'+e.wmode+'" /> ':"")+'<param name="bgcolor" value="'+e.bgColor+'" /><!-- --></object>'}else{q=document.createElement("embed");for(D in C){if(C.hasOwnProperty(D)){q.setAttribute(D,C[D])}}}var l=document.createElement("div");l.id=e.debugID+"-toggle";var m={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001};l.appendChild(document.createTextNode("-"));l.onclick=e._toggleDebug;l.title="Toggle SM2 debug console";if(navigator.userAgent.match(/msie 6/i)){l.style.position="absolute";l.style.cursor="hand"}for(D in m){if(m.hasOwnProperty(D)){l.style[D]=m[D]}}var i="soundManager._createMovie(): appendChild/innerHTML set failed. May be app/xhtml+xml DOM-related.";var y=e._getDocument();if(y){e.oMC=g("sm2-container")?g("sm2-container"):document.createElement("div");if(!e.oMC.id){e.oMC.id="sm2-container";e.oMC.className="movieContainer";var r=null;var t=null;if(e.useHighPerformance){r={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px"}}else{r={position:"absolute",width:"1px",height:"1px",top:"-999px",left:"-999px"}}var n=null;for(n in r){if(r.hasOwnProperty(n)){e.oMC.style[n]=r[n]}}try{if(!e.isIE){e.oMC.appendChild(q)}y.appendChild(e.oMC);if(e.isIE){t=e.oMC.appendChild(document.createElement("div"));t.className="sm2-object-box";t.innerHTML=w}e._appendSuccess=true}catch(B){throw new Error(i)}}else{e.oMC.appendChild(q);if(e.isIE){t=e.oMC.appendChild(document.createElement("div"));t.className="sm2-object-box";t.innerHTML=w}e._appendSuccess=true}if(!g(e.debugID)&&((!e._hasConsole||!e.useConsole)||(e.useConsole&&e._hasConsole&&!e.consoleOnly))){var o=document.createElement("div");o.id=e.debugID;o.style.display=(e.debugMode?"block":"none");if(e.debugMode&&!g(l.id)){try{y.appendChild(l)}catch(k){throw new Error(i)}y.appendChild(o)}}y=null}if(v){e._wD(v)}e._wD("-- SoundManager 2 "+e.version+(e.useMovieStar?", MovieStar mode":"")+(e.useHighPerformance?", high performance mode":"")+" --",1);e._wD("soundManager._createMovie(): Trying to load "+p+(!e._overHTTP&&e.altURL?"(alternate URL)":""),1)};this._writeDebug=function(i,p,k){if(!e.debugMode){return false}if(typeof k!="undefined"&&k){i=i+" | "+new Date().getTime()}if(e._hasConsole&&e.useConsole){var h=e._debugLevels[p];if(typeof console[h]!="undefined"){console[h](i)}else{console.log(i)}if(e.useConsoleOnly){return true}}var n="soundmanager-debug";try{var m=g(n);if(!m){return false}var l=document.createElement("div");if(++e._wdCount%2===0){l.className="sm2-alt"}if(typeof p=="undefined"){p=0}else{p=parseInt(p,10)}l.appendChild(document.createTextNode(i));if(p){if(p>=2){l.style.fontWeight="bold"}if(p==3){l.style.color="#ff3333"}}m.insertBefore(l,m.firstChild)}catch(j){}m=null};this._writeDebug._protected=true;this._wdCount=0;this._wdCount._protected=true;this._wD=this._writeDebug;this._wDAlert=function(h){alert(h)};if(window.location.href.indexOf("debug=alert")+1&&e.debugMode){e._wD=e._wDAlert}this._toggleDebug=function(){var i=g(e.debugID);var h=g(e.debugID+"-toggle");if(!i){return false}if(e._debugOpen){h.innerHTML="+";i.style.display="none"}else{h.innerHTML="-";i.style.display="block"}e._debugOpen=!e._debugOpen};this._toggleDebug._protected=true;this._debug=function(){e._wD("--- soundManager._debug(): Current sound objects ---",1);for(var k=0,h=e.soundIDs.length;k<h;k++){e.sounds[e.soundIDs[k]]._debug()}};this._debugTS=function(k,h,i){if(typeof sm2Debugger!="undefined"){try{sm2Debugger.handleEvent(k,h,i)}catch(j){}}};this._debugTS._protected=true;this._mergeObjects=function(j,h){var m={};for(var k in j){if(j.hasOwnProperty(k)){m[k]=j[k]}}var l=(typeof h=="undefined"?e.defaultOptions:h);for(var n in l){if(l.hasOwnProperty(n)&&typeof m[n]=="undefined"){m[n]=l[n]}}return m};this.createMovie=function(h){if(h){e.url=h}e._initMovie()};this.go=this.createMovie;this._initMovie=function(){if(e.o){return false}e.o=e.getMovie(e.id);if(!e.o){if(!e.oRemoved){e._createMovie(e.id,e.url)}else{if(!e.isIE){e.oMC.appendChild(e.oRemoved)}else{e.oMC.innerHTML=e.oRemovedHTML}e.oRemoved=null;e._didAppend=true}e.o=e.getMovie(e.id)}if(e.o){e._wD("soundManager._initMovie(): Got "+e.o.nodeName+" element ("+(e._didAppend?"created via JS":"static HTML")+")",1);if(e.flashLoadTimeout>0){e._wD("soundManager._initMovie(): Waiting for ExternalInterface call from Flash..")}}};this.waitForExternalInterface=function(){if(e._waitingForEI){return false}e._waitingForEI=true;if(e._tryInitOnFocus&&!e._isFocused){e._wD("soundManager: Special case: Waiting for focus-related event..");return false}if(e.flashLoadTimeout>0){if(!e._didInit){e._wD("soundManager: Getting impatient, still waiting for Flash.. ;)")}setTimeout(function(){if(!e._didInit){e._wD("soundManager: No Flash response within reasonable time after document load.\nPossible causes: Flash version under 8, no support, or Flash security denying JS-Flash communication.",2);if(!e._overHTTP){e._wD('soundManager: Loading this page from local/network file system (not over HTTP?) Flash security likely restricting JS-Flash access. Consider adding current URL to "trusted locations" in the Flash player security settings manager at '+d+", or simply serve this content over HTTP.",2)}e._debugTS("flashtojs",false,": Timed out"+(e._overHTTP)?" (Check flash security)":" (No plugin/missing SWF?)")}if(!e._didInit&&e._okToDisable){e._failSafely(true)}},e.flashLoadTimeout)}else{if(!e.didInit){e._wD("soundManager: Waiting indefinitely for Flash...")}}};this.handleFocus=function(){if(e._isFocused||!e._tryInitOnFocus){return true}e._okToDisable=true;e._isFocused=true;e._wD("soundManager.handleFocus()");if(e._tryInitOnFocus){window.removeEventListener("mousemove",e.handleFocus,false)}e._waitingForEI=false;setTimeout(e.waitForExternalInterface,500);if(window.removeEventListener){window.removeEventListener("focus",e.handleFocus,false)}else{if(window.detachEvent){window.detachEvent("onfocus",e.handleFocus)}}};this.initComplete=function(h){if(e._didInit){return false}e._didInit=true;e._wD("-- SoundManager 2 "+(e._disabled?"failed to load":"loaded")+" ("+(e._disabled?"security/load error":"OK")+") --",1);if(e._disabled||h){e._wD("soundManager.initComplete(): calling soundManager.onerror()",1);e._debugTS("onload",false);e.onerror.apply(window);return false}else{e._debugTS("onload",true)}if(e.waitForWindowLoad&&!e._windowLoaded){e._wD("soundManager: Waiting for window.onload()");if(window.addEventListener){window.addEventListener("load",e.initUserOnload,false)}else{if(window.attachEvent){window.attachEvent("onload",e.initUserOnload)}}return false}else{if(e.waitForWindowLoad&&e._windowLoaded){e._wD("soundManager: Document already loaded")}e.initUserOnload()}};this.initUserOnload=function(){e._wD("soundManager.initComplete(): calling soundManager.onload()",1);e.onload.apply(window);e._wD("soundManager.onload() complete",1)};this.init=function(){e._wD("-- soundManager.init() --");e._initMovie();if(e._didInit){e._wD("soundManager.init(): Already called?");return false}if(window.removeEventListener){window.removeEventListener("load",e.beginDelayedInit,false)}else{if(window.detachEvent){window.detachEvent("onload",e.beginDelayedInit)}}try{e._wD("Attempting to call Flash from JS..");e.o._externalInterfaceTest(false);if(!e.allowPolling){e._wD("Polling (whileloading/whileplaying support) is disabled.",1)}e.setPolling(true);if(!e.debugMode){e.o._disableDebug()}e.enabled=true;e._debugTS("jstoflash",true)}catch(h){e._debugTS("jstoflash",false);e._failSafely(true);e.initComplete();return false}e.initComplete()};this.beginDelayedInit=function(){e._wD("soundManager.beginDelayedInit()");e._windowLoaded=true;setTimeout(e.waitForExternalInterface,500);setTimeout(e.beginInit,20)};this.beginInit=function(){if(e._initPending){return false}e.createMovie();e._initMovie();e._initPending=true;return true};this.domContentLoaded=function(){e._wD("soundManager.domContentLoaded()");if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",e.domContentLoaded,false)}e.go()};this._externalInterfaceOK=function(){if(e.swfLoaded){return false}e._wD("soundManager._externalInterfaceOK()");e._debugTS("swf",true);e._debugTS("flashtojs",true);e.swfLoaded=true;e._tryInitOnFocus=false;if(e.isIE){setTimeout(e.init,100)}else{e.init()}};this._setSandboxType=function(h){var i=e.sandbox;i.type=h;i.description=i.types[(typeof i.types[h]!="undefined"?h:"unknown")];e._wD("Flash security sandbox type: "+i.type);if(i.type=="localWithFile"){i.noRemote=true;i.noLocal=false;e._wD("Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html",2)}else{if(i.type=="localWithNetwork"){i.noRemote=false;i.noLocal=true}else{if(i.type=="localTrusted"){i.noRemote=false;i.noLocal=false}}}};this.reboot=function(){e._wD("soundManager.reboot()");if(e.soundIDs.length){e._wD("Destroying "+e.soundIDs.length+" SMSound objects...")}for(var h=e.soundIDs.length;h--;){e.sounds[e.soundIDs[h]].destruct()}try{if(e.isIE){e.oRemovedHTML=e.o.innerHTML}e.oRemoved=e.o.parentNode.removeChild(e.o);e._wD("Flash movie removed.")}catch(j){e._wD("Warning: Failed to remove flash movie.",2)}e.enabled=false;e._didInit=false;e._waitingForEI=false;e._initPending=false;e._didInit=false;e._didAppend=false;e._appendSuccess=false;e._didInit=false;e._disabled=false;e._waitingforEI=true;e.swfLoaded=false;e.soundIDs={};e.sounds=[];e.o=null;e._wD("soundManager: Rebooting...");window.setTimeout(function(){soundManager.beginDelayedInit()},20)};this.destruct=function(){e._wD("soundManager.destruct()");e.disable(true)};f=function(h){var i=this;this.sID=h.id;this.url=h.url;this.options=e._mergeObjects(h);this.instanceOptions=this.options;this._iO=this.instanceOptions;this.pan=this.options.pan;this.volume=this.options.volume;this._debug=function(){if(e.debugMode){var l=null;var n=[];var k=null;var m=null;var j=64;for(l in i.options){if(i.options[l]!==null){if(i.options[l] instanceof Function){k=i.options[l].toString();k=k.replace(/\s\s+/g," ");m=k.indexOf("{");n[n.length]=" "+l+": {"+k.substr(m+1,(Math.min(Math.max(k.indexOf("\n")-1,j),j))).replace(/\n/g,"")+"... }"}else{n[n.length]=" "+l+": "+i.options[l]}}}e._wD("SMSound() merged options: {\n"+n.join(", \n")+"\n}")}};this._debug();this.id3={};this.resetProperties=function(j){i.bytesLoaded=null;i.bytesTotal=null;i.position=null;i.duration=null;i.durationEstimate=null;i.loaded=false;i.playState=0;i.paused=false;i.readyState=0;i.muted=false;i.didBeforeFinish=false;i.didJustBeforeFinish=false;i.isBuffering=false;i.instanceOptions={};i.instanceCount=0;i.peakData={left:0,right:0};i.waveformData=[];i.eqData=[]};i.resetProperties();this.load=function(j){if(typeof j!="undefined"){i._iO=e._mergeObjects(j);i.instanceOptions=i._iO}else{j=i.options;i._iO=j;i.instanceOptions=i._iO}if(typeof i._iO.url=="undefined"){i._iO.url=i.url}e._wD("soundManager.load(): "+i._iO.url,1);if(i._iO.url==i.url&&i.readyState!==0&&i.readyState!=2){e._wD("soundManager.load(): current URL already assigned.",1);return false}i.loaded=false;i.readyState=1;i.playState=0;try{if(e.flashVersion==8){e.o._load(i.sID,i._iO.url,i._iO.stream,i._iO.autoPlay,(i._iO.whileloading?1:0))}else{e.o._load(i.sID,i._iO.url,i._iO.stream?true:false,i._iO.autoPlay?true:false);if(i._iO.isMovieStar&&i._iO.autoLoad&&!i._iO.autoPlay){i.pause()}}}catch(k){e._wD("SMSound.load(): Exception: JS-Flash communication failed, or JS error.",2);e._debugTS("onload",false);e.onerror();e.disable()}};this.unload=function(){if(i.readyState!==0){e._wD('SMSound.unload(): "'+i.sID+'"');if(i.readyState!=2){i.setPosition(0,true)}e.o._unload(i.sID,e.nullURL);i.resetProperties()}};this.destruct=function(){e._wD('SMSound.destruct(): "'+i.sID+'"');e.o._destroySound(i.sID);e.destroySound(i.sID,true)};this.play=function(k){if(!k){k={}}i._iO=e._mergeObjects(k,i._iO);i._iO=e._mergeObjects(i._iO,i.options);i.instanceOptions=i._iO;if(i.playState==1){var j=i._iO.multiShot;if(!j){e._wD('SMSound.play(): "'+i.sID+'" already playing (one-shot)',1);return false}else{e._wD('SMSound.play(): "'+i.sID+'" already playing (multi-shot)',1)}}if(!i.loaded){if(i.readyState===0){e._wD('SMSound.play(): Attempting to load "'+i.sID+'"',1);i._iO.stream=true;i._iO.autoPlay=true;i.load(i._iO)}else{if(i.readyState==2){e._wD('SMSound.play(): Could not load "'+i.sID+'" - exiting',2);return false}else{e._wD('SMSound.play(): "'+i.sID+'" is loading - attempting to play..',1)}}}else{e._wD('SMSound.play(): "'+i.sID+'"')}if(i.paused){i.resume()}else{i.playState=1;if(!i.instanceCount||e.flashVersion==9){i.instanceCount++}i.position=(typeof i._iO.position!="undefined"&&!isNaN(i._iO.position)?i._iO.position:0);if(i._iO.onplay){i._iO.onplay.apply(i)}i.setVolume(i._iO.volume,true);i.setPan(i._iO.pan,true);e.o._start(i.sID,i._iO.loop||1,(e.flashVersion==9?i.position:i.position/1000))}};this.start=this.play;this.stop=function(j){if(i.playState==1){i.playState=0;i.paused=false;if(i._iO.onstop){i._iO.onstop.apply(i)}e.o._stop(i.sID,j);i.instanceCount=0;i._iO={}}};this.setPosition=function(k,j){if(typeof k=="undefined"){k=0}var l=Math.min(i.duration,Math.max(k,0));i._iO.position=l;if(!j){e._wD("SMSound.setPosition("+k+")"+(k!=l?", corrected value: "+l:""))}e.o._setPosition(i.sID,(e.flashVersion==9?i._iO.position:i._iO.position/1000),(i.paused||!i.playState))};this.pause=function(){if(i.paused||i.playState===0){return false}e._wD("SMSound.pause()");i.paused=true;e.o._pause(i.sID);if(i._iO.onpause){i._iO.onpause.apply(i)}};this.resume=function(){if(!i.paused||i.playState===0){return false}e._wD("SMSound.resume()");i.paused=false;e.o._pause(i.sID);if(i._iO.onresume){i._iO.onresume.apply(i)}};this.togglePause=function(){e._wD("SMSound.togglePause()");if(!i.playState){i.play({position:(e.flashVersion==9?i.position:i.position/1000)});return false}if(i.paused){i.resume()}else{i.pause()}};this.setPan=function(k,j){if(typeof k=="undefined"){k=0}if(typeof j=="undefined"){j=false}e.o._setPan(i.sID,k);i._iO.pan=k;if(!j){i.pan=k}};this.setVolume=function(j,k){if(typeof j=="undefined"){j=100}if(typeof k=="undefined"){k=false}e.o._setVolume(i.sID,(e.muted&&!i.muted)||i.muted?0:j);i._iO.volume=j;if(!k){i.volume=j}};this.mute=function(){i.muted=true;e.o._setVolume(i.sID,0)};this.unmute=function(){i.muted=false;var j=typeof i._iO.volume!="undefined";e.o._setVolume(i.sID,j?i._iO.volume:i.options.volume)};this._whileloading=function(j,k,l){if(!i._iO.isMovieStar){i.bytesLoaded=j;i.bytesTotal=k;i.duration=Math.floor(l);i.durationEstimate=parseInt((i.bytesTotal/i.bytesLoaded)*i.duration,10);if(i.readyState!=3&&i._iO.whileloading){i._iO.whileloading.apply(i)}}else{i.bytesLoaded=j;i.bytesTotal=k;i.duration=Math.floor(l);i.durationEstimate=i.duration;if(i.readyState!=3&&i._iO.whileloading){i._iO.whileloading.apply(i)}}};this._onid3=function(n,k){e._wD('SMSound._onid3(): "'+this.sID+'" ID3 data received.');var o=[];for(var m=0,l=n.length;m<l;m++){o[n[m]]=k[m]}i.id3=e._mergeObjects(i.id3,o);if(i._iO.onid3){i._iO.onid3.apply(i)}};this._whileplaying=function(k,l,j,m){if(isNaN(k)||k===null){return false}i.position=k;if(i._iO.usePeakData&&typeof l!="undefined"&&l){i.peakData={left:l.leftPeak,right:l.rightPeak}}if(i._iO.useWaveformData&&typeof j!="undefined"&&j){i.waveformData=j}if(i._iO.useEQData&&typeof m!="undefined"&&m){i.eqData=m}if(i.playState==1){if(i._iO.whileplaying){i._iO.whileplaying.apply(i)}if(i.loaded&&i._iO.onbeforefinish&&i._iO.onbeforefinishtime&&!i.didBeforeFinish&&i.duration-i.position<=i._iO.onbeforefinishtime){e._wD("duration-position &lt;= onbeforefinishtime: "+i.duration+" - "+i.position+" &lt= "+i._iO.onbeforefinishtime+" ("+(i.duration-i.position)+")");i._onbeforefinish()}}};this._onload=function(j){j=(j==1?true:false);e._wD('SMSound._onload(): "'+i.sID+'"'+(j?" loaded.":" failed to load? - "+i.url),(j?1:2));if(!j){if(e.sandbox.noRemote===true){e._wD("SMSound._onload(): Reminder: Flash security is denying network/internet access",1)}if(e.sandbox.noLocal===true){e._wD("SMSound._onload(): Reminder: Flash security is denying local access",1)}}i.loaded=j;i.readyState=j?3:2;if(i._iO.onload){i._iO.onload.apply(i)}};this._onbeforefinish=function(){if(!i.didBeforeFinish){i.didBeforeFinish=true;if(i._iO.onbeforefinish){e._wD('SMSound._onbeforefinish(): "'+i.sID+'"');i._iO.onbeforefinish.apply(i)}}};this._onjustbeforefinish=function(j){if(!i.didJustBeforeFinish){i.didJustBeforeFinish=true;if(i._iO.onjustbeforefinish){e._wD('SMSound._onjustbeforefinish(): "'+i.sID+'"');i._iO.onjustbeforefinish.apply(i)}}};this._onfinish=function(){if(i._iO.onbeforefinishcomplete){i._iO.onbeforefinishcomplete.apply(i)}i.didBeforeFinish=false;i.didJustBeforeFinish=false;if(i.instanceCount){i.instanceCount--;if(!i.instanceCount){i.playState=0;i.paused=false;i.instanceCount=0;i.instanceOptions={};if(i._iO.onfinish){e._wD('SMSound._onfinish(): "'+i.sID+'"');i._iO.onfinish.apply(i)}}}else{}};this._onmetadata=function(j){e._wD("SMSound.onmetadata()");if(!j.width&&!j.height){e._wD("No width/height given, assuming defaults");j.width=320;j.height=240}i.metadata=j;i.width=j.width;i.height=j.height;if(i._iO.onmetadata){e._wD('SMSound._onmetadata(): "'+i.sID+'"');i._iO.onmetadata.apply(i)}e._wD("SMSound.onmetadata() complete")};this._onbufferchange=function(j){if(j==i.isBuffering){return false}i.isBuffering=(j==1?true:false);if(i._iO.onbufferchange){e._wD("SMSound._onbufferchange(): "+j);i._iO.onbufferchange.apply(i)}}};if(window.addEventListener){window.addEventListener("focus",e.handleFocus,false);window.addEventListener("load",e.beginDelayedInit,false);window.addEventListener("unload",e.destruct,false);if(e._tryInitOnFocus){window.addEventListener("mousemove",e.handleFocus,false)}}else{if(window.attachEvent){window.attachEvent("onfocus",e.handleFocus);window.attachEvent("onload",e.beginDelayedInit);window.attachEvent("unload",e.destruct)}else{e._debugTS("onload",false);soundManager.onerror();soundManager.disable()}}if(document.addEventListener){document.addEventListener("DOMContentLoaded",e.domContentLoaded,false)}}soundManager=new SoundManager();