var dtCh="/";var minYear=1800;var maxYear=2100;function isInteger(B){var A;for(A=0;A<B.length;A++){var C=B.charAt(A);if(((C<"0")||(C>"9"))){return false}}return true}function stripCharsInBag(C,D){var B;var A="";for(B=0;B<C.length;B++){var E=C.charAt(B);if(D.indexOf(E)==-1){A+=E}}return A}function daysInFebruary(A){return(((A%4==0)&&((!(A%100==0))||(A%400==0)))?29:28)}function DaysArray(B){for(var A=1;A<=B;A++){this[A]=31;if(A==4||A==6||A==9||A==11){this[A]=30}if(A==2){this[A]=29}}return this}function isDate(D){var A=DaysArray(12);var E=D.indexOf(dtCh);var C=D.indexOf(dtCh,E+1);var H=D.substring(0,E);var G=D.substring(E+1,C);var F=D.substring(C+1);strYr=F;if(G.charAt(0)=="0"&&G.length>1){G=G.substring(1)}if(H.charAt(0)=="0"&&H.length>1){H=H.substring(1)}for(var B=1;B<=3;B++){if(strYr.charAt(0)=="0"&&strYr.length>1){strYr=strYr.substring(1)}}month=parseInt(H);day=parseInt(G);year=parseInt(strYr);if(E==-1||C==-1){alert("The date format should be : mm/dd/yyyy");return false}if(H.length<1||month<1||month>12){return false}if(G.length<1||day<1||day>31||(month==2&&day>daysInFebruary(year))||day>A[month]){return false}if(F.length!=4||year==0||year<minYear||year>maxYear){return false}if(D.indexOf(dtCh,C+1)!=-1||isInteger(stripCharsInBag(D,dtCh))==false){return false}return true}String.prototype.trim=function(){if(this!==null){return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1")}return null};String.prototype.toJSNumber=function(){return this.replace(".","").replace(",",".")};Validator={CURRENCY_ERROR_MSG:"Le montant doit être une valeur uniquement avec des nombres.",TOO_LOW_CURRENCY:"Attention! Le montant doit être compris entre 23 € et 200 €.",TOO_HIGH_CURRENCY:"Attention! Le montant doit être compris entre 23 € et 200 €.",TOO_LOW_CURRENCY_SP:"Attention! Le montant doit être compris entre 25 € et 250 €.",TOO_HIGH_CURRENCY_SP:"Attention! Le montant doit être compris entre 25 € et 250 €.",TOO_LOW_CURRENCY_OP:"Attention! Le montant doit être compris entre 50 € et 2500 €.",TOO_HIGH_CURRENCY_OP:"Attention! Le montant doit être compris entre 50 € et 2500 €.",TOO_LOW_CURRENCY_DT:"Attention! Le montant doit être compris entre 110 € et 3000 €.",TOO_HIGH_CURRENCY_DT:"Attention! Le montant doit être compris entre 110 € et 3000 €.",TOO_LOW_CURRENCY_AU:"Attention! Le montant doit être compris entre 200 € et 3000 €.",TOO_HIGH_CURRENCY_AU:"Attention! Le montant doit être compris entre 200 € et 3000 €.",TOO_LOW_TEETH:"Attention! Le nombre de dents doit être compris entre 1 et 32.",TOO_HIGH_TEETH:"Attention! Le nombre de dents doit être compris entre 1 et 32.",TOO_LOW_AGE:"Attention! L'âge doit être compris entre 1 et 125 ans.",TOO_HIGH_AGE:"Attention! L'âge doit être compris entre 1 et 125 ans.",THEET_ERROR_MSG:"Le nombre de dents doit être une valeur uniquement avec des nombres.",AGE_ERROR_MSG:"L'age doit être une valeur uniquement avec des nombres.",isValidCurrency:function(B){B=B.trim();if(B===""){return false}var C=new RegExp("^[0-9]{0,3}([.]{0,1}[0-9]{3})*(,[0-9]+)?$");var A=C.test(B);return A},isValidInteger:function(B){B=B.trim();if(B===""){return false}var C=new RegExp("^[0-9]+$");var A=C.test(B);return A},insertInteger:function(A){if(A.keyCode<45||A.keyCode>57){A.returnValue=false}if(A.which<45||A.which>57){return false}},isValueFilled:function(B){var A=dwr.util;if((B)&&(B.trim()!=="")){return true}else{return false}},isCorrectSize:function(C,A){var B=dwr.util;if(C){if(C.length<=A){return true}else{return false}}else{return false}},isEmailValid:function(B){var A=/\b[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}\b/;return A.test(B)}};Mornay={showResult:function(A){var B=$(A);B.style.display=""},hideResult:function(A){var B=$(A);B.style.display="none"},prettifyMoney:function(A){if(A.indexOf(",")==-1){return A+",00 "}var B=A.indexOf(",");if(A.trim().length-B<3){return A+"0 "}return A+" "},calculateAge:function(A){var B=this._getDateOfBirth(A);if(B!=null){Visitor.calculateAge({dateOfBirth:B},function(C){})}},_getDateOfBirth:function(B){var A=dwr.util;if(A.getValue(B+"birthyear")==-1||A.getValue(B+"birthmonth")==-1||A.getValue(B+"birthday")==-1){return null}return new Date(A.getValue(B+"birthyear"),A.getValue(B+"birthmonth"),A.getValue(B+"birthday"))},formatDate:function(C,B){var A=C.getMonth()+1;var D=C.getDate();if(A<=9){A="0"+A}if(D<=9){D="0"+D}dwr.util.byId(B).innerHTML=D+"/"+A+"/"+C.getFullYear()}};RefoundSimulator={hideResult:function(){dwr.util.byId("refoundTable").style.display="none";dwr.util.byId("refoundTableNote").style.display="none";dwr.util.byId("refoundContainerSoinsOpt").style.display="none";Mornay.hideResult("refoundContainer")},showResult:function(){var A=parseInt(dwr.util.getValue("careid"));if(A==3){dwr.util.byId("refoundContainerSoinsOpt").style.display=""}else{dwr.util.byId("refoundTable").style.display=""}if(A>2){dwr.util.byId("refoundTableStar").style.display="none";dwr.util.byId("refoundTableNote").style.display="none"}else{dwr.util.byId("refoundTableStar").style.display="";dwr.util.byId("refoundTableNote").style.display=""}Mornay.showResult("refoundContainer")},getCares:function(){Simulation.getCares(function(A){dwr.util.addOptions("careid",A,"id","category")})},activateExtraInput:function(){var A=dwr.util;var B=parseInt(dwr.util.getValue("careid"));var C=function(){A.byId("ageInput").style.display="none";A.byId("theetInput").style.display="none"};switch(B){case 1:A.byId("contextText").innerHTML="Remboursement pour une consultation de généraliste conventionné réalisée dans le cadre du parcours de soins coordonné.<br/><br/>Saisissez le montant de la consultation.";C();break;case 2:A.byId("contextText").innerHTML="Remboursement pour une consultation de spécialiste conventionné réalisée dans le cadre du parcours de santé.<br/><br/>Saisissez le montant de la consultation.";C();break;case 3:A.byId("contextText").innerHTML="Remboursement d'une paire de lunettes comprenant une monture et deux verres. Le remboursement de la Sécurité sociale des verres optiques s’effectuant en fonction du degré de correction, un remboursement moyen est appliqué  sur ces derniers pour effectuer la simulation.<br/><br/>Saisissez le montant global de la facture en euros.";C();break;case 4:A.byId("contextText").innerHTML="Remboursement sur la base d'une prothèse dentaire égale à 50 SPR .<br/><br/>Saisissez le montant total de la prothèse et le nombre de dents concernées.";A.byId("ageInput").style.display="none";A.byId("theetInput").style.display="";break;case 5:A.byId("contextText").innerHTML="Remboursement sur la base de l'achat d'une prothèse auditive par une personne assurée depuis plus de 2 ans et n'ayant pas utilisé son forfait la 1ère année.<br/><br/>Saisissez le montant total de la prothèse et votre âge en années.";A.byId("ageInput").style.display="";A.byId("theetInput").style.display="none";break;default:A.byId("contextText").innerHTML=""}},calculateRefound:function(){var C=dwr.util.getValue("careid");var A=dwr.util.getValue("expenditure").trim();var E=dwr.util.getValue("numberOfTheet").trim();var B=dwr.util.getValue("age").trim();if(!this._validateAndDisplayErrors(C,A,E,B)){return }var D={expenditure:A.toJSNumber(),careId:C,numberOfTheet:E!==""?E:null,age:B!=""?B:null};HDAInterface.sendEvent("NN_VS_0008_1");if(C==3){Simulation.simulateRefound(D,this.calculateRefoundCBSoinsOpt)}else{Simulation.simulateRefound(D,this.calculateRefoundCB)}},calculateRefoundCB:function(D){var G=dwr.util.byId("refoundTable");G.style.display="";G.style.width="100%";var A="refoundTableResult";var F=false;var E=" €";var C=[function(K){var H="";var I=K.guarantee.name;var J=K.guarantee.id;if(J==5){H+="<br />"}H+='<a href="'+I.toLowerCase()+'.do">'+I+"</a>";if(K.withModulePlus){if(J==1||J==2){H+=' avec <a href="modulePlusOne.do?p=1">Module Plus</a>'}else{H+=' avec <a href="modulePlusTwo.do?p=2">Module Plus</a>'}F=!F?true:F}return H},function(H){return H.guarantee.id==5?"<br />"+Mornay.prettifyMoney(H.simulation.socialRefound)+E:Mornay.prettifyMoney(H.simulation.socialRefound)+E},function(H){return H.guarantee.id==5?"<br />"+Mornay.prettifyMoney(H.simulation.insuranceRefound)+E:Mornay.prettifyMoney(H.simulation.insuranceRefound)+E},function(H){return H.guarantee.id==5?"<br />"+Mornay.prettifyMoney(H.simulation.fromInsured)+E:Mornay.prettifyMoney(H.simulation.fromInsured)+E}];dwr.util.removeAllRows(A);dwr.util.addRows(A,D,C,{escapeHtml:false});var B=dwr.util.byId("modulePlusNote");dwr.util.byId("refoundTableAdd").style.display="";if(B){B.style.display=F?"":"none"}RefoundSimulator.showResult()},calculateRefoundCBSoinsOpt:function(H){var G=dwr.util.byId("refoundTable1SoinsOpt");G.style.display="";G.style.width="100%";var E=dwr.util.byId("refoundTable2SoinsOpt");E.style.display="";E.style.width="100%";var D="refoundTableResult1SoinsOpt";var F="refoundTableResult2SoinsOpt";var A=false;var K=" €";var B=function(O){var L="";var M=O.guarantee.name;var N=O.guarantee.id;if(N==5){L+="<br />"}L+='<a href="'+M.toLowerCase()+'.do">'+M+"</a>";if(O.withModulePlus){if(N==1||N==2){L+=' avec <a href="modulePlusOne.do?p=1">Module Plus</a>'}else{L+=' avec <a href="modulePlusTwo.do?p=2">Module Plus</a>'}A=!A?true:A}return L};var J=[B,function(L){return L.guarantee.id==5?"<br />"+Mornay.prettifyMoney(L.simulation.socialRefound)+K:Mornay.prettifyMoney(L.simulation.socialRefound)+K},function(L){return L.guarantee.id==5?"<br />"+Mornay.prettifyMoney(L.simulation.insuranceRefound)+K:Mornay.prettifyMoney(L.simulation.insuranceRefound)+K},function(L){return L.guarantee.id==5?"<br />"+Mornay.prettifyMoney(L.simulation.fromInsured)+K:Mornay.prettifyMoney(L.simulation.fromInsured)+K}];var I=[B,function(L){return L.guarantee.id==5?"<br />"+Mornay.prettifyMoney(L.simulation.socialRefound)+K:Mornay.prettifyMoney(L.simulation.socialRefound)+K},function(L){return L.guarantee.id==5?"<br />"+Mornay.prettifyMoney(L.simulation.insuranceRefoundMax)+K:Mornay.prettifyMoney(L.simulation.insuranceRefoundMax)+K},function(L){return L.guarantee.id==5?"<br />"+Mornay.prettifyMoney(L.simulation.fromInsuredMin)+K:Mornay.prettifyMoney(L.simulation.fromInsuredMin)+K}];dwr.util.removeAllRows(D);dwr.util.addRows(D,H,J,{escapeHtml:false});dwr.util.removeAllRows(F);dwr.util.addRows(F,H,I,{escapeHtml:false});var C=dwr.util.byId("modulePlusNote");dwr.util.byId("refoundTableAdd").style.display="";if(C){C.style.display=A?"":"none"}RefoundSimulator.showResult()},_validateAndDisplayErrors:function(D,J,H,O){var M=[];var C=null;var F=null;var I=null;var L=null;var K=null;var P=null;var N=null;var A=null;if(Validator.isValidCurrency(J)==false){M.push(Validator.CURRENCY_ERROR_MSG)}switch(D){case"1":if(J<23){M.push(Validator.TOO_LOW_CURRENCY)}if(J>200){M.push(Validator.TOO_HIGH_CURRENCY)}C=5;A=Validator.isValidCurrency(J)?J:-1;break;case"2":if(J<25){M.push(Validator.TOO_LOW_CURRENCY_SP)}if(J>250){M.push(Validator.TOO_HIGH_CURRENCY_SP)}C=4;N=Validator.isValidCurrency(J)?J:-1;break;case"3":if(J<50){M.push(Validator.TOO_LOW_CURRENCY_OP)}if(J>2500){M.push(Validator.TOO_HIGH_CURRENCY_OP)}C=3;P=Validator.isValidCurrency(J)?J:-1;break;case"4":if(J<110){M.push(Validator.TOO_LOW_CURRENCY_DT)}if(J>3000){M.push(Validator.TOO_HIGH_CURRENCY_DT)}C=1;F=Validator.isValidCurrency(J)?J:-1;I=H;break;case"5":if(J<200){M.push(Validator.TOO_LOW_CURRENCY_AU)}if(J>3000){M.push(Validator.TOO_HIGH_CURRENCY_AU)}C=2;L=Validator.isValidCurrency(J)?J:-1;K=O;break}switch(D){case"4":if(Validator.isValidInteger(H)==false){M.push(Validator.THEET_ERROR_MSG);I=-1}else{if(H>32){M.push(Validator.TOO_HIGH_TEETH)}if(H<=0){M.push(Validator.TOO_LOW_TEETH)}}break;case"5":if(Validator.isValidInteger(O)==false){M.push(Validator.AGE_ERROR_MSG);K=-1}else{if(O>125){M.push(Validator.TOO_HIGH_AGE)}if(O<=0){M.push(Validator.TOO_LOW_AGE)}}break}var B="tipo_consultazione="+C;if(F){B+="&dents_montante="+F+"&dents_denti="+I}if(L){B+="&audi_montante="+L+"&audi_age="+K}if(P){B+="&eyes_montante="+P}if(N){B+="&specialiste_montante="+N}if(A){B+="&generaliste_montante="+A}if(HDAInterface){HDAInterface.sendEvent("RR_VS_00012",B)}if(M.length>0){var E="";for(var G=0;G<M.length;G++){E+=M[G]+" "}dwr.util.setValue("dataError",E);dwr.util.byId("dataError").style.display="";return false}else{dwr.util.setValue("dataError","");dwr.util.byId("dataError").style.display="none";return true}}};RateSimulator={hideResult:function(){Mornay.hideResult("rateContainer")},showResult:function(){Mornay.showResult("rateContainer")},toggleRelative:function(){var C=dwr.util.byId("visitorDate");var B=dwr.util.byId("family");var A=dwr.util.byId("relativeDate");dwr.util.byId("dataError").style.display="none";B.style.display=this._isFamily()?"":"none";A.style.display=this._isCouple()?"":"none";if(dwr.util.byId("simSeul").checked||this._isFamily()){C.style.display=""}},simulateRate:function(){var D,B,J=null;var H=parseInt(this._getChildren());var I=dwr.util.byId("simSeul").checked;var E=this._isCouple();var A=this._isFamily();var N=Mornay._getDateOfBirth("relative");var M=Mornay._getDateOfBirth("visitor");var C=new Date();var L=[];if(!I&&!A){return false}if(A){if(E){if(N==null||N>C){if(M==null||M>C){L.push("Votre date de naissance et celle de votre conjoint ne sont pas valides.")}else{L.push("La date de naissance de votre conjoint n'est pas valide.")}}B={dateOfBirth:N}}else{if(M==null||M>C){L.push("Votre date de naissance n'est pas valide.")}}D=[];for(var G=0;G<H&&G<2;G++){D[D.length]={dateOfBirth:C}}}else{if(M==null||M>C){L.push("Votre date de naissance n'est pas valide.")}}if(L.length>0){var F="";for(var G=0;G<L.length;G++){F+=L[G]+" "}dwr.util.setValue("dataError",F);dwr.util.byId("dataError").style.display="";return }else{dwr.util.byId("dataError").style.display="none"}J={dateOfBirth:M,relative:B,children:D,simulateFamily:A,simulateCouple:E};var K=function(Q){var X,P=null;var T=" €";var Y=2;var R=Q&&(Q[0].relativeRate!=-1||Q[0].childrenRate[0]!=null)?true:false;var O=function(Z){dwr.util.byId("rateTable").style.display="none";dwr.util.byId("conjoint").style.display="none";dwr.util.byId("firstChild").style.display="none";dwr.util.byId("secondChild").style.display="none";dwr.util.byId("todayRate").style.display="none";dwr.util.byId("noteCouple").style.display="none";dwr.util.byId("singleTotal").style.display="";dwr.util.byId("noteTotal").style.display="none";if(Z=="rateTable"){dwr.util.byId("rateTable").style.display="";dwr.util.byId("todayRate").style.display="block";if(R){if(E){dwr.util.byId("singleTotal").style.display="none";dwr.util.byId("noteTotal").style.display="";dwr.util.byId("conjoint").style.display="";dwr.util.byId("noteCouple").style.display=""}if(H>0){dwr.util.byId("firstChild").style.display=""}if(H>1){dwr.util.byId("secondChild").style.display=""}if(H==3){dwr.util.byId("singleTotal").style.display="none";dwr.util.byId("noteTotal").style.display=""}}}};if(HDAInterface){var U=J.dateOfBirth;var W=U.getMonth()+1;var V=U.getDate();if(W<=9){W="0"+W}if(V<=9){V="0"+V}HDAInterface.sendEvent("RR_VS_0002","seul="+(!R)+"&date_naissance="+escape(U.getFullYear()+"-"+W+"-"+V)+"&date_error=0")}P=[function(a){var b=a.guarantee.name;var d=a.guarantee.id;var Z=null;if(b.toLowerCase()=="imprévus"){Z='<a href="imprevus.do">'+b+"</a>"}else{Z='<a href="'+b.toLowerCase()+'.do">'+b+"</a>"}if(a.modulePlus){if((d==1)||(d==2)){Z+=' avec <br /><a href="modulePlusOne.do?p=1">Module Plus</a>'}if((d==3)||(d==4)){Z+=' avec <br /><a href="modulePlusTwo.do?p=2">Module Plus</a>'}}return Z},function(Z){return Mornay.prettifyMoney(Z.visitorRate)+T}];X="rateTable";if(R){if(E){P[Y]=function(Z){return Mornay.prettifyMoney(Z.relativeRate)+T};Y=Y+1}if(H>0){P[Y]=function(Z){return Mornay.prettifyMoney(Z.childrenRate[0])+T};Y=Y+1}if(H==2||H==3){P[Y]=function(Z){return Mornay.prettifyMoney(Z.childrenRate[1])+T};Y=Y+1}}P[Y]=function(Z){return Mornay.prettifyMoney(Z.total)+T};O(X);var S=X+"Result";dwr.util.removeAllRows(S);dwr.util.addRows(S,Q,P,{escapeHtml:false});RateSimulator.showResult()};Simulation.simulateRate(J,{callback:K})},_isCouple:function(){return dwr.util.byId("couple").checked},_isFamily:function(){return dwr.util.byId("simFamily").checked},_getChildren:function(){return dwr.util.getValue("childrenNumber")}};Mornay.faq=function(){};Mornay.faq.prototype={lastClickedLink:null,haveToHandle:false,ut:null,currentDiv:null,firstTime:true,init:function(){this.ut=dwr.util;HDAPlayer.events.videoBegin.subscribe(this._handleFaq,this)},_handleFaq:function(B,C){if(this.haveToHandle){this.lastClickedLink.style.fontSize="1.4em";this.lastClickedLink.style.color="#BD3083";var A=this.ut.byId("hda-alternativeText");var D=this.currentDiv;if(!this.firstTime){new Fx.Style(D,"opacity",{duration:0,onComplete:function(){D.innerHTML=A.innerHTML;new Fx.Style(D,"opacity",{duration:0}).start(0,1)}}).start(1,0)}else{D.style.visibility="hidden";D.innerHTML=A.innerHTML;new Fx.Style(D,"opacity",{duration:0}).start(0,1);this.firstTime=false}this.stopHandleRequest()}},handleRequest:function(){this.haveToHandle=true},stopHandleRequest:function(){this.haveToHandle=false},showFaq:function(A){if(!HDAInterface.player._isPlayerInited()){return }if(this.ut.byId(A).style.display=="block"){this.ut.byId(A).innerHTML="";this.ut.byId(A).style.display="none";this.stopHandleRequest()}else{this.handleRequest();this.ut.byId(A).style.display="block";this.ut.byId(A).innerHTML=""}if(this.lastClickedLink){this.lastClickedLink.style.fontSize="1.2em";this.lastClickedLink.style.color="#0E6AA5"}this.lastClickedLink=this.ut.byId("link_"+A);this.currentDiv=this.ut.byId(A);return this.haveToHandle}};Mornay.form=function(){};Mornay.form.prototype={ut:null,errorDiv:null,ulDiv:null,formDiv:null,confirmationDiv:null,singleConfirmationDiv:null,coupleConfirmationDiv:null,personSelector:null,visitorId:null,title:null,name:null,surname:null,birthdate_day:null,birthdate_month:null,birthdate_year:null,relative_title:null,relative_name:null,relative_surname:null,relative_birthdate_day:null,relative_birthdate_month:null,relative_birthdate_year:null,apartment:null,building:null,streetAndNumber:null,mailbox:null,postalCode:null,town:null,state:null,email:null,email2:null,telephone:null,newsletter:null,requestInfo:null,downloadDate:null,documentation:false,idPersonneMS:null,codeAction:null,_loadDataFromForm:function(){this.ut.getValues(this);this.idPersonneMS=NL.extractAttributeFromCookieByName("idIndividu");this.codeAction=NL.extractAttributeFromCookieByName("deliveryCode")},_trackGA:function(A){var B=0;var C=function(){if(!pageTracker){if(++B<5){window.setTimeout(C,2000)}return }pageTracker._trackPageview(A)};C()},_buildVisitorObject:function(){var A={};A.apartment=this.apartment;A.streetAndNumber=this.streetAndNumber;A.building=this.building;A.mailbox=this.mailbox;A.postalCode=this.postalCode;A.town=this.town;A.state=this.state;var C=null;if(this.personSelector=="couple"){C={};C.relativeType=1;C.name=this.relative_name;C.surname=this.relative_surname;C.title=this.relative_title;C.dateOfBirth=new Date(this.relative_birthdate_year,this.relative_birthdate_month-1,this.relative_birthdate_day,17,0,0,0)}var B={};B.id=this.visitorId;B.name=this.name;B.surname=this.surname;B.title=this.title;B.dateOfBirth=new Date(this.birthdate_year,this.birthdate_month-1,this.birthdate_day,17,0,0,0);B.address=A;B.email=this.email;B.telephone=this.telephone;B.relative=C;B.newsletter=this.newsletter;B.requestedInfo=this.requestInfo?this.requestInfo:null;B.downloadDate=this.downloadDate?this.downloadDate:null;B.documentation=this.documentation?this.documentation:false;B.idPersonneMS=this.idPersonneMS?this.idPersonneMS:null;B.codeAction=this.codeAction?this.codeAction:null;return B},_loadDataFromVisitorObject:function(D){if(D){var E=new Date(D.dateOfBirth);this.visitorId=D.id;this.name=D.name;this.surname=D.surname;this.title=D.title;this.birthdate_year=E.getFullYear();this.birthdate_month=E.getMonth()+1;this.birthdate_day=E.getDate();this.email=D.email;this.email2=D.email;this.telephone=D.telephone;if(D.newsletter==null||typeof (D.newsletter)=="undefined"){this.newsletter=true}else{this.newsletter=D.newsletter}this.requestInfo=D.requestedInfo;this.downloadDate=D.downloadDate;this.documentation=D.documentation;this.idPersonneMS=D.idPersonneMS;this.codeAction=D.codeAction;if(D.address){var A=D.address;this.streetAndNumber=A.streetAndNumber;this.building=A.building;this.apartment=A.apartment;this.mailbox=A.mailbox;this.postalCode=A.postalCode;this.town=A.town;this.state=A.state}if(D.relative){var C=new Date(D.relative.dateOfBirth);var B=D.relative;this.relative_name=B.name;this.relative_surname=B.surname;this.relative_title=B.title;this.relative_birthdate_year=C.getFullYear();this.relative_birthdate_month=C.getMonth()+1;this.relative_birthdate_day=C.getDate()}}},_saveToSession:function(){Visitor.setVisitor(this._buildVisitorObject())},_storeToDB:function(){Visitor.save(this._buildVisitorObject())},_loadFromSession:function(){Visitor.getVisitor(this._loadFromSessionCallback.bind(this))},_loadFromSessionCallback:function(A){if(A){this._loadDataFromVisitorObject(A);this.ut.setValues(this)}else{}},_validationError:function(B,A){console.debug("Override this!")},createVisitorFromNLCookie:function(){var A=NL.extractAttributeFromCookieByName("salutationMs");if(A=="Monsieur"){this.title=1}else{if(A=="Madame"){this.title=2}else{this.title=3}}this.name=NL.extractAttributeFromCookieByName("lastName");this.surname=NL.extractAttributeFromCookieByName("name");this.birthdate_day=NL.extractAttributeFromCookieByName("birthDate_day");this.birthdate_month=NL.extractAttributeFromCookieByName("birthDate_month");this.birthdate_year=NL.extractAttributeFromCookieByName("birthDate_year");this.apartment=NL.extractAttributeFromCookieByName("additionalGeo");this.building=NL.extractAttributeFromCookieByName("additionalRcp");this.streetAndNumber=NL.extractAttributeFromCookieByName("street");this.mailbox=NL.extractAttributeFromCookieByName("special");this.postalCode=NL.extractAttributeFromCookieByName("zipCode");this.town=NL.extractAttributeFromCookieByName("city");this.state=NL.extractAttributeFromCookieByName("paysMs");this.email=NL.extractAttributeFromCookieByName("email");this.email2=NL.extractAttributeFromCookieByName("email");this.telephone=NL.extractAttributeFromCookieByName("phone");this.idPersonneMS=NL.extractAttributeFromCookieByName("idIndividu");this.codeAction=NL.extractAttributeFromCookieByName("deliveryCode");this.newsletter=null;Visitor.save(this._buildVisitorObject())},addAnswer:function(A,C){var B={};B.question=A;B.answerText=C;Answer.addAnswer(B,{async:false})},init:function(E,F,B,A,C,D){this.ut=dwr.util;this.errorDiv=E;this.ulDiv=F;this.formDiv=B;this.confirmationDiv=A;this.singleConfirmationDiv=C;this.coupleConfirmationDiv=D;this._loadFromSession();if(this.ut.byId("newsletter")){this.newsletter=true;this.ut.byId("newsletter").value="true";this.ut.byId("newsletter").checked=true}},validate:function(){var B=false;this._loadDataFromForm();var D=new Array();var A=new Array();if(!Validator.isValueFilled(this.title)){D.push('le champ "Civilité" est obligatoire');A.push("Civilité")}if(!Validator.isValueFilled(this.name)){D.push('le champ "Nom" est obligatoire');A.push("Nom")}else{if(!Validator.isCorrectSize(this.name,30)){B=true;A.push("Nom");D.push('le champ "Nom" ne peut etre plus grand de 30 caractères')}}if(!Validator.isValueFilled(this.surname)){D.push('le champ "Prénom" est obligatoire');A.push("Prénom")}else{if(!Validator.isCorrectSize(this.surname,30)){B=true;A.push("Nom");D.push('le champ "Prénom" ne peut etre plus grand de 30 caractères')}}if((!Validator.isValueFilled(this.birthdate_day))||(!Validator.isValueFilled(this.birthdate_month))||(!Validator.isValueFilled(this.birthdate_year))){D.push('le champ "Date de naissance" est obligatoire');A.push("Date de naissance")}else{var C=parseInt(this.birthdate_month);if(!isDate(C+"/"+this.birthdate_day+"/"+this.birthdate_year)){D.push('le champ "Date de naissance" n\'a pas un format valide');A.push("Date de naissance")}}if(!Validator.isValueFilled(this.streetAndNumber)){D.push('le champ "N, voie" est obligatoire');A.push("numéro")}else{if(!Validator.isCorrectSize(this.streetAndNumber,38)){B=true;A.push("Nom");D.push('le champ "N, voie" ne peut etre plus grand de 38 caractères')}}if(!Validator.isValueFilled(this.postalCode)){D.push('le champ "Code postal" est obligatoire');A.push("Code postal")}else{if(!Validator.isCorrectSize(this.postalCode,5)){B=true;A.push("Code postal");D.push('le champ "Code postal" ne peut etre plus grand de 5 caractères')}if(!Validator.isValidInteger(this.postalCode)){B=true;A.push("Code postal");D.push('le "Code postal" doit être composé uniquement de chiffres')}}if(!Validator.isValueFilled(this.town)){D.push('le champ "Ville" est obligatoire');A.push("Ville")}else{if(!Validator.isCorrectSize(this.town,32)){B=true;A.push("Ville");D.push('le champ "Ville" ne peut etre plus grand de 32 caractères')}}if(!Validator.isValueFilled(this.state)){D.push('le champ "Pays" est obligatoire');A.push("Pays")}else{if(!Validator.isCorrectSize(this.state,32)){B=true;A.push("Pays");D.push('le champ "Pays" ne peut etre plus grand de 32 caractères')}}if(!Validator.isValueFilled(this.email)){D.push('le champ "email" est obligatoire');A.push("email")}else{if(!Validator.isCorrectSize(this.email,60)){B=true;A.push("email");D.push('le champ "email" ne peut etre plus grand de 60 caractères')}}if(!Validator.isValueFilled(this.email2)){D.push('le champ "Confirmation email" est obligatoire');A.push("Confirmation email")}else{if(!Validator.isCorrectSize(this.email2,60)){B=true;A.push("Confirmation email");D.push('le champ "Confirmation email" ne peut etre plus grand de 60 caractères')}}if(Validator.isValueFilled(this.email)&&Validator.isValueFilled(this.email2)&&(this.email!=this.email2)){D.push("l'adresse email doit être identique à l'adresse de confirmation. Merci de verifier votre saisie.");A.push("email");B=true}else{if(!Validator.isEmailValid(this.email)){D.push("L'adresse email n'a pas un format valide");A.push("email");B=true}}if(this.personSelector=="couple"){if(!Validator.isValueFilled(this.relative_title)){D.push('le champ "Civilité" du conjoint est obligatoire');A.push("Civilité du conjoint")}if(!Validator.isValueFilled(this.relative_name)){D.push('le champ "Nom" du conjoint est obligatoire');A.push("Nom du conjoint")}else{if(!Validator.isCorrectSize(this.relative_name,30)){B=true;A.push("Nom du conjoint");D.push('le champ "Nom du conjoint" ne peut etre plus grand de 30 caractères')}}if(!Validator.isValueFilled(this.relative_surname)){D.push('le champ "Prénom" du conjoint est obligatoire');A.push("Prénom du conjoint")}else{if(!Validator.isCorrectSize(this.relative_surname,30)){B=true;A.push("Prénom du conjoint");D.push('le champ "Prénom du conjoint" ne peut etre plus grand de 30 caractères')}}if((!Validator.isValueFilled(this.relative_birthdate_day))||(!Validator.isValueFilled(this.relative_birthdate_month))||(!Validator.isValueFilled(this.relative_birthdate_year))){D.push('le champ "Date de naissance" du conjoint est obligatoire');A.push("Date de naissance du conjoint")}else{var C=parseInt(this.relative_birthdate_month);if(!isDate(C+"/"+this.relative_birthdate_day+"/"+this.relative_birthdate_year)){D.push('le champ "Date de naissance" du conjoint n\'a pas un format valide');A.push("Date de naissance du conjoint")}}}if(this.ut.byId("newsletter")){if(this.ut.byId("newsletter").value!="true"){if(this.ut.byId("newsletter").value!="false"){D.push('le champ "Newsletter" est obligatoire');A.push("newsletter")}}}if(Validator.isValueFilled(this.telephone)){if(!Validator.isCorrectSize(this.telephone,10)){A.push("Téléphone");D.push('le champ "Téléphone" ne peut etre plus grand de 10 caractères')}}if(this.ut.byId("requestInfo")){if((Validator.isValueFilled(this.requestInfo))&&(!Validator.isCorrectSize(this.requestInfo,255))){A.push("Votre demande");D.push('le champ "Votre demande" ne peut etre plus grand de 255 caractères')}if(!Validator.isValueFilled(this.requestInfo)){D.push('le champ "Votre demande" est obligatoire');A.push("Votre demande")}}if(this.telephone){if(isNaN(this.telephone)){B=true;D.push("Le champ téléphone doit être une valeur uniquement avec de nombre");A.push("téléphone")}}if(D.length>0){this.ut.removeAllOptions(this.ulDiv);this.ut.addOptions(this.ulDiv,D);this.ut.byId(this.errorDiv).style.display="inline";if(A.length==1){if(B){this._validationError(A,3)}else{this._validationError(A,1)}}else{if(B){this._validationError(A,4)}else{this._validationError(A,2)}}return false}else{this.ut.byId(this.errorDiv).style.display="none";this._validationError(A,0);return true}},setSingleConfirmationText:function(A){this.ut.byId(this.singleConfirmationDiv).innerHTML=A},setCoupleConfirmationText:function(A){this.ut.byId(this.coupleConfirmationDiv).innerHTML=A},processForm:function(){var B=this.validate();if(B){this._saveToSession();var A=this.ut.byId(this.singleConfirmationDiv);this.ut.byId(this.formDiv).style.display="none";this.ut.byId(this.confirmationDiv).style.display="inline";if(this.personSelector=="couple"){this.ut.byId(this.coupleConfirmationDiv).style.display="inline"}}return B},backToForm:function(){if(this.ut.byId(this.formDiv).style.display){this.ut.byId(this.formDiv).style.display="inline"}if(this.ut.byId(this.confirmationDiv).style.display){this.ut.byId(this.confirmationDiv).style.display="none"}if(this.ut.byId(this.coupleConfirmationDiv).style.display){this.ut.byId(this.coupleConfirmationDiv).style.display="none"}if(this.ut.byId(this.errorDiv).style.display){this.ut.byId(this.errorDiv).style.display="none"}this._loadFromSession()},confirmationAccepted:function(){this._storeToDB()},_getAddress:function(){var A="";if(this.apartment){A+=this.apartment}if(this.building){A+=" - ";A+=this.building}if(this.streetAndNumber){if(A.trim().length>0){A+=" - "}A+=this.streetAndNumber}if(this.mailbox){A+=" - "+this.mailbox+" "}return A}};Mornay.form.downloadForm=function(){};Mornay.form.downloadForm.prototype=new Mornay.form;Mornay.form.downloadForm.prototype.processForm=function(){if(Mornay.form.prototype.processForm.call(this)){var D=null;if(this.title==1){D="M."}if(this.title==2){D="Mme"}if(this.title==3){D="Mlle"}var C=this._getAddress();var F=this.birthdate_day<=9?"0"+this.birthdate_day:this.birthdate_day;var A=this.birthdate_month<=9?"0"+this.birthdate_month:this.birthdate_month;var E=["<br /><br />",D+" "+this.surname+" "+this.name+"<br />","Né(e) le "+F+"/"+A+"/"+this.birthdate_year+"<br />",C+"<br />",this.postalCode+" - "+this.town+" - "+this.state+"<br />",(this.telephone?this.telephone:"")+"<br />"+this.email].join("");this.setSingleConfirmationText(E);if(this.personSelector=="couple"){var F=this.relative_birthdate_day<=9?"0"+this.relative_birthdate_day:this.relative_birthdate_day;var A=this.relative_birthdate_month<=9?"0"+this.relative_birthdate_month:this.relative_birthdate_month;if(this.relative_title==1){D="M."}if(this.relative_title==2){D="Mme"}if(this.relative_title==3){D="Mlle"}var B=["<br /><br />",D+" "+this.relative_surname+" "+this.relative_name+"<br />","Né(e) le "+F+"/"+A+"/"+this.relative_birthdate_year+"<br />"].join("");this.setCoupleConfirmationText(B)}}};Mornay.form.downloadForm.prototype.confirmationAccepted=function(){this.documentation=true;Mornay.form.prototype.confirmationAccepted.call(this);if(!deploymentMode){this._trackGA("documentationRequested.do")}if(HDAInterface){HDAInterface.sendEvent("NN_VS_00017_5")}var A=["<h4>Documentation</h4>","Votre demande a bien été enregistrée.<br />","Vous recevrez votre documentation sous quelques jours à votre adresse."].join("");this.ut.byId(this.confirmationDiv).style.display="none";this.ut.byId("extraInfo").innerHTML=A;this.ut.byId("extraInfo").style.display="inline"};Mornay.form.downloadForm.prototype._validationError=function(C,B){var D=C.join(",");var A="error_type="+escape(B)+"&wrong_field_labels="+D;if(HDAInterface){HDAInterface.sendEvent("RR_VS_00032",A)}};Mornay.form.teleForm=function(){};Mornay.form.teleForm.prototype=new Mornay.form;Mornay.form.teleForm.prototype.backToForm=function(){var A=dwr.util.byId("valider");A.style.backgroundPosition="0px 0px";A.style.cursor="auto";A.onclick=function(){return theForm.confirmationAccepted()};Mornay.form.prototype.backToForm.call(this)};Mornay.form.teleForm.prototype.processForm=function(){if(Mornay.form.prototype.processForm.call(this)){Simulation.simulateRate(this._buildVisitorObject());var C=null;if(this.title==1){C="M."}if(this.title==2){C="Mme"}if(this.title==3){C="Mlle"}var B=this._getAddress();var E=this.birthdate_day<=9?"0"+this.birthdate_day:this.birthdate_day;var A=this.birthdate_month<=9?"0"+this.birthdate_month:this.birthdate_month;var D=["<br /><br />",C+" "+this.surname+" "+this.name+"<br />","Né(e) le "+E+"/"+A+"/"+this.birthdate_year+"<br />",B+"<br />",this.postalCode+" - "+this.town+" - "+this.state+"<br />",(this.telephone?this.telephone:"")+"<br />En cliquant sur « Valider » un email vous est envoyé pour télécharger votre dossier personnalisé, à l’adresse suivante : "+this.email+"."].join("");this.setSingleConfirmationText(D)}};Mornay.form.teleForm.prototype.confirmationAccepted=function(){Mornay.form.prototype.confirmationAccepted.call(this);if(NL.extractAttributeFromCookieByName("idBroadLog")!=""){pageTracker._trackEvent("splash_0910","mail")}var A=dwr.util.byId("valider");A.style.backgroundPosition="0px -100px";A.style.cursor="auto";A.onclick=function(){return };if(HDAInterface){HDAInterface.sendEvent("NN_VS_00017_1")}};Mornay.form.teleForm.prototype._validationError=function(C,B){var D=C.join(",");var A="error_type="+escape(B)+"&wrong_field_labels="+D;if(HDAInterface){HDAInterface.sendEvent("RR_VS_0003",A)}};Mornay.form.infoForm=function(){this.newsletter=false};Mornay.form.infoForm.prototype=new Mornay.form;Mornay.form.infoForm.prototype.processForm=function(){if(Mornay.form.prototype.processForm.call(this)){var C=null;if(this.title==1){C="M."}if(this.title==2){C="Mme"}if(this.title==3){C="Mlle"}var B=this._getAddress();var E=this.birthdate_day<=9?"0"+this.birthdate_day:this.birthdate_day;var A=this.birthdate_month<=9?"0"+this.birthdate_month:this.birthdate_month;var D=["<br /><br />",C+" "+this.surname+" "+this.name+"<br />","Né(e) le "+E+"/"+A+"/"+this.birthdate_year+"<br />",B+"<br />",this.postalCode+" - "+this.town+" - "+this.state+"<br />",(this.telephone?this.telephone:"")+"<br />"+this.email+"<br />","<strong>Votre demande:</strong> "+this.requestInfo].join("");this.setSingleConfirmationText(D)}};Mornay.form.infoForm.prototype.confirmationAccepted=function(){Mornay.form.prototype.confirmationAccepted.call(this);if(!deploymentMode){this._trackGA("infoRequested.do")}if(HDAInterface){HDAInterface.sendEvent("NN_VS_00017_4")}var A=["Votre demande d’information a bien été enregistrée. Un conseiller vous répondra dans les meilleurs délais.<br />","Mornay Services est ouvert du lundi au vendredi, de 9h00 à 12h00 et de 14h00 à 18h00."].join("");this.ut.byId(this.confirmationDiv).style.display="none";this.ut.byId("extraInfo").innerHTML=A;this.ut.byId("extraInfo").style.display="inline"};Mornay.form.infoForm.prototype._validationError=function(C,B){var D=C.join(",");var A="error_type="+escape(B)+"&wrong_field_labels="+D;if(HDAInterface){HDAInterface.sendEvent("RR_VS_00031",A)}};Mornay.form.infoForm.prototype.init=function(E,F,B,A,C,D){Mornay.form.prototype.init.call(this,E,F,B,A,C,D);this.newsletter=false};Home={aryImages:[],imgPrefix:"images/visual-",init:function(){this.aryImages[0]="sante";this.aryImages[1]="essentiel";this.aryImages[2]="equilibre";this.aryImages[3]="energie";this.aryImages[4]="excellence";this.aryImages[5]="imprevus";for(var A=0;A<this.aryImages.length;A++){var B=new Image();B.src=this._getImgName("home_",this.aryImages[A]);var C=new Image();C.src=this._getImgName("header_",this.aryImages[A])}window.addEvent("domready",function(){var E=$$("div.bannertext");var D=1;var F=function(){var H=E[D];var G;if(D==0){G=E[E.length-1]}else{G=E[D-1]}new Fx.Style(G,"opacity",{duration:800,onComplete:function(){G.style.display="none";new Fx.Style(H,"opacity",{duration:800,onStart:function(){H.style.display=""}}).start(0,1)}}).start(1,0);D++;if(D>E.length-1){D=0}};setInterval(F,5000)});window.addEvent("domready",function(){Home.swap(0,"targetImg")})},_getImgName:function(B,A){return this.imgPrefix+B+A+".jpg"},swap:function(A,D){var B=dwr.util.byId(D);var C=dwr.util.byId("bannerBoxText");if(B&&C){B.src=this._getImgName("home_",this.aryImages[A]);if(A>0){C.style.display="none";var E=this.aryImages[A];B.onclick=function(){window.location=E+".do"};B.style.cursor="hand"}else{C.style.display="";var E=this.aryImages[A];B.onclick=function(){window.location=E+".do"};B.style.cursor="hand"}}},enableCurrentMenu:function(){var E=window.location.pathname;var D=E.substring(E.lastIndexOf("/")+1,E.length-3);if(D==="modulePlusOne"||D==="modulePlusTwo"){var C=window.location.search;if(C.indexOf("p=1")>0){D="essentiel"}else{if(C.indexOf("p=2")>0){D="equilibre"}else{if(C.indexOf("p=3")>0){D="energie"}else{if(C.indexOf("p=4")>0){D="excellence"}}}}}var B=dwr.util.byId("menu-"+D);if(B){var A="#bd3083";switch(D){case"essentiel":A="#3668AF";break;case"equilibre":A="#9F9F9F";break;case"energie":A="#C5CE00";break;case"excellence":A="#CEAC00";break;case"imprevus":A="#844284";break}B.style.color=A;B.style.fontWeight="bolder";B.style.fontSize="13px"}}};var prefsLoaded=false;var defaultFontSize=85;var currentFontSize=defaultFontSize;var topLimit=95;var bottomLimit=85;function revertStyles(){currentFontSize=defaultFontSize;changeFontSize(0)}function checkFontSizeButtons(A){if(A>bottomLimit){window.parent.document.getElementById("diminuisci").style.visibility="visible"}else{window.parent.document.getElementById("diminuisci").style.visibility="hidden"}if(A<topLimit){window.parent.document.getElementById("aumenta").style.visibility="visible"}else{window.parent.document.getElementById("aumenta").style.visibility="hidden"}}function changeFontSize(A){currentFontSize=parseInt(currentFontSize)+parseInt(A*5);if(currentFontSize>=topLimit){currentFontSize=topLimit}else{if(currentFontSize<=bottomLimit){currentFontSize=bottomLimit}}setFontSize(currentFontSize)}function setFontSize(B){var A=(document.getElementById)?document.getElementById("content"):document.all("content");A.style.fontSize=B+"%";checkFontSizeButtons(B)}function createCookie(C,D,E){if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));var A="; expires="+B.toGMTString()}else{A=""}document.cookie=C+"="+D+A+"; path=/"}function readCookie(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return null}window.onload=setUserOptions;function setUserOptions(){if(!prefsLoaded){cookie=readCookie("fontSize");currentFontSize=cookie?cookie:defaultFontSize;setFontSize(currentFontSize);prefsLoaded=true}}window.onunload=saveSettings;function saveSettings(){createCookie("fontSize",currentFontSize,365)}var MooTools={version:"1.11"};function $defined(A){return(A!=undefined)}function $type(B){if(!$defined(B)){return false}if(B.htmlElement){return"element"}var A=typeof B;if(A=="object"&&B.nodeName){switch(B.nodeType){case 1:return"element";case 3:return(/\S/).test(B.nodeValue)?"textnode":"whitespace"}}if(A=="object"||A=="function"){switch(B.constructor){case Array:return"array";case RegExp:return"regexp";case Class:return"class"}if(typeof B.length=="number"){if(B.item){return"collection"}if(B.callee){return"arguments"}}}return A}function $merge(){var C={};for(var B=0;B<arguments.length;B++){for(var E in arguments[B]){var A=arguments[B][E];var D=C[E];if(D&&$type(A)=="object"&&$type(D)=="object"){C[E]=$merge(D,A)}else{C[E]=A}}}return C}var $extend=function(){var A=arguments;if(!A[1]){A=[this,A[0]]}for(var B in A[1]){A[0][B]=A[1][B]}return A[0]};var $native=function(){for(var B=0,A=arguments.length;B<A;B++){arguments[B].extend=function(C){for(var D in C){if(!this.prototype[D]){this.prototype[D]=C[D]}if(!this[D]){this[D]=$native.generic(D)}}}}};$native.generic=function(A){return function(B){return this.prototype[A].apply(B,Array.prototype.slice.call(arguments,1))}};$native(Function,Array,String,Number);function $chk(A){return !!(A||A===0)}function $pick(B,A){return $defined(B)?B:A}function $random(B,A){return Math.floor(Math.random()*(A-B+1)+B)}function $time(){return new Date().getTime()}function $clear(A){clearTimeout(A);clearInterval(A);return null}var Abstract=function(A){A=A||{};A.extend=$extend;return A};var Window=new Abstract(window);var Document=new Abstract(document);document.head=document.getElementsByTagName("head")[0];window.xpath=!!(document.evaluate);if(window.ActiveXObject){window.ie=window[window.XMLHttpRequest?"ie7":"ie6"]=true}else{if(document.childNodes&&!document.all&&!navigator.taintEnabled){window.webkit=window[window.xpath?"webkit420":"webkit419"]=true}else{if(document.getBoxObjectFor!=null){window.gecko=true}}}window.khtml=window.webkit;Object.extend=$extend;if(typeof HTMLElement=="undefined"){var HTMLElement=function(){};if(window.webkit){document.createElement("iframe")}HTMLElement.prototype=(window.webkit)?window["[[DOMElement.prototype]]"]:{}}HTMLElement.prototype.htmlElement=function(){};if(window.ie6){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}var Class=function(B){var A=function(){return(arguments[0]!==null&&this.initialize&&$type(this.initialize)=="function")?this.initialize.apply(this,arguments):this};$extend(A,this);A.prototype=B;A.constructor=Class;return A};Class.empty=function(){};Class.prototype={extend:function(B){var C=new this(null);for(var D in B){var A=C[D];C[D]=Class.Merge(A,B[D])}return new Class(C)},implement:function(){for(var B=0,A=arguments.length;B<A;B++){$extend(this.prototype,arguments[B])}}};Class.Merge=function(C,D){if(C&&C!=D){var B=$type(D);if(B!=$type(C)){return D}switch(B){case"function":var A=function(){this.parent=arguments.callee.parent;return D.apply(this,arguments)};A.parent=C;return A;case"object":return $merge(C,D)}}return D};var Chain=new Class({chain:function(A){this.chains=this.chains||[];this.chains.push(A);return this},callChain:function(){if(this.chains&&this.chains.length){this.chains.shift().delay(10,this)}},clearChain:function(){this.chains=[]}});var Events=new Class({addEvent:function(B,A){if(A!=Class.empty){this.$events=this.$events||{};this.$events[B]=this.$events[B]||[];this.$events[B].include(A)}return this},fireEvent:function(C,B,A){if(this.$events&&this.$events[C]){this.$events[C].each(function(D){D.create({"bind":this,"delay":A,"arguments":B})()},this)}return this},removeEvent:function(B,A){if(this.$events&&this.$events[B]){this.$events[B].remove(A)}return this}});var Options=new Class({setOptions:function(){this.options=$merge.apply(null,[this.options].extend(arguments));if(this.addEvent){for(var A in this.options){if($type(this.options[A]=="function")&&(/^on[A-Z]/).test(A)){this.addEvent(A,this.options[A])}}}return this}});Array.extend({forEach:function(C,D){for(var B=0,A=this.length;B<A;B++){C.call(D,this[B],B,this)}},filter:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){if(D.call(E,this[B],B,this)){C.push(this[B])}}return C},map:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){C[B]=D.call(E,this[B],B,this)}return C},every:function(C,D){for(var B=0,A=this.length;B<A;B++){if(!C.call(D,this[B],B,this)){return false}}return true},some:function(C,D){for(var B=0,A=this.length;B<A;B++){if(C.call(D,this[B],B,this)){return true}}return false},indexOf:function(C,D){var A=this.length;for(var B=(D<0)?Math.max(0,A+D):D||0;B<A;B++){if(this[B]===C){return B}}return -1},copy:function(D,C){D=D||0;if(D<0){D=this.length+D}C=C||(this.length-D);var A=[];for(var B=0;B<C;B++){A[B]=this[D++]}return A},remove:function(C){var B=0;var A=this.length;while(B<A){if(this[B]===C){this.splice(B,1);A--}else{B++}}return this},contains:function(A,B){return this.indexOf(A,B)!=-1},associate:function(C){var D={},B=Math.min(this.length,C.length);for(var A=0;A<B;A++){D[C[A]]=this[A]}return D},extend:function(C){for(var B=0,A=C.length;B<A;B++){this.push(C[B])}return this},merge:function(C){for(var B=0,A=C.length;B<A;B++){this.include(C[B])}return this},include:function(A){if(!this.contains(A)){this.push(A)}return this},getRandom:function(){return this[$random(0,this.length-1)]||null},getLast:function(){return this[this.length-1]||null}});Array.prototype.each=Array.prototype.forEach;Array.each=Array.forEach;function $A(A){return Array.copy(A)}function $each(C,B,D){if(C&&typeof C.length=="number"&&$type(C)!="object"){Array.forEach(C,B,D)}else{for(var A in C){B.call(D||C,C[A],A)}}}Array.prototype.test=Array.prototype.contains;String.extend({test:function(A,B){return(($type(A)=="string")?new RegExp(A,B):A).test(this)},toInt:function(){return parseInt(this,10)},toFloat:function(){return parseFloat(this)},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/\w[A-Z]/g,function(A){return(A.charAt(0)+"-"+A.charAt(1).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(A){return A.toUpperCase()})},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s{2,}/g," ").trim()},rgbToHex:function(B){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHex(B):false},hexToRgb:function(B){var A=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(A)?A.slice(1).hexToRgb(B):false},contains:function(A,B){return(B)?(B+this+B).indexOf(B+A+B)>-1:this.indexOf(A)>-1},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")}});Array.extend({rgbToHex:function(D){if(this.length<3){return false}if(this.length==4&&this[3]==0&&!D){return"transparent"}var B=[];for(var A=0;A<3;A++){var C=(this[A]-0).toString(16);B.push((C.length==1)?"0"+C:C)}return D?B:"#"+B.join("")},hexToRgb:function(C){if(this.length!=3){return false}var A=[];for(var B=0;B<3;B++){A.push(parseInt((this[B].length==1)?this[B]+this[B]:this[B],16))}return C?A:"rgb("+A.join(",")+")"}});Function.extend({create:function(A){var B=this;A=$merge({"bind":B,"event":false,"arguments":null,"delay":false,"periodical":false,"attempt":false},A);if($chk(A.arguments)&&$type(A.arguments)!="array"){A.arguments=[A.arguments]}return function(E){var C;if(A.event){E=E||window.event;C=[(A.event===true)?E:new A.event(E)];if(A.arguments){C.extend(A.arguments)}}else{C=A.arguments||arguments}var F=function(){return B.apply($pick(A.bind,B),C)};if(A.delay){return setTimeout(F,A.delay)}if(A.periodical){return setInterval(F,A.periodical)}if(A.attempt){try{return F()}catch(D){return false}}return F()}},pass:function(A,B){return this.create({"arguments":A,"bind":B})},attempt:function(A,B){return this.create({"arguments":A,"bind":B,"attempt":true})()},bind:function(B,A){return this.create({"bind":B,"arguments":A})},bindAsEventListener:function(B,A){return this.create({"bind":B,"event":true,"arguments":A})},delay:function(B,C,A){return this.create({"delay":B,"bind":C,"arguments":A})()},periodical:function(A,C,B){return this.create({"periodical":A,"bind":C,"arguments":B})()}});Number.extend({toInt:function(){return parseInt(this)},toFloat:function(){return parseFloat(this)},limit:function(B,A){return Math.min(A,Math.max(B,this))},round:function(A){A=Math.pow(10,A||0);return Math.round(this*A)/A},times:function(B){for(var A=0;A<this;A++){B(A)}}});var Element=new Class({initialize:function(D,C){if($type(D)=="string"){if(window.ie&&C&&(C.name||C.type)){var A=(C.name)?' name="'+C.name+'"':"";var B=(C.type)?' type="'+C.type+'"':"";delete C.name;delete C.type;D="<"+D+A+B+">"}D=document.createElement(D)}D=$(D);return(!C||!D)?D:D.set(C)}});var Elements=new Class({initialize:function(A){return(A)?$extend(A,this):this}});Elements.extend=function(A){for(var B in A){this.prototype[B]=A[B];this[B]=$native.generic(B)}};function $(B){if(!B){return null}if(B.htmlElement){return Garbage.collect(B)}if([window,document].contains(B)){return B}var A=$type(B);if(A=="string"){B=document.getElementById(B);A=(B)?"element":false}if(A!="element"){return null}if(B.htmlElement){return Garbage.collect(B)}if(["object","embed"].contains(B.tagName.toLowerCase())){return B}$extend(B,Element.prototype);B.htmlElement=function(){};return Garbage.collect(B)}document.getElementsBySelector=document.getElementsByTagName;function $$(){var D=[];for(var C=0,B=arguments.length;C<B;C++){var A=arguments[C];switch($type(A)){case"element":D.push(A);case"boolean":break;case false:break;case"string":A=document.getElementsBySelector(A,true);default:D.extend(A)}}return $$.unique(D)}$$.unique=function(G){var D=[];for(var C=0,A=G.length;C<A;C++){if(G[C].$included){continue}var B=$(G[C]);if(B&&!B.$included){B.$included=true;D.push(B)}}for(var F=0,E=D.length;F<E;F++){D[F].$included=null}return new Elements(D)};Elements.Multi=function(A){return function(){var D=arguments;var B=[];var G=true;for(var E=0,C=this.length,F;E<C;E++){F=this[E][A].apply(this[E],D);if($type(F)!="element"){G=false}B.push(F)}return(G)?$$.unique(B):B}};Element.extend=function(A){for(var B in A){HTMLElement.prototype[B]=A[B];Element.prototype[B]=A[B];Element[B]=$native.generic(B);var C=(Array.prototype[B])?B+"Elements":B;Elements.prototype[C]=Elements.Multi(B)}};Element.extend({set:function(A){for(var C in A){var B=A[C];switch(C){case"styles":this.setStyles(B);break;case"events":if(this.addEvents){this.addEvents(B)}break;case"properties":this.setProperties(B);break;default:this.setProperty(C,B)}}return this},inject:function(C,A){C=$(C);switch(A){case"before":C.parentNode.insertBefore(this,C);break;case"after":var B=C.getNext();if(!B){C.parentNode.appendChild(this)}else{C.parentNode.insertBefore(this,B)}break;case"top":var D=C.firstChild;if(D){C.insertBefore(this,D);break}default:C.appendChild(this)}return this},injectBefore:function(A){return this.inject(A,"before")},injectAfter:function(A){return this.inject(A,"after")},injectInside:function(A){return this.inject(A,"bottom")},injectTop:function(A){return this.inject(A,"top")},adopt:function(){var A=[];$each(arguments,function(B){A=A.concat(B)});$$(A).inject(this);return this},remove:function(){return this.parentNode.removeChild(this)},clone:function(C){var B=$(this.cloneNode(C!==false));if(!B.$events){return B}B.$events={};for(var A in this.$events){B.$events[A]={"keys":$A(this.$events[A].keys),"values":$A(this.$events[A].values)}}return B.removeEvents()},replaceWith:function(A){A=$(A);this.parentNode.replaceChild(A,this);return A},appendText:function(A){this.appendChild(document.createTextNode(A));return this},hasClass:function(A){return this.className.contains(A," ")},addClass:function(A){if(!this.hasClass(A)){this.className=(this.className+" "+A).clean()}return this},removeClass:function(A){this.className=this.className.replace(new RegExp("(^|\\s)"+A+"(?:\\s|$)"),"$1").clean();return this},toggleClass:function(A){return this.hasClass(A)?this.removeClass(A):this.addClass(A)},setStyle:function(B,A){switch(B){case"opacity":return this.setOpacity(parseFloat(A));case"float":B=(window.ie)?"styleFloat":"cssFloat"}B=B.camelCase();switch($type(A)){case"number":if(!["zIndex","zoom"].contains(B)){A+="px"}break;case"array":A="rgb("+A.join(",")+")"}this.style[B]=A;return this},setStyles:function(A){switch($type(A)){case"object":Element.setMany(this,"setStyle",A);break;case"string":this.style.cssText=A}return this},setOpacity:function(A){if(A==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"}}else{if(this.style.visibility!="visible"){this.style.visibility="visible"}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1}if(window.ie){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")"}this.style.opacity=this.$tmp.opacity=A;return this},getStyle:function(C){C=C.camelCase();var A=this.style[C];if(!$chk(A)){if(C=="opacity"){return this.$tmp.opacity}A=[];for(var B in Element.Styles){if(C==B){Element.Styles[B].each(function(F){var E=this.getStyle(F);A.push(parseInt(E)?E:"0px")},this);if(C=="border"){var D=A.every(function(E){return(E==A[0])});return(D)?A[0]:false}return A.join(" ")}}if(C.contains("border")){if(Element.Styles.border.contains(C)){return["Width","Style","Color"].map(function(E){return this.getStyle(C+E)},this).join(" ")}else{if(Element.borderShort.contains(C)){return["Top","Right","Bottom","Left"].map(function(E){return this.getStyle("border"+E+C.replace("border",""))},this).join(" ")}}}if(document.defaultView){A=document.defaultView.getComputedStyle(this,null).getPropertyValue(C.hyphenate())}else{if(this.currentStyle){A=this.currentStyle[C]}}}if(window.ie){A=Element.fixStyle(C,A,this)}if(A&&C.test(/color/i)&&A.contains("rgb")){return A.split("rgb").splice(1,4).map(function(E){return E.rgbToHex()}).join(" ")}return A},getStyles:function(){return Element.getMany(this,"getStyle",arguments)},walk:function(A,C){A+="Sibling";var B=(C)?this[C]:this[A];while(B&&$type(B)!="element"){B=B[A]}return $(B)},getPrevious:function(){return this.walk("previous")},getNext:function(){return this.walk("next")},getFirst:function(){return this.walk("next","firstChild")},getLast:function(){return this.walk("previous","lastChild")},getParent:function(){return $(this.parentNode)},getChildren:function(){return $$(this.childNodes)},hasChild:function(A){return !!$A(this.getElementsByTagName("*")).contains(A)},getProperty:function(D){var B=Element.Properties[D];if(B){return this[B]}var A=Element.PropertiesIFlag[D]||0;if(!window.ie||A){return this.getAttribute(D,A)}var C=this.attributes[D];return(C)?C.nodeValue:null},removeProperty:function(B){var A=Element.Properties[B];if(A){this[A]=""}else{this.removeAttribute(B)}return this},getProperties:function(){return Element.getMany(this,"getProperty",arguments)},setProperty:function(C,B){var A=Element.Properties[C];if(A){this[A]=B}else{this.setAttribute(C,B)}return this},setProperties:function(A){return Element.setMany(this,"setProperty",A)},setHTML:function(){this.innerHTML=$A(arguments).join("");return this},setText:function(B){var A=this.getTag();if(["style","script"].contains(A)){if(window.ie){if(A=="style"){this.styleSheet.cssText=B}else{if(A=="script"){this.setProperty("text",B)}}return this}else{this.removeChild(this.firstChild);return this.appendText(B)}}this[$defined(this.innerText)?"innerText":"textContent"]=B;return this},getText:function(){var A=this.getTag();if(["style","script"].contains(A)){if(window.ie){if(A=="style"){return this.styleSheet.cssText}else{if(A=="script"){return this.getProperty("text")}}}else{return this.innerHTML}}return($pick(this.innerText,this.textContent))},getTag:function(){return this.tagName.toLowerCase()},empty:function(){Garbage.trash(this.getElementsByTagName("*"));return this.setHTML("")}});Element.fixStyle=function(E,A,D){if($chk(parseInt(A))){return A}if(["height","width"].contains(E)){var B=(E=="width")?["left","right"]:["top","bottom"];var C=0;B.each(function(F){C+=D.getStyle("border-"+F+"-width").toInt()+D.getStyle("padding-"+F).toInt()});return D["offset"+E.capitalize()]-C+"px"}else{if(E.test(/border(.+)Width|margin|padding/)){return"0px"}}return A};Element.Styles={"border":[],"padding":[],"margin":[]};["Top","Right","Bottom","Left"].each(function(B){for(var A in Element.Styles){Element.Styles[A].push(A+B)}});Element.borderShort=["borderWidth","borderStyle","borderColor"];Element.getMany=function(B,D,C){var A={};$each(C,function(E){A[E]=B[D](E)});return A};Element.setMany=function(B,D,C){for(var A in C){B[D](A,C[A])}return B};Element.Properties=new Abstract({"class":"className","for":"htmlFor","colspan":"colSpan","rowspan":"rowSpan","accesskey":"accessKey","tabindex":"tabIndex","maxlength":"maxLength","readonly":"readOnly","frameborder":"frameBorder","value":"value","disabled":"disabled","checked":"checked","multiple":"multiple","selected":"selected"});Element.PropertiesIFlag={"href":2,"src":2};Element.Methods={Listeners:{addListener:function(B,A){if(this.addEventListener){this.addEventListener(B,A,false)}else{this.attachEvent("on"+B,A)}return this},removeListener:function(B,A){if(this.removeEventListener){this.removeEventListener(B,A,false)}else{this.detachEvent("on"+B,A)}return this}}};window.extend(Element.Methods.Listeners);document.extend(Element.Methods.Listeners);Element.extend(Element.Methods.Listeners);var Garbage={elements:[],collect:function(A){if(!A.$tmp){Garbage.elements.push(A);A.$tmp={"opacity":1}}return A},trash:function(D){for(var B=0,A=D.length,C;B<A;B++){if(!(C=D[B])||!C.$tmp){continue}if(C.$events){C.fireEvent("trash").removeEvents()}for(var E in C.$tmp){C.$tmp[E]=null}for(var F in Element.prototype){C[F]=null}Garbage.elements[Garbage.elements.indexOf(C)]=null;C.htmlElement=C.$tmp=C=null}Garbage.elements.remove(null)},empty:function(){Garbage.collect(window);Garbage.collect(document);Garbage.trash(Garbage.elements)}};window.addListener("beforeunload",function(){window.addListener("unload",Garbage.empty);if(window.ie){window.addListener("unload",CollectGarbage)}});var Event=new Class({initialize:function(C){if(C&&C.$extended){return C}this.$extended=true;C=C||window.event;this.event=C;this.type=C.type;this.target=C.target||C.srcElement;if(this.target.nodeType==3){this.target=this.target.parentNode}this.shift=C.shiftKey;this.control=C.ctrlKey;this.alt=C.altKey;this.meta=C.metaKey;if(["DOMMouseScroll","mousewheel"].contains(this.type)){this.wheel=(C.wheelDelta)?C.wheelDelta/120:-(C.detail||0)/3}else{if(this.type.contains("key")){this.code=C.which||C.keyCode;for(var B in Event.keys){if(Event.keys[B]==this.code){this.key=B;break}}if(this.type=="keydown"){var A=this.code-111;if(A>0&&A<13){this.key="f"+A}}this.key=this.key||String.fromCharCode(this.code).toLowerCase()}else{if(this.type.test(/(click|mouse|menu)/)){this.page={"x":C.pageX||C.clientX+document.documentElement.scrollLeft,"y":C.pageY||C.clientY+document.documentElement.scrollTop};this.client={"x":C.pageX?C.pageX-window.pageXOffset:C.clientX,"y":C.pageY?C.pageY-window.pageYOffset:C.clientY};this.rightClick=(C.which==3)||(C.button==2);switch(this.type){case"mouseover":this.relatedTarget=C.relatedTarget||C.fromElement;break;case"mouseout":this.relatedTarget=C.relatedTarget||C.toElement}this.fixRelatedTarget()}}}return this},stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});Event.fix={relatedTarget:function(){if(this.relatedTarget&&this.relatedTarget.nodeType==3){this.relatedTarget=this.relatedTarget.parentNode}},relatedTargetGecko:function(){try{Event.fix.relatedTarget.call(this)}catch(A){this.relatedTarget=this.target}}};Event.prototype.fixRelatedTarget=(window.gecko)?Event.fix.relatedTargetGecko:Event.fix.relatedTarget;Event.keys=new Abstract({"enter":13,"up":38,"down":40,"left":37,"right":39,"esc":27,"space":32,"backspace":8,"tab":9,"delete":46});Element.Methods.Events={addEvent:function(C,B){this.$events=this.$events||{};this.$events[C]=this.$events[C]||{"keys":[],"values":[]};if(this.$events[C].keys.contains(B)){return this}this.$events[C].keys.push(B);var A=C;var D=Element.Events[C];if(D){if(D.add){D.add.call(this,B)}if(D.map){B=D.map}if(D.type){A=D.type}}if(!this.addEventListener){B=B.create({"bind":this,"event":true})}this.$events[C].values.push(B);return(Element.NativeEvents.contains(A))?this.addListener(A,B):this},removeEvent:function(C,B){if(!this.$events||!this.$events[C]){return this}var F=this.$events[C].keys.indexOf(B);if(F==-1){return this}var A=this.$events[C].keys.splice(F,1)[0];var E=this.$events[C].values.splice(F,1)[0];var D=Element.Events[C];if(D){if(D.remove){D.remove.call(this,B)}if(D.type){C=D.type}}return(Element.NativeEvents.contains(C))?this.removeListener(C,E):this},addEvents:function(A){return Element.setMany(this,"addEvent",A)},removeEvents:function(A){if(!this.$events){return this}if(!A){for(var B in this.$events){this.removeEvents(B)}this.$events=null}else{if(this.$events[A]){this.$events[A].keys.each(function(C){this.removeEvent(A,C)},this);this.$events[A]=null}}return this},fireEvent:function(C,B,A){if(this.$events&&this.$events[C]){this.$events[C].keys.each(function(D){D.create({"bind":this,"delay":A,"arguments":B})()},this)}return this},cloneEvents:function(C,A){if(!C.$events){return this}if(!A){for(var B in C.$events){this.cloneEvents(C,B)}}else{if(C.$events[A]){C.$events[A].keys.each(function(D){this.addEvent(A,D)},this)}}return this}};window.extend(Element.Methods.Events);document.extend(Element.Methods.Events);Element.extend(Element.Methods.Events);Element.Events=new Abstract({"mouseenter":{type:"mouseover",map:function(A){A=new Event(A);if(A.relatedTarget!=this&&!this.hasChild(A.relatedTarget)){this.fireEvent("mouseenter",A)}}},"mouseleave":{type:"mouseout",map:function(A){A=new Event(A);if(A.relatedTarget!=this&&!this.hasChild(A.relatedTarget)){this.fireEvent("mouseleave",A)}}},"mousewheel":{type:(window.gecko)?"DOMMouseScroll":"mousewheel"}});Element.NativeEvents=["click","dblclick","mouseup","mousedown","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","keydown","keypress","keyup","load","unload","beforeunload","resize","move","focus","blur","change","submit","reset","select","error","abort","contextmenu","scroll"];Function.extend({bindWithEvent:function(B,A){return this.create({"bind":B,"arguments":A,"event":Event})}});Elements.extend({filterByTag:function(A){return new Elements(this.filter(function(B){return(Element.getTag(B)==A)}))},filterByClass:function(A,C){var B=this.filter(function(D){return(D.className&&D.className.contains(A," "))});return(C)?B:new Elements(B)},filterById:function(C,B){var A=this.filter(function(D){return(D.id==C)});return(B)?A:new Elements(A)},filterByAttribute:function(B,A,D,E){var C=this.filter(function(F){var G=Element.getProperty(F,B);if(!G){return false}if(!A){return true}switch(A){case"=":return(G==D);case"*=":return(G.contains(D));case"^=":return(G.substr(0,D.length)==D);case"$=":return(G.substr(G.length-D.length)==D);case"!=":return(G!=D);case"~=":return G.contains(D," ")}return false});return(E)?C:new Elements(C)}});function $E(A,B){return($(B)||document).getElement(A)}function $ES(A,B){return($(B)||document).getElementsBySelector(A)}$$.shared={"regexp":/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([!*^$]?=)["']?([^"'\]]*)["']?)?])?$/,"xpath":{getParam:function(B,D,E,C){var A=[D.namespaceURI?"xhtml:":"",E[1]];if(E[2]){A.push('[@id="',E[2],'"]')}if(E[3]){A.push('[contains(concat(" ", @class, " "), " ',E[3],' ")]')}if(E[4]){if(E[5]&&E[6]){switch(E[5]){case"*=":A.push("[contains(@",E[4],', "',E[6],'")]');break;case"^=":A.push("[starts-with(@",E[4],', "',E[6],'")]');break;case"$=":A.push("[substring(@",E[4],", string-length(@",E[4],") - ",E[6].length,' + 1) = "',E[6],'"]');break;case"=":A.push("[@",E[4],'="',E[6],'"]');break;case"!=":A.push("[@",E[4],'!="',E[6],'"]')}}else{A.push("[@",E[4],"]")}}B.push(A.join(""));return B},getItems:function(B,E,G){var F=[];var A=document.evaluate(".//"+B.join("//"),E,$$.shared.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for(var D=0,C=A.snapshotLength;D<C;D++){F.push(A.snapshotItem(D))}return(G)?F:new Elements(F.map($))}},"normal":{getParam:function(A,C,E,B){if(B==0){if(E[2]){var D=C.getElementById(E[2]);if(!D||((E[1]!="*")&&(Element.getTag(D)!=E[1]))){return false}A=[D]}else{A=$A(C.getElementsByTagName(E[1]))}}else{A=$$.shared.getElementsByTagName(A,E[1]);if(E[2]){A=Elements.filterById(A,E[2],true)}}if(E[3]){A=Elements.filterByClass(A,E[3],true)}if(E[4]){A=Elements.filterByAttribute(A,E[4],E[5],E[6],true)}return A},getItems:function(A,B,C){return(C)?A:$$.unique(A)}},resolver:function(A){return(A=="xhtml")?"http://www.w3.org/1999/xhtml":false},getElementsByTagName:function(D,C){var E=[];for(var B=0,A=D.length;B<A;B++){E.extend(D[B].getElementsByTagName(C))}return E}};$$.shared.method=(window.xpath)?"xpath":"normal";Element.Methods.Dom={getElements:function(A,H){var C=[];A=A.trim().split(" ");for(var E=0,D=A.length;E<D;E++){var F=A[E];var G=F.match($$.shared.regexp);if(!G){break}G[1]=G[1]||"*";var B=$$.shared[$$.shared.method].getParam(C,this,G,E);if(!B){break}C=B}return $$.shared[$$.shared.method].getItems(C,this,H)},getElement:function(A){return $(this.getElements(A,true)[0]||false)},getElementsBySelector:function(A,E){var D=[];A=A.split(",");for(var C=0,B=A.length;C<B;C++){D=D.concat(this.getElements(A[C],true))}return(E)?D:$$.unique(D)}};Element.extend({getElementById:function(C){var B=document.getElementById(C);if(!B){return false}for(var A=B.parentNode;A!=this;A=A.parentNode){if(!A){return false}}return B},getElementsByClassName:function(A){return this.getElements("."+A)}});document.extend(Element.Methods.Dom);Element.extend(Element.Methods.Dom);Element.extend({getValue:function(){switch(this.getTag()){case"select":var A=[];$each(this.options,function(B){if(B.selected){A.push($pick(B.value,B.text))}});return(this.multiple)?A:A[0];case"input":if(!(this.checked&&["checkbox","radio"].contains(this.type))&&!["hidden","text","password"].contains(this.type)){break}case"textarea":return this.value}return false},getFormElements:function(){return $$(this.getElementsByTagName("input"),this.getElementsByTagName("select"),this.getElementsByTagName("textarea"))},toQueryString:function(){var A=[];this.getFormElements().each(function(D){var C=D.name;var E=D.getValue();if(E===false||!C||D.disabled){return }var B=function(F){A.push(C+"="+encodeURIComponent(F))};if($type(E)=="array"){E.each(B)}else{B(E)}});return A.join("&")}});Element.extend({scrollTo:function(A,B){this.scrollLeft=A;this.scrollTop=B},getSize:function(){return{"scroll":{"x":this.scrollLeft,"y":this.scrollTop},"size":{"x":this.offsetWidth,"y":this.offsetHeight},"scrollSize":{"x":this.scrollWidth,"y":this.scrollHeight}}},getPosition:function(A){A=A||[];var B=this,D=0,C=0;do{D+=B.offsetLeft||0;C+=B.offsetTop||0;B=B.offsetParent}while(B);A.each(function(E){D-=E.scrollLeft||0;C-=E.scrollTop||0});return{"x":D,"y":C}},getTop:function(A){return this.getPosition(A).y},getLeft:function(A){return this.getPosition(A).x},getCoordinates:function(B){var A=this.getPosition(B);var C={"width":this.offsetWidth,"height":this.offsetHeight,"left":A.x,"top":A.y};C.right=C.left+C.width;C.bottom=C.top+C.height;return C}});Element.Events.domready={add:function(B){if(window.loaded){B.call(this);return }var A=function(){if(window.loaded){return }window.loaded=true;window.timer=$clear(window.timer);this.fireEvent("domready")}.bind(this);if(document.readyState&&window.webkit){window.timer=function(){if(["loaded","complete"].contains(document.readyState)){A()}}.periodical(50)}else{if(document.readyState&&window.ie){if(!$("ie_ready")){var C=(window.location.protocol=="https:")?"://0":"javascript:void(0)";document.write('<script id="ie_ready" defer src="'+C+'"><\/script>');$("ie_ready").onreadystatechange=function(){if(this.readyState=="complete"){A()}}}}else{window.addListener("load",A);document.addListener("DOMContentLoaded",A)}}}};window.onDomReady=function(A){return this.addEvent("domready",A)};window.extend({getWidth:function(){if(this.webkit419){return this.innerWidth}if(this.opera){return document.body.clientWidth}return document.documentElement.clientWidth},getHeight:function(){if(this.webkit419){return this.innerHeight}if(this.opera){return document.body.clientHeight}return document.documentElement.clientHeight},getScrollWidth:function(){if(this.ie){return Math.max(document.documentElement.offsetWidth,document.documentElement.scrollWidth)}if(this.webkit){return document.body.scrollWidth}return document.documentElement.scrollWidth},getScrollHeight:function(){if(this.ie){return Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight)}if(this.webkit){return document.body.scrollHeight}return document.documentElement.scrollHeight},getScrollLeft:function(){return this.pageXOffset||document.documentElement.scrollLeft},getScrollTop:function(){return this.pageYOffset||document.documentElement.scrollTop},getSize:function(){return{"size":{"x":this.getWidth(),"y":this.getHeight()},"scrollSize":{"x":this.getScrollWidth(),"y":this.getScrollHeight()},"scroll":{"x":this.getScrollLeft(),"y":this.getScrollTop()}}},getPosition:function(){return{"x":0,"y":0}}});var Fx={};Fx.Base=new Class({options:{onStart:Class.empty,onComplete:Class.empty,onCancel:Class.empty,transition:function(A){return -(Math.cos(Math.PI*A)-1)/2},duration:500,unit:"px",wait:true,fps:50},initialize:function(A){this.element=this.element||null;this.setOptions(A);if(this.options.initialize){this.options.initialize.call(this)}},step:function(){var A=$time();if(A<this.time+this.options.duration){this.delta=this.options.transition((A-this.time)/this.options.duration);this.setNow();this.increase()}else{this.stop(true);this.set(this.to);this.fireEvent("onComplete",this.element,10);this.callChain()}},set:function(A){this.now=A;this.increase();return this},setNow:function(){this.now=this.compute(this.from,this.to)},compute:function(B,A){return(A-B)*this.delta+B},start:function(B,A){if(!this.options.wait){this.stop()}else{if(this.timer){return this}}this.from=B;this.to=A;this.change=this.to-this.from;this.time=$time();this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);this.fireEvent("onStart",this.element);return this},stop:function(A){if(!this.timer){return this}this.timer=$clear(this.timer);if(!A){this.fireEvent("onCancel",this.element)}return this},custom:function(B,A){return this.start(B,A)},clearTimer:function(A){return this.stop(A)}});Fx.Base.implement(new Chain,new Events,new Options);Fx.CSS={select:function(B,C){if(B.test(/color/i)){return this.Color}var A=$type(C);if((A=="array")||(A=="string"&&C.contains(" "))){return this.Multi}return this.Single},parse:function(C,D,A){if(!A.push){A=[A]}var F=A[0],E=A[1];if(!$chk(E)){E=F;F=C.getStyle(D)}var B=this.select(D,E);return{"from":B.parse(F),"to":B.parse(E),"css":B}}};Fx.CSS.Single={parse:function(A){return parseFloat(A)},getNow:function(C,B,A){return A.compute(C,B)},getValue:function(C,A,B){if(A=="px"&&B!="opacity"){C=Math.round(C)}return C+A}};Fx.CSS.Multi={parse:function(A){return A.push?A:A.split(" ").map(function(B){return parseFloat(B)})},getNow:function(E,D,C){var A=[];for(var B=0;B<E.length;B++){A[B]=C.compute(E[B],D[B])}return A},getValue:function(C,A,B){if(A=="px"&&B!="opacity"){C=C.map(Math.round)}return C.join(A+" ")+A}};Fx.CSS.Color={parse:function(A){return A.push?A:A.hexToRgb(true)},getNow:function(E,D,C){var A=[];for(var B=0;B<E.length;B++){A[B]=Math.round(C.compute(E[B],D[B]))}return A},getValue:function(A){return"rgb("+A.join(",")+")"}};Fx.Style=Fx.Base.extend({initialize:function(B,C,A){this.element=$(B);this.property=C;this.parent(A)},hide:function(){return this.set(0)},setNow:function(){this.now=this.css.getNow(this.from,this.to,this)},set:function(A){this.css=Fx.CSS.select(this.property,A);return this.parent(this.css.parse(A))},start:function(C,B){if(this.timer&&this.options.wait){return this}var A=Fx.CSS.parse(this.element,this.property,[C,B]);this.css=A.css;return this.parent(A.from,A.to)},increase:function(){this.element.setStyle(this.property,this.css.getValue(this.now,this.options.unit,this.property))}});Element.extend({effect:function(B,A){return new Fx.Style(this,B,A)}});Fx.Styles=Fx.Base.extend({initialize:function(B,A){this.element=$(B);this.parent(A)},setNow:function(){for(var A in this.from){this.now[A]=this.css[A].getNow(this.from[A],this.to[A],this)}},set:function(C){var A={};this.css={};for(var B in C){this.css[B]=Fx.CSS.select(B,C[B]);A[B]=this.css[B].parse(C[B])}return this.parent(A)},start:function(C){if(this.timer&&this.options.wait){return this}this.now={};this.css={};var E={},D={};for(var B in C){var A=Fx.CSS.parse(this.element,B,C[B]);E[B]=A.from;D[B]=A.to;this.css[B]=A.css}return this.parent(E,D)},increase:function(){for(var A in this.now){this.element.setStyle(A,this.css[A].getValue(this.now[A],this.options.unit,A))}}});Element.extend({effects:function(A){return new Fx.Styles(this,A)}});Fx.Elements=Fx.Base.extend({initialize:function(B,A){this.elements=$$(B);this.parent(A)},setNow:function(){for(var C in this.from){var F=this.from[C],E=this.to[C],B=this.css[C],A=this.now[C]={};for(var D in F){A[D]=B[D].getNow(F[D],E[D],this)}}},set:function(G){var B={};this.css={};for(var D in G){var F=G[D],C=this.css[D]={},A=B[D]={};for(var E in F){C[E]=Fx.CSS.select(E,F[E]);A[E]=C[E].parse(F[E])}}return this.parent(B)},start:function(D){if(this.timer&&this.options.wait){return this}this.now={};this.css={};var I={},J={};for(var E in D){var G=D[E],A=I[E]={},H=J[E]={},C=this.css[E]={};for(var B in G){var F=Fx.CSS.parse(this.elements[E],B,G[B]);A[B]=F.from;H[B]=F.to;C[B]=F.css}}return this.parent(I,J)},increase:function(){for(var C in this.now){var A=this.now[C],B=this.css[C];for(var D in A){this.elements[C].setStyle(D,B[D].getValue(A[D],this.options.unit,D))}}}});Fx.Scroll=Fx.Base.extend({options:{overflown:[],offset:{"x":0,"y":0},wheelStops:true},initialize:function(B,A){this.now=[];this.element=$(B);this.bound={"stop":this.stop.bind(this,false)};this.parent(A);if(this.options.wheelStops){this.addEvent("onStart",function(){document.addEvent("mousewheel",this.bound.stop)}.bind(this));this.addEvent("onComplete",function(){document.removeEvent("mousewheel",this.bound.stop)}.bind(this))}},setNow:function(){for(var A=0;A<2;A++){this.now[A]=this.compute(this.from[A],this.to[A])}},scrollTo:function(B,F){if(this.timer&&this.options.wait){return this}var D=this.element.getSize();var C={"x":B,"y":F};for(var E in D.size){var A=D.scrollSize[E]-D.size[E];if($chk(C[E])){C[E]=($type(C[E])=="number")?C[E].limit(0,A):A}else{C[E]=D.scroll[E]}C[E]+=this.options.offset[E]}return this.start([D.scroll.x,D.scroll.y],[C.x,C.y])},toTop:function(){return this.scrollTo(false,0)},toBottom:function(){return this.scrollTo(false,"full")},toLeft:function(){return this.scrollTo(0,false)},toRight:function(){return this.scrollTo("full",false)},toElement:function(B){var A=this.element.getPosition(this.options.overflown);var C=$(B).getPosition(this.options.overflown);return this.scrollTo(C.x-A.x,C.y-A.y)},increase:function(){this.element.scrollTo(this.now[0],this.now[1])}});Fx.Slide=Fx.Base.extend({options:{mode:"vertical"},initialize:function(B,A){this.element=$(B);this.wrapper=new Element("div",{"styles":$extend(this.element.getStyles("margin"),{"overflow":"hidden"})}).injectAfter(this.element).adopt(this.element);this.element.setStyle("margin",0);this.setOptions(A);this.now=[];this.parent(this.options);this.open=true;this.addEvent("onComplete",function(){this.open=(this.now[0]===0)});if(window.webkit419){this.addEvent("onComplete",function(){if(this.open){this.element.remove().inject(this.wrapper)}})}},setNow:function(){for(var A=0;A<2;A++){this.now[A]=this.compute(this.from[A],this.to[A])}},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth},slideIn:function(A){this[A||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[0,this.offset])},slideOut:function(A){this[A||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[-this.offset,0])},hide:function(A){this[A||this.options.mode]();this.open=false;return this.set([-this.offset,0])},show:function(A){this[A||this.options.mode]();this.open=true;return this.set([0,this.offset])},toggle:function(A){if(this.wrapper.offsetHeight==0||this.wrapper.offsetWidth==0){return this.slideIn(A)}return this.slideOut(A)},increase:function(){this.element.setStyle(this.margin,this.now[0]+this.options.unit);this.wrapper.setStyle(this.layout,this.now[1]+this.options.unit)}});Fx.Transition=function(B,A){A=A||[];if($type(A)!="array"){A=[A]}return $extend(B,{easeIn:function(C){return B(C,A)},easeOut:function(C){return 1-B(1-C,A)},easeInOut:function(C){return(C<=0.5)?B(2*C,A)/2:(2-B(2*(1-C),A))/2}})};Fx.Transitions=new Abstract({linear:function(A){return A}});Fx.Transitions.extend=function(A){for(var B in A){Fx.Transitions[B]=new Fx.Transition(A[B]);Fx.Transitions.compat(B)}};Fx.Transitions.compat=function(A){["In","Out","InOut"].each(function(B){Fx.Transitions[A.toLowerCase()+B]=Fx.Transitions[A]["ease"+B]})};Fx.Transitions.extend({Pow:function(B,A){return Math.pow(B,A[0]||6)},Expo:function(A){return Math.pow(2,8*(A-1))},Circ:function(A){return 1-Math.sin(Math.acos(A))},Sine:function(A){return 1-Math.sin((1-A)*Math.PI/2)},Back:function(B,A){A=A[0]||1.618;return Math.pow(B,2)*((A+1)*B-A)},Bounce:function(D){var C;for(var B=0,A=1;1;B+=A,A/=2){if(D>=(7-4*B)/11){C=-Math.pow((11-6*B-11*D)/4,2)+A*A;break}}return C},Elastic:function(B,A){return Math.pow(2,10*--B)*Math.cos(20*B*Math.PI*(A[0]||1)/3)}});["Quad","Cubic","Quart","Quint"].each(function(B,A){Fx.Transitions[B]=new Fx.Transition(function(C){return Math.pow(C,[A+2])});Fx.Transitions.compat(B)});var Drag={};Drag.Base=new Class({options:{handle:false,unit:"px",onStart:Class.empty,onBeforeStart:Class.empty,onComplete:Class.empty,onSnap:Class.empty,onDrag:Class.empty,limit:false,modifiers:{x:"left",y:"top"},grid:false,snap:6},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.handle=$(this.options.handle)||this.element;this.mouse={"now":{},"pos":{}};this.value={"start":{},"now":{}};this.bound={"start":this.start.bindWithEvent(this),"check":this.check.bindWithEvent(this),"drag":this.drag.bindWithEvent(this),"stop":this.stop.bind(this)};this.attach();if(this.options.initialize){this.options.initialize.call(this)}},attach:function(){this.handle.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handle.removeEvent("mousedown",this.bound.start);return this},start:function(C){this.fireEvent("onBeforeStart",this.element);this.mouse.start=C.page;var A=this.options.limit;this.limit={"x":[],"y":[]};for(var D in this.options.modifiers){if(!this.options.modifiers[D]){continue}this.value.now[D]=this.element.getStyle(this.options.modifiers[D]).toInt();this.mouse.pos[D]=C.page[D]-this.value.now[D];if(A&&A[D]){for(var B=0;B<2;B++){if($chk(A[D][B])){this.limit[D][B]=($type(A[D][B])=="function")?A[D][B]():A[D][B]}}}}if($type(this.options.grid)=="number"){this.options.grid={"x":this.options.grid,"y":this.options.grid}}document.addListener("mousemove",this.bound.check);document.addListener("mouseup",this.bound.stop);this.fireEvent("onStart",this.element);C.stop()},check:function(A){var B=Math.round(Math.sqrt(Math.pow(A.page.x-this.mouse.start.x,2)+Math.pow(A.page.y-this.mouse.start.y,2)));if(B>this.options.snap){document.removeListener("mousemove",this.bound.check);document.addListener("mousemove",this.bound.drag);this.drag(A);this.fireEvent("onSnap",this.element)}A.stop()},drag:function(A){this.out=false;this.mouse.now=A.page;for(var B in this.options.modifiers){if(!this.options.modifiers[B]){continue}this.value.now[B]=this.mouse.now[B]-this.mouse.pos[B];if(this.limit[B]){if($chk(this.limit[B][1])&&(this.value.now[B]>this.limit[B][1])){this.value.now[B]=this.limit[B][1];this.out=true}else{if($chk(this.limit[B][0])&&(this.value.now[B]<this.limit[B][0])){this.value.now[B]=this.limit[B][0];this.out=true}}}if(this.options.grid[B]){this.value.now[B]-=(this.value.now[B]%this.options.grid[B])}this.element.setStyle(this.options.modifiers[B],this.value.now[B]+this.options.unit)}this.fireEvent("onDrag",this.element);A.stop()},stop:function(){document.removeListener("mousemove",this.bound.check);document.removeListener("mousemove",this.bound.drag);document.removeListener("mouseup",this.bound.stop);this.fireEvent("onComplete",this.element)}});Drag.Base.implement(new Events,new Options);Element.extend({makeResizable:function(A){return new Drag.Base(this,$merge({modifiers:{x:"width",y:"height"}},A))}});var Cookie=new Abstract({options:{domain:false,path:false,duration:false,secure:false},set:function(C,D,B){B=$merge(this.options,B);D=encodeURIComponent(D);if(B.domain){D+="; domain="+B.domain}if(B.path){D+="; path="+B.path}if(B.duration){var A=new Date();A.setTime(A.getTime()+B.duration*24*60*60*1000);D+="; expires="+A.toGMTString()}if(B.secure){D+="; secure"}document.cookie=C+"="+D;return $extend(B,{"key":C,"value":D})},get:function(A){var B=document.cookie.match("(?:^|;)\\s*"+A.escapeRegExp()+"=([^;]*)");return B?decodeURIComponent(B[1]):false},remove:function(B,A){if($type(B)=="object"){this.set(B.key,"",$merge(B,{duration:-1}))}else{this.set(B,"",$merge(A,{duration:-1}))}}});var Json={toString:function(C){switch($type(C)){case"string":return'"'+C.replace(/(["\\])/g,"\\$1")+'"';case"array":return"["+C.map(Json.toString).join(",")+"]";case"object":var A=[];for(var B in C){A.push(Json.toString(B)+":"+Json.toString(C[B]))}return"{"+A.join(",")+"}";case"number":if(isFinite(C)){break}case false:return"null"}return String(C)},evaluate:function(str,secure){return(($type(str)!="string")||(secure&&!str.test(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/)))?null:eval("("+str+")")}};var Hash=new Class({length:0,initialize:function(A){this.obj=A||{};this.setLength()},get:function(A){return(this.hasKey(A))?this.obj[A]:null},hasKey:function(A){return(A in this.obj)},set:function(A,B){if(!this.hasKey(A)){this.length++}this.obj[A]=B;return this},setLength:function(){this.length=0;for(var A in this.obj){this.length++}return this},remove:function(A){if(this.hasKey(A)){delete this.obj[A];this.length--}return this},each:function(A,B){$each(this.obj,A,B)},extend:function(A){$extend(this.obj,A);return this.setLength()},merge:function(){this.obj=$merge.apply(null,[this.obj].extend(arguments));return this.setLength()},empty:function(){this.obj={};this.length=0;return this},keys:function(){var A=[];for(var B in this.obj){A.push(B)}return A},values:function(){var A=[];for(var B in this.obj){A.push(this.obj[B])}return A}});function $H(A){return new Hash(A)}Hash.Cookie=Hash.extend({initialize:function(B,A){this.name=B;this.options=$extend({"autoSave":true},A||{});this.load()},save:function(){if(this.length==0){Cookie.remove(this.name,this.options);return true}var A=Json.toString(this.obj);if(A.length>4096){return false}Cookie.set(this.name,A,this.options);return true},load:function(){this.obj=Json.evaluate(Cookie.get(this.name),true)||{};this.setLength()}});Hash.Cookie.Methods={};["extend","set","merge","empty","remove"].each(function(A){Hash.Cookie.Methods[A]=function(){Hash.prototype[A].apply(this,arguments);if(this.options.autoSave){this.save()}return this}});Hash.Cookie.implement(Hash.Cookie.Methods);var Color=new Class({initialize:function(B,D){D=D||(B.push?"rgb":"hex");var C,A;switch(D){case"rgb":C=B;A=C.rgbToHsb();break;case"hsb":C=B.hsbToRgb();A=B;break;default:C=B.hexToRgb(true);A=C.rgbToHsb()}C.hsb=A;C.hex=C.rgbToHex();return $extend(C,Color.prototype)},mix:function(){var A=$A(arguments);var C=($type(A[A.length-1])=="number")?A.pop():50;var B=this.copy();A.each(function(D){D=new Color(D);for(var E=0;E<3;E++){B[E]=Math.round((B[E]/100*(100-C))+(D[E]/100*C))}});return new Color(B,"rgb")},invert:function(){return new Color(this.map(function(A){return 255-A}))},setHue:function(A){return new Color([A,this.hsb[1],this.hsb[2]],"hsb")},setSaturation:function(A){return new Color([this.hsb[0],A,this.hsb[2]],"hsb")},setBrightness:function(A){return new Color([this.hsb[0],this.hsb[1],A],"hsb")}});function $RGB(C,B,A){return new Color([C,B,A],"rgb")}function $HSB(C,B,A){return new Color([C,B,A],"hsb")}Array.extend({rgbToHsb:function(){var B=this[0],C=this[1],J=this[2];var G,F,H;var I=Math.max(B,C,J),E=Math.min(B,C,J);var K=I-E;H=I/255;F=(I!=0)?K/I:0;if(F==0){G=0}else{var D=(I-B)/K;var A=(I-C)/K;var L=(I-J)/K;if(B==I){G=L-A}else{if(C==I){G=2+D-L}else{G=4+A-D}}G/=6;if(G<0){G++}}return[Math.round(G*360),Math.round(F*100),Math.round(H*100)]},hsbToRgb:function(){var C=Math.round(this[2]/100*255);if(this[1]==0){return[C,C,C]}else{var A=this[0]%360;var E=A%60;var F=Math.round((this[2]*(100-this[1]))/10000*255);var D=Math.round((this[2]*(6000-this[1]*E))/600000*255);var B=Math.round((this[2]*(6000-this[1]*(60-E)))/600000*255);switch(Math.floor(A/60)){case 0:return[C,B,F];case 1:return[D,C,F];case 2:return[F,C,B];case 3:return[F,D,C];case 4:return[B,F,C];case 5:return[C,F,D]}}return false}});var Scroller=new Class({options:{area:20,velocity:1,onChange:function(A,B){this.element.scrollTo(A,B)}},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.mousemover=([window,document].contains(B))?$(document.body):this.element},start:function(){this.coord=this.getCoords.bindWithEvent(this);this.mousemover.addListener("mousemove",this.coord)},stop:function(){this.mousemover.removeListener("mousemove",this.coord);this.timer=$clear(this.timer)},getCoords:function(A){this.page=(this.element==window)?A.client:A.page;if(!this.timer){this.timer=this.scroll.periodical(50,this)}},scroll:function(){var A=this.element.getSize();var D=this.element.getPosition();var C={"x":0,"y":0};for(var B in this.page){if(this.page[B]<(this.options.area+D[B])&&A.scroll[B]!=0){C[B]=(this.page[B]-this.options.area-D[B])*this.options.velocity}else{if(this.page[B]+this.options.area>(A.size[B]+D[B])&&A.scroll[B]+A.size[B]!=A.scrollSize[B]){C[B]=(this.page[B]-A.size[B]+this.options.area-D[B])*this.options.velocity}}}if(C.y||C.x){this.fireEvent("onChange",[A.scroll.x+C.x,A.scroll.y+C.y])}}});Scroller.implement(new Events,new Options);var Slider=new Class({options:{onChange:Class.empty,onComplete:Class.empty,onTick:function(A){this.knob.setStyle(this.p,A)},mode:"horizontal",steps:100,offset:0},initialize:function(D,A,B){this.element=$(D);this.knob=$(A);this.setOptions(B);this.previousChange=-1;this.previousEnd=-1;this.step=-1;this.element.addEvent("mousedown",this.clickedElement.bindWithEvent(this));var C,F;switch(this.options.mode){case"horizontal":this.z="x";this.p="left";C={"x":"left","y":false};F="offsetWidth";break;case"vertical":this.z="y";this.p="top";C={"x":false,"y":"top"};F="offsetHeight"}this.max=this.element[F]-this.knob[F]+(this.options.offset*2);this.half=this.knob[F]/2;this.getPos=this.element["get"+this.p.capitalize()].bind(this.element);this.knob.setStyle("position","relative").setStyle(this.p,-this.options.offset);var E={};E[this.z]=[-this.options.offset,this.max-this.options.offset];this.drag=new Drag.Base(this.knob,{limit:E,modifiers:C,snap:0,onStart:function(){this.draggedKnob()}.bind(this),onDrag:function(){this.draggedKnob()}.bind(this),onComplete:function(){this.draggedKnob();this.end()}.bind(this)});if(this.options.initialize){this.options.initialize.call(this)}},set:function(A){this.step=A.limit(0,this.options.steps);this.checkStep();this.end();this.fireEvent("onTick",this.toPosition(this.step));return this},clickedElement:function(B){var A=B.page[this.z]-this.getPos()-this.half;A=A.limit(-this.options.offset,this.max-this.options.offset);this.step=this.toStep(A);this.checkStep();this.end();this.fireEvent("onTick",A)},draggedKnob:function(){this.step=this.toStep(this.drag.value.now[this.z]);this.checkStep()},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("onChange",this.step)}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("onComplete",this.step+"")}},toStep:function(A){return Math.round((A+this.options.offset)/this.max*this.options.steps)},toPosition:function(A){return this.max*A/this.options.steps}});Slider.implement(new Events);Slider.implement(new Options);var SmoothScroll=Fx.Scroll.extend({initialize:function(B){this.parent(window,B);this.links=(this.options.links)?$$(this.options.links):$$(document.links);var A=window.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(D){if(D.href.indexOf(A)!=0){return }var C=D.href.substr(A.length);if(C&&$(C)){this.useLink(D,C)}},this);if(!window.webkit419){this.addEvent("onComplete",function(){window.location.hash=this.anchor})}},useLink:function(B,A){B.addEvent("click",function(C){this.anchor=A;this.toElement(A);C.stop()}.bindWithEvent(this))}});var Sortables=new Class({options:{handles:false,onStart:Class.empty,onComplete:Class.empty,ghost:true,snap:3,onDragStart:function(A,B){B.setStyle("opacity",0.7);A.setStyle("opacity",0.7)},onDragComplete:function(A,B){A.setStyle("opacity",1);B.remove();this.trash.remove()}},initialize:function(D,B){this.setOptions(B);this.list=$(D);this.elements=this.list.getChildren();this.handles=(this.options.handles)?$$(this.options.handles):this.elements;this.bound={"start":[],"moveGhost":this.moveGhost.bindWithEvent(this)};for(var C=0,A=this.handles.length;C<A;C++){this.bound.start[C]=this.start.bindWithEvent(this,this.elements[C])}this.attach();if(this.options.initialize){this.options.initialize.call(this)}this.bound.move=this.move.bindWithEvent(this);this.bound.end=this.end.bind(this)},attach:function(){this.handles.each(function(B,A){B.addEvent("mousedown",this.bound.start[A])},this)},detach:function(){this.handles.each(function(B,A){B.removeEvent("mousedown",this.bound.start[A])},this)},start:function(C,B){this.active=B;this.coordinates=this.list.getCoordinates();if(this.options.ghost){var A=B.getPosition();this.offset=C.page.y-A.y;this.trash=new Element("div").inject(document.body);this.ghost=B.clone().inject(this.trash).setStyles({"position":"absolute","left":A.x,"top":C.page.y-this.offset});document.addListener("mousemove",this.bound.moveGhost);this.fireEvent("onDragStart",[B,this.ghost])}document.addListener("mousemove",this.bound.move);document.addListener("mouseup",this.bound.end);this.fireEvent("onStart",B);C.stop()},moveGhost:function(A){var B=A.page.y-this.offset;B=B.limit(this.coordinates.top,this.coordinates.bottom-this.ghost.offsetHeight);this.ghost.setStyle("top",B);A.stop()},move:function(E){var B=E.page.y;this.previous=this.previous||B;var A=((this.previous-B)>0);var D=this.active.getPrevious();var C=this.active.getNext();if(D&&A&&B<D.getCoordinates().bottom){this.active.injectBefore(D)}if(C&&!A&&B>C.getCoordinates().top){this.active.injectAfter(C)}this.previous=B},serialize:function(A){return this.list.getChildren().map(A||function(B){return this.elements.indexOf(B)},this)},end:function(){this.previous=null;document.removeListener("mousemove",this.bound.move);document.removeListener("mouseup",this.bound.end);if(this.options.ghost){document.removeListener("mousemove",this.bound.moveGhost);this.fireEvent("onDragComplete",[this.active,this.ghost])}this.fireEvent("onComplete",this.active)}});Sortables.implement(new Events,new Options);var Tips=new Class({options:{onShow:function(A){A.setStyle("visibility","visible")},onHide:function(A){A.setStyle("visibility","hidden")},maxTitleChars:30,showDelay:100,hideDelay:100,className:"tool",offsets:{"x":16,"y":16},fixed:false},initialize:function(B,A){this.setOptions(A);this.toolTip=new Element("div",{"class":this.options.className+"-tip","styles":{"position":"absolute","top":"0","left":"0","visibility":"hidden"}}).inject(document.body);this.wrapper=new Element("div").inject(this.toolTip);$$(B).each(this.build,this);if(this.options.initialize){this.options.initialize.call(this)}},build:function(B){B.$tmp.myTitle=(B.href&&B.getTag()=="a")?B.href.replace("http://",""):(B.rel||false);if(B.title){var C=B.title.split("::");if(C.length>1){B.$tmp.myTitle=C[0].trim();B.$tmp.myText=C[1].trim()}else{B.$tmp.myText=B.title}B.removeAttribute("title")}else{B.$tmp.myText=false}if(B.$tmp.myTitle&&B.$tmp.myTitle.length>this.options.maxTitleChars){B.$tmp.myTitle=B.$tmp.myTitle.substr(0,this.options.maxTitleChars-1)+"&hellip;"}B.addEvent("mouseenter",function(D){this.start(B);if(!this.options.fixed){this.locate(D)}else{this.position(B)}}.bind(this));if(!this.options.fixed){B.addEvent("mousemove",this.locate.bindWithEvent(this))}var A=this.end.bind(this);B.addEvent("mouseleave",A);B.addEvent("trash",A)},start:function(A){this.wrapper.empty();if(A.$tmp.myTitle){this.title=new Element("span").inject(new Element("div",{"class":this.options.className+"-title"}).inject(this.wrapper)).setHTML(A.$tmp.myTitle)}if(A.$tmp.myText){this.text=new Element("span").inject(new Element("div",{"class":this.options.className+"-text"}).inject(this.wrapper)).setHTML(A.$tmp.myText)}$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this)},end:function(A){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this)},position:function(A){var B=A.getPosition();this.toolTip.setStyles({"left":B.x+this.options.offsets.x,"top":B.y+this.options.offsets.y})},locate:function(B){var D={"x":window.getWidth(),"y":window.getHeight()};var A={"x":window.getScrollLeft(),"y":window.getScrollTop()};var C={"x":this.toolTip.offsetWidth,"y":this.toolTip.offsetHeight};var G={"x":"left","y":"top"};for(var E in G){var F=B.page[E]+this.options.offsets[E];if((F+C[E]-A[E])>D[E]){F=B.page[E]-this.options.offsets[E]-C[E]}this.toolTip.setStyle(G[E],F)}},show:function(){if(this.options.timeout){this.timer=this.hide.delay(this.options.timeout,this)}this.fireEvent("onShow",[this.toolTip])},hide:function(){this.fireEvent("onHide",[this.toolTip])}});Tips.implement(new Events,new Options);var Group=new Class({initialize:function(){this.instances=$A(arguments);this.events={};this.checker={}},addEvent:function(B,A){this.checker[B]=this.checker[B]||{};this.events[B]=this.events[B]||[];if(this.events[B].contains(A)){return false}else{this.events[B].push(A)}this.instances.each(function(C,D){C.addEvent(B,this.check.bind(this,[B,C,D]))},this);return this},check:function(C,A,B){this.checker[C][B]=true;var D=this.instances.every(function(F,E){return this.checker[C][E]||false},this);if(!D){return }this.checker[C]={};this.events[C].each(function(E){E.call(this,this.instances,A)},this)}});var Accordion=Fx.Elements.extend({options:{onActive:Class.empty,onBackground:Class.empty,display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var C,E,F,B;$each(arguments,function(I,H){switch($type(I)){case"object":C=I;break;case"element":B=$(I);break;default:var G=$$(I);if(!E){E=G}else{F=G}}});this.togglers=E||[];this.elements=F||[];this.container=$(B);this.setOptions(C);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show}if(this.options.start){this.options.display=false;this.options.show=false}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity"}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth"}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight"}for(var D=0,A=this.togglers.length;D<A;D++){this.addSection(this.togglers[D],this.elements[D])}this.elements.each(function(H,G){if(this.options.show===G){this.fireEvent("onActive",[this.togglers[G],H])}else{for(var I in this.effects){H.setStyle(I,0)}}},this);this.parent(this.elements);if($chk(this.options.display)){this.display(this.options.display)}},addSection:function(E,C,G){E=$(E);C=$(C);var F=this.togglers.contains(E);var B=this.togglers.length;this.togglers.include(E);this.elements.include(C);if(B&&(!F||G)){G=$pick(G,B-1);E.injectBefore(this.togglers[G]);C.injectAfter(E)}else{if(this.container&&!F){E.inject(this.container);C.inject(this.container)}}var A=this.togglers.indexOf(E);E.addEvent("click",this.display.bind(this,A));if(this.options.height){C.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"})}if(this.options.width){C.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"})}C.fullOpacity=1;if(this.options.fixedWidth){C.fullWidth=this.options.fixedWidth}if(this.options.fixedHeight){C.fullHeight=this.options.fixedHeight}C.setStyle("overflow","hidden");if(!F){for(var D in this.effects){C.setStyle(D,0)}}return this},display:function(A){A=($type(A)=="element")?this.elements.indexOf(A):A;if((this.timer&&this.options.wait)||(A===this.previous&&!this.options.alwaysHide)){return this}this.previous=A;var B={};this.elements.each(function(E,D){B[D]={};var C=(D!=A)||(this.options.alwaysHide&&(E.offsetHeight>0));this.fireEvent(C?"onBackground":"onActive",[this.togglers[D],E]);for(var F in this.effects){B[D][F]=C?0:E[this.effects[F]]}},this);return this.start(B)},showThisHideOpen:function(A){return this.display(A)}});Fx.Accordion=Accordion;function Exception(A,B){if(A){this.name=A}if(B){this.message=B}}Exception.prototype.setName=function(A){this.name=A};Exception.prototype.getName=function(){return this.name};Exception.prototype.setMessage=function(A){this.message=A};Exception.prototype.getMessage=function(){return this.message};function FlashTag(E,C,A,B,D){this.src=E;this.width=C;this.height=A;this.id=null;this.bgcolor=B;this.flashVars=null;this.wmode=D?D:"opaque"}FlashTag.prototype.setId=function(A){this.id=A};FlashTag.prototype.setBgcolor=function(A){this.bgcolor=A};FlashTag.prototype.setFlashvars=function(A){this.flashVars=A};FlashTag.prototype.setWmode=function(A){this.wmode=A};FlashTag.prototype.toString=function(){var B=navigator.userAgent.indexOf("MSIE")!=-1;var C=navigator.userAgent.indexOf("AppleWebKit")!=-1;var A=null;A='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"                    id="{id}" width="{width}" height="{height}"                    codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">                    <param name="movie" value="{src}" />                    <param name="quality" value="high" />                    <param name="bgcolor" value="{bgcolor}" />                    <param name="wmode" value="{wmode}" />                    <param name="allowScriptAccess" value="sameDomain" />                    <embed src="{src}" quality="high" bgcolor="{bgcolor}"                        name="{id}" align="middle" width="{width}" height="{height}"                        play="true"                        loop="false"                        quality="high"                        allowScriptAccess="sameDomain"                        type="application/x-shockwave-flash"                        wmode="{wmode}"                        pluginspage="http://www.adobe.com/go/getflashplayer">                    </embed>            </object>';A=A.replace(/\{id\}/g,this.id);A=A.replace(/\{bgcolor\}/g,this.bgcolor);A=A.replace(/\{src\}/g,this.src);A=A.replace(/\{width\}/g,this.width);A=A.replace(/\{height\}/g,this.height);A=A.replace(/\{wmode\}/g,this.wmode);return A};FlashTag.prototype.write=function(A){A.write(this.toString())};function FlashSerializer(A){this.useCdata=A}FlashSerializer.prototype.serialize=function(B){var A=new String();for(var D=0;D<B.length;++D){switch(typeof (B[D])){case"undefined":A+="t"+(D)+"=undf";break;case"string":A+="t"+(D)+"=str&d"+(D)+"="+escape(B[D]);break;case"number":A+="t"+(D)+"=num&d"+(D)+"="+escape(B[D]);break;case"boolean":A+="t"+(D)+"=bool&d"+(D)+"="+escape(B[D]);break;case"object":if(B[D]==null){A+="t"+(D)+"=null"}else{if(B[D] instanceof Date){A+="t"+(D)+"=date&d"+(D)+"="+escape(B[D].getTime())}else{try{A+="t"+(D)+"=xser&d"+(D)+"="+escape(this._serializeXML(B[D]))}catch(C){throw new Exception("FlashSerializationException","The following error occurred during complex object serialization: "+C.getMessage())}}}break;default:throw new Exception("FlashSerializationException","You can only serialize strings, numbers, booleans, dates, objects, arrays, nulls, and undefined.")}if(D!=(B.length-1)){A+="&"}}return A};FlashSerializer.prototype._serializeXML=function(B){var A=new Object();A.xml="<fp>";this._serializeNode(B,A,null);A.xml+="</fp>";return A.xml};FlashSerializer.prototype._serializeNode=function(D,C,A){switch(typeof (D)){case"undefined":C.xml+="<undf"+this._addName(A)+"/>";break;case"string":C.xml+="<str"+this._addName(A)+">"+this._escapeXml(D)+"</str>";break;case"number":C.xml+="<num"+this._addName(A)+">"+D+"</num>";break;case"boolean":C.xml+="<bool"+this._addName(A)+' val="'+D+'"/>';break;case"object":if(D==null){C.xml+="<null"+this._addName(A)+"/>"}else{if(D instanceof Date){C.xml+="<date"+this._addName(A)+">"+D.getTime()+"</date>"}else{if(D instanceof Array){C.xml+="<array"+this._addName(A)+">";for(var B=0;B<D.length;++B){this._serializeNode(D[B],C,null)}C.xml+="</array>"}else{C.xml+="<obj"+this._addName(A)+">";for(var E in D){if(typeof (D[E])=="function"){continue}this._serializeNode(D[E],C,E)}C.xml+="</obj>"}}}break;default:throw new Exception("FlashSerializationException","You can only serialize strings, numbers, booleans, objects, dates, arrays, nulls and undefined");break}};FlashSerializer.prototype._addName=function(A){if(A!=null){return' name="'+A+'"'}return""};FlashSerializer.prototype._escapeXml=function(A){if(this.useCdata){return"<![CDATA["+A+"]]>"}else{return A.replace(/&/g,"&amp;").replace(/</g,"&lt;")}};function FlashProxy(A,B){this.uid=A;this.proxySwfName=B;this.flashSerializer=new FlashSerializer(false)}FlashProxy.prototype.call=function(){if(arguments.length==0){throw new Exception("Flash Proxy Exception","The first argument should be the function name followed by any number of additional arguments.")}var A="lcId="+escape(this.uid)+"&functionName="+escape(arguments[0]);if(arguments.length>1){var C=new Array();for(var B=1;B<arguments.length;++B){C.push(arguments[B])}A+=("&"+this.flashSerializer.serialize(C))}var D="_flash_proxy_"+this.uid;if(!document.getElementById(D)){var F=document.createElement("div");F.id=D;document.body.appendChild(F)}var E=document.getElementById(D);var G=new FlashTag(this.proxySwfName,1,1);G.setVersion("6,0,65,0");G.setFlashvars(A);E.innerHTML=G.toString()};FlashProxy.callJS=function(){var functionToCall=eval(arguments[0]);var argArray=new Array();for(var i=1;i<arguments.length;++i){argArray.push(arguments[i])}functionToCall.apply(functionToCall,argArray)};if(dwr==null){var dwr={}}if(dwr.engine==null){dwr.engine={}}if(DWREngine==null){var DWREngine=dwr.engine}dwr.engine.setErrorHandler=function(A){dwr.engine._errorHandler=A};dwr.engine.setWarningHandler=function(A){dwr.engine._warningHandler=A};dwr.engine.setTextHtmlHandler=function(A){dwr.engine._textHtmlHandler=A};dwr.engine.setTimeout=function(A){dwr.engine._timeout=A};dwr.engine.setPreHook=function(A){dwr.engine._preHook=A};dwr.engine.setPostHook=function(A){dwr.engine._postHook=A};dwr.engine.setHeaders=function(A){dwr.engine._headers=A};dwr.engine.setParameters=function(A){dwr.engine._parameters=A};dwr.engine.XMLHttpRequest=1;dwr.engine.IFrame=2;dwr.engine.ScriptTag=3;dwr.engine.setRpcType=function(A){if(A!=dwr.engine.XMLHttpRequest&&A!=dwr.engine.IFrame&&A!=dwr.engine.ScriptTag){dwr.engine._handleError(null,{name:"dwr.engine.invalidRpcType",message:"RpcType must be one of dwr.engine.XMLHttpRequest or dwr.engine.IFrame or dwr.engine.ScriptTag"});return }dwr.engine._rpcType=A};dwr.engine.setHttpMethod=function(A){if(A!="GET"&&A!="POST"){dwr.engine._handleError(null,{name:"dwr.engine.invalidHttpMethod",message:"Remoting method must be one of GET or POST"});return }dwr.engine._httpMethod=A};dwr.engine.setOrdered=function(A){dwr.engine._ordered=A};dwr.engine.setAsync=function(A){dwr.engine._async=A};dwr.engine.setActiveReverseAjax=function(A){if(A){if(dwr.engine._activeReverseAjax){return }dwr.engine._activeReverseAjax=true;dwr.engine._poll()}else{if(dwr.engine._activeReverseAjax&&dwr.engine._pollReq){dwr.engine._pollReq.abort()}dwr.engine._activeReverseAjax=false}};dwr.engine.defaultErrorHandler=function(B,A){dwr.engine._debug("Error: "+A.name+", "+A.message,true);if(B==null||B==""){alert("A server error has occured.")}else{if(B.indexOf("0x80040111")!=-1){dwr.engine._debug(B)}else{alert(B)}}};dwr.engine.defaultWarningHandler=function(B,A){dwr.engine._debug(B)};dwr.engine.beginBatch=function(){if(dwr.engine._batch){dwr.engine._handleError(null,{name:"dwr.engine.batchBegun",message:"Batch already begun"});return }dwr.engine._batch=dwr.engine._createBatch()};dwr.engine.endBatch=function(B){var A=dwr.engine._batch;if(A==null){dwr.engine._handleError(null,{name:"dwr.engine.batchNotBegun",message:"No batch in progress"});return }dwr.engine._batch=null;if(A.map.callCount==0){return }if(B){dwr.engine._mergeBatch(A,B)}if(dwr.engine._ordered&&dwr.engine._batchesLength!=0){dwr.engine._batchQueue[dwr.engine._batchQueue.length]=A}else{dwr.engine._sendData(A)}};dwr.engine.setPollMethod=function(A){dwr.engine.setPollType(A)};dwr.engine.setMethod=function(A){dwr.engine.setRpcType(A)};dwr.engine.setVerb=function(A){dwr.engine.setHttpMethod(A)};dwr.engine.setPollType=function(){dwr.engine._debug("Manually setting the Poll Type is not supported")};dwr.engine._origScriptSessionId="0A8E87B857FF91D3D8D5373380B69BFB";dwr.engine._sessionCookieName="JSESSIONID";dwr.engine._allowGetForSafariButMakeForgeryEasier="false";dwr.engine._scriptTagProtection="throw 'allowScriptTagRemoting is false.';";dwr.engine._defaultPath="/AuthoringHelianthus/dwr";dwr.engine._pollWithXhr="false";dwr.engine._scriptSessionId=null;dwr.engine._getScriptSessionId=function(){if(dwr.engine._scriptSessionId==null){dwr.engine._scriptSessionId=dwr.engine._origScriptSessionId+Math.floor(Math.random()*1000)}return dwr.engine._scriptSessionId};dwr.engine._errorHandler=dwr.engine.defaultErrorHandler;dwr.engine._warningHandler=dwr.engine.defaultWarningHandler;dwr.engine._preHook=null;dwr.engine._postHook=null;dwr.engine._batches={};dwr.engine._batchesLength=0;dwr.engine._batchQueue=[];dwr.engine._rpcType=dwr.engine.XMLHttpRequest;dwr.engine._httpMethod="POST";dwr.engine._ordered=false;dwr.engine._async=true;dwr.engine._batch=null;dwr.engine._timeout=0;dwr.engine._DOMDocument=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"];dwr.engine._XMLHTTP=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];dwr.engine._activeReverseAjax=false;dwr.engine._outstandingIFrames=[];dwr.engine._pollReq=null;dwr.engine._pollCometInterval=200;dwr.engine._pollRetries=0;dwr.engine._maxPollRetries=0;dwr.engine._textHtmlHandler=null;dwr.engine._headers=null;dwr.engine._parameters=null;dwr.engine._postSeperator="\n";dwr.engine._defaultInterceptor=function(A){return A};dwr.engine._urlRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._contentRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._replyRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._nextBatchId=0;dwr.engine._propnames=["rpcType","httpMethod","async","timeout","errorHandler","warningHandler","textHtmlHandler"];dwr.engine._partialResponseNo=0;dwr.engine._partialResponseYes=1;dwr.engine._partialResponseFlush=2;dwr.engine._execute=function(K,B,I,H){var E=false;if(dwr.engine._batch==null){dwr.engine.beginBatch();E=true}var D=dwr.engine._batch;var G=[];for(var C=0;C<arguments.length-3;C++){G[C]=arguments[C+3]}if(D.path==null){D.path=K}else{if(D.path!=K){dwr.engine._handleError(D,{name:"dwr.engine.multipleServlets",message:"Can't batch requests to multiple DWR Servlets."});return }}var A;var J=G[G.length-1];if(typeof J=="function"||J==null){A={callback:G.pop()}}else{A=G.pop()}dwr.engine._mergeBatch(D,A);D.handlers[D.map.callCount]={exceptionHandler:A.exceptionHandler,callback:A.callback};var F="c"+D.map.callCount+"-";D.map[F+"scriptName"]=B;D.map[F+"methodName"]=I;D.map[F+"id"]=D.map.callCount;for(C=0;C<G.length;C++){dwr.engine._serializeAll(D,[],G[C],F+"param"+C)}D.map.callCount++;if(E){dwr.engine.endBatch()}};dwr.engine._poll=function(B){if(!dwr.engine._activeReverseAjax){return }var A=dwr.engine._createBatch();A.map.id=0;A.map.callCount=1;A.isPoll=true;if(dwr.engine._pollWithXhr=="true"){A.rpcType=dwr.engine.XMLHttpRequest;A.map.partialResponse=dwr.engine._partialResponseNo}else{if(navigator.userAgent.indexOf("Gecko/")!=-1){A.rpcType=dwr.engine.XMLHttpRequest;A.map.partialResponse=dwr.engine._partialResponseYes}else{if(navigator.userAgent.indexOf("Safari/")){A.rpcType=dwr.engine.XMLHttpRequest;A.map.partialResponse=dwr.engine._partialResponseYes}else{A.rpcType=dwr.engine.XMLHttpRequest;A.map.partialResponse=dwr.engine._partialResponseNo}}}A.httpMethod="POST";A.async=true;A.timeout=0;A.path=(B)?B:dwr.engine._defaultPath;A.preHooks=[];A.postHooks=[];A.errorHandler=dwr.engine._pollErrorHandler;A.warningHandler=dwr.engine._pollErrorHandler;A.handlers[0]={callback:function(C){dwr.engine._pollRetries=0;setTimeout("dwr.engine._poll()",C)}};dwr.engine._sendData(A);if(A.rpcType==dwr.engine.XMLHttpRequest&&A.map.partialResponse==dwr.engine._partialResponseYes){dwr.engine._checkCometPoll()}};dwr.engine._pollErrorHandler=function(B,A){dwr.engine._pollRetries++;dwr.engine._debug("Reverse Ajax poll failed (pollRetries="+dwr.engine._pollRetries+"): "+A.name+" : "+A.message);if(dwr.engine._pollRetries<dwr.engine._maxPollRetries){setTimeout("dwr.engine._poll()",10000)}else{dwr.engine._activeReverseAjax=false;dwr.engine._debug("Giving up.")}};dwr.engine._createBatch=function(){var A={map:{callCount:0,page:window.location.pathname+window.location.search,httpSessionId:dwr.engine._getJSessionId(),scriptSessionId:dwr.engine._getScriptSessionId()},charsProcessed:0,paramCount:0,parameters:{},headers:{},isPoll:false,handlers:{},preHooks:[],postHooks:[],rpcType:dwr.engine._rpcType,httpMethod:dwr.engine._httpMethod,async:dwr.engine._async,timeout:dwr.engine._timeout,errorHandler:dwr.engine._errorHandler,warningHandler:dwr.engine._warningHandler,textHtmlHandler:dwr.engine._textHtmlHandler};if(dwr.engine._preHook){A.preHooks.push(dwr.engine._preHook)}if(dwr.engine._postHook){A.postHooks.push(dwr.engine._postHook)}var C,B;if(dwr.engine._headers){for(C in dwr.engine._headers){B=dwr.engine._headers[C];if(typeof B!="function"){A.headers[C]=B}}}if(dwr.engine._parameters){for(C in dwr.engine._parameters){B=dwr.engine._parameters[C];if(typeof B!="function"){A.parameters[C]=B}}}return A};dwr.engine._mergeBatch=function(A,D){var E,C;for(var B=0;B<dwr.engine._propnames.length;B++){E=dwr.engine._propnames[B];if(D[E]!=null){A[E]=D[E]}}if(D.preHook!=null){A.preHooks.unshift(D.preHook)}if(D.postHook!=null){A.postHooks.push(D.postHook)}if(D.headers){for(E in D.headers){C=D.headers[E];if(typeof C!="function"){A.headers[E]=C}}}if(D.parameters){for(E in D.parameters){C=D.parameters[E];if(typeof C!="function"){A.map["p-"+E]=""+C}}}};dwr.engine._getJSessionId=function(){var C=document.cookie.split(";");for(var B=0;B<C.length;B++){var A=C[B];while(A.charAt(0)==" "){A=A.substring(1,A.length)}if(A.indexOf(dwr.engine._sessionCookieName+"=")==0){return A.substring(dwr.engine._sessionCookieName.length+1,A.length)}}return""};dwr.engine._checkCometPoll=function(){for(var B=0;B<dwr.engine._outstandingIFrames.length;B++){var E="";var C=dwr.engine._outstandingIFrames[B];try{E=dwr.engine._getTextFromCometIFrame(C)}catch(A){dwr.engine._handleWarning(C.batch,A)}if(E!=""){dwr.engine._processCometResponse(E,C.batch)}}if(dwr.engine._pollReq){var D=dwr.engine._pollReq;var E=D.responseText;if(E!=null){dwr.engine._processCometResponse(E,D.batch)}}if(dwr.engine._outstandingIFrames.length>0||dwr.engine._pollReq){setTimeout("dwr.engine._checkCometPoll()",dwr.engine._pollCometInterval)}};dwr.engine._getTextFromCometIFrame=function(B){var A=B.contentWindow.document.body;if(A==null){return""}var C=A.innerHTML;if(C.indexOf("<PRE>")==0||C.indexOf("<pre>")==0){C=C.substring(5,C.length-7)}return C};dwr.engine._processCometResponse=function(D,E){if(E.charsProcessed==D.length){return }if(D.length==0){E.charsProcessed=0;return }var B=D.indexOf("//#DWR-START#",E.charsProcessed);if(B==-1){E.charsProcessed=D.length;return }var A=D.lastIndexOf("//#DWR-END#");if(A==-1){return }if(D.charCodeAt(A+11)==13&&D.charCodeAt(A+12)==10){E.charsProcessed=A+13}else{E.charsProcessed=A+11}var C=D.substring(B+13,A);dwr.engine._receivedBatch=E;dwr.engine._eval(C);dwr.engine._receivedBatch=null};dwr.engine._sendData=function(E){E.map.batchId=dwr.engine._nextBatchId;dwr.engine._nextBatchId++;dwr.engine._batches[E.map.batchId]=E;dwr.engine._batchesLength++;E.completed=false;for(var D=0;D<E.preHooks.length;D++){E.preHooks[D]()}E.preHooks=null;if(E.timeout&&E.timeout!=0){E.interval=setInterval(function(){dwr.engine._abortRequest(E)},E.timeout)}if(E.rpcType==dwr.engine.XMLHttpRequest){if(window.XMLHttpRequest){E.req=new XMLHttpRequest()}else{if(window.ActiveXObject&&!(navigator.userAgent.indexOf("Mac")>=0&&navigator.userAgent.indexOf("MSIE")>=0)){E.req=dwr.engine._newActiveXObject(dwr.engine._XMLHTTP)}}}var A,C;if(E.req){if(E.async){E.req.onreadystatechange=function(){if(typeof dwr!="undefined"){dwr.engine._stateChange(E)}}}if(E.isPoll){dwr.engine._pollReq=E.req;if(!document.all){E.req.batch=E}}var B=navigator.userAgent.indexOf("Safari/");if(B>=0){var G=navigator.userAgent.substring(B+7);if(parseInt(G,10)<400){if(dwr.engine._allowGetForSafariButMakeForgeryEasier=="true"){E.httpMethod="GET"}else{dwr.engine._handleWarning(E,{name:"dwr.engine.oldSafari",message:"Safari GET support disabled. See getahead.org/dwr/server/servlet and allowGetForSafariButMakeForgeryEasier."})}}}E.mode=E.isPoll?dwr.engine._ModePlainPoll:dwr.engine._ModePlainCall;C=dwr.engine._constructRequest(E);try{E.req.open(E.httpMethod,C.url,E.async);try{for(A in E.headers){var I=E.headers[A];if(typeof I=="string"){E.req.setRequestHeader(A,I)}}if(!E.headers["Content-Type"]){E.req.setRequestHeader("Content-Type","text/plain")}}catch(H){dwr.engine._handleWarning(E,H)}E.req.send(C.body);if(!E.async){dwr.engine._stateChange(E)}}catch(H){dwr.engine._handleError(E,H)}}else{if(E.rpcType!=dwr.engine.ScriptTag){var F=E.isPoll?"dwr-if-poll-"+E.map.batchId:"dwr-if-"+E.map["c0-id"];if(E.isPoll&&window.ActiveXObject){E.htmlfile=new window.ActiveXObject("htmlfile");E.htmlfile.open();E.htmlfile.write("<html>");E.htmlfile.write("<div><iframe className='wibble' src='javascript:void(0)' id='"+F+"' name='"+F+"' onload='dwr.engine._iframeLoadingComplete("+E.map.batchId+");'></iframe></div>");E.htmlfile.write("</html>");E.htmlfile.close();E.htmlfile.parentWindow.dwr=dwr;E.document=E.htmlfile}else{E.div=document.createElement("div");document.body.appendChild(E.div);E.div.innerHTML="<iframe src='javascript:void(0)' frameborder='0' style='width:0px;height:0px;border:0;' id='"+F+"' name='"+F+"' onload='dwr.engine._iframeLoadingComplete ("+E.map.batchId+");'></iframe>";E.document=document}E.iframe=E.document.getElementById(F);E.iframe.batch=E;E.mode=E.isPoll?dwr.engine._ModeHtmlPoll:dwr.engine._ModeHtmlCall;if(E.isPoll){dwr.engine._outstandingIFrames.push(E.iframe)}C=dwr.engine._constructRequest(E);if(E.httpMethod=="GET"){E.iframe.setAttribute("src",C.url)}else{E.form=E.document.createElement("form");E.form.setAttribute("id","dwr-form");E.form.setAttribute("action",C.url);E.form.setAttribute("target",F);E.form.target=F;E.form.setAttribute("method",E.httpMethod);for(A in E.map){var I=E.map[A];if(typeof I!="function"){var J=E.document.createElement("input");J.setAttribute("type","hidden");J.setAttribute("name",A);J.setAttribute("value",I);E.form.appendChild(J)}}E.document.body.appendChild(E.form);E.form.submit()}}else{E.httpMethod="GET";E.mode=E.isPoll?dwr.engine._ModePlainPoll:dwr.engine._ModePlainCall;C=dwr.engine._constructRequest(E);E.script=document.createElement("script");E.script.id="dwr-st-"+E.map["c0-id"];E.script.src=C.url;document.body.appendChild(E.script)}}};dwr.engine._ModePlainCall="/call/plaincall/";dwr.engine._ModeHtmlCall="/call/htmlcall/";dwr.engine._ModePlainPoll="/call/plainpoll/";dwr.engine._ModeHtmlPoll="/call/htmlpoll/";dwr.engine._constructRequest=function(A){var B={url:A.path+A.mode,body:null};if(A.isPoll==true){B.url+="ReverseAjax.dwr"}else{if(A.map.callCount==1){B.url+=A.map["c0-scriptName"]+"."+A.map["c0-methodName"]+".dwr"}else{B.url+="Multiple."+A.map.callCount+".dwr"}}var D=location.href.match(/jsessionid=([^?]+)/);if(D!=null){B.url+=";jsessionid="+D[1]}var C;if(A.httpMethod=="GET"){A.map.callCount=""+A.map.callCount;B.url+="?";for(C in A.map){if(typeof A.map[C]!="function"){B.url+=encodeURIComponent(C)+"="+encodeURIComponent(A.map[C])+"&"}}B.url=B.url.substring(0,B.url.length-1)}else{B.body="";for(C in A.map){if(typeof A.map[C]!="function"){B.body+=C+"="+A.map[C]+dwr.engine._postSeperator}}B.body=dwr.engine._contentRewriteHandler(B.body)}B.url=dwr.engine._urlRewriteHandler(B.url);return B};dwr.engine._stateChange=function(C){var B;if(C.completed){dwr.engine._debug("Error: _stateChange() with batch.completed");return }var F=C.req;try{if(F.readyState!=4){return }}catch(D){dwr.engine._handleWarning(C,D);dwr.engine._clearUp(C);return }try{var E=F.responseText;E=dwr.engine._replyRewriteHandler(E);var A=F.status;if(E==null||E==""){dwr.engine._handleWarning(C,{name:"dwr.engine.missingData",message:"No data received from server"})}else{if(A!=200){dwr.engine._handleError(C,{name:"dwr.engine.http."+A,message:F.statusText})}else{var G=F.getResponseHeader("Content-Type");if(!G.match(/^text\/plain/)&&!G.match(/^text\/javascript/)){if(G.match(/^text\/html/)&&typeof C.textHtmlHandler=="function"){C.textHtmlHandler()}else{dwr.engine._handleWarning(C,{name:"dwr.engine.invalidMimeType",message:"Invalid content type: '"+G+"'"})}}else{if(C.isPoll&&C.map.partialResponse==dwr.engine._partialResponseYes){dwr.engine._processCometResponse(E,C)}else{if(E.search("//#DWR")==-1){dwr.engine._handleWarning(C,{name:"dwr.engine.invalidReply",message:"Invalid reply from server"})}else{B=E}}}}}}catch(D){dwr.engine._handleWarning(C,D)}dwr.engine._callPostHooks(C);dwr.engine._receivedBatch=C;if(B!=null){B=B.replace(dwr.engine._scriptTagProtection,"")}dwr.engine._eval(B);dwr.engine._receivedBatch=null;dwr.engine._validateBatch(C);dwr.engine._clearUp(C)};dwr.engine._validateBatch=function(A){if(!A.completed){for(var B=0;B<A.map.callCount;B++){if(A.handlers[B]!=null){dwr.engine._handleWarning(A,{name:"dwr.engine.incompleteReply",message:"Incomplete reply from server"});break}}}};dwr.engine._iframeLoadingComplete=function(A){var B=dwr.engine._batches[A];if(B){dwr.engine._validateBatch(B)}};dwr.engine._remoteHandleCallback=function(A,F,E){var C=dwr.engine._batches[A];if(C==null){dwr.engine._debug("Warning: batch == null in remoteHandleCallback for batchId="+A,true);return }try{var B=C.handlers[F];C.handlers[F]=null;if(!B){dwr.engine._debug("Warning: Missing handlers. callId="+F,true)}else{if(typeof B.callback=="function"){B.callback(E)}}}catch(D){dwr.engine._handleError(C,D)}};dwr.engine._remoteHandleException=function(A,E,D){var C=dwr.engine._batches[A];if(C==null){dwr.engine._debug("Warning: null batch in remoteHandleException",true);return }var B=C.handlers[E];C.handlers[E]=null;if(B==null){dwr.engine._debug("Warning: null handlers in remoteHandleException",true);return }if(D.message==undefined){D.message=""}if(typeof B.exceptionHandler=="function"){B.exceptionHandler(D.message,D)}else{if(typeof C.errorHandler=="function"){C.errorHandler(D.message,D)}}};dwr.engine._remoteHandleBatchException=function(C,A){var B=(dwr.engine._receivedBatch==null&&A!=null);if(B){dwr.engine._receivedBatch=dwr.engine._batches[A]}if(C.message==undefined){C.message=""}dwr.engine._handleError(dwr.engine._receivedBatch,C);if(B){dwr.engine._receivedBatch=null;dwr.engine._clearUp(dwr.engine._batches[A])}};dwr.engine._remotePollCometDisabled=function(C,A){dwr.engine.setActiveReverseAjax(false);var B=(dwr.engine._receivedBatch==null&&A!=null);if(B){dwr.engine._receivedBatch=dwr.engine._batches[A]}if(C.message==undefined){C.message=""}dwr.engine._handleError(dwr.engine._receivedBatch,C);if(B){dwr.engine._receivedBatch=null;dwr.engine._clearUp(dwr.engine._batches[A])}};dwr.engine._remoteBeginIFrameResponse=function(B,A){if(B!=null){dwr.engine._receivedBatch=B.batch}dwr.engine._callPostHooks(dwr.engine._receivedBatch)};dwr.engine._remoteEndIFrameResponse=function(A){dwr.engine._clearUp(dwr.engine._receivedBatch);dwr.engine._receivedBatch=null};dwr.engine._eval=function(script){if(script==null){return null}if(script==""){dwr.engine._debug("Warning: blank script",true);return null}return eval(script)};dwr.engine._abortRequest=function(A){if(A&&!A.completed){clearInterval(A.interval);dwr.engine._clearUp(A);if(A.req){A.req.abort()}dwr.engine._handleError(A,{name:"dwr.engine.timeout",message:"Timeout"})}};dwr.engine._callPostHooks=function(A){if(A.postHooks){for(var B=0;B<A.postHooks.length;B++){A.postHooks[B]()}A.postHooks=null}};dwr.engine._clearUp=function(B){if(!B){dwr.engine._debug("Warning: null batch in dwr.engine._clearUp()",true);return }if(B.completed=="true"){dwr.engine._debug("Warning: Double complete",true);return }if(B.div){B.div.parentNode.removeChild(B.div)}if(B.iframe){for(var C=0;C<dwr.engine._outstandingIFrames.length;C++){if(dwr.engine._outstandingIFrames[C]==B.iframe){dwr.engine._outstandingIFrames.splice(C,1)}}B.iframe.parentNode.removeChild(B.iframe)}if(B.form){B.form.parentNode.removeChild(B.form)}if(B.req){if(B.req==dwr.engine._pollReq){dwr.engine._pollReq=null}delete B.req}if(B.map&&B.map.batchId){delete dwr.engine._batches[B.map.batchId];dwr.engine._batchesLength--}B.completed=true;if(dwr.engine._batchQueue.length!=0){var A=dwr.engine._batchQueue.shift();dwr.engine._sendData(A)}};dwr.engine._handleError=function(A,B){if(typeof B=="string"){B={name:"unknown",message:B}}if(B.message==null){B.message=""}if(B.name==null){B.name="unknown"}if(A&&typeof A.errorHandler=="function"){A.errorHandler(B.message,B)}else{if(dwr.engine._errorHandler){dwr.engine._errorHandler(B.message,B)}}if(A){dwr.engine._clearUp(A)}};dwr.engine._handleWarning=function(A,B){if(typeof B=="string"){B={name:"unknown",message:B}}if(B.message==null){B.message=""}if(B.name==null){B.name="unknown"}if(A&&typeof A.warningHandler=="function"){A.warningHandler(B.message,B)}else{if(dwr.engine._warningHandler){dwr.engine._warningHandler(B.message,B)}}if(A){dwr.engine._clearUp(A)}};dwr.engine._serializeAll=function(B,D,C,A){if(C==null){B.map[A]="null:null";return }switch(typeof C){case"boolean":B.map[A]="boolean:"+C;break;case"number":B.map[A]="number:"+C;break;case"string":B.map[A]="string:"+encodeURIComponent(C);break;case"object":if(C instanceof String){B.map[A]="String:"+encodeURIComponent(C)}else{if(C instanceof Boolean){B.map[A]="Boolean:"+C}else{if(C instanceof Number){B.map[A]="Number:"+C}else{if(C instanceof Date){B.map[A]="Date:"+C.getTime()}else{if(C&&C.join){B.map[A]=dwr.engine._serializeArray(B,D,C,A)}else{B.map[A]=dwr.engine._serializeObject(B,D,C,A)}}}}}break;case"function":break;default:dwr.engine._handleWarning(null,{name:"dwr.engine.unexpectedType",message:"Unexpected type: "+typeof C+", attempting default converter."});B.map[A]="default:"+C;break}};dwr.engine._lookup=function(E,C,A){var D;for(var B=0;B<E.length;B++){if(E[B].data==C){D=E[B];break}}if(D){return"reference:"+D.name}E.push({data:C,name:A});return null};dwr.engine._serializeObject=function(C,H,G,B){var F=dwr.engine._lookup(H,G,B);if(F){return F}if(G.nodeName&&G.nodeType){return dwr.engine._serializeXml(C,H,G,B)}var E="Object_"+dwr.engine._getObjectClassName(G)+":{";var D;for(D in G){if(typeof G[D]!="function"){C.paramCount++;var A="c"+dwr.engine._batch.map.callCount+"-e"+C.paramCount;dwr.engine._serializeAll(C,H,G[D],A);E+=encodeURIComponent(D)+":reference:"+A+", "}}if(E.substring(E.length-2)==", "){E=E.substring(0,E.length-2)}E+="}";return E};dwr.engine._errorClasses={"Error":Error,"EvalError":EvalError,"RangeError":RangeError,"ReferenceError":ReferenceError,"SyntaxError":SyntaxError,"TypeError":TypeError,"URIError":URIError};dwr.engine._getObjectClassName=function(C){if(C&&C.constructor&&C.constructor.toString){var D=C.constructor.toString();var A=D.match(/function\s+(\w+)/);if(A&&A.length==2){return A[1]}}if(C&&C.constructor){for(var B in dwr.engine._errorClasses){if(C.constructor==dwr.engine._errorClasses[B]){return B}}}if(C){var D=Object.prototype.toString.call(C);var A=D.match(/\[object\s+(\w+)/);if(A&&A.length==2){return A[1]}}return"Object"};dwr.engine._serializeXml=function(C,F,E,B){var D=dwr.engine._lookup(F,E,B);if(D){return D}var A;if(window.XMLSerializer){A=new XMLSerializer().serializeToString(E)}else{if(E.toXml){A=E.toXml}else{A=E.innerHTML}}return"XML:"+encodeURIComponent(A)};dwr.engine._serializeArray=function(C,H,G,B){var F=dwr.engine._lookup(H,G,B);if(F){return F}var E="Array:[";for(var D=0;D<G.length;D++){if(D!=0){E+=","}C.paramCount++;var A="c"+dwr.engine._batch.map.callCount+"-e"+C.paramCount;dwr.engine._serializeAll(C,H,G[D],A);E+="reference:";E+=A}E+="]";return E};dwr.engine._unserializeDocument=function(A){var C;if(window.DOMParser){var E=new DOMParser();C=E.parseFromString(A,"text/xml");if(!C.documentElement||C.documentElement.tagName=="parsererror"){var B=C.documentElement.firstChild.data;B+="\n"+C.documentElement.firstChild.nextSibling.firstChild.data;throw B}return C}else{if(window.ActiveXObject){C=dwr.engine._newActiveXObject(dwr.engine._DOMDocument);C.loadXML(A);return C}else{var D=document.createElement("div");D.innerHTML=A;return D}}};dwr.engine._newActiveXObject=function(A){var D;for(var C=0;C<A.length;C++){try{D=new ActiveXObject(A[C]);break}catch(B){}}return D};dwr.engine._debug=function(F,D){var A=false;try{if(window.console){if(D&&window.console.trace){window.console.trace()}window.console.log(F);A=true}else{if(window.opera&&window.opera.postError){window.opera.postError(F);A=true}}}catch(C){}if(!A){var B=document.getElementById("dwr-debug");if(B){var E=F+"<br/>"+B.innerHTML;if(E.length>2048){E=E.substring(0,2048)}B.innerHTML=E}}};var HDAChrome={textMode:false,lastFormAction:null,minimumNumberOfVisibleButtons:4,lastMenuToRender:false,init:function(D){this.player=D;if(D!=null){if(typeof (HDATheme)!="undefined"&&HDATheme.init){HDATheme.init()}if(typeof (HDAClient)!="undefined"&&HDAClient.init){HDAClient.init()}}this.controls=new Object();if(HDASearchTag("hda-faceControls")){var C=HDASearchTag("hda-faceControls").getElementsByTagName("li");for(var B=0;B<C.length;B++){var E=HDAUtils.camelize(C[B].id.replace("hda-control",""));this.controls[E]=new Object();this.controls[E].element=C[B]}if(this.player!=null){this.menuButtons=this.getMenuButtons()}this.reset();if(HDASearchTag("hda-controlVideoOn")){HDASearchTag("hda-controlVideoOn").style.display="none"}if(HDASearchTag("hda-controlVideoOff")){HDASearchTag("hda-controlVideoOff").style.display=""}if(this.player!=null){for(control in this.controls){var A=this.controls[control].element;A.onclick=(function(G){var I=HDAUtils.DOMEvent.getTarget(G);if(!HDAUtils.element.hasClassName(I,"active")){return }var H=I.id.replace("hda-control","face");if(this.events[H]){var F="_on"+H.substring(0,1).toUpperCase()+H.substring(1);if(this[F]){this[F]()}HDAPlayer[F]();this.events[H].fire()}}).bind(this);A.onmouseover=(function(F){var G=HDAUtils.DOMEvent.getTarget(F);if(!HDAUtils.element.hasClassName(G,"active")){return }HDAUtils.element.addClassName(G,"hover")}).bind(this);A.onmouseout=(function(F){var G=HDAUtils.DOMEvent.getTarget(F);if(!HDAUtils.element.hasClassName(G,"active")){return }HDAUtils.element.removeClassName(G,"hover")}).bind(this)}}}if(HDASearchTag("hda-helpSpot")){HDASearchTag("hda-helpSpot").onclick=(function(F){HDAPlayer._onFaceHelp();this.events["faceHelp"].fire()}).bind(this)}},getMenuButtons:function(){var C=[];var A=HDASearchTag("hda-menu-body").getElementsByTagName("td");for(var B=0;B<A.length;B++){if(HDAUtils.element.hasClassName(A[B],"hda-button")){C.push(A[B])}}return C},removeMenuButtons:function(){var A=HDASearchTag("hda-menu-body");if(A){while(A.childNodes.length>0){A.removeChild(A.childNodes[0])}}this.menuButtons=[]},createMenuButton:function(D,B,A){var C=document.createElement("td");C.id=D;HDAUtils.element.addClassName(C,"hda-button");HDAUtils.element.addClassName(C,A===true?"":"active");C.innerHTML=B;C.onmouseover=function(E){HDAUtils.element.addClassName(HDAUtils.DOMEvent.getTarget(E),"hover")};C.onmouseout=function(E){HDAUtils.element.removeClassName(HDAUtils.DOMEvent.getTarget(E),"hover")};C.onmousedown=function(E){HDAUtils.element.addClassName(HDAUtils.DOMEvent.getTarget(E),"selected")};C.onmouseup=function(E){HDAUtils.element.removeClassName(HDAUtils.DOMEvent.getTarget(E),"selected")};if(A!==true){C.onclick=(function(E){this.resetControls();el=HDAUtils.DOMEvent.getTarget(E);var F=parseInt(el.id.replace("hda-menuButton_",""))-1;this._onMenuChoice(F);HDAPlayer._onMenuChoice(F);this.events.menuChoice.fire(F)}).bind(this)}return C},addMenuButton:function(B,D){var A=HDASearchTag("hda-menu-body");if(A.childNodes.length===0){HDAUtils.element.addClassName(B,"first")}if(D===true){HDAUtils.element.addClassName(B,"last")}var C=document.createElement("tr");C.appendChild(B);A.appendChild(C)},reset:function(A){if(this.player!=null){this.resetMenu()}this.resetForm();this.resetControls();this.textMode=false;if(this.player!=null){HDASearchTag(HDAFlashFacePlayer.flashTagId).style.height="";HDASearchTag(HDAFlashFacePlayer.flashTagId).style.width=""}if(HDASearchTag("hda-alternativeText")){HDASearchTag("hda-alternativeText").style.display="none"}if(HDASearchTag("hda-controlVideoOff")){HDASearchTag("hda-controlVideoOff").style.display=""}if(HDASearchTag("hda-controlVideoOn")){HDASearchTag("hda-controlVideoOn").style.display="none"}HDAFacePlayer.engine=HDAFlashFacePlayer;if(this.controls.videoOff&&this.controls.videoOff.element){if(this.player!=null){HDAUtils.element.addClassName(this.controls.videoOff.element,"active")}}if(A){if(HDASearchTag("hda-controlLastMenu")){HDAUtils.element.removeClassName(HDASearchTag("hda-controlLastMenu"),"active")}if(this.controls.repeat&&this.controls.repeat.element){HDAUtils.element.removeClassName(this.controls.repeat.element,"active")}}},resetMenu:function(){this.menuButtons=this.getMenuButtons();this.resetOldMenu()},resetOldMenu:function(){for(var B=0,C=this.menuButtons.length;B<C;B++){var A=this.menuButtons[B];A.innerHTML="";HDAUtils.element.removeClassName(A,"active");A.onclick=function(){return false}}if(this.controls.lastMenu&&(HDAPlayer.playMode!="repeat")){HDAUtils.element.removeClassName(this.controls.lastMenu.element,"active")}},resetControls:function(){for(c in this.controls){if(this.controls[c].element.id!="hda-controlLastMenu"){if(this.controls[c].element){HDAUtils.element.removeClassName(this.controls[c].element,"active")}}}if(HDASearchTag("hda-controlVideoOff")){HDAUtils.element.addClassName(HDASearchTag("hda-controlVideoOff"),"active")}if(HDASearchTag("hda-controlVideoOn")){HDAUtils.element.addClassName(HDASearchTag("hda-controlVideoOn"),"active")}},displayMenu:function(D){this.removeMenuButtons();if(this.minimumNumberOfVisibleButtons===0){var A=D.children.length}else{var A=this.minimumNumberOfVisibleButtons}for(var C=0;C<A;C++){if(C<D.children.length){console.debug("[CH] Adding menu item %o",D.children[C]);var B=this.createMenuButton("hda-menuButton_"+(C+1),D.children[C].content)}else{var B=this.createMenuButton("hda-menuButton_"+(C+1),"",true)}this.menuButtons.push(B);this.addMenuButton(B,C===D.children.length-1)}},setAlternativeTextHTML:function(A){if(HDASearchTag("hda-alternativeText")){HDASearchTag("hda-alternativeText").innerHTML=A}},getAlternativeTextHTML:function(A){if(HDASearchTag("hda-alternativeText")){return HDASearchTag("hda-alternativeText").innerHTML}},appendAlternativeText:function(A){if(!A){return }if(HDASearchTag("hda-alternativeText")){HDASearchTag("hda-alternativeText").innerHTML+="<p>"+A+"</p>"}},setCaption:function(A){if(!A){A=""}if(A=="*"){return }HDASearchTag("hda-textArea").innerHTML=A},getCaption:function(A){return HDASearchTag("hda-textArea").innerHTML},appendErrorMessage:function(A,C){if(C){var D=C}else{if(A=="null-response"){var B="hda-noConnectionErrorMessage"}else{var B="hda-noVideoErrorMessage"}var D=HDASearchTag(B)?HDASearchTag(B).innerHTML:"There are some connection problems, try again later."}HDASearchTag("hda-alternativeText").innerHTML='<p class="hda-errorMessage">'+D+"<p>"+HDASearchTag("hda-alternativeText").innerHTML},clearAlternativeText:function(){if(HDASearchTag("hda-alternativeText")){HDASearchTag("hda-alternativeText").innerHTML=""}},limitFormTextLength:function(C,B,A){var D=C.value.length;if(D>A){C.value=C.value.substring(0,A)}else{window.document.getElementById(B).innerHTML=(A-D)+"/"+A}},renderFormField:function(B){console.debug("[CH] Requested a %o field",B.params["type"]);var A="";maxTextSize=B.params["maxtextchars"];console.info(B.params["maxtextchars"]);switch(B.params["type"]){case"hda-text-area":if(!maxTextSize||maxTextSize==-1){A='<label for="'+B.target+'" class="hda-form-label">'+B.content+'</label><textarea id="'+B.target+'" name="'+B.target+'" class="hda-text-area" cols="20" rows="'+B.params["numrows"]+'"></textarea>'}else{A='<label for="'+B.target+'" class="hda-form-label">'+B.content+'</label><textarea id="'+B.target+'" name="'+B.target+'" class="hda-text-area" cols="20" rows="'+B.params["numrows"]+'" onfocus="javascript:HDAChrome.limitFormTextLength(this, \''+B.target+"CharactersCounter', "+maxTextSize+')" onmouseout="javascript:HDAChrome.limitFormTextLength(this, \''+B.target+"CharactersCounter', "+maxTextSize+')" onclick="javascript:HDAChrome.limitFormTextLength(this, \''+B.target+"CharactersCounter', "+maxTextSize+')" onmousedown="javascript:HDAChrome.limitFormTextLength(this, \''+B.target+"CharactersCounter', "+maxTextSize+')" onmouseup="javascript:HDAChrome.limitFormTextLength(this, \''+B.target+"CharactersCounter', "+maxTextSize+')" onKeyDown="javascript:HDAChrome.limitFormTextLength(this, \''+B.target+"CharactersCounter', "+maxTextSize+')" onKeyUp="javascript:HDAChrome.limitFormTextLength(this, \''+B.target+"CharactersCounter', "+maxTextSize+')"></textarea><div class="hda-text-area-counter" id="'+B.target+'CharactersCounter">'+maxTextSize+"/"+maxTextSize+'</div><div class="hda-form-spacer" ></div>'}break;default:console.warn("[CH] Unknown type field: %o. This should not happen!",B.params["type"]);break}return A},renderSubmitButton:function(B){console.debug("[CH] Requested a %o field",B.params["type"]);var A='<input type="button" id="hda-submit-button" name="hda-submit-button" class="hda-submit-button" onclick="javascript:HDAChrome.submitForm()" value="'+B.content+'" />';return A},renderForm:function(D){this.lastFormAction=D;var G='<form name="hda-generated-form">';var C=D.children;var F=null;for(var B=0;B<C.length;B++){switch(C[B].command){case"form-field":if(F==null){F=C[B].target}G+=this.renderFormField(C[B]);break;case"form-submit":G+=this.renderSubmitButton(C[B]);break;default:console.warn("[CH] Unknown field element for hda-generated-form: %o. This should not happen!",C[B].command);break}}G+="</form>";console.debug("[CH] Generated form code: %o",G);var A=HDASearchTag("hda-form");if(A){A.innerHTML=G}var E=HDASearchTag(F);if(E){E.focus()}},resetForm:function(){var A=HDASearchTag("hda-form");if(A){A.innerHTML=""}},submitForm:function(){var B="";var D=this.lastFormAction.children;var E=null;for(var C=0;C<D.length;C++){switch(D[C].command){case"form-field":var A=HDASearchTag(D[C].target);if(!A){console.warn("[CH] Found a field that is not rendered: %o. This should not be happen.",D[C].target)}else{B+=D[C].target+"="+encodeURI(A.value)+"&"}break;case"form-submit":E=D[C].target;break;default:console.debug("[CH] Ignoring %o field",D[C].command);break}}B=B.substring(0,B.length-1);console.debug("[CH] Ready to invoke node/rule %o with theese parameters: %o",E,B);HDAInterface.sendFormEvent(E,B);return true},events:{faceVideoOn:new HDAEvent("faceVideoOn"),faceVideoOff:new HDAEvent("faceVideoOff"),faceRepeat:new HDAEvent("faceRepeat"),faceLastMenu:new HDAEvent("faceLastMenu"),faceSkip:new HDAEvent("faceSkip"),faceHelp:new HDAEvent("faceHelp"),menuChoice:new HDAEvent("menuChoice")},_onBeginSequence:function(A){console.debug("[CH] begin sequence");this.resetMenu();this.resetForm();this.resetControls();this.clearAlternativeText();if(!this.textMode){if(this.controls.skip){HDAUtils.element.addClassName(this.controls.skip.element,"active");HDAUtils.element.removeClassName(this.controls.skip.element,"hover")}}if(this.controls.repeat){HDAUtils.element.removeClassName(this.controls.repeat.element,"active");HDAUtils.element.removeClassName(this.controls.repeat.element,"hover")}if(this.controls.lastMenu){if(this.lastMenuToRender){this.lastMenuToRender=false;HDAUtils.element.addClassName(this.controls.lastMenu.element,"active")}}},_onEndSequence:function(){console.debug("[CH] end sequence");if(!this.textMode){if(this.controls.skip){HDAUtils.element.removeClassName(this.controls.skip.element,"active");HDAUtils.element.removeClassName(this.controls.skip.element,"hover")}if(this.controls.repeat){HDAUtils.element.addClassName(this.controls.repeat.element,"active")}}},_onDisplayMenu:function(A){this.displayMenu(A)},_onVideoBegin:function(A,B){this.resetForm();this.setCaption(A.caption);this.appendAlternativeText(A.alternativeText)},_onFaceLastMenu:function(){HDAUtils.element.removeClassName(this.controls.lastMenu.element,"active");HDAUtils.element.removeClassName(this.controls.lastMenu.element,"hover");HDAUtils.element.removeClassName(this.controls.repeat.element,"active");HDAUtils.element.removeClassName(this.controls.skip.element,"active")},_onMenuChoice:function(A){var B=HDAPlayer.currentMenu.children[A];if(B.command!="open-url"||(B.command=="open-url"&&B.params["target"]=="popup")){if(B.command!="call-javascript"){this.resetMenu();if(this.controls.lastMenu){this.lastMenuToRender=true}}}console.log("[CH] Menu choice %o",B)},_onFaceVideoOff:function(){this.textMode=true;if(this.player){HDASearchTag(HDAFlashFacePlayer.flashTagId).style.height="1px";HDASearchTag(HDAFlashFacePlayer.flashTagId).style.width="1px";var C=HDASearchTag(HDAFlashFacePlayer.flashTagId);if(C.hasChildNodes()){var B=C.childNodes;for(var A=0;A<B.length;A++){if(B[A].tagName=="EMBED"||B[A].tagName=="embed"){B[A].style.width="1px";B[A].style.height="1px"}}}}HDASearchTag("hda-alternativeText").style.display="block";HDASearchTag("hda-controlVideoOff").style.display="none";HDASearchTag("hda-controlVideoOn").style.display="";console.debug("[CH] Stopping current node.");if(this.player){if(this.player.currentNode){HDAFacePlayer.engine.stop()}else{if(HDAPlayer.currentNode){HDAFacePlayer.engine.stop()}}}HDAFacePlayer.engine=HDADummyFacePlayer;if(this.controls.videoOn){HDAUtils.element.addClassName(this.controls.videoOn.element,"active")}if(this.controls.repeat){HDAUtils.element.removeClassName(this.controls.repeat.element,"active")}if(this.controls.skip){HDAUtils.element.removeClassName(this.controls.skip.element,"active")}},_onFaceVideoOn:function(){this.textMode=false;HDASearchTag(HDAFlashFacePlayer.flashTagId).style.height="";HDASearchTag(HDAFlashFacePlayer.flashTagId).style.width="";var C=HDASearchTag(HDAFlashFacePlayer.flashTagId);if(C.hasChildNodes()){var B=C.childNodes;for(var A=0;A<B.length;A++){if(B[A].tagName=="EMBED"||B[A].tagName=="embed"){B[A].style.width="";B[A].style.height=""}}}HDASearchTag("hda-alternativeText").style.display="none";HDASearchTag("hda-controlVideoOff").style.display="";HDASearchTag("hda-controlVideoOn").style.display="none";HDAFacePlayer.engine=HDAFlashFacePlayer;HDAUtils.element.addClassName(this.controls.videoOff.element,"active")},_onFaceSkip:function(){HDAUtils.element.removeClassName(this.controls.skip.element,"active")}};var HDAClientLog={traceClient:false,traceClientOnGA:false,HDA_CONNECTED:1,HDA_ERROR:2,HDA_FACE_HELP:3,HDA_FACE_REPEAT:4,HDA_FACE_SKIP:5,HDA_FACE_VIDEO_OFF:6,HDA_FACE_VIDEO_ON:7,HDA_BANDWIDTH_LEVEL:8,HDA_CONFIGURATION_REQUEST:9};var HDAFlashFacePlayer={flashTagId:"_hda_flash_player",brainObject:null,hdaswfroot:"swf/",hdawidth:160,hdaheight:160,hdabgcolor:"ffffff",hdaextra:null,hdaclientlog:false,hdawmode:null,hdaErrorHandler:function(B,A){if(B==null||B==""){console.error("A server error has occured. Please check Brain logs")}else{if(B.indexOf("0x80040111")!=-1){}else{console.error("HDA error detected. Object that describes the problem: %o",A);HDAChrome._onFaceVideoOff();HDAChrome.appendErrorMessage("hda-noConnectionErrorMessage")}}},initFlashTag:function(K,E,I,F,B,M,A,L,G,C){if((K!=null)&&(typeof (K)=="object")){if(((K.brainScriptObject===null)||(K.brainScriptObject===undefined))&&(typeof HDABrain==="undefined")){console.error("Unable to initialize player because Brain Application is missing.");console.error("Is Brain Application started? Is reverse proxy configured properly?");console.error("Player is not available at the moment.");HDAChrome.init(null);HDAChrome._onFaceVideoOff();HDAChrome.appendErrorMessage("hda-noConnectionErrorMessage");return }console.debug("[FP] Configuring HDA using an object.");HDAFlashFacePlayer.hdaswfroot=K.swfroot||"swf/";HDAFlashFacePlayer.hdawidth=K.width||160;HDAFlashFacePlayer.hdaheight=K.height||160;HDAFlashFacePlayer.hdaextra=K.extra||null;HDAFlashFacePlayer.hdabgcolor=K.bgcolor||"ffffff";if(HDAFlashFacePlayer.hdaextra==null){HDAFlashFacePlayer.hdaextra="bgcolor="+HDAFlashFacePlayer.hdabgcolor}else{HDAFlashFacePlayer.hdaextra+="&bgcolor="+HDAFlashFacePlayer.hdabgcolor}K.brainScriptObject?HDAFlashFacePlayer.brainObject=K.brainScriptObject:HDAFlashFacePlayer.brainObject=HDABrain;((K.clientlog!=null)&&(K.clientlog!=undefined))?this.hdaclientlog=K.clientlog:this.hdaclientlog=true;HDAPlayer.service=K.service;HDAFlashFacePlayer.hdawmode=K.wmode||"opaque"}else{console.debug("[FP] Configuring HDA using old method (positional).");if(((L===null)||(L===undefined))&&(typeof HDABrain==="undefined")){console.error("Unable to initialize player because Brain Application is missing.");console.error("Is Brain Application started? Is reverse proxy configured properly?");console.error("Player is not available at the moment.");HDAChrome.init(null);HDAChrome._onFaceVideoOff();HDAChrome.appendErrorMessage("hda-noConnectionErrorMessage");return }HDAFlashFacePlayer.hdaswfroot=K||"swf/";HDAFlashFacePlayer.hdawidth=B||160;HDAFlashFacePlayer.hdaheight=M||160;HDAFlashFacePlayer.hdaextra=F||null;HDAFlashFacePlayer.hdaclientlog=((A!=null)&&(A!=undefined))?A:true;HDAFlashFacePlayer.brainObject=L||HDABrain;HDAPlayer.service=G;HDAFlashFacePlayer.hdawmode=C||"opaque"}dwr.engine.setErrorHandler(this.hdaErrorHandler);dwr.engine.setWarningHandler(this.hdaErrorHandler);console.debug("[FP] Overridden DWR error and warning handler");console.debug("[FP] Brain Object: "+HDAFlashFacePlayer.brainObject);HDAPlayer.brainObject=HDAFlashFacePlayer.brainObject;if(!this.hdaclientlog){HDAClientLog.traceClient=false;console.debug("[FP] Client trace disabled")}else{HDAClientLog.traceClient=true;console.debug("[FP] Client trace enabled")}var J=new FlashTag(HDAFlashFacePlayer.hdaswfroot+"HDA.swf",HDAFlashFacePlayer.hdawidth,HDAFlashFacePlayer.hdaheight,HDAFlashFacePlayer.hdabgcolor,HDAFlashFacePlayer.hdawmode);J.setId(HDAFlashFacePlayer.flashTagId);var H="hda-lc-"+new Date().getTime();var D="lcname="+H;if(HDAFlashFacePlayer.hdaextra){D+="&"+HDAFlashFacePlayer.hdaextra}if(typeof J!="undefined"){J.setFlashvars(D);return J}else{return null}},init:function(G,C,E,D,B,I,A,H){var F=HDAFlashFacePlayer.initFlashTag(G,C,E,D,B,I,A,H);if(F!=null){F.write(document)}},initFlashProxy:function(){},play:function(A){console.debug("[FP] play("+A+")");this.flashProxy.playMovie(A)},stop:function(A){console.debug("[FP] stop");this.flashProxy.stopMovie()},pause:function(){console.debug("[FP] pause");this.flashProxy.pauseMovie()},continuePlay:function(){console.debug("[FP] continue");this.flashProxy.pauseMovie()},videoOn:function(){console.debug("[FP] videoOn");this.flashProxy.videoOn()},videoOff:function(){console.debug("[FP] videoOff");this.flashProxy.videoOff()}};var HDADummyFacePlayer={init:function(){console.debug("[DP] init")},play:function(A){console.debug("[DP] play("+A+")");HDAFacePlayer.fireEvent("movieBegin");HDAFacePlayer.fireEvent("throwStartActions");HDAFacePlayer.fireEvent("throwEndActions");HDAFacePlayer.fireEvent("movieEnd")},stop:function(A){console.debug("[DP] stop")},pause:function(){console.debug("[DP] pause")},continuePlay:function(){console.debug("[DP] continue")},videoOn:function(){console.debug("[DP] videoOn");HDAFlashFacePlayer.videoOn()},videoOff:function(){console.debug("[DP] videoOff")}};var HDAFacePlayer={engine:HDAFlashFacePlayer,hdaInterface:null,isExternalInterfaceInited:false,completeInit:function(){if(!HDAPlayer.isPlayerInited){HDAPlayer._setPlayerInited(true);this.findHDAInterface(top);this.hdaInterface.playerFinalization()}else{console.debug("[FE] Player already init")}},fireEvent:function(A,C){console.debug("[FE] event received: %o(%o)",A,C);if(!A){return }switch(A){case"configuration":return HDAPlayer._onConfiguration();break;case"service":return HDAPlayer._onService();break;case"connected":HDAPlayer._onConnected(C);break;case"movieBegin":HDAPlayer._onVideoBegin(C);break;case"movieEnd":HDAPlayer._onVideoEnd(C);break;case"bandwidthLevel":HDAPlayer._setBandwidthLevel(C);break;case"throwStartActions":HDAPlayer._onThrowStartActions(C);break;case"throwEndActions":HDAPlayer._onThrowEndActions(C);break;case"error":HDAPlayer._onError(C);break;case"externalInterfaceReady":console.debug("[FE] Received external interface ready signal :%o",HDAPlayer);this.initExternalInterface();break;case"playerReady":console.debug("[FE] Received player ready signal "+HDAPlayer);this.completeInit();break;case"missingStaticImage":console.debug("[FE] Received missing no-video image. ");HDAPlayer.configError="No-video image not found. Please check your configuration. Is this image missing?";break}try{HDAFacePlayer.events[A].fire(C)}catch(B){console.error("[FE] Unknown event received: '%s'",A)}},initExternalInterface:function(){if(!this.isExternalInterfaceInited){this.isExternalInterfaceInited=true}HDAFlashFacePlayer.flashProxy=document[HDAFlashFacePlayer.flashTagId]||window[HDAFlashFacePlayer.flashTagId];console.debug("Init flashProxy: ");console.debug(HDAFlashFacePlayer.flashProxy);_DHDA=HDAFlashFacePlayer.flashProxy;HDAChrome.init(HDAFlashFacePlayer.flashProxy);console.debug("[FP] Flash player assigned to _DHDA: %o",_DHDA)},findHDAInterface:function(B){if(this.hdaInterface!=null){return }try{var A=((B.HDAInterface)&&(B.HDAInterface.playerFrameName!=null))}catch(C){console.warn("[FE] Impossible to access to a frame. Ignore it finding HDAInterface.");console.warn("[FE] Error description is: "+C.message);return }if((!A)&&(B.frames.length==0)){console.debug("[FE] Interface not found in "+B.document.title+" and there are not child frames available");return }else{if(A){console.debug("[FE] Interface found in "+B.document.title);this.hdaInterface=B.HDAInterface;console.debug("[FE] Interface object "+this.hdaInterface);return }else{console.debug("[FE] Interface not found in "+B.document.title+". Looking on child frames.");for(var D=0;D<B.frames.length;D++){this.findHDAInterface(B.frames[D])}}}},events:{configuration:new HDAEvent("configuration"),connected:new HDAEvent("connected"),movieEnd:new HDAEvent("movieEnd"),throwStartActions:new HDAEvent("throwStartActions"),throwEndActions:new HDAEvent("throwEndActions"),moviePaused:new HDAEvent("moviePaused"),movieContinue:new HDAEvent("movieContinue"),movieSkipped:new HDAEvent("movieSkipped"),movieBegin:new HDAEvent("movieBegin"),bandwidthLevel:new HDAEvent("bandwidthLevel"),error:new HDAEvent("error"),externalInterfaceReady:new HDAEvent("externalInterfaceReady"),playerReady:new HDAEvent("playerReady"),missingStaticImage:new HDAEvent("missingStaticImage"),service:new HDAEvent("service")}};var _DHDA=null;var HDAInterface={firstKey:null,firstParams:null,playerFrameName:null,player:null,start:function(A){if((A!=null)&&(typeof (A)=="object")){console.debug("[PL] HDAInterface.start with a Object.");if(A.key){this.firstKey=A.key}if(A.params){this.firstParams=A.params}if(A.frame){this.playerFrameName=A.frame}else{this.playerFrameName="hda"}}else{if(!A){this.playerFrameName="hda"}else{this.playerFrameName=A}}this.findHDA(top);if(this.player===null){console.debug("[PL] Player not found. Assuming it is in init fase.");return }if(this.player._isPlayerInited()){console.debug("[PL] Player has been already initialized. Send meta...");this.sendMeta()}else{console.debug("[PL] Player found but not init yet.");this.player=null}},sendEvent:function(A,B){this.player.sendEvent(A,B,"interaction point")},sendFormEvent:function(A,B){this.player.sendEvent(A,B,"form")},sendMeta:function(){var D=document.getElementsByTagName("meta");var B=new Object();for(var A=0;A<D.length;A++){if(D[A].name!=null&&D[A].name.indexOf("hda-")==0){var C=D[A].name.substring(4,D[A].name.length);B[C]=D[A].content}}if(!!B.key){this.player.sendEvent(B.key,B.value,"start")}},findHDA:function(A){if(this.player){return }try{var D=A.document["_hda_flash_player"]||A["_hda_flash_player"]}catch(B){console.warn("[PL] Impossible to access to a frame. Ignore it finding Player.");console.warn("[PL] Error description is: "+B.message);return }if((!D)&&(A.frames.length==0)){console.debug("[PL] Player not found in "+A.document.title+" and there are not child frames available");return }else{if(D){console.debug("[PL] Player found in "+A.document.title);this.player=A.HDAPlayer;console.debug("[PL] Player object: %o",this.player);return }else{console.debug("[PL] Player not found in "+A.document.title+". Looking on child frames.");for(var C=0;C<A.frames.length;C++){this.findHDA(A.frames[C])}}}},playerFinalization:function(){this._to=setInterval((function(){if(!this._loops){this._loops=1}console.debug("[PL] Waiting for the HDA player initialisation... Number of loops: "+this._loops);this._loops++;if(this._loops>100){clearInterval(this._to);console.error("[PL] Failed finding player");return }this.findHDA(top);if(this.player){this.player.init();if(this.player.configError==null){if(this.firstKey!=null){console.debug("[PL] Send first request : key:"+this.firstKey+" params:"+this.firstParams);this.player.sendEvent(this.firstKey,this.firstParams,"start")}else{console.debug("[PL] Send Meta");this.sendMeta()}}clearInterval(this._to);console.debug("[PL] Player Finalized!");if(HDAUtils.cookie.read(HDAPlayer.HDA_PLAYER_STATUS)=="false"){console.debug("[PL] Player previously disabled by user. Disabling again");this.player.chrome._onFaceVideoOff();this.player._onFaceVideoOff()}if(this.player.currentBandwidthLevel=="text"){this.player.chrome.appendErrorMessage("hda-noVideoErrorMessage");this.player.chrome._onFaceVideoOff()}if(this.player.configError!=null){this.player.chrome.appendErrorMessage("hda-noVideoErrorMessage");this.player.chrome._onFaceVideoOff();console.error(this.player.configError)}return }}).bind(this),100)}};var HDAPlayer={HDA_PLAYER_STATUS:"hda-player-status",service:null,configError:null,brainObject:null,isVideoActive:true,isRenderingError:false,currentNode:null,currentMenu:null,referrerAction:null,protocol:"http",audioOnly:false,connected:false,enabled:true,endSequence:true,beginSequence:true,sequenceAborted:false,currentBandwidthLevel:"audio-video",nodeBuffer:new HDABuffer(),lastMenu:null,isInternalRequest:false,isPlayerInited:false,playMode:"normal",chrome:HDAChrome,firstInit:true,autoTextMode:false,skipMode:false,init:function(){this.chrome=HDAChrome;this.endSequence=true;this.beginSequence=true;this.sequenceAborted=false;this.lastMenu=null;this.isInternalRequest=false;this.playMode="normal";this.nodeBuffer=new HDABuffer();if(this.chrome.menuButtons){this.chrome.reset(true);this.events.playerReady.fire();return }this.chrome.init(this);this.events.playerReady.fire()},events:{configuration:new HDAEvent("configuration"),displayMenu:new HDAEvent("displayMenu"),renderForm:new HDAEvent("renderForm"),loadNode:new HDAEvent("loadNode"),loadRule:new HDAEvent("loadRule"),loadURL:new HDAEvent("loadURL"),videoBegin:new HDAEvent("videoBegin"),videoEnd:new HDAEvent("videoEnd"),faceVideoOn:new HDAEvent("faceVideoOn"),faceVideoOff:new HDAEvent("faceVideoOff"),faceSkip:new HDAEvent("faceSkip"),faceRepeat:new HDAEvent("faceRepeat"),faceLastMenu:new HDAEvent("faceLastMenu"),faceHelp:new HDAEvent("faceHelp"),menuChoice:new HDAEvent("menuChoice"),playerReady:new HDAEvent("playerReady"),nodeLoaded:new HDAEvent("nodeLoaded"),beginSequence:new HDAEvent("beginSequence"),endSequence:new HDAEvent("endSequence")},sendEvent:function(C,H,F){if((F===null)||(F==="undefined")){F=null;console.debug("[PL] Source not defined in sendEvent.")}if(!this.connected){var E=0;var B=setInterval((function(){E++;if(E>100){clearInterval(B);console.error("[PL] Connection failed, can't send event %s",C);if(E==101){HDAFacePlayer.fireEvent("error","connection-failed")}return }if(this.connected){clearInterval(B);this.sendEvent(C,H,F)}}).bind(this),100);return }this.playMode="normal";var D="hdaAudioOnly="+this.audioOnly+"&hdaStreamingProtocol="+this.protocol;if(!H||H=="undefined"){H=D}else{if(H instanceof String){H+=("&"+D)}else{if(typeof H==="object"){var A="";if(H["action_attributes"]){A=H["action_attributes"];delete H["action_attributes"];if(A.charAt(A.length)!="&"){A=A+"&"}}for(var G in H){A=A+G+"="+H[G]+"&"}if(A===""){A="&"}H=A+D}}}console.debug("[PL] Sending event: key=%o params=%o source=%o",C,H,F);this.brainObject.sendEvent({key:C,referrerActionId:this.referrerAction?this.referrerAction.actionId:null,params:H,source:F,serviceId:this.service},this._processResponse.bind(this));this.isInternalRequest=false;this.referrerAction=null},sendInternalEvent:function(A,B){this.sendEvent(A,B);this.isInternalRequest=true},disable:function(){this._abortSequence();this.enabled=false},enable:function(){this.enabled=true},_abortSequence:function(){this.sequenceAborted=true;this.endSequence=true;this.beginSequence=true;HDAFacePlayer.engine.stop()},_processResponse:function(A){if(!this.enabled){return }if(!A){console.debug("[PL] Null response");this._onError("null-response");return }console.debug("[PL] Response received. Now playing "+A.movie);if((A.movie==null)&&(this.isVideoActive)){console.debug("[PL] Detected a Rendering Error. Prepare to switch in text mode.");this.isRenderingError=true}else{if((this.isRenderingError)&&(this.isVideoActive)){console.debug("[PL] Restoring state after a previous Rendering Error.");this.isRenderingError=false;this.chrome._onFaceVideoOn()}}this.currentNode=A;if(!this.isInternalRequest){console.debug("[PL] Last request was not from a menu, resetting lastMenu");if(HDAPlayer.playMode!="repeat"){this.lastMenu=null;this._onFaceLastMenu();this.chrome.events.faceLastMenu.fire()}this.nodeBuffer=new HDABuffer()}if(HDAPlayer.playMode!="repeat"){this.currentMenu=null}this._detectSequenceBounds();this.sequenceAborted=false;if(this.beginSequence){console.debug("[PL] begin sequence");if(this.isRenderingError){console.debug("[PL] Switching to text mode due to a rendering error.");this.chrome._onFaceVideoOff()}this.nodeBuffer=new HDABuffer();this.chrome._onBeginSequence(this.currentNode);this.events.beginSequence.fire(this.currentNode)}this.nodeBuffer.store(this.currentNode);this._playMovie(A.movie);this.events.nodeLoaded.fire(this.currentNode);if(this.endSequence){console.debug("[PL] end sequence")}},_detectSequenceBounds:function(){this.beginSequence=this.endSequence;this.endSequence=false;if(this.currentNode&&this.currentNode.actions){for(var A=0;A<this.currentNode.actions.length;A++){switch(this.currentNode.actions[A].command){case"open-url":this.endSequence=true;break;case"menu":this.endSequence=true;break;case"form":this.endSequence=true;break;case"call-javascript":this.endSequence=true;break}}}else{this.endSequence=true}},_playMovie:function(A){HDAFacePlayer.engine.play(A)},_skipMovie:function(){HDAFacePlayer.engine.stop()},_onConfiguration:function(){if(this.configError!=null){return null}if((this.service===null)||(this.service===undefined)){if(this.configError===null){this.configError='Unable to load player configuration. Required parameter "service" is unavailable. Please check your configuration.';HDAFacePlayer.completeInit();return null}}console.debug("[PL] swf want configuration ");var B=null;var A={async:false,callback:function(C){console.debug("[PL] configuration received");B=C;return C}};this.brainObject.getPlayerConfiguration(this.service,A);console.info("[PL] get configuration to swf: %o",B);this.brainObject.traceClient(this.service,HDAClientLog.HDA_CONFIGURATION_REQUEST);if(!B){if(this.configError===null){this.configError="Unable to load player configuration. System is not initialized and it is not possible to get videos.";HDAFacePlayer.completeInit();return null}}return B},_onService:function(){return this.service},_onMenuChoice:function(A){console.debug("[PL] Menu item %o selected",this.currentMenu.children[A]);this.lastMenu={menu:this.currentMenu,alternativeTextHTML:this.chrome.getAlternativeTextHTML(),caption:this.chrome.getCaption()};this._runActionOnMovieEnd(this.currentMenu.children[A],true);this.events.menuChoice.fire(A)},_onFaceVideoOn:function(){console.debug("[PL] _onFaceVideoOn invoked. AutoTextMode value -> "+this.autoTextMode);if(HDAClientLog.traceClient){this.brainObject.traceClient(this.service,HDAClientLog.HDA_FACE_VIDEO_ON)}console.debug("[PL] Setting "+this.HDA_PLAYER_STATUS+" to on using cookie");HDAUtils.cookie.write(this.HDA_PLAYER_STATUS,true,30);if(this.autoTextMode){console.debug("[PL] Video ON after an error. Reinit the player");this.currentBandwidthLevel="audio-video";this.autoTextMode=false;HDAFlashFacePlayer.flashProxy.reinitPlayer();return }console.debug("[PL] Restart Idle video");HDAFacePlayer.engine.videoOn();console.debug("[PL] Video ON");this.events.faceVideoOn.fire();this.isVideoActive=true},_onFaceVideoOff:function(){if(HDAClientLog.traceClient){this.brainObject.traceClient(this.service,HDAClientLog.HDA_FACE_VIDEO_OFF)}console.debug("[PL] Setting "+this.HDA_PLAYER_STATUS+" to off using cookie");HDAUtils.cookie.write(this.HDA_PLAYER_STATUS,false,30);console.debug("[PL] Freeze Idle video");HDAFacePlayer.engine.videoOff();console.debug("[PL] Video OFF");this.events.faceVideoOff.fire();this.isVideoActive=false},_onFaceSkip:function(){if(HDAClientLog.traceClient){this.brainObject.traceClient(this.service,HDAClientLog.HDA_FACE_SKIP)}console.debug("[PL] Skip");this.skipMode=true;this.events.faceSkip.fire();this._skipMovie()},_onFaceLastMenu:function(){if(this.lastMenu){console.debug("[PL] Last menu");this._abortSequence();this.currentMenu=this.lastMenu.menu;this.chrome._onDisplayMenu(this.lastMenu.menu);this.events.displayMenu.fire(this.lastMenu.menu);this.chrome.setAlternativeTextHTML(this.lastMenu.alternativeTextHTML);this.chrome.setCaption(this.lastMenu.caption)}this.events.faceLastMenu.fire()},_onFaceRepeat:function(){if(HDAClientLog.traceClient){this.brainObject.traceClient(this.service,HDAClientLog.HDA_FACE_REPEAT)}console.debug("[PL] Repeat");this.nodeBuffer.rewind();this.playMode="repeat";this.chrome._onBeginSequence();this.currentNode=this.nodeBuffer.fetch();if(this.currentNode){this._playMovie(this.currentNode.movie)}this.events.beginSequence.fire(this.currentNode);this.events.faceRepeat.fire()},_onFaceHelp:function(){if(HDAClientLog.traceClient){this.brainObject.traceClient(this.service,HDAClientLog.HDA_FACE_HELP)}this.events.faceHelp.fire()},_onConnected:function(A){if(HDAClientLog.traceClient){this.brainObject.traceClient(this.service,HDAClientLog.HDA_CONNECTED,"protocol="+A+";")}this.protocol=A;this.connected=true},_setBandwidthLevel:function(A){if(this.currentBandwidthLevel==A){console.debug('[PL] Not changing the bandwidth level. It is already at level "'+A+'"');return }this.currentBandwidthLevel=A;console.debug("[PL] Setting bandwidth to level %o",A);if(A=="text"){this.autoTextMode=true;this.audioOnly=false;if(!this.isPlayerInited){this.connected=true;HDAFacePlayer.fireEvent("playerReady");if(HDAClientLog.traceClient){this.brainObject.traceClient(this.service,HDAClientLog.HDA_BANDWIDTH_LEVEL,"level="+A+";")}return }HDAChrome.appendErrorMessage("hda-noVideoErrorMessage");HDAChrome._onFaceVideoOff()}else{if(A=="audio"){this.audioOnly=true}else{if(A=="audio-video"){this.audioOnly=false;console.debug("New level set: audioOnly -> "+this.audioOnly);HDAChrome._onFaceVideoOn()}}}if(HDAClientLog.traceClient){this.brainObject.traceClient(this.service,HDAClientLog.HDA_BANDWIDTH_LEVEL,"level="+A+";")}},_setPlayerInited:function(A){this.isPlayerInited=A},_isPlayerInited:function(){return this.isPlayerInited},_resetAutoTextMode:function(){this.autoTextMode=false},_onVideoBegin:function(){console.debug("[PL] Player informs us that movie has BEGAN ("+this.playMode+")");this._detectSequenceBounds();this.chrome._onVideoBegin(this.currentNode,this.playMode);this.events.videoBegin.fire(this.currentNode,this.playMode)},_onThrowStartActions:function(){this._runActions(0,true,false)},_onThrowEndActions:function(){var A=true;if(this.playMode=="repeat"){A=false}this._runActions(-1,A,false)},_onVideoEnd:function(){console.debug("[PL] Player informs us that movie has ENDED");if(this.sequenceAborted){console.debug("[PL] Sequence aborted");return }this.events.videoEnd.fire(this.currentNode,this.playMode);if(this.skipMode===true){console.debug("[PL] Skip mode activated, using Dummy player");HDAFacePlayer.engine=HDADummyFacePlayer}var A=true;if(this.playMode=="repeat"){A=false;this.currentNode=this.nodeBuffer.fetch();if(this.currentNode){this._playMovie(this.currentNode.movie);return }else{this.playMode="normal";this.currentNode=this.nodeBuffer.latest();this.chrome._onEndSequence()}}if(this.endSequence){this.chrome._onEndSequence();this.events.endSequence.fire();if(this.skipMode===true){console.debug("[PL] End sequence detected. Skip mode active -> Diabling Skip Mode");HDAFacePlayer.engine=HDAFlashFacePlayer;this.skipMode=false}}this._runActions(-1,A,true)},_runActions:function(A,C,D){if(this.currentNode&&this.currentNode.actions){for(var B=0;B<this.currentNode.actions.length;B++){if(this.currentNode.actions[B].runAt==A){if(D===false){this._runAction(this.currentNode.actions[B],C)}else{this._runActionOnMovieEnd(this.currentNode.actions[B],C)}}}}},_runActionOnMovieEnd:function(action,openUrls){switch(action.command){case"open-url":if(openUrls){var url={method:action.params["method"]?action.params["method"]:"GET",url:action.target,target:action.params["where"],popup:{width:action.params["width"],height:action.params["height"]}};this.events.loadURL.fire(url)}break;case"call-javascript":try{var f=eval(action.target);var extractParams=function(params){var o={};if(params){var pairs=params.split("&");for(var i=0,s=pairs.length;i<s;i++){var pair=pairs[i].split("=");var name=unescape(pair[0]);var value=unescape(pair[1]);o[name]=value}}return o};f(extractParams(action.params["action_attributes"]))}catch(e){console.error(e)}break;case"load-item":this.referrerAction=action;this.sendInternalEvent(action.target,action.params);this.events.loadNode.fire(this.currentNode,this.playMode);break;default:if(HDAClient.runCustomAction){HDAClient.runCustomAction(action)}break}},_runAction:function(action,openUrls){this.referrerAction=action;switch(action.command){case"open-url":if(openUrls){if(action.runAt==0){var url={method:action.params["method"]?action.params["method"]:"GET",url:action.target,target:action.params["where"],popup:{width:action.params["width"],height:action.params["height"]}};this.events.loadURL.fire(url)}}break;case"call-javascript":if(action.runAt==0){try{var f=eval(action.target);var extractParams=function(params){var o={};if(params){var pairs=params.split("&");for(var i=0,s=pairs.length;i<s;i++){var pair=pairs[i].split("=");var name=unescape(pair[0]);var value=unescape(pair[1]);o[name]=value}}return o};f(extractParams(action.params["action_attributes"]))}catch(e){console.error(e)}}break;case"menu":if(HDAPlayer.playMode!="repeat"){this.currentMenu=action;this.chrome.displayMenu(action);this.events.displayMenu.fire(action)}else{this.chrome.displayMenu(this.currentMenu);this.events.displayMenu.fire(this.currentMenu)}break;case"form":this.chrome.renderForm(action);this.events.renderForm.fire(action)}},_onError:function(A,B){if(HDAClientLog.traceClient){this.brainObject.traceClient(this.service,HDAClientLog.HDA_ERROR,"error="+A+";message="+B+";")}if((A=="connection-failed")&&(HDAPlayer.firstInit)){HDAPlayer.firstInit=false;HDAFacePlayer.fireEvent("playerReady")}else{this.autoTextMode=true;this.chrome.appendErrorMessage(A,B);this.chrome._onFaceVideoOff();this.chrome.events.faceVideoOff.fire()}console.debug("[PL] received error: "+A)}};function HDABuffer(){this.items=new Array();this.next=0}HDABuffer.prototype={fetch:function(){if(this.next>=this.items.length){return null}return this.items[this.next++]},store:function(A){this.items.push(A)},rewind:function(){this.next=0},latest:function(){if(this.next>0){return this.items[this.next-1]}return null}};var HDAUtils={element:{hasClassName:function(A,B){A=HDASearchTag(A);return !!A.className.match(new RegExp("\\b"+B+"\\b"))},addClassName:function(A,B){A=HDASearchTag(A);if(!this.hasClassName(A,B)){A.className=(A.className+" "+B)}},removeClassName:function(A,B){A=HDASearchTag(A);if(this.hasClassName(A,B)){A.className=A.className.replace(B,"")}}},DOMEvent:{observe:function(B,C,A){B=HDASearchTag(B);if(C=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||B.attachEvent)){C="keydown"}if(B.addEventListener){B.addEventListener(C,A,true)}else{if(B.attachEvent){B.attachEvent("on"+C,A)}}},getTarget:function(A){if(!A){A=window.event}var B=A.target||A.srcElement;if(B&&B.nodeName&&"#TEXT"==B.nodeName.toUpperCase()){return B.parentNode}else{return B}}},cookie:{write:function(C,D,E){if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));var A="; expires="+B.toGMTString()}else{var A=""}document.cookie=C+"="+D+A+"; path=/"},read:function(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return null},erase:function(A){this.write(A,"",-1)}},copyObject:function(B){if(typeof (B)!="object"){return B}if(B==null){return B}var C=new Object();for(var A in B){C[A]=B[A]}return C},camelize:function(A){return A.charAt(0).toLowerCase()+A.substring(1)}};if(!Function.prototype.bind){Function.prototype.bind=function(B){var A=this;return function(){return A.apply(B,arguments)}}}if(typeof HDASearchTag=="undefined"){window.HDASearchTag=function(A){if(typeof A=="string"){element=document.getElementById(A)}else{element=A}return element}}function HDAEvent(A){this.name=A;this.subscribers=new Array();this.subscribe=function(D,C){for(var B=0;B<this.subscribers.length;B++){if(this.subscribers[B].fn==D){return }}this.subscribers.push({fn:D,scope:C})};this.unsubscribe=function(D,C){for(var B=0;B<this.subscribers.length;B++){if(this.subscribers[B].fn==D){this.subscribers.splice(B,1);return }}};this.fire=function(){var B=[];for(var C=0;C<arguments.length;++C){B.push(arguments[C])}for(C=0;C<this.subscribers.length;C++){this.subscribers[C].fn.apply(this.subscribers[C].scope,B)}}}if(!("console" in window)||!("firebug" in console)){var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];window.console={};for(var i=0;i<names.length;++i){window.console[names[i]]=function(){}}}var HDAClient={init:function(){this.initChrome();HDAPlayer.events.loadURL.subscribe(this.handleUrl,this);HDAFacePlayer.events.error.subscribe(this.handleError,this);HDAPlayer.events.faceHelp.subscribe(function(){HDASearchTag("hda-textArea").innerHTML="<p>&nbsp;</p>"})},initXMLHttpRequest:function(){var A=navigator.userAgent.toLowerCase();var B=null;if(!window.ActiveXObject){B=new XMLHttpRequest()}else{if(A.indexOf("msie 5")==-1){B=new ActiveXObject("Msxml2.XMLHTTP")}else{B=new ActiveXObject("Microsoft.XMLHTTP")}}return B},handleError:function(A){if(A=="connection-failed"){var B="http://localhost:8080/brain/player-connection-error.jsp";var C=this.initXMLHttpRequest();C.open("GET",B,true);C.send(null)}},handleUrl:function(A){if(A.method=="POST"){this.handlePostMethod(A)}else{this.handleGetMethod(A)}},runCustomAction:function(A){},handleGetMethod:function(B){if(B.target=="_popup"){var A=window.open(B.url,"name","height="+B.popup.height+",width="+B.popup.width);if(A&&window.focus){A.focus()}}else{if(B.target=="_self"){location.href=B.url}else{if(B.target=="_parent"){top.opener.location.href=B.url}else{if(B.target=="_blank"){A=window.open(B.url);if(A&&window.focus){A.focus()}}else{var C=top.frames[B.target];if(C){C.location.href=B.url}else{A=window.open(B.url);if(A&&window.focus){A.focus()}}}}}}},handlePostMethod:function(E){var A=E.url.split("?");var B;if(A.length>1){B=A[0];A=A[1]}else{B=A[0];A=null}var H;var I=[],G=[];if(A!=null){H=A.split("&");for(i=0;i<H.length;i++){pair=H[i];var D=pair.split("=");I.push(D.shift());G.push(D.shift())}}if(E.target=="_popup"){var C=this.openWindowWithPost(B,"name",I,G,E.popup.height,E.popup.width);if(C&&window.focus){C.focus()}}else{if(E.target=="_self"){this.openUrlWithPost(document,B,I,G)}else{if(E.target=="_parent"){this.openUrlWithPost(top.opener.document,B,I,G)}else{if(E.target=="_blank"){var C=this.openWindowWithPost(B,"name",I,G);if(C&&window.focus){C.focus()}}else{var F=top.frames[E.target];if(F){this.openUrlWithPost(F,B,I,G)}else{var C=this.openWindowWithPost(B,"name",I,G);if(C&&window.focus){C.focus()}}}}}}},initChrome:function(){var B=HDASearchTag("hda-menu-body");if(B&&B.tagName=="TBODY"){var C=document.createElement("tr");C.id="hda-menu-bottom";C.appendChild(document.createElement("td"));B.appendChild(C)}var A=new hda_scroller({windowWidth:170,windowHeight:120,container:"hda-textArea"});if(HDASearchTag("hda-textWidgetScrollUp")!=null&&HDASearchTag("hda-textWidgetScrollDown")!=null){HDASearchTag("hda-textWidgetScrollUp").onmouseover=function(){A.scrollUp()};HDASearchTag("hda-textWidgetScrollDown").onmouseover=function(){A.scrollDown()};HDASearchTag("hda-textWidgetScrollDown").onmouseout=function(){A.stopScroll()};HDASearchTag("hda-textWidgetScrollUp").onmouseout=function(){A.stopScroll()}}HDASearchTag("hda-textArea").style.visibility="visible";HDAPlayer.events.videoBegin.subscribe(function(){A.scrollToTop()},this)},openWindowWithPost:function(D,C,F,B,E,A){var H=null;if(E&&A){H="height="+A+",width="+E}var G=window.open(D,C,H);if(!G){return false}this.openUrlWithPost(G.document,D,F,B);return G},openUrlWithPost:function(F,B,E,A){var D="";D+="<html><head></head><body><form id='formid' method='post' action='"+B+"'>";if(E&&A&&(E.length==A.length)){for(var C=0;C<E.length;C++){D+="<input type='hidden' name='"+E[C]+"' value='"+A[C]+"'/>"}}D+="</form><script type='text/javascript'>document.getElementById(\"formid\").submit()<\/script></body></html>";F.write(D)}};function hda_scroller(A){this.windowWidth=A.windowWidth;this.windowHeight=A.windowHeight;this.container=document.getElementById(A.container);this.offsetTop=this.container.offsetTop;this.amount=A.amount||10;this.time=A.time||100;this.container.style.clip="rect(0,"+this.windowWidth+"px, "+this.windowHeight+"px,0)";this._top=0;this._bottom=this.windowHeight}hda_scroller.prototype.scrollDown=function(){if(this._bottom>this.container.offsetHeight){return }this._top+=this.amount;this._bottom+=this.amount;this.offsetTop-=this.amount;this.scroll();obj=this;this.to=setTimeout(function(){obj.scrollDown()},this.time)};hda_scroller.prototype.scrollUp=function(){if(this._top<=0){return }this._top-=this.amount;this._bottom-=this.amount;this.offsetTop+=this.amount;this.scroll();obj=this;this.to=setTimeout(function(){obj.scrollUp()},this.time)};hda_scroller.prototype.scroll=function(){this.container.style.clip="rect("+this._top+"px,"+this.windowWidth+"px,"+this._bottom+"px,0)";this.container.style.top=this.offsetTop+"px"};hda_scroller.prototype.stopScroll=function(){if(this.to){clearTimeout(this.to)}};hda_scroller.prototype.scrollToTop=function(){this._top=0;this.offsetTop=0;this.scroll()};var NL={setNLCookie:function(A){NL.setMyCookie("NL_cookie",A,365,"/")},setMyCookie:function(B,E,C,I,D,A){var G="";for(var H in E){G=G+H+"="+E[H]+"&"}if(G.length>0){G=G.substring(0,G.length-1)}valueNoPlus=G.replace(/\+/g," ");var F=new Date();F.setTime(F.getTime()+(1000*60*60*24*C));document.cookie=B+"="+encodeURIComponent(valueNoPlus)+((C)?";expires="+F.toGMTString():"")+((I)?";path="+I:"")+((D)?";domain="+D:"")+((A)?";secure":"")},setNLCookieFromHiddenDiv:function(){NL.setMyCookieFromHiddenDiv("NL_cookie","nl_cookie",365,"/")},setMyCookieFromHiddenDiv:function(B,C,A,H,E,G){var D=document.getElementById(C).innerHTML;valueNoPlus=D.replace(/\+/g," ");valueNoPlus=D.replace(/&amp;/g,"&");var F=new Date();document.cookie=B+"="+encodeURIComponent(valueNoPlus)+";expires="+F.toGMTString();F.setTime(F.getTime()+(1000*60*60*24*A));document.cookie=B+"="+encodeURIComponent(valueNoPlus)+((A)?";expires="+F.toGMTString():"")+((H)?";path="+H:"")+((E)?";domain="+E:"")+((G)?";secure":"")},getNLCookie:function(){name="NL_cookie";var C=document.cookie.indexOf(name+"=");var A=C+name.length+1;if((!C)&&(name!=document.cookie.substring(0,name.length))){return""}if(C==-1){return""}var B=document.cookie.indexOf(";",A);if(B==-1){B=document.cookie.length}return decodeURIComponent(document.cookie.substring(A,B))},getCookie:function(C){var D=document.cookie.indexOf(C+"=");var A=D+C.length+1;if((!D)&&(C!=document.cookie.substring(0,C.length))){return""}if(D==-1){return""}var B=document.cookie.indexOf(";",A);if(B==-1){B=document.cookie.length}return decodeURIComponent(document.cookie.substring(A,B))},addNLCookie:function(A){tmpCookie=NL.getNLCookie()+"&";for(var B in A){tmpCookie=tmpCookie+B+"="+A[B]+"&"}if(tmpCookie.length>0){tmpCookie=tmpCookie.substring(0,tmpCookie.length-1)}valueNoPlus=tmpCookie.replace(/\+/g," ");name="NL_cookie";expiredays=365;path="/";var C=new Date();document.cookie=name+"="+encodeURIComponent(valueNoPlus)+";expires="+C.toGMTString();C.setTime(C.getTime()+(1000*60*60*24*expiredays));document.cookie=name+"="+encodeURIComponent(valueNoPlus)+((expiredays)?";expires="+C.toGMTString():"")+((path)?";path="+path:"")},isAlreadyVisit:function(A){if(NL.getNLCookie()==""){name="NL_userList";expiredays=365;path="/";var B=new Date();B.setTime(B.getTime()+(1000*60*60*24*expiredays));document.cookie=name+"="+encodeURIComponent(A+"&")+((expiredays)?";expires="+B.toGMTString():"")+((path)?";path="+path:"");return false}if(NL.getCookie("NL_userList").indexOf(A)==-1){tmpCookie=NL.getCookie("NL_userList");name="NL_userList";expiredays=365;path="/";var B=new Date();document.cookie=name+"="+encodeURIComponent("")+";expires="+B.toGMTString();B.setTime(B.getTime()+(1000*60*60*24*expiredays));document.cookie=name+"="+encodeURIComponent(tmpCookie+A+"&")+((expiredays)?";expires="+B.toGMTString():"")+((path)?";path="+path:"");return false}else{return true}},extractAttributeFromCookieByName:function(B){cookieString=NL.getNLCookie();var E=cookieString.split("&");for(var C=0;C<E.length;C++){var F=E[C].indexOf("=");var A=E[C].substring(0,F);var D=E[C].substring(F+1);if(A==B){return D}}return""},getObjectFromDateAttribute:function(A){date={};date["day"]=A.getDate();date["month"]=A.getMonth();date["year"]=A.getYear()},extractAttributesFromCookie:function(){attr={};cookieString=NL.getNLCookie();var D=cookieString.split("&");for(var B=0;B<D.length;B++){var A=D[B].substring(0,pos);var C=D[B].substring(pos+1);attr[A]=C}return attr},hideLandingFooter:function(){document.getElementById("footer_assurance").style.visibility="hidden";document.getElementById("bannerNav_landing").style.visibility="hidden"},fillCSVDataFromNeolane:function(A){var B=new Mornay.form();B.init("formError","ulError","formContainer","confirmation","singleConfirmation","coupleConfirmation");B.fillFromNeolane(A)}};function Querystring(A){this.params={};if(A==null){A=location.search.substring(1,location.search.length)}if(A.length==0){return }A=A.replace(/\+/g," ");var C=A.split("&");for(var D=0;D<C.length;D++){var F=C[D].split("=");var B=decodeURIComponent(F[0]);var E=(F.length==2)?decodeURIComponent(F[1]):B;this.params[B]=E}}Querystring.prototype.get=function(A,B){var C=this.params[A];return(C!=null)?C:B};Querystring.prototype.contains=function(A){var B=this.params[A];return(B!=null)}
