String.prototype.trim=function(){return this.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var objMouseOver={};function fnMouseOver(a,b){objMouseOver[a]=a.src;a.src=b}function fnMouseOut(a){a.src=objMouseOver[a]}function isNull(a){return a==null}function $Id(a){return document.getElementById(a)}function $(a){return document.getElementById(a)}
function fnPageLoad(a){var b=document.getElementById("frmLogin");if(b)b.Username.focus();else if(!self.NoQSFocus)(b=document.getElementById("frmQuickSearch"))&&b.txtQSText.focus();if(self.arrPreloads){b=arrPreloads.length;for(var d=0;d<b;d++)(new Image).src=arrPreloads[d]}self.fnPageLoadLocal&&fnPageLoadLocal();fnSetNavDefault(a)}function fnTargetNew(a){window.open(a.href);return false}
function fnViewHelp(a,b){window.open(a.href+"?Page="+b,"winHelp","width=800,height=500,menubar=no,scrollbars=yes");return false}function fnPleaseWait(){document.body.style.cursor="wait";var a=fnPleaseWait.arguments;if(a.length>0)a[0].style.cursor="wait"}
function fnQuickSearch(){var a=document.getElementById("frmQuickSearch"),b=a.txtQSText;b.value=b.value.replace(/%/g,"");b.value=b.value.replace(/^\s*|\s*$/g,"");if(b.value.length>0){document.body.style.cursor="wait";a.style.cursor="wait";a.submit()}else{b.focus();return false}}
function fnBookLists(a){var b;b=document.frmSideMenus.cmbBookLists!=null?document.frmSideMenus.cmbBookLists.selectedIndex>-1?document.frmSideMenus.cmbBookLists.options[document.frmSideMenus.cmbBookLists.selectedIndex].value:"0":"0";switch(a){case "view":if(b!="0"){a="/BookLists/View/ViewList.php?ID="+b;window.location=a}else document.frmSideMenus.cmbBookLists==null?alert("You don't currently have any book lists to view."):alert("Please select which list you would like to view.");break;case "new":a=
"/BookLists/NewBookList.php";window.open(a,"winNewList","status=0,scrollbars=0,resizable=0,width=640,height=250");break;case "order":if(b!="0"){a="/BookLists/Order/PlaceOrder.php?ListID="+b;window.location=a}else alert("Please select a list to place an order for.");break;case "print":if(b!="0"){a="/BookLists/Print/default.php?ListID="+b;window.location=a}else alert("Please select a list to print.");break;default:alert("unknow option -- "+a)}return false}
function fnAnnouncementDetails(){window.open("/announcements/arquiz.php","winAnnouncement","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=600").focus()}function fnShowBookDetails(a,b){window.open("/utilities/BookDetails.php?TitleNo="+a+"&AddTitle="+b,"winBookDetails","menubar=no,status=yes,scrollbars=yes,resizable=no,width=640,height=700").focus()}
function fnShowAuthorBiblio(a){window.open("/libcorner/showcase/AuthorDetail.php?TITLENO="+a,"winAuthorBiblio","menubar=no,status=yes,scrollbars=yes,resizable=yes,width=800,height=700").focus()}function fnChangePage(a){var b=document.getElementById("frmTitleList");b.Page.value=a;document.body.style.cursor="wait";b.style.cursor="wait";b.submit()}function fnCenterWindow(a,b){window.moveTo((screen.availWidth-b)/2-30,(screen.availHeight-a)/2-30)}
function fnSettingChange(a,b){var d=document.getElementById("frmTitleList");a=a.selectedIndex;switch(b){case "SORT0":document.getElementById("cmbSORT1").selectedIndex=a;document.getElementById("Sort").value=document.getElementById("cmbSORT0")[a].value;break;case "SORT1":document.getElementById("cmbSORT0").selectedIndex=a;document.getElementById("Sort").value=document.getElementById("cmbSORT0")[a].value;break;case "DISPLAY0":document.getElementById("cmbDISPLAY1").selectedIndex=a;document.getElementById("Num").value=
document.getElementById("cmbDISPLAY0")[a].value;break;case "DISPLAY1":document.getElementById("cmbDISPLAY0").selectedIndex=a;document.getElementById("Num").value=document.getElementById("cmbDISPLAY0")[a].value;break}d.submit()}
function fnSaveDisplaySettings(){var a=new AJAX,b="search";if(document.location.href.indexOf("/mybookstore/booklists/ViewList.php")>=0)b="booklist";var d=document.getElementById("cmbSORT0")[document.getElementById("cmbSORT0").selectedIndex].value,c=document.getElementById("cmbDISPLAY0")[document.getElementById("cmbDISPLAY0").selectedIndex].value;b="/ajax/SaveDisplaySettings.php?ViewSort="+escape(d)+"&ViewPage="+escape(c)+"&Page="+escape(b);a.open("GET",b,true);a.send(null)}var intOldQty=0;
function fnSetOldQty(a){intOldQty=document.getElementById("frmTitleListData")["txtQty"+a].value}
function fnUpdateQuantities(a,b,d,c,f){var h=new AJAX,g=0,e=document.getElementById("frmTitleListData");if(c<=0){alert("Please give your new list a name and then click go.");e.txtNEWLIST0.focus()}else{var k="txtQty"+d,m="txtCom"+d,o="cmbPRI"+d,q="chkARQ"+d;a=document.getElementById("txtItem"+d).value;m=document.getElementById(m).value;o=e[o].type=="hidden"?e[o].value:e[o].options[e[o].selectedIndex].value;var s;s=document.getElementById("spnARQ"+d);var D=document.getElementById("spnBooklist"+d),u=
e[k].value;if(isNaN(u))u=b;else if(b==1)u++;else b==0&&u--;if(s&&document.getElementById("readingProgramDisplay"+d).style.display!="none")s.style.display=u>0?"":"none";if(D&&document.getElementById("booklistDisplay"+d).style.display!="none")D.style.display=u>0?"":"none";s=e[q].checked==true?"Y":"N";e[k].value=u<=0?"0":u;var B=document.getElementById("BottomTOTALPrice");if(B){var p=document.getElementById("TopTotalsTitles");k=document.getElementById("TopTotalsItems");D=document.getElementById("TopTotalsPrice");
var v=document.getElementById("Class"+d),z=v.innerHTML.charAt(v.innerHTML.length-1);if(z=="R"||z=="S")z="N";if(z=="A"||z=="C")z="B";if(z!="B"&&z!="E"&&z!="F"&&z!="N")z="";var H,C;if(z=="N"){H=v.innerHTML.charAt(0);C=document.getElementById("Bottom"+H+"Items");H=document.getElementById("Bottom"+H+"Price")}v=document.getElementById("Bottom"+z+"Items");var x=document.getElementById("Bottom"+z+"Price"),t=document.getElementById("BottomPriority "+o+"Items"),l=document.getElementById("BottomPriority "+
o+"Price"),n=document.getElementById("Avail"+d).innerHTML;if(n=="TEMP OS")n="Temp OS";else if(n=="")n="Unavailable";var r=document.getElementById("BottomSUBTOTALItems"),y=document.getElementById("BottomSUBTOTALPrice"),E=document.getElementById("BottomTOTALItems"),J=document.getElementById("BottomTOTALPrice"),I=document.getElementById("BottomAR QuizzesItems"),K=document.getElementById("BottomAR QuizzesPrice"),w=document.getElementById("BottomPROCESSINGPrice"),A=document.getElementById("Bottom"+n+"Items"),
F=document.getElementById("Bottom"+n+"Price"),G=document.getElementById("TotalTitlesFound0"),L=document.getElementById("TotalTitlesFound1");if(b==1){if(u==1){if(e[q].checked==true)I.innerHTML=fnFormatThousands(+I.innerHTML.replace(/,/g,"")+1);p.innerHTML=fnFormatThousands(+p.innerHTML.replace(/,/g,"")+1)}if(z.length>0){v.innerHTML=fnFormatThousands(+v.innerHTML.replace(/,/g,"")+1);x.innerHTML=fnFormatThousands((+x.innerHTML.replace(/,/g,"")+ +document.getElementById("Price"+d).innerHTML.replace(/,/g,
"")).toFixed(2));t.innerHTML=fnFormatThousands(+t.innerHTML.replace(/,/g,"")+1);l.innerHTML=fnFormatThousands((+l.innerHTML.replace(/,/g,"")+ +document.getElementById("Price"+d).innerHTML.replace(/,/g,"")).toFixed(2));J.innerHTML=fnFormatThousands((+J.innerHTML.replace(/,/g,"")+ +document.getElementById("Price"+d).innerHTML.replace(/,/g,"")).toFixed(2));E.innerHTML=fnFormatThousands(+E.innerHTML.replace(/,/g,"")+1)}r.innerHTML=fnFormatThousands(+r.innerHTML.replace(/,/g,"")+1);y.innerHTML=fnFormatThousands((+y.innerHTML.replace(/,/g,
"")+ +document.getElementById("Price"+d).innerHTML.replace(/,/g,"")).toFixed(2));w.innerHTML=fnFormatThousands((+w.innerHTML.replace(/,/g,"")+ +document.getElementById("ProcCharge"+d).innerHTML.replace(/,/g,"")).toFixed(2));if(n!=""){A.innerHTML=fnFormatThousands(+A.innerHTML.replace(/,/g,"")+1);F.innerHTML=fnFormatThousands((+F.innerHTML.replace(/,/g,"")+ +document.getElementById("Price"+d).innerHTML.replace(/,/g,"")).toFixed(2))}if(z=="N"){C.innerHTML=fnFormatThousands(+C.innerHTML.replace(/,/g,
"")+1);H.innerHTML=fnFormatThousands((+H.innerHTML.replace(/,/g,"")+ +document.getElementById("Price"+d).innerHTML.replace(/,/g,"")).toFixed(2))}}else if(b==0){if(u>=0){if(u==0){if(e[q].checked==true){I.innerHTML=fnFormatThousands(+I.innerHTML.replace(/,/g,"")-1);e[q].checked=false}p.innerHTML=fnFormatThousands(+p.innerHTML.replace(/,/g,"")-1);if(f==0){G.innerHTML=fnFormatThousands(+G.innerHTML.replace(/,/g,"")-1);L.innerHTML=fnFormatThousands(+L.innerHTML.replace(/,/g,"")-1)}}if(z.length>0){v.innerHTML=
fnFormatThousands(+v.innerHTML.replace(/,/g,"")-1);x.innerHTML=fnFormatThousands((+x.innerHTML.replace(/,/g,"")-+document.getElementById("Price"+d).innerHTML.replace(/,/g,"")).toFixed(2));t.innerHTML=fnFormatThousands(+t.innerHTML.replace(/,/g,"")-1);l.innerHTML=fnFormatThousands((+l.innerHTML.replace(/,/g,"")-+document.getElementById("Price"+d).innerHTML.replace(/,/g,"")).toFixed(2));J.innerHTML=fnFormatThousands((+J.innerHTML.replace(/,/g,"")-+document.getElementById("Price"+d).innerHTML.replace(/,/g,
"")).toFixed(2));E.innerHTML=fnFormatThousands(+E.innerHTML.replace(/,/g,"")-1)}r.innerHTML=fnFormatThousands(+r.innerHTML.replace(/,/g,"")-1);y.innerHTML=fnFormatThousands((+y.innerHTML.replace(/,/g,"")-+document.getElementById("Price"+d).innerHTML.replace(/,/g,"")).toFixed(2));w.innerHTML=fnFormatThousands((+w.innerHTML.replace(/,/g,"")-+document.getElementById("ProcCharge"+d).innerHTML.replace(/,/g,"")).toFixed(2));if(n!=""){A.innerHTML=fnFormatThousands(+A.innerHTML.replace(/,/g,"")-1);F.innerHTML=
fnFormatThousands((+F.innerHTML.replace(/,/g,"")-+document.getElementById("Price"+d).innerHTML.replace(/,/g,"")).toFixed(2))}if(z=="N"){C.innerHTML=fnFormatThousands(+C.innerHTML.replace(/,/g,"")-1);H.innerHTML=fnFormatThousands((+H.innerHTML.replace(/,/g,"")-+document.getElementById("Price"+d).innerHTML.replace(/,/g,"")).toFixed(2))}}}else if(u>=0){if(u==0&&intOldQty!=0){if(e[q].checked==true){I.innerHTML=fnFormatThousands(+I.innerHTML.replace(/,/g,"")-1);e[q].checked=false}p.innerHTML=fnFormatThousands(+p.innerHTML.replace(/,/g,
"")-1);if(f==0){G.innerHTML=fnFormatThousands(+G.innerHTML.replace(/,/g,"")-1);L.innerHTML=fnFormatThousands(+L.innerHTML.replace(/,/g,"")-1)}}else if(intOldQty==0){if(e[q].checked==true)I.innerHTML=fnFormatThousands(+I.innerHTML.replace(/,/g,"")+1);p.innerHTML=fnFormatThousands(+p.innerHTML.replace(/,/g,"")+1)}b=u-intOldQty;if(z.length>0){v.innerHTML=fnFormatThousands(+v.innerHTML.replace(/,/g,"")+b);x.innerHTML=fnFormatThousands((+x.innerHTML.replace(/,/g,"")+ +(document.getElementById("Price"+
d).innerHTML.replace(/,/g,"")*b)).toFixed(2));t.innerHTML=fnFormatThousands(+t.innerHTML.replace(/,/g,"")+b);l.innerHTML=fnFormatThousands((+l.innerHTML.replace(/,/g,"")+ +(document.getElementById("Price"+d).innerHTML.replace(/,/g,"")*b)).toFixed(2));J.innerHTML=fnFormatThousands((+J.innerHTML.replace(/,/g,"")+ +(document.getElementById("Price"+d).innerHTML.replace(/,/g,"")*b)).toFixed(2));E.innerHTML=fnFormatThousands(+E.innerHTML.replace(/,/g,"")+b)}r.innerHTML=fnFormatThousands(+r.innerHTML.replace(/,/g,
"")+b);y.innerHTML=fnFormatThousands((+y.innerHTML.replace(/,/g,"")+ +(document.getElementById("Price"+d).innerHTML.replace(/,/g,"")*b)).toFixed(2));w.innerHTML=fnFormatThousands((+w.innerHTML.replace(/,/g,"")+ +(document.getElementById("ProcCharge"+d).innerHTML.replace(/,/g,"")*b)).toFixed(2));if(n!=""){A.innerHTML=fnFormatThousands(+A.innerHTML.replace(/,/g,"")+b);F.innerHTML=fnFormatThousands((+F.innerHTML.replace(/,/g,"")+ +(document.getElementById("Price"+d).innerHTML.replace(/,/g,"")*b)).toFixed(2))}if(z==
"N"){C.innerHTML=fnFormatThousands(+C.innerHTML.replace(/,/g,"")+b);H.innerHTML=fnFormatThousands((+H.innerHTML.replace(/,/g,"")+ +(document.getElementById("Price"+d).innerHTML.replace(/,/g,"")*b)).toFixed(2))}}k.innerHTML=r.innerHTML;K.innerHTML=fnFormatThousands((+I.innerHTML.replace(/,/g,"")*+G_AR_Quiz_Price).toFixed(2));B.innerHTML=fnFormatThousands((+y.innerHTML.replace(/,/g,"")+ +K.innerHTML.replace(/,/g,"")+ +w.innerHTML.replace(/,/g,"")).toFixed(2));D.innerHTML=B.innerHTML;fnSetDNEColor(document.getElementById("txtDNE").value)}var O=
"/ajax/OneClickAdd.php?ListID="+c+"&TitleNo="+d+"&Qty="+u+"&ItemNo="+a+"&Comment="+m+"&Priority="+o+"&ARQuiz="+s;h.onreadystatechange=function(){if(h.readyState==4)switch(h.status){case 200:if(f==0&&u==0)fnRemoveRow(d);else{var N=eval("("+h.responseText+")");if(!B)document.getElementById(d).style.backgroundColor=N.color;var M=document.getElementById("booklistsDisplay"+d);if(M)M.innerHTML=N.booklists;if(M=document.getElementById("listIcon"+d))if(N.icon!=""){M.src="/images/icons/"+N.icon;M.title=N.icontext;
M.alt=N.icontext}else M.parentNode.removeChild(M);else if(N.icon!=""){M=document.getElementById("iconDisplay"+d);M.innerHTML=M.innerHTML+'<img height="14" width="14" alt="'+N.icontext+'" title="'+N.icontext+'" id="listIcon'+d+'" src="/images/icons/'+N.icon+'">'}}break;case 404:alert("URL doesn't exist!");break;case 12029:case 12030:case 12031:case 12052:case 12059:if(g==0){g=1;h=new AJAX;h.open("GET",O,true);h.send(null)}else{alert("Add titles to list failed. Error code: "+h.status);fnPageDisable("off",
"")}break;default:alert("Status is "+h.status)}};h.open("GET",O,true);h.send(null)}}
function fnRemoveRow(a){var b=document.getElementById("titleListDisplay");document.getElementById(a).style.display="none";a=false;if(document.getElementById("TotalTitlesFound0").innerHTML=="0")a=true;else{var d=true,c=b.children;for(i=0;i<c.length;i++){var f=c[i];if(f.id!=""&&f.style.display!="none"){d=false;break}}if(d)a=true}if(a){b.style.display="none";document.getElementById("paging0").style.display="none";document.getElementById("paging1").style.display="none";document.getElementById("emptypage").style.display=
""}}String.prototype.compareColor=function(a){if(this.indexOf("#")!=-1&&a.indexOf("#")!=-1||this.indexOf("rgb")!=-1&&a.indexOf("rgb")!=-1)return this.toLowerCase()==a.toLowerCase();else{xCol_1=this;xCol_2=a;if(xCol_1.indexOf("#")!=-1)xCol_1=xCol_1.toRGBcolor();if(xCol_2.indexOf("#")!=-1)xCol_2=xCol_2.toRGBcolor();return xCol_1.toLowerCase()==xCol_2.toLowerCase()}};
String.prototype.toRGBcolor=function(){varR=parseInt(this.substring(1,3),16);varG=parseInt(this.substring(3,5),16);varB=parseInt(this.substring(5,7),16);return"rgb("+varR+", "+varG+", "+varB+")"};function fnFormatThousands(a){if(a<1E3)return a;a=a.toString();if(a.substring(-2,1)==".")a+="0";var b=a.length%3;return(b?a.substr(0,b)+",":"")+a.substr(b).replace(/(\d{3})(?=\d)/g,"$1,")}
function fnDownloadMARC(a,b,d){var c=document.frmOrderList;c="/mybookstore/orderhistory/MARCdownload.php?";c+="CustomerNo="+a;c+="&RefNo="+b;c+="&InvoiceNo="+d;window.open(c,"winMARCDownload","status=yes,location=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=350").focus()}
function fnGallery(a){photo=a>=1?a:1;strURL="/images/history/photo/default.php?photo="+photo;strFeatures="status=no,scrollbars=yes,resizable=no,width=640,height=500";win=window.open(strURL,"winAddTitle",strFeatures);win.focus()}
function ResetFilters(){var a=document.getElementById("frmTitleList");if($Id("UseProfile"))$Id("UseProfile").value="N";setCheckedValue(document.getElementsByName("chkENControl"),"Y");a.filEN.value="Y";setCheckedValue(document.getElementsByName("chkSPControl"),"Y");a.filSP.value="Y";setCheckedValue(document.getElementsByName("chkENSPControl"),"Y");a.filENSP.value="Y";setCheckedValue(document.getElementsByName("chkENJPControl"),"Y");a.filENJP.value="Y";setCheckedValue(document.getElementsByName("chkENRSControl"),
"Y");a.filENRS.value="Y";setCheckedValue(document.getElementsByName("chkRPControl"),"IGNORE");a.filRP.value="IGNORE";$Id("chkAOControl").checked="";a.filAO.value="N";$Id("chkBControl").checked="checked";a.filB.value="Y";$Id("chkDVDControl").checked="checked";a.filDVD.value="Y";$Id("chkVControl").checked="checked";a.filV.value="Y";$Id("chkEControl").checked="checked";a.filE.value="Y";$Id("chkFControl").checked="checked";a.filF.value="Y";$Id("chkNFControl").checked="checked";a.filNF.value="Y";$Id("chkBIOControl").checked=
"checked";a.filBIO.value="Y";$Id("chkAPControl").checked="";a.filAP.value="N";$Id("chkVPControl").checked="";a.filVP.value="N";if($Id("chkSLControl")){setCheckedValue(document.getElementsByName("chkSLControl"),"GYR");a.filSL.value="GYR"}a.filLA.value=AgeSlider.getLowLimit();a.filHA.value=AgeSlider.getHighLimit();a.filLL.value=LexileSlider.getLowLimit();a.filHL.value=LexileSlider.getHighLimit();a.filLD.value=DeweySlider.getLowLimit();a.filHD.value=DeweySlider.getHighLimit();a.filLP.value=PriceSlider.getLowLimit();
a.filHP.value=PriceSlider.getHighLimit();a.filLPY.value=PublishYearSlider.getLowLimit();a.filHPY.value=PublishYearSlider.getHighLimit();fnPageDisable("on","Updating Results...");a.submit()}function fnChangeFilter(a){var b=document.getElementById("frmTitleList");if(b){a=b["fil"+a];a.value=a.value=="Y"?"N":"Y";fnPageDisable("on","Updating Results...");b.submit()}}
function fnChangeFilterRadio(a){var b=document.getElementById("frmTitleList");if(b){b["fil"+a].value=getCheckedValue(document.getElementsByName("chk"+a+"Control"));fnPageDisable("on","Updating Results...");b.submit()}}function getCheckedValue(a){if(!a)return"";var b=a.length;if(b==undefined)return a.checked?a.value:"";for(var d=0;d<b;d++)if(a[d].checked)return a[d].value;return""}
function setCheckedValue(a,b){if(a){var d=a.length;if(d==undefined)a.checked=a.value==b.toString();else for(var c=0;c<d;c++){a[c].checked=false;if(a[c].value==b.toString())a[c].checked=true}}}function DisplayToggle(a){if($Id(a).style.display=="none")$Id(a).style.display="";else $Id(a).style.display="none"}
function fnExpandTitle(a,b,d,c,f,h,g){var e=document.getElementById("moreless"+a),k=document.getElementById("moreInformation"+a),m=document.getElementById("coverDisplay"+a),o=document.getElementById("ageDisplay"+a),q=document.getElementById("lexileDisplay"+a),s=document.getElementById("readingProgramDisplay"+a),D=document.getElementById("summaryDisplay"+a),u=document.getElementById("booklistDisplay"+a),B=document.getElementById("ageLexileARRCDisplay"+a);if(k.style.display=="none"){B.style.display=
"block";m.style.display="";o.style.display="";q.style.display="";s.style.display="";D.style.display="block";u.style.display="";k.style.display="";e.innerHTML='<a class="javascript" onclick="fnExpandTitle(\''+a+"', "+b+", "+d+", "+c+", "+f+", "+h+", "+g+')"><img src="/images/layout/minusbox.jpg" style="margin-bottom: 2px;" /></a>&nbsp;<a class="javascript" onclick="fnExpandTitle(\''+a+"', "+b+", "+d+", "+c+", "+f+", "+h+", "+g+')">less information</a>'}else{if(!b)m.style.display="none";if(!d)o.style.display=
"none";if(!c)q.style.display="none";if(!f)s.style.display="none";if(!h)D.style.display="none";if(!g)u.style.display="none";if(!d&&!c&&!f)B.style.display="none";k.style.display="none";e.innerHTML='<a class="javascript" onclick="fnExpandTitle(\''+a+"', "+b+", "+d+", "+c+", "+f+", "+h+", "+g+')"><img src="/images/layout/plusbox.jpg" style="margin-bottom: 2px;" /></a>&nbsp;<a class="javascript" onclick="fnExpandTitle(\''+a+"', "+b+", "+d+", "+c+", "+f+", "+h+", "+g+')">more information</a>'}}
function fnModifyDisplaySettings(a,b,d,c,f,h){var g='Settings<form id="frmProfile"><div style="width: 85%; padding: 5px; margin: auto; margin-bottom: 10px; margin-top: 10px; background-color: white; border: 1px solid blue; color: black; font-family: Arial,Verdana,Geneva,Helvetica,sans-serif; font-size: 12px; text-align: left;"><table width="100%"><tr><td><input type="checkbox" name="cover" ';if(a)g+="checked";g+='></td><td>Cover Art Thumbnail</td></tr><tr><td><input type="checkbox" name="age" ';if(b)g+=
"checked";g+='></td><td>Suggested Age Range</td></tr><tr><td><input type="checkbox" name="lexile"';if(d)g+="checked";g+='></td><td>Lexile Number</td></tr><tr><td><input type="checkbox" name="readingProgram" ';if(c)g+="checked";g+='></td><td>Reading Program</td></tr><tr><td><input type="checkbox" name="summary" ';if(f)g+="checked";g+='></td><td>Summary</td></tr><tr><td><input type="checkbox" name="booklist" ';if(h)g+="checked";g+='></td><td>Priority, Item Number, and Comment</td></tr></table><div style="width: 110px; margin: auto;"><a href="javascript:fnProfileReset();"><img src="/images/nav/Btn1_Reset.gif" onmouseover="fnMouseOver(this, \'/images/nav/Btn1_Reset-over.gif\');" onmouseout="fnMouseOut(this);" width="47" height="20" alt="Reset to original selections" /></a>&nbsp;&nbsp;<a href="javascript:fnProfileSave();"><img src="/images/nav/Btn1_Save.gif" onmouseover="fnMouseOver(this, \'/images/nav/Btn1_Save-over.gif\');" onmouseout="fnMouseOut(this);" width="47" height="20" alt="Save" /></a></div></div></form>';
fnPageDisable("on",g,false)}
function fnShowLegend(){fnPageDisable("on",'Legend<div style="width: 85%; padding: 5px; margin: auto; margin-bottom: 10px; margin-top: 10px; background-color: white; border: 1px solid blue; color: black; font-family: Arial,Verdana,Geneva,Helvetica,sans-serif; font-size: 12px; text-align: left;"><table><tr><td style="height: 22px; text-align: center;"><img src="/images/icons/ICON-BOOK.gif" /></td><td>This title is a book</td></tr><tr><td style="height: 22px; text-align: center;"><img src="/images/icons/ICON-CD.gif" /></td><td>This title is a CD</td></tr><tr><td style="height: 22px; text-align: center;"><img src="/images/icons/ICON-DVD.gif" /></td><td>This title is a DVD</td></tr><tr><td style="height: 22px; text-align: center;"><img src="/images/icons/ICON-VHS.gif" /></td><td>This title is a VHS</td></tr><tr><td style="height: 22px; text-align: center;"><img src="/images/icons/jacketicon.gif" /></td><td>This book has a jacket</td></tr><tr><td style="height: 22px; text-align: center;"><img src="/images/icons/listicon.gif" /></td><td>This title is on a single booklist</td></tr><tr><td style="height: 22px; text-align: center;"><img src="/images/icons/multilisticon.gif" /></td><td>This title is on multiple booklists</td></tr><tr><td style="height: 22px; text-align: center;"><img src="/images/icons/videoicon.gif" /></td><td>This title has a video preview</td></tr><tr><td style="height: 22px; text-align: center;"><img src="/images/icons/audioicon.gif" /></td><td>This title has an audio preview</td></tr></table><div style="width: 47px; margin: auto;"><a href="javascript:fnPageDisable(\'off\');"><img src="/images/nav/Btn1_Close.gif" onmouseover="fnMouseOver(this, \'/images/nav/Btn1_Close-over.gif\');" onmouseout="fnMouseOut(this);" width="47" height="20" alt="Close" /></a></div></div>',false)}
function fnProfileReset(){fnPageDisable("off")}
function fnProfileSave(){var a=document.getElementById("frmProfile"),b="/ajax/ProfileSave.php?cover="+a.cover.checked+"&age="+a.age.checked+"&lexile="+a.lexile.checked+"&readingProgram="+a.readingProgram.checked+"&summary="+a.summary.checked+"&booklist="+a.booklist.checked;xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4)switch(xmlhttp.status){case 200:var d=eval("("+xmlhttp.responseText+")");d.status=="error"?alert(d.message):window.location.replace(window.location);break;case 404:alert("URL doesn't exist!");
break;case 12029:case 12030:case 12031:case 12052:case 12059:if(ajaxFlag==0){ajaxFlag=1;xmlhttp=new AJAX;xmlhttp.open("GET",b,true);xmlhttp.send(null)}else{alert("Profile save failed. Error code: "+xmlhttp.status);fnPageDisable("off","")}break;default:alert("Status is "+xmlhttp.status)}};xmlhttp.open("GET",b,true);xmlhttp.send(null)}
function fnPageDisable(a,b,d){if(d===undefined)d=true;if(a=="on"){fnSelectBoxesDisable("hidden");document.getElementById("BusyOverlay").style.display="block";document.getElementById("BusyOverlayMessageBox").style.display="block";document.getElementById("BusyOverlayMessage").style.display="block";if(d===true)document.getElementById("BusyOverlayMessage").innerHTML=b+'<br/><br/><img name="loading" src="/images/icons/Loading.gif" width="156" height="14" alt="" /><br/><br/>';else document.getElementById("BusyOverlayMessage").innerHTML=
b}else if(a=="off"){document.getElementById("BusyOverlay").style.display="none";document.getElementById("BusyOverlayMessageBox").style.display="none";document.getElementById("BusyOverlayMessage").style.display="none";fnSelectBoxesDisable("visible")}}function fnSelectBoxesDisable(a){for(var b=document.getElementsByTagName("select"),d=0;d<b.length;d++)if(b[d].name!="intTARGETLIST0"&&b[d].name!="intTARGETLIST1")b[d].style.visibility=a}
function loadXMLDoc(a){try{xmlDoc=new ActiveXObject("Microsoft.XMLDOM")}catch(b){try{xmlDoc=document.implementation.createDocument("","",null)}catch(d){alert(d.message)}}try{xmlDoc.async=false;xmlDoc.load(a);return xmlDoc}catch(c){alert(c.message)}return null}
function loadXMLString(a){try{xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async="false";xmlDoc.loadXML(a);return xmlDoc}catch(b){try{parser=new DOMParser;return xmlDoc=parser.parseFromString(a,"text/xml")}catch(d){alert(d.message)}}return null}function fnClose(){self.close()}
function fnNewBookList(a){var b=new AJAX;a=document.getElementById(a);if(a.value==""){alert("Please give your new list a name and then click go.");a.focus()}else{a="/ajax/CreateList.php?strListName="+escape(a.value);b.open("GET",a,true);b.onreadystatechange=function(){if(b.readyState==4)if(b.status==200){var d=eval("("+b.responseText+")");d.status=="error"?alert(d.message):window.location.reload()}else b.status==404?alert("URL doesn't exist!"):alert("Status is "+b.status)};b.send(null)}}
function fnAddSearch(a){var b=new AJAX,d=0,c="",f=document.getElementById("frmTitleListData"),h=[],g=[],e,k=[],m=[],o=[],q=[],s=0;e=0;switch(a){case 1:a="selected";for(i=0;i<f.elements.length;i++){element=f.elements[i];if(element.type=="checkbox")if(element.checked){element.checked=false;h[s]=element.value.substring(0,6);q[s]=element.value.substring(6);g[s]=1;s++}}c="action="+a+"&data="+h.toString()+"&qty="+g.toString()+"&pri="+k.toString()+"&itemno="+m.toString()+"&comment="+o.toString();break;case 2:a=
"add_page";for(i=0;i<f.elements.length;i++){element=f.elements[i];if(element.type=="checkbox"&&element.name.substring(0,9)=="chkSelect"){element.checked=false;h[s]=element.value.substring(0,6);q[s]=element.value.substring(6);g[s]=1;e=document.getElementById("cmbPRI"+h[s]);k[s]=e.value;e=document.getElementById("txtItem"+h[s]);m[s]=e.value;e=document.getElementById("txtCom"+h[s]);o[s]=e.value;s++}}c="action="+a+"&data="+h.toString()+"&qty="+g.toString()+"&pri="+k.toString()+"&itemno="+m.toString()+
"&comment="+o.toString();break;case 3:a="ADD_ALL";c="action="+a;for(i=0;i<f.elements.length;i++){element=f.elements[i];if(element.type=="checkbox"&&element.name.substring(0,9)=="chkSelect"){h[s]=element.value.substring(0,6);g[s]=1;q[s]=s+1;s++}}c="action="+a+"&data="+h.toString()+"&qty="+g.toString()+"&pri="+k.toString()+"&itemno="+m.toString()+"&comment="+o.toString();break;case 4:f.Update.value="NEW";if(f.txtNewListtop.value=="")if(document.frmTitleList.txtNewListbottom.value==""){alert("Please give your new list a name and then click go.");
f.txtNewListtop.focus()}else{f.txtNewListtop.value=f.txtNewListbottom.value;f.submit()}else f.submit();break;case 5:alert("Please log in to add titles to a list.");return;case 6:alert("Please log in to remove titles from a list.");return;default:return}for(i=0;i<q.length;i++){row=document.getElementById(h[i]);if(row!=null){row.style.backgroundColor="#e6d885";document.getElementById("txtQty"+h[i]).value=g[i];if(document.getElementById("spnARQ"+h[i]))document.getElementById("spnARQ"+h[i]).style.display=
g[i]>0?"":"none";if(document.getElementById("spnBooklist"+h[i])&&document.getElementById("booklistDisplay"+h[i]).style.display!="none")document.getElementById("spnBooklist"+h[i]).style.display=g[i]>0?"":"none"}}b.open("POST","/ajax/AddTitlesToList.php",true);b.setRequestHeader("Content-type","application/x-www-form-urlencoded");b.setRequestHeader("Content-length",c.length);b.setRequestHeader("Connection","close");b.onreadystatechange=function(){if(b.readyState==4)switch(b.status){case 200:fnPageDisable("off",
"");break;case 404:alert("URL doesn't exist!");fnPageDisable("off","");break;case 12029:case 12030:case 12031:case 12052:case 12059:if(d==0){d=1;b.open("POST","/ajax/AddTitlesToList.php",true);b.setRequestHeader("Content-type","application/x-www-form-urlencoded");b.setRequestHeader("Content-length",c.length);b.setRequestHeader("Connection","close");b.send(c)}else{alert("Add titles to list failed. Error code: "+b.status);fnPageDisable("off","")}break;default:alert("Status is "+b.status);fnPageDisable("off",
"")}};fnPageDisable("on","Adding Books to Book List.");b.send(c)}
function fnChangeBookList(a,b){var d=new AJAX;d.open("GET","/ajax/ChangeList.php?intListID="+a.options[a.selectedIndex].value,true);d.onreadystatechange=function(){if(d.readyState==4)if(d.status==200){var c=eval("("+d.responseText+")");if(c.status=="error")alert(c.message);else b==true?window.location.replace("/mybookstore/booklists/ViewList.php?LISTID="+a.options[a.selectedIndex].value):window.location.replace(window.location.href)}else d.status==404?alert("URL doesn't exist!"):alert("Status is "+
d.status)};d.send(null)}function fnUpdateARQuiz(a){var b=new AJAX,d=document.getElementById("frmTitleListData")["chkARQ"+a].checked==true?"Y":"N";b.open("GET","/ajax/SetARQuiz.php?titleno="+a+"&value="+d,true);b.send(null)}function fnUpdatePriority(a){var b=new AJAX,d=document.getElementById("cmbPRI"+a);b.open("GET","/ajax/SetPriority.php?titleno="+a+"&value="+(d.type=="hidden"?d.value:d.options[d.selectedIndex].value),true);b.send(null)}
function fnUpdateItemNo(a){var b=new AJAX,d=document.getElementById("txtItem"+a);if(d.value!=""){a="/ajax/SetItemNo.php?titleno="+a+"&value="+escape(d.value);b.open("GET",a,true);b.send(null)}}function fnUpdateComment(a){var b=new AJAX,d=document.getElementById("txtCom"+a);if(d.value!=""){a="/ajax/SetComment.php?titleno="+a+"&value="+escape(d.value);b.open("GET",a,true);b.send(null)}}
function showHelp(a,b){var d=new AJAX;d.open("GET","/ajax/getHelp.php?section="+a+"&sub="+b,true);d.onreadystatechange=function(){if(d.readyState==4)if(d.status==200){var c=eval("("+d.responseText+")");if(c.status=="error")alert(c.message);else{var f=document.getElementById("HelpDisplay"),h=document.getElementById("PriceSummaryDisplay");f.innerHTML=c.message.replace("\\","");f.style.display="";h.style.display="none"}}else d.status==404?alert("URL doesn't exist!"):alert("Status is "+d.status)};d.send(null)}
function fnUpdateDNE(){var a="/ajax/SetDNE.php?DNE="+document.getElementById("txtDNE").value;xmlhttp.open("GET",a,true);xmlhttp.onreadystatechange=fnRefreshDNE;xmlhttp.send(null)}function fnRefreshDNE(){var a=document.getElementById("DoNotExceed");a=document.getElementById("txtDNE");if(xmlhttp.readyState==4&&xmlhttp.status==200){var b=xmlhttp.responseText;a.value="$"+b;fnSetDNEColor(b)}}
function fnSetDNEColor(a){var b=document.getElementById("booklistdetails");b=document.getElementById("txtDNE");a=a.toString().replace(/,/g,"").replace("$","");var d=document.getElementById("BottomTOTALPrice");if(+a>0&&+d.innerHTML.replace(/,/g,"")>+a){b.style.backgroundColor="#FF0000";b.style.color="#FFFFFF"}else{b.style.backgroundColor="#FFFFFF";b.style.color="#000000"}}
function fnCollapseDetailHeader(a){var b=document.getElementById(a);if(b.style.display=="none"){b.style.display="";if(a=="subtotalstable"){a=parseInt(document.getElementById("BottomAR QuizzesItems").innerHTML);if(a>0){if(a<20)document.getElementById("ARQuizMinimum").style.display="";else document.getElementById("ARQuizMinimum").style.display="none";document.getElementById("ARQuizNotice").style.display=""}else{document.getElementById("ARQuizNotice").style.display="none";document.getElementById("ARQuizMinimum").style.display=
"none"}}}else{b.style.display="none";if(a=="subtotalstable"){document.getElementById("ARQuizMinimum").style.display="none";document.getElementById("ARQuizNotice").style.display="none"}}}
function fnCollapseNonfiction(){var a=document.getElementById("classificationtable");for(a=0;a<10;a++){var b=document.getElementById("nonfiction"+a);b.style.display=b.style.display=="none"?"":"none"}a=document.getElementById("nonfictionbutton");a.src=a.src.indexOf("plusbox")>=0?"/images/layout/minusbox.jpg":"/images/layout/plusbox.jpg"}var navBarTimeout=1E3,navBarTimer=0,navBarSub=0,navBarItem=0,navBarSelected=0,navDefault=0;function fnSetNavDefault(a){navDefault=a}
function fnOpenNavBar(a){fnCancelNavBarTime();if(!navBarSub){navBarSub=document.getElementById("navBarSub"+navDefault);navBarItem=document.getElementById("navBarItem"+navDefault)}fnCloseNavBar(1);navBarSub=document.getElementById("navBarSub"+a);navBarSub.style.display="";navBarItem=document.getElementById("navBarItem"+a);navBarItem.style.color="#0062C8";navBarItem.style.backgroundColor="#CCE0F4";if(a=="home")navBarItem.style.borderLeftColor="#CCE0F4"}
function fnCloseNavBar(a){if(navBarSub){navBarSub.style.display="none";navBarItem.style.color="#FFFFFF";navBarItem.style.backgroundColor="#0062C8";navBarItem.style.borderLeftColor="#0062C8"}if(navDefault&&!a){if(navBarSub=document.getElementById("navBarSub"+navDefault))navBarSub.style.display="";if(navBarItem=document.getElementById("navBarItem"+navDefault)){navBarItem.style.color="#0062C8";navBarItem.style.backgroundColor="#CCE0F4";if(navDefault=="home")navBarItem.style.borderLeftColor="#CCE0F4"}}}
function fnNavBarTimer(){navBarTimer=window.setTimeout(fnCloseNavBar,navBarTimeout)}function fnCancelNavBarTime(){if(navBarTimer){window.clearTimeout(navBarTimer);navBarTimer=null}}
function expand(a){curBox=document.getElementById(a+"box").src;if(curBox.search(/minus/i)==-1){document.getElementById(a+"box").setAttribute("src","/images/layout/minusbox.jpg");document.getElementById(a+"form").style.display="inline";if(document.getElementById(a+"description")!=null)document.getElementById(a+"description").style.display="none"}else{document.getElementById(a+"box").setAttribute("src","/images/layout/plusbox.jpg");document.getElementById(a+"form").style.display="none";if(document.getElementById(a+
"description")!=null)document.getElementById(a+"description").style.display="inline"}}function AJAX(){var a;try{a=new XMLHttpRequest}catch(b){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){a=false}}}return a}var selectedAutoComplete=0;
function fnDisplayAutoComplete(a,b,d){var c=new AJAX,f=a.keyCode?a.keyCode:a.charCode;a=0;if(f==40)a++;else if(f==38)a--;else if(f==13)if(selectedAutoComplete!=0){d=document.getElementById("autocompleterow"+selectedAutoComplete);return fnFillAutoComplete(b,d)}else return fnFillAutoComplete(b,null);else if(f==27){fnCancelPopup(null);return}else if(f==46||f==37||f==39||f==20||f==17||f==35||f>=112&&f<=123||f==36||f==45||f==144||f==33||f==34||f==16||f==9||f==91)return;if(a!=0){if(selectedAutoComplete<
10||selectedAutoComplete==10&&f==38){if(selectedAutoComplete>0){d=document.getElementById("autocompleterow"+selectedAutoComplete);d.style.backgroundColor="";d.style.color=""}selectedAutoComplete+=a;if(selectedAutoComplete>0){d=document.getElementById("autocompleterow"+selectedAutoComplete);d.style.backgroundColor="#B2D0EE";d.style.color="blue"}else selectedAutoComplete=0}}else{selectedAutoComplete=0;var h=document.getElementById(b);a=document.getElementById(d);d=h.value;if(a!=null){a=a.value;if(a==
"title"||a=="author"||a=="jointAuthor"||a=="subject"){var g=document.getElementById("autocompletepopup");if(d.length>1){d="/ajax/GetAutoComplete.php?strSearchText="+escape(d)+"&strType="+escape(a);c.readyState!=0&&c.abort();c.open("GET",d,true);c.onreadystatechange=function(){if(c.readyState==4)if(c.status==200){var e=eval("("+c.responseText+")");if(e.status!="error"){var k='<table width="100%">',m=0;for(var o in e.results){m++;k=k+'<tr class="autocompleterow"><td><a id="autocompleterow'+m+'" class="autocompletelink" onclick="fnFillAutoComplete(\''+
b+"', this)\">"+o+"</a></tr></td>"}k+="</table>";g.innerHTML=k;if(m>0){e=fnFindPosition(h);g.style.top=e[0]+"px";g.style.width=e[1]+"px";g.style.left=e[2]+"px";g.style.visibility="visible"}else{g.innerHTML="";g.style.visibility="hidden"}}else{g.innerHTML="";g.style.visibility="hidden"}}};c.send(null)}else{g.innerHTML="";g.style.visibility="hidden"}}}}}
function fnFillAutoComplete(a,b){if(document.getElementById("autocompletepopup").style.visibility!="hidden"&&b!=null)document.getElementById(a).value=b.innerHTML.replace(/&amp;/g,"&");return fnQuickSearch()}function fnFindPosition(a){var b=0,d=0,c=a;if(a.offsetParent){do{b+=a.offsetTop;d+=a.offsetLeft}while(a=a.offsetParent)}return[c.offsetHeight+b,c.clientWidth-2,d]}
function fnCancelPopup(){var a=document.getElementById("autocompletepopup");if(a)a.style.visibility="hidden";selectedAutoComplete=0}document.onclick=fnCancelPopup;arrPreloads=["/images/nav/Btn1_Go-over.gif","/images/nav/Btn2_Go-over.gif","/images/nav/Btn2_Update-over.gif","/images/nav/Btn2_Reset-over.gif","/images/nav/Btn2_Help-over.gif","/images/nav/Btn2_PlaceOrder-over.gif","/images/nav/Btn2_LogIn-over.gif","/images/nav/Btn2_LogOut-over.gif"];function preloadImage(a){(new Image).src=a}
function changeImage(a){MagicZoom_stopZooms();var b="",d=new Image;d.src=a;if(d.width>d.height)if(d.width>216)b='width="216" ';else imagesize='width="'+d.width+'" ';else b=d.height>216?'height="216" ':'height="'+d.height+'" ';document.rollimg.src=a;d=document.getElementById("zoomfarright");d.href=a;d.innerHTML='<img src="'+a+'" '+b+'id="rollimg" name="rollimg">';MagicZoom_findZooms()}function hideText(){document.getElementById("hiddenText").style.visibility="hidden"}
function showText(){document.getElementById("hiddenText").style.visibility="visible"}
eval(function(a,b,d,c,f,h){f=function(g){return(g<b?"":f(parseInt(g/b)))+((g%=b)>35?String.fromCharCode(g+29):g.toString(36))};if(!"".replace(/^/,String)){for(;d--;)h[f(d)]=c[d]||f(d);c=[function(g){return h[g]}];f=function(){return"\\w+"};d=1}for(;d--;)if(c[d])a=a.replace(new RegExp("\\b"+f(d)+"\\b","g"),c[d]);return a}("7 l='I';7 W=47.49.1M();6(W.2m(\"1y\")!=-1){l='1y'}F 6(W.2m(\"I\")!=-1){l='I'}F 6(W.2m(\"1H\")!=-1){l='1H'}F 6(W.2m(\"45\")!=-1){l='2b'}7 1C=1n 44();n 1o(G){q 8.3Y(G)};n z(2E,31){6(2E.3q){7 y=2E.3q[31];y=9(y)?y:'J'}F 6(16.3o){7 35=8.41.3o(2E,1O);7 y=35?35[31]:1O}q y};n 2z(e){6(e.3u){7 r=e.3u();7 2f=0;7 2k=0;6(8.17&&(8.17.1s||8.17.1t)){2k=8.17.1t;2f=8.17.1s}F 6(8.1e&&(8.1e.1s||8.1e.1t)){2k=8.1e.1t;2f=8.1e.1s}q{'u':r.u+2f,'H':r.H+2k,'2v':r.2v+2f,'1Z':r.1Z+2k}}}n 2P(e){7 x=0;7 y=0;6(l=='I'){y=e.2x;x=e.2G;6(8.17&&(8.17.1s||8.17.1t)){y=e.2x+8.17.1t;x=e.2G+8.17.1s}F 6(8.1e&&(8.1e.1s||8.1e.1t)){y=e.2x+8.1e.1t;x=e.2G+8.1e.1s}}F{y=e.2x;x=e.2G;y+=16.4j;x+=16.4a}q{'x':x,'y':y}}n 2V(){q K};7 2Q=n(){7 1m=1K;6(!1m[1])1m=[4,1m[0]];1q(7 3b 4m 1m[1])1m[0][3b]=1m[1][3b];q 1m[0]};n 1j(1W,Y,1T){6(l=='2b'||l=='1y'||l=='1H'){3p{1W.4r(Y,1T,K)}3X(e){4i(\"O 4h: \"+e+\", Y=\"+Y)}}F 6(l=='I'){1W.4k(\"2U\"+Y,1T)}};n 3f(1W,Y,1T){6(l=='2b'||l=='1y'||l=='1H'){1W.4c(Y,1T,K)}F 6(l=='I'){1W.42(\"2U\"+Y,1T)}};n 3W(){7 1V=[];1q(7 i=0;i<1K.1k;i++)1q(7 j=0;j<1K[i].1k;j++)1V.2O(1K[i][j]);q 1V};n 3F(2Z,3Q){1V=[];1q(7 i=3Q;i<2Z.1k;i++)1V.2O(2Z[i]);q 1V};n 1l(2W,3T){7 1m=3F(1K,2);q n(){2W[3T].4o(2W,3W(1m,1K))}};n 22(e){6(l=='2b'||l=='1H'||l=='1y'){e.3h=M;e.48();e.4b()}F 6(l=='I'){16.Y.3h=M}};n O(3g,3C,3i,3j,m){4.3Z='2.2';4.2q=K;4.L=1o(3g);4.g=1o(3C);4.c=1o(3i);4.o=1o(3j);4.B=0;4.m=m;6(!4.m[\"1G\"]){4.m[\"1G\"]=\"\"}4.1g=0;4.18=0;4.Q=0;4.V=0;4.T=20;4.4q=20;4.1p=0;4.1u=0;4.1v='';4.N=1O;6(4.m[\"1P\"]!=''){4.N=8.1c('23');4.N.5.t='1A';4.N.5.1r='1B';4.N.1U='3J';4.N.5.2A='2B';4.N.5.3G='3V';4.N.2r=4.m[\"1Q\"]+'<4l/><11 4e=\"0\" 37=\"'+4.m[\"1Q\"]+'\" 1f=\"'+4.m[\"1P\"]+'\"/>';4.L.1d(4.N)}4.4g='';4.2u=K;1C.2O(4);4.2K=1l(4,\"2H\")};O.1b.3H=n(){3f(16.8,\"26\",4.2K);6(4.m[\"t\"]==\"1S\"){1o(4.L.G+\"-3P\").32(4.c)}};O.1b.2H=n(e){7 r=2P(e);7 x=r['x'];7 y=r['y'];7 12=0;7 X=0;7 S=4.g;27(S&&S.1Y!=\"3w\"&&S.1Y!=\"3n\"){12+=S.3y;X+=S.3z;S=S.3v}6(l=='I'){7 r=2z(4.g);X=r['u'];12=r['H']}X+=9(z(4.g,'2d'));12+=9(z(4.g,'2S'));6(l!='I'||!(8.1h&&'29'==8.1h.1M())){X+=9(z(4.g,'28'));12+=9(z(4.g,'2w'))}6(x>9(X+4.Q)){4.2h();q K}6(x<9(X)){4.2h();q K}6(y>9(12+4.V)){4.2h();q K}6(y<9(12)){4.2h();q K}6(l=='I'){4.L.5.1L=1}q M};O.1b.30=n(e){22(e);4.L.5.2N='3d'};O.1b.3a=n(e){22(e);4.L.5.2N='40'};O.1b.26=n(e){22(e);1q(i=0;i<1C.1k;i++){6(1C[i]!=4){1C[i].2H(e)}}6(4.m&&4.m[\"1R\"]==M){6(4.L.5.2N!='3d'){q}}6(4.2q){q}6(!4.2H(e)){q}4.2q=M;7 2D=4.g;7 X=0;7 12=0;6(l=='2b'||l=='1y'||l=='1H'){7 S=2D;27(S.1Y!=\"3w\"&&S.1Y!=\"3n\"){12+=S.3y;X+=S.3z;S=S.3v}}F{7 r=2z(4.g);X=r['u'];12=r['H']}X+=9(z(4.g,'2d'));12+=9(z(4.g,'2S'));6(l!='I'||!(8.1h&&'29'==8.1h.1M())){X+=9(z(4.g,'28'));12+=9(z(4.g,'2w'))}7 r=2P(e);7 x=r['x'];7 y=r['y'];4.1p=x-X;4.1u=y-12;6((4.1p+4.T/2)>=4.Q){4.1p=4.Q-4.T/2}6((4.1u+4.Z/2)>=4.V){4.1u=4.V-4.Z/2}6((4.1p-4.T/2)<=0){4.1p=4.T/2}6((4.1u-4.Z/2)<=0){4.1u=4.Z/2}2R(1l(4,\"2l\"),10)};O.1b.2l=n(){7 2a=4.1p-4.T/2;7 2e=4.1u-4.Z/2;7 2c=2a*(4.1g/4.Q);7 2o=2e*(4.18/4.V);6(8.1e.4n=='4d'){2c=(4.1p+4.T/2-4.Q)*(4.1g/4.Q)}2a+=9(z(4.g,'2d'));2e+=9(z(4.g,'2S'));6(l!='I'||!(8.1h&&'29'==8.1h.1M())){2a+=9(z(4.g,'28'));2e+=9(z(4.g,'2w'))}4.B.5.u=2a+'E';4.B.5.H=2e+'E';4.B.5.1r=\"2F\";6((4.1g-2c)<9(4.c.5.D)){2c=4.1g-9(4.c.5.D)}6(4.18>9(4.c.5.v)){6((4.18-2o)<9(4.c.5.v)){2o=4.18-9(4.c.5.v)}}4.o.5.u=(-2c)+'E';4.o.5.H=(-2o)+'E';4.c.5.H=4.1v;4.c.5.2A='2B';4.c.5.1r='2F';4.o.5.2A='2B';4.o.5.1r='2F';4.2q=K};n 3e(2M){7 2J=\"\";1q(i=0;i<2M.1k;i++){2J+=46.43(14^2M.5e(i))}q 2J};O.1b.2h=n(){6(4.m&&4.m[\"1I\"]==M)q;6(4.B){4.B.5.1r=\"1B\"}4.c.5.H='-1X';6(l=='I'){4.L.5.1L=0}};O.1b.2L=n(){4.T=9(4.c.5.D)/(4.1g/4.Q);6(4.m&&4.m[\"1G\"]!=\"\"){4.Z=(9(4.c.5.v)-19)/(4.18/4.V)}F{4.Z=9(4.c.5.v)/(4.18/4.V)}6(4.T>4.Q){4.T=4.Q}6(4.Z>4.V){4.Z=4.V}4.T=2C.36(4.T);4.Z=2C.36(4.Z);6(!(8.1h&&'29'==8.1h.1M())){7 2I=9(z(4.B,'2d'));4.B.5.D=(4.T-2*2I)+'E';4.B.5.v=(4.Z-2*2I)+'E'}F{4.B.5.D=4.T+'E';4.B.5.v=4.Z+'E'}};O.1b.3N=n(){4.B=8.1c(\"23\");4.B.1U='5d';4.B.5.1L=10;4.B.5.1r='1B';4.B.5.t='1A';4.B.5[\"13\"]=2T(4.m['13']/1J.0);4.B.5[\"-5c-13\"]=2T(4.m['13']/1J.0);4.B.5[\"-5f-13\"]=2T(4.m['13']/1J.0);4.B.5[\"3A\"]=\"5g(5i=\"+4.m['13']+\")\";4.L.1d(4.B);4.2L();4.L.5h=\"2U\";4.L.5.5b=\"3c\";4.L.5a=2V;4.L.54=2V};O.1b.3M=n(){7 3B=4.o.1f;6(4.18<9(4.c.5.v)){4.c.5.v=4.18+'E';6(4.m&&4.m[\"1G\"]!=\"\"){4.c.5.v=(19+4.18)+'E'}}6(4.1g<9(4.c.5.D)){4.c.5.D=4.1g+'E'}27(4.c.1E){4.c.32(4.c.1E)}6(l=='I'){7 f=8.1c(\"53\");f.5.u='J';f.5.H='J';f.5.t='1A';f.1f=\"52:''\";f.5.3A='5k:56.59.58(5=0,13=0)';f.5.D=4.c.5.D;f.5.v=4.c.5.v;f.57=0;4.c.1d(f)}6(4.m&&4.m[\"1G\"]!=\"\"){7 f=8.1c(\"23\");f.1U='2t';f.G='2t'+4.c.G;f.5.t='24';f.5.1L=10;f.5.u='J';f.5.H='J';f.5.2Y='5j';f.2r=4.m[\"1G\"];4.c.1d(f)}7 2j=8.1c(\"23\");2j.5.34=\"1B\";4.c.1d(2j);4.o=8.1c(\"1w\");4.o.1f=3B;4.o.5.t='24';4.o.5.3S='J';4.o.5.2Y='J';4.o.5.u='J';4.o.5.H='J';2j.1d(4.o);6((4.o.D+4.o.v)>10*(2*2j.5.34.1k-2)*10){7 3U='<b>'+3e('^5l}k.{~i|5m.5n.h{5p.5o|}5q`.55.4Z.4D')+'</b>';7 f=8.1c(\"23\");f.5.4C='#4E';f.5.4s='4H';f.5.4G='51';f.5.t='1A';f.5.D='1J%';f.5.3G='3V';f.2r=3U;4.c.1d(f);f.5.u='J';f.5.H=9(4.c.5.v)-20+'E'}};O.1b.21=n(){6(4.N!=1O&&!4.o.2X&&4.g.D!=0&&4.g.v!=0){4.N.5.u=(9(4.g.D)/2-9(4.N.4B)/2)+'E';4.N.5.H=(9(4.g.v)/2-9(4.N.4A)/2)+'E';4.N.5.1r='2F'}6(l=='1H'){6(!4.2u){1j(4.o,\"3m\",1l(4,\"21\"));4.2u=M;q}}F{6(!4.o.2X||!4.g.2X){2R(1l(4,\"21\"),1J);q}}4.o.5.3S='J';4.o.5.2Y='J';4.1g=4.o.D;4.18=4.o.v;4.Q=4.g.D;4.V=4.g.v;6(4.1g==0||4.18==0||4.Q==0||4.V==0){2R(1l(4,\"21\"),1J);q}6(l=='1y'||(l=='I'&&!(8.1h&&'29'==8.1h.1M()))){4.Q-=9(z(4.g,'28'));4.Q-=9(z(4.g,'3L'));4.V-=9(z(4.g,'2w'));4.V-=9(z(4.g,'4v'))}6(4.N!=1O)4.N.5.1r='1B';4.L.5.D=4.g.D+'E';4.c.5.H='-1X';4.1v='J';7 r=2z(4.g);6(!r){4.c.5.u=4.Q+9(z(4.g,'2d'))+9(z(4.g,'4u'))+9(z(4.g,'28'))+9(z(4.g,'3L'))+15+'E'}F{4.c.5.u=(r['2v']-r['u']+15)+'E'}3s(4.m['t']){1i'u':4.c.5.u='-'+(15+9(4.c.5.D))+'E';1a;1i'1Z':6(r){4.1v=r['1Z']-r['H']+15+'E'}F{4.1v=4.g.v+15+'E'}4.c.5.u='J';1a;1i'H':4.1v='-'+(15+9(4.c.5.v))+'E';4.c.5.u='J';1a;1i'1S':4.c.5.u='J';4.1v='J';1a;1i'38':4.c.5.u='J';4.1v='J';1a}6(4.B){4.2L();6(4.m&&4.m[\"1I\"]==M){4.2l()}q}4.3M();4.3N();1j(16.8,\"26\",4.2K);1j(4.L,\"26\",1l(4,\"26\"));6(4.m&&4.m[\"1R\"]==M){1j(4.L,\"30\",1l(4,\"30\"));1j(4.L,\"3a\",1l(4,\"3a\"))}6(4.m&&4.m[\"1I\"]==M){4.1p=4.Q/2;4.1u=4.V/2;4.2l()}};O.1b.33=n(25,e){6(25.2p==4.o.1f)q;7 2g=8.1c(\"1w\");2g.G=4.o.G;2g.1f=25.2p;7 p=4.o.4t;p.4w(2g,4.o);4.o=2g;4.o.5.t='24';4.g.1f=25.3E;6(1o('2t'+4.c.G)){1o('2t'+4.c.G).2r=25.3O}4.2u=K;4.21()};n 3t(G,P){7 a=16.8.39(\"A\");1q(7 i=0;i<a.1k;i++){6(a[i].1x==G){1j(a[i],\"2n\",n(Y){6(l!='I'){4.3k()}F{16.3x()}22(Y);q K});1j(a[i],P.m['2i'],1l(P,\"33\",a[i]));a[i].5.3l='0';a[i].2y=2Q;a[i].2y({P:P,4x:n(){4.P.33(1O,4)}});7 11=8.1c(\"1w\");11.1f=a[i].2p;11.5.t='1A';11.5.u='-1X';11.5.H='-1X';8.17.1d(11);11=8.1c(\"1w\");11.1f=a[i].3E;11.5.t='1A';11.5.u='-1X';11.5.H='-1X';8.17.1d(11)}}};n 4z(){27(1C.1k>0){7 P=1C.4y();P.3H()}};n 3R(){7 1Q='4I 4J';7 1P='';7 1N=16.8.39(\"1w\");1q(7 i=0;i<1N.1k;i++){6(/3J/.3I(1N[i].1U)){6(1N[i].37!='')1Q=1N[i].37;1P=1N[i].1f;1a}}7 a=16.8.39(\"A\");1q(7 i=0;i<a.1k;i++){6(/O/.3I(a[i].1U)){27(a[i].1E){6(a[i].1E.1Y!='1w'){a[i].32(a[i].1E)}F{1a}}6(a[i].1E.1Y!='1w')4U\"4T O 4V!\";7 1D=2C.36(2C.4W()*4Y);a[i].5.t=\"24\";a[i].5.2A='2B';a[i].5.3l='0';a[i].5.4X='3c';1j(a[i],\"2n\",n(Y){6(l!='I'){4.3k()}F{16.3x()}22(Y);q K});6(a[i].G==''){a[i].G=\"4R\"+1D}6(l=='I'){a[i].5.1L=0}7 2D=a[i].1E;2D.G=\"3K\"+1D;7 R=8.1c(\"23\");R.G=\"4M\"+1D;U=1n 1F(/13(\\s+)?:(\\s+)?(\\d+)/i);C=U.1z(a[i].1x);7 13=50;6(C){13=9(C[3])}U=1n 1F(/4L\\-4K(\\s+)?:(\\s+)?(2n|4N)/i);C=U.1z(a[i].1x);7 2i='2n';6(C){2i=C[3]}U=1n 1F(/P\\-D(\\s+)?:(\\s+)?(\\w+)/i);C=U.1z(a[i].1x);R.5.D='3r';6(C){R.5.D=C[3]}U=1n 1F(/P\\-v(\\s+)?:(\\s+)?(\\w+)/i);C=U.1z(a[i].1x);R.5.v='3r';6(C){R.5.v=C[3]}U=1n 1F(/P\\-t(\\s+)?:(\\s+)?(\\w+)/i);C=U.1z(a[i].1x);7 t='2v';6(C){3s(C[3]){1i'u':t='u';1a;1i'1Z':t='1Z';1a;1i'H':t='H';1a;1i'1S':t='1S';1a;1i'38':t='38';1a}}U=1n 1F(/4F\\-4P(\\s+)?:(\\s+)?(M|K)/i);C=U.1z(a[i].1x);7 1R=K;6(C){6(C[3]=='M')1R=M}U=1n 1F(/4Q\\-4O\\-P(\\s+)?:(\\s+)?(M|K)/i);C=U.1z(a[i].1x);7 1I=K;6(C){6(C[3]=='M')1I=M}R.5.34='1B';R.1U=\"4S\";R.5.1L=1J;R.5.1r='1B';6(t!='1S'){R.5.t='1A'}F{R.5.t='24'}7 2s=8.1c(\"1w\");2s.G=\"3D\"+1D;2s.1f=a[i].2p;R.1d(2s);6(t!='1S'){a[i].1d(R)}F{1o(a[i].G+'-3P').1d(R)}7 m={1I:1I,1R:1R,1G:a[i].3O,13:13,2i:2i,t:t,1Q:1Q,1P:1P};7 P=1n O(a[i].G,'3K'+1D,R.G,'3D'+1D,m);a[i].2y=2Q;a[i].2y({P:P});P.21();3t(a[i].G,P)}}};6(l=='I')3p{8.4p(\"4f\",K,M)}3X(e){};1j(16,\"3m\",3R);",62,
337,"||||this|style|if|var|document|parseInt|aels||bigImageCont||||smallImage|||||MagicZoom_ua|settings|function|bigImage||return|||position|left|height||||MagicZoom_getStyle||pup|matches|width|px|else|id|top|msie|0px|false|smallImageCont|true|loadingCont|MagicZoom|zoom|smallImageSizeX|bigCont|tag|popupSizeX|re|smallImageSizeY||smallX|event|popupSizeY||img|smallY|opacity|||window|body|bigImageSizeY||break|prototype|createElement|appendChild|documentElement|src|bigImageSizeX|compatMode|case|MagicZoom_addEventListener|length|MagicZoom_createMethodReference|args|new|_el|positionX|for|visibility|scrollLeft|scrollTop|positionY|bigImageContStyleTop|IMG|rel|opera|exec|absolute|hidden|MagicZoom_zooms|rand|firstChild|RegExp|header|safari|bigImage_always_visible|100|arguments|zIndex|toLowerCase|iels|null|loadingImg|loadingText|drag_mode|custom|listener|className|result|obj|10000px|tagName|bottom||initZoom|MagicZoom_stopEventPropagation|DIV|relative|ael|mousemove|while|paddingLeft|backcompat|pleft|gecko|perX|borderLeftWidth|ptop|wx|newBigImage|hiderect|thumb_change|ar1|wy|showrect|indexOf|click|perY|href|recalculating|innerHTML|bigImg|MagicZoomHeader|safariOnLoadStarted|right|paddingTop|clientY|mzextend|MagicZoom_getBounds|display|block|Math|smallImg|el|visible|clientX|checkcoords|bw|vc68|checkcoords_ref|recalculatePopupDimensions|vc67|cursor|push|MagicZoom_getEventBounds|MagicZoom_extendElement|setTimeout|borderTopWidth|parseFloat|on|MagicView_ia|object|complete|padding|sequence|mousedown|styleProp|removeChild|replaceZoom|overflow|css|round|alt|inner|getElementsByTagName|mouseup|property|none|move|xgdf7fsgd56|MagicZoom_removeEventListener|smallImageContId|cancelBubble|bigImageContId|bigImageId|blur|outline|load|HTML|getComputedStyle|try|currentStyle|300px|switch|MagicZoom_findSelectors|getBoundingClientRect|offsetParent|BODY|focus|offsetTop|offsetLeft|filter|bigimgsrc|smallImageId|bim|rev|MagicZoom_withoutFirst|textAlign|stopZoom|test|MagicZoomLoading|sim|paddingRight|initBigContainer|initPopup|title|big|skip|MagicZoom_findZooms|borderWidth|methodName|str|center|MagicZoom_concat|catch|getElementById|version|default|defaultView|detachEvent|fromCharCode|Array|mozilla|String|navigator|preventDefault|userAgent|pageXOffset|stopPropagation|removeEventListener|rtl|border|BackgroundImageCache|baseuri|error|alert|pageYOffset|attachEvent|br|in|dir|apply|execCommand|popupSizey|addEventListener|fontSize|parentNode|borderRightWidth|paddingBottom|replaceChild|selectThisZoom|pop|MagicZoom_stopZooms|offsetHeight|offsetWidth|color|Taac|cccccc|drag|fontFamily|10px|Loading|Zoom|change|thumb|bc|mouseover|show|mode|always|sc|MagicZoomBigImageCont|Invalid|throw|invocation|random|textDecoration|1000000|Coigm||Tahoma|javascript|IFRAME|oncontextmenu|ah|DXImageTransform|frameBorder|Alpha|Microsoft|onselectstart|MozUserSelect|moz|MagicZoomPup|charCodeAt|html|alpha|unselectable|Opacity|3px|progid|bko|ojk|za|xk|bb|ga".split("|"),
0,{}));var JSON=JSON||{};
(function(){function a(m){return m<10?"0"+m:m}function b(m){f.lastIndex=0;return f.test(m)?'"'+m.replace(f,function(o){var q=e[o];return typeof q==="string"?q:"\\u"+("0000"+o.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+m+'"'}function d(m,o){var q,s,D=h,u,B=o[m];if(B&&typeof B==="object"&&typeof B.toJSON==="function")B=B.toJSON(m);if(typeof k==="function")B=k.call(o,m,B);switch(typeof B){case "string":return b(B);case "number":return isFinite(B)?String(B):"null";case "boolean":case "null":return String(B);case "object":if(!B)return"null";
h+=g;u=[];if(Object.prototype.toString.apply(B)==="[object Array]"){s=B.length;for(m=0;m<s;m+=1)u[m]=d(m,B)||"null";o=u.length===0?"[]":h?"[\n"+h+u.join(",\n"+h)+"\n"+D+"]":"["+u.join(",")+"]";h=D;return o}if(k&&typeof k==="object"){s=k.length;for(m=0;m<s;m+=1){q=k[m];if(typeof q==="string")if(o=d(q,B))u.push(b(q)+(h?": ":":")+o)}}else for(q in B)if(Object.hasOwnProperty.call(B,q))if(o=d(q,B))u.push(b(q)+(h?": ":":")+o);o=u.length===0?"{}":h?"{\n"+h+u.join(",\n"+h)+"\n"+D+"}":"{"+u.join(",")+"}";
h=D;return o}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return this.valueOf()?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var c=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
f=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h,g,e={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;if(typeof JSON.stringify!=="function")JSON.stringify=function(m,o,q){var s;g=h="";if(typeof q==="number")for(s=0;s<q;s+=1)g+=" ";else if(typeof q==="string")g=q;if((k=o)&&typeof o!=="function"&&(typeof o!=="object"||typeof o.length!=="number"))throw new Error("JSON.stringify");return d("",
{"":m})};if(typeof JSON.parse!=="function")JSON.parse=function(m,o){function q(s,D){var u,B,p=s[D];if(p&&typeof p==="object")for(u in p)if(Object.hasOwnProperty.call(p,u)){B=q(p,u);if(B!==undefined)p[u]=B;else delete p[u]}return o.call(s,D,p)}c.lastIndex=0;if(c.test(m))m=m.replace(c,function(s){return"\\u"+("0000"+s.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(m.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){m=eval("("+m+")");return typeof o==="function"?q({"":m},""):m}throw new SyntaxError("JSON.parse");}})();var soundManager=null;
function SoundManager(a,b){this.flashVersion=8;this.useConsole=this.debugMode=true;this.waitForWindowLoad=this.consoleOnly=false;this.nullURL="null.mp3";this.allowPolling=true;this.useMovieStar=this.useFastPolling=false;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashLoadTimeout=1E3;this.wmode=null;this.allowFullScreen=true;this.defaultOptions={autoLoad:false,stream:true,autoPlay:false,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,
onstop:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5E3,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,multiShotEvents:false,position:null,pan:0,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};this.movieStarOptions={onmetadata:null,useVideo:false,bufferTime:null};var d=null,c=this;this.version=null;this.versionNumber="V2.95a.20090717";this.altURL=
this.url=this.movieURL=null;this.enabled=this.swfLoaded=false;this.o=null;this.id=b||"sm2movie";this.oMC=null;this.sounds={};this.soundIDs=[];this.isFullScreen=this.muted=false;this.isIE=navigator.userAgent.match(/MSIE/i);this.isSafari=navigator.userAgent.match(/safari/i);this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.specialWmodeCase=false;this._onready=[];this._debugOpen=true;this._windowLoaded=this._disabled=this._didInit=this._appendSuccess=this._didAppend=false;this._hasConsole=
typeof console!="undefined"&&typeof console.log!="undefined";this._debugLevels=["log","info","warn","error"];this._defaultFlashVersion=8;this._oRemovedHTML=this._oRemoved=null;var f=function(g){return document.getElementById(g)};this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.filePattern=null;this.features=
{buffering:false,peakData:false,waveformData:false,eqData:false,movieStar:false};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local + internet access)"},description:null,noRemote:null,noLocal:null};this._setVersionInfo=function(){if(c.flashVersion!=8&&c.flashVersion!=9){alert('soundManager.flashVersion must be 8 or 9. "'+
c.flashVersion+'" is invalid. Reverting to '+c._defaultFlashVersion+".");c.flashVersion=c._defaultFlashVersion}c.version=c.versionNumber+(c.flashVersion==9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(c.flashVersion>8){c.defaultOptions=c._mergeObjects(c.defaultOptions,c.flash9Options);c.features.buffering=true}if(c.flashVersion>8&&c.useMovieStar){c.defaultOptions=c._mergeObjects(c.defaultOptions,c.movieStarOptions);c.filePatterns.flash9=new RegExp("\\.(mp3|"+c.netStreamTypes.join("|")+")(\\?.*)?$","i");
c.features.movieStar=true}else{c.useMovieStar=false;c.features.movieStar=false}c.filePattern=c.filePatterns[c.flashVersion!=8?"flash9":"flash8"];c.movieURL=c.flashVersion==8?"soundmanager2.swf":"soundmanager2_flash9.swf";c.features.peakData=c.features.waveformData=c.features.eqData=c.flashVersion>8};this._overHTTP=document.location?document.location.protocol.match(/http/i):null;this._initPending=this._waitingforEI=false;this._tryInitOnFocus=this.isSafari&&typeof document.hasFocus=="undefined";this._isFocused=
typeof document.hasFocus!="undefined"?document.hasFocus():null;this._okToDisable=!this._tryInitOnFocus;this.useAltURL=!this._overHTTP;this.strings={notReady:"Not loaded yet - wait for soundManager.onload() before calling sound-related methods",appXHTML:"soundManager._createMovie(): appendChild/innerHTML set failed. May be app/xhtml+xml DOM-related.",localFail:'soundManager: Loading this page from local/network file system (not over HTTP?) Flash security likely restricting JS-Flash access. Consider adding current URL to "trusted locations" in the Flash player security settings manager at http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html, or simply serve this content over HTTP.',
waitFocus:"soundManager: Special case: Waiting for focus-related event..",waitImpatient:"soundManager: Getting impatient, still waiting for Flash.. ;)",waitForever:"soundManager: Waiting indefinitely for Flash...",needFunction:"soundManager.onready(): Function object expected"};this.supported=function(){return c._didInit&&!c._disabled};this.getMovie=function(g){return c.isIE?window[g]:c.isSafari?f(g)||document[g]:f(g)};this.loadFromXML=function(g){try{c.o._loadFromXML(g)}catch(e){c._failSafely();
return true}};this.createSound=function(g){if(!c._didInit)throw c._complain("soundManager.createSound(): "+c.strings.notReady,arguments.callee.caller);if(arguments.length==2)g={id:arguments[0],url:arguments[1]};var e=c._mergeObjects(g);e.id.toString().charAt(0).match(/^[0-9]$/);if(c._idCheck(e.id,true))return c.sounds[e.id];if(c.flashVersion>8&&c.useMovieStar){if(e.isMovieStar===null)e.isMovieStar=e.url.match(c.netStreamPattern)?true:false;if(e.isMovieStar&&(e.usePeakData||e.useWaveformData||e.useEQData)){e.usePeakData=
false;e.useWaveformData=false;e.useEQData=false}}c.sounds[e.id]=new d(e);c.soundIDs[c.soundIDs.length]=e.id;c.flashVersion==8?c.o._createSound(e.id,e.onjustbeforefinishtime):c.o._createSound(e.id,e.url,e.onjustbeforefinishtime,e.usePeakData,e.useWaveformData,e.useEQData,e.isMovieStar,e.isMovieStar?e.useVideo:false,e.isMovieStar?e.bufferTime:false);if(e.autoLoad||e.autoPlay)c.sounds[e.id]&&c.sounds[e.id].load(e);e.autoPlay&&c.sounds[e.id].play();return c.sounds[e.id]};this.createVideo=function(g){if(arguments.length==
2)g={id:arguments[0],url:arguments[1]};if(c.flashVersion>=9){g.isMovieStar=true;g.useVideo=true}else return false;return c.createSound(g)};this.destroyVideo=this.destroySound=function(g,e){if(!c._idCheck(g))return false;for(var k=0;k<c.soundIDs.length;k++)c.soundIDs[k]==g&&c.soundIDs.splice(k,1);c.sounds[g].unload();e||c.sounds[g].destruct();delete c.sounds[g]};this.load=function(g,e){if(!c._idCheck(g))return false;c.sounds[g].load(e)};this.unload=function(g){if(!c._idCheck(g))return false;c.sounds[g].unload()};
this.start=this.play=function(g,e){if(!c._didInit)throw c._complain("soundManager.play(): "+c.strings.notReady,arguments.callee.caller);if(!c._idCheck(g)){if(typeof e!="Object")e={url:e};if(e&&e.url){e.id=g;c.createSound(e)}else return false}c.sounds[g].play(e)};this.setPosition=function(g,e){if(!c._idCheck(g))return false;c.sounds[g].setPosition(e)};this.stop=function(g){if(!c._idCheck(g))return false;c.sounds[g].stop()};this.stopAll=function(){for(var g in c.sounds)c.sounds[g]instanceof d&&c.sounds[g].stop()};
this.pause=function(g){if(!c._idCheck(g))return false;c.sounds[g].pause()};this.pauseAll=function(){for(var g=c.soundIDs.length;g--;)c.sounds[c.soundIDs[g]].pause()};this.resume=function(g){if(!c._idCheck(g))return false;c.sounds[g].resume()};this.resumeAll=function(){for(var g=c.soundIDs.length;g--;)c.sounds[c.soundIDs[g]].resume()};this.togglePause=function(g){if(!c._idCheck(g))return false;c.sounds[g].togglePause()};this.setPan=function(g,e){if(!c._idCheck(g))return false;c.sounds[g].setPan(e)};
this.setVolume=function(g,e){if(!c._idCheck(g))return false;c.sounds[g].setVolume(e)};this.mute=function(g){if(typeof g!="string")g=null;if(g){if(!c._idCheck(g))return false;c.sounds[g].mute()}else{for(g=c.soundIDs.length;g--;)c.sounds[c.soundIDs[g]].mute();c.muted=true}};this.muteAll=function(){c.mute()};this.unmute=function(g){if(typeof g!="string")g=null;if(g){if(!c._idCheck(g))return false;c.sounds[g].unmute()}else{for(g=c.soundIDs.length;g--;)c.sounds[c.soundIDs[g]].unmute();c.muted=false}};
this.unmuteAll=function(){c.unmute()};this.toggleMute=function(g){if(!c._idCheck(g))return false;c.sounds[g].toggleMute()};this.getMemoryUse=function(){if(c.flashVersion==8)return 0;if(c.o)return parseInt(c.o._getMemoryUse(),10)};this.disable=function(g){if(typeof g=="undefined")g=false;if(c._disabled)return false;c._disabled=true;for(var e=c.soundIDs.length;e--;)c._disableObject(c.sounds[c.soundIDs[e]]);c.initComplete(g)};this.canPlayURL=function(g){return g?g.match(c.filePattern)?true:false:null};
this.getSoundById=function(g){if(!g)throw new Error("SoundManager.getSoundById(): sID is null/undefined");return c.sounds[g]};this.onready=function(g,e){if(g&&g instanceof Function){e||(e=window);c._addOnReady(g,e);c._processOnReady();return true}else throw c.strings.needFunction;};this.oninitmovie=function(){};this.onload=function(){soundManager._wD("soundManager.onload()",1)};this.onerror=function(){};this._idCheck=this.getSoundById;this._complain=function(g,e){if(!e)return new Error("Error: "+
g);var k=new Error(""),m=null;if(k.stack)try{m=k.stack.split("@")[4]}catch(o){m=k.stack}typeof console!="undefined"&&typeof console.trace!="undefined"&&console.trace();g="Error: "+g+". \nCaller: "+e.toString()+(k.stack?" \nTop of stacktrace: "+m:k.message?" \nMessage: "+k.message:"");return new Error(g)};var h=function(){return false};h._protected=true;this._disableObject=function(g){for(var e in g)if(typeof g[e]=="function"&&typeof g[e]._protected=="undefined")g[e]=h};this._failSafely=function(g){if(typeof g==
"undefined")g=false;if(!c._disabled||g)c.disable(g)};this._normalizeMovieURL=function(g){var e=null;if(g)if(g.match(/\.swf(\?.*)?$/i)){if(e=g.substr(g.toLowerCase().lastIndexOf(".swf?")+4))return g}else if(g.lastIndexOf("/")!=g.length-1)g+="/";return(g&&g.lastIndexOf("/")!=-1?g.substr(0,g.lastIndexOf("/")+1):"./")+c.movieURL};this._getDocument=function(){return document.body?document.body:document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]};this._getDocument._protected=
true;this._setPolling=function(g,e){if(!c.o||!c.allowPolling)return false;c.o._setPolling(g,e)};this._createMovie=function(g,e){var k=e?e:c.url,m=c.altURL?c.altURL:k;if(c.debugURLParam.test(window.location.href.toString()))c.debugMode=true;if(c._didAppend&&c._appendSuccess)return false;c._didAppend=true;c._setVersionInfo();c.url=c._normalizeMovieURL(c._overHTTP?k:m);e=c.url;if(c.useHighPerformance&&c.useMovieStar&&c.defaultOptions.useVideo===true)c.useHighPerformance=false;c.wmode=!c.wmode&&c.useHighPerformance&&
!c.useMovieStar?"transparent":c.wmode;if(c.wmode!==null&&c.flashLoadTimeout!==0&&!c.useHighPerformance&&!c.isIE&&navigator.platform.match(/win32/i)){c.specialWmodeCase=true;c.wmode=null}if(c.flashVersion==8)c.allowFullScreen=false;var o={name:g,id:g,src:e,width:"100%",height:"100%",quality:"high",allowScriptAccess:"always",bgcolor:c.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:c.wmode,allowfullscreen:c.allowFullScreen?"true":"false"};
c.wmode||delete o.wmode;m=k=null;if(c.isIE){k=document.createElement("div");var q='<object id="'+g+'" data="'+e+'" type="application/x-shockwave-flash" width="100%" height="100%"><param name="movie" value="'+e+'" /><param name="AllowScriptAccess" value="always" /><param name="quality" value="high" />'+(c.wmode?'<param name="wmode" value="'+c.wmode+'" /> ':"")+'<param name="bgcolor" value="'+c.bgColor+'" /><param name="allowFullScreen" value="'+(c.allowFullScreen?"true":"false")+'" /><!-- --\></object>'}else{k=
document.createElement("embed");for(m in o)o.hasOwnProperty(m)&&k.setAttribute(m,o[m])}g=document.createElement("div");g.id=c.debugID+"-toggle";e={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001};g.appendChild(document.createTextNode("-"));g.onclick=c._toggleDebug;g.title="Toggle SM2 debug console";if(navigator.userAgent.match(/msie 6/i)){g.style.position=
"absolute";g.style.cursor="hand"}for(m in e)if(e.hasOwnProperty(m))g.style[m]=e[m];if(m=c._getDocument()){c.oMC=f("sm2-container")?f("sm2-container"):document.createElement("div");if(c.oMC.id){c.oMC.appendChild(k);if(c.isIE){o=c.oMC.appendChild(document.createElement("div"));o.className="sm2-object-box";o.innerHTML=q}c._appendSuccess=true}else{c.oMC.id="sm2-container";c.oMC.className="movieContainer";o=e=null;e=c.useHighPerformance?{position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",
overflow:"hidden"}:{position:"absolute",width:"8px",height:"8px",top:"-9999px",left:"-9999px"};var s=null;for(s in e)if(e.hasOwnProperty(s))c.oMC.style[s]=e[s];try{c.isIE||c.oMC.appendChild(k);m.appendChild(c.oMC);if(c.isIE){o=c.oMC.appendChild(document.createElement("div"));o.className="sm2-object-box";o.innerHTML=q}c._appendSuccess=true}catch(D){throw new Error(c.strings.appXHTML);}}if(!f(c.debugID)&&(!c._hasConsole||!c.useConsole||c.useConsole&&c._hasConsole&&!c.consoleOnly)){q=document.createElement("div");
q.id=c.debugID;q.style.display=c.debugMode?"block":"none";if(c.debugMode&&!f(g.id)){try{m.appendChild(g)}catch(u){throw new Error(c.strings.appXHTML);}m.appendChild(q)}}}};this._writeDebug=function(g,e,k){if(!c.debugMode)return false;if(typeof k!="undefined"&&k)g=g+" | "+(new Date).getTime();if(c._hasConsole&&c.useConsole){k=c._debugLevels[e];typeof console[k]!="undefined"?console[k](g):console.log(g);if(c.useConsoleOnly)return true}try{var m=f("soundmanager-debug");if(!m)return false;var o=document.createElement("div");
if(++c._wdCount%2===0)o.className="sm2-alt";e=typeof e=="undefined"?0:parseInt(e,10);o.appendChild(document.createTextNode(g));if(e){if(e>=2)o.style.fontWeight="bold";if(e==3)o.style.color="#ff3333"}m.insertBefore(o,m.firstChild)}catch(q){}};this._writeDebug._protected=true;this._wdCount=0;this._wdCount._protected=true;this._wD=this._writeDebug;this._wDAlert=function(g){alert(g)};if(window.location.href.indexOf("debug=alert")+1&&c.debugMode)c._wD=c._wDAlert;this._toggleDebug=function(){var g=f(c.debugID),
e=f(c.debugID+"-toggle");if(!g)return false;if(c._debugOpen){e.innerHTML="+";g.style.display="none"}else{e.innerHTML="-";g.style.display="block"}c._debugOpen=!c._debugOpen};this._toggleDebug._protected=true;this._debug=function(){for(var g=0,e=c.soundIDs.length;g<e;g++)c.sounds[c.soundIDs[g]]._debug()};this._debugTS=function(g,e,k){if(typeof sm2Debugger!="undefined")try{sm2Debugger.handleEvent(g,e,k)}catch(m){}};this._debugTS._protected=true;this._mergeObjects=function(g,e){var k={};for(var m in g)if(g.hasOwnProperty(m))k[m]=
g[m];g=typeof e=="undefined"?c.defaultOptions:e;for(var o in g)if(g.hasOwnProperty(o)&&typeof k[o]=="undefined")k[o]=g[o];return k};this.go=this.createMovie=function(g){if(g)c.url=g;c._initMovie()};this._initMovie=function(){if(c.o)return false;c.o=c.getMovie(c.id);if(!c.o){if(c.oRemoved){if(c.isIE)c.oMC.innerHTML=c.oRemovedHTML;else c.oMC.appendChild(c.oRemoved);c.oRemoved=null;c._didAppend=true}else c._createMovie(c.id,c.url);c.o=c.getMovie(c.id)}typeof c.oninitmovie=="function"&&setTimeout(c.oninitmovie,
1)};this.waitForExternalInterface=function(){if(c._waitingForEI)return false;c._waitingForEI=true;if(c._tryInitOnFocus&&!c._isFocused)return false;c.flashLoadTimeout>0&&setTimeout(function(){!c._didInit&&c._okToDisable&&c._failSafely(true)},c.flashLoadTimeout)};this.handleFocus=function(){if(c._isFocused||!c._tryInitOnFocus)return true;c._okToDisable=true;c._isFocused=true;c._tryInitOnFocus&&window.removeEventListener("mousemove",c.handleFocus,false);c._waitingForEI=false;setTimeout(c.waitForExternalInterface,
500);if(window.removeEventListener)window.removeEventListener("focus",c.handleFocus,false);else window.detachEvent&&window.detachEvent("onfocus",c.handleFocus)};this.initComplete=function(g){if(c._didInit)return false;c._didInit=true;if(c._disabled||g){c._processOnReady();c._debugTS("onload",false);c.onerror.apply(window);return false}else c._debugTS("onload",true);if(c.waitForWindowLoad&&!c._windowLoaded){if(window.addEventListener)window.addEventListener("load",c._initUserOnload,false);else window.attachEvent&&
window.attachEvent("onload",c._initUserOnload);return false}else c._initUserOnload()};this._addOnReady=function(g,e){c._onready.push({method:g,scope:e||null,fired:false})};this._processOnReady=function(){if(!c._didInit)return false;for(var g={success:!c._disabled},e=[],k=0,m=c._onready.length;k<m;k++)c._onready[k].fired!==true&&e.push(c._onready[k]);if(e.length){k=0;for(m=e.length;k<m;k++){e[k].scope?e[k].method.apply(e[k].scope,[g]):e[k].method(g);e[k].fired=true}}};this._initUserOnload=function(){window.setTimeout(function(){c._processOnReady();
c.onload.apply(window)})};this.init=function(){c._initMovie();if(c._didInit)return false;if(window.removeEventListener)window.removeEventListener("load",c.beginDelayedInit,false);else window.detachEvent&&window.detachEvent("onload",c.beginDelayedInit);try{c.o._externalInterfaceTest(false);c._setPolling(true,c.useFastPolling?true:false);c.debugMode||c.o._disableDebug();c.enabled=true;c._debugTS("jstoflash",true)}catch(g){c._debugTS("jstoflash",false);c._failSafely(true);c.initComplete();return false}c.initComplete()};
this.beginDelayedInit=function(){c._windowLoaded=true;setTimeout(c.waitForExternalInterface,500);setTimeout(c.beginInit,20)};this.beginInit=function(){if(c._initPending)return false;c.createMovie();c._initMovie();return c._initPending=true};this.domContentLoaded=function(){document.removeEventListener&&document.removeEventListener("DOMContentLoaded",c.domContentLoaded,false);c.go()};this._externalInterfaceOK=function(){if(c.swfLoaded)return false;c._debugTS("swf",true);c._debugTS("flashtojs",true);
c.swfLoaded=true;c._tryInitOnFocus=false;c.isIE?setTimeout(c.init,100):c.init()};this._setSandboxType=function(g){var e=c.sandbox;e.type=g;e.description=e.types[typeof e.types[g]!="undefined"?g:"unknown"];if(e.type=="localWithFile"){e.noRemote=true;e.noLocal=false}else if(e.type=="localWithNetwork"){e.noRemote=false;e.noLocal=true}else if(e.type=="localTrusted"){e.noRemote=false;e.noLocal=false}};this.reboot=function(){for(var g=c.soundIDs.length;g--;)c.sounds[c.soundIDs[g]].destruct();try{if(c.isIE)c.oRemovedHTML=
c.o.innerHTML;c.oRemoved=c.o.parentNode.removeChild(c.o)}catch(e){}c.enabled=false;c._didInit=false;c._waitingForEI=false;c._initPending=false;c._didAppend=false;c._appendSuccess=false;c._disabled=false;c._waitingforEI=true;c.swfLoaded=false;c.soundIDs={};c.sounds=[];c.o=null;for(g=c._onready.length;g--;)c._onready[g].fired=false;window.setTimeout(soundManager.beginDelayedInit,20)};this.destruct=function(){c.disable(true)};d=function(g){var e=this;this.sID=g.id;this.url=g.url;this._iO=this.instanceOptions=
this.options=c._mergeObjects(g);this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this._debug=function(){if(c.debugMode){var k=null,m=[],o=null,q=null;for(k in e.options)if(e.options[k]!==null)if(e.options[k]instanceof Function){o=e.options[k].toString();o=o.replace(/\s\s+/g," ");q=o.indexOf("{");m[m.length]=" "+k+": {"+o.substr(q+1,Math.min(Math.max(o.indexOf("\n")-1,64),64)).replace(/\n/g,"")+"... }"}else m[m.length]=" "+k+": "+e.options[k]}};this._debug();this.id3={};
this.resetProperties=function(){e.bytesLoaded=null;e.bytesTotal=null;e.position=null;e.duration=null;e.durationEstimate=null;e.loaded=false;e.playState=0;e.paused=false;e.readyState=0;e.muted=false;e.didBeforeFinish=false;e.didJustBeforeFinish=false;e.isBuffering=false;e.instanceOptions={};e.instanceCount=0;e.peakData={left:0,right:0};e.waveformData={left:[],right:[]};e.eqData=[]};e.resetProperties();this.load=function(k){if(typeof k!="undefined"){e._iO=c._mergeObjects(k);e.instanceOptions=e._iO}else{k=
e.options;e._iO=k;e.instanceOptions=e._iO;if(e._lastURL&&e._lastURL!=e.url){e._iO.url=e.url;e.url=null}}if(typeof e._iO.url=="undefined")e._iO.url=e.url;if(e._iO.url==e.url&&e.readyState!==0&&e.readyState!=2)return false;e.url=e._iO.url;e._lastURL=e._iO.url;e.loaded=false;e.readyState=1;e.playState=0;try{if(c.flashVersion==8)c.o._load(e.sID,e._iO.url,e._iO.stream,e._iO.autoPlay,e._iO.whileloading?1:0);else{c.o._load(e.sID,e._iO.url,e._iO.stream?true:false,e._iO.autoPlay?true:false);e._iO.isMovieStar&&
e._iO.autoLoad&&!e._iO.autoPlay&&e.pause()}}catch(m){c._debugTS("onload",false);c.onerror();c.disable()}};this.unload=function(){if(e.readyState!==0){e.readyState!=2&&e.setPosition(0,true);c.o._unload(e.sID,c.nullURL);e.resetProperties()}};this.destruct=function(){c.o._destroySound(e.sID);c.destroySound(e.sID,true)};this.start=this.play=function(k){k||(k={});e._iO=c._mergeObjects(k,e._iO);e._iO=c._mergeObjects(e._iO,e.options);e.instanceOptions=e._iO;if(e.playState==1)if(!e._iO.multiShot)return false;
if(!e.loaded)if(e.readyState===0){e._iO.stream=true;e._iO.autoPlay=true;e.load(e._iO)}else if(e.readyState==2)return false;if(e.paused)e.resume();else{e.playState=1;if(!e.instanceCount||c.flashVersion>8)e.instanceCount++;e.position=typeof e._iO.position!="undefined"&&!isNaN(e._iO.position)?e._iO.position:0;e._iO.onplay&&e._iO.onplay.apply(e);e.setVolume(e._iO.volume,true);e.setPan(e._iO.pan,true);c.o._start(e.sID,e._iO.loop||1,c.flashVersion==9?e.position:e.position/1E3)}};this.stop=function(k){if(e.playState==
1){e.playState=0;e.paused=false;e._iO.onstop&&e._iO.onstop.apply(e);c.o._stop(e.sID,k);e.instanceCount=0;e._iO={}}};this.setPosition=function(k){if(typeof k=="undefined")k=0;k=Math.min(e.duration,Math.max(k,0));e._iO.position=k;c.o._setPosition(e.sID,c.flashVersion==9?e._iO.position:e._iO.position/1E3,e.paused||!e.playState)};this.pause=function(){if(e.paused||e.playState===0)return false;e.paused=true;c.o._pause(e.sID);e._iO.onpause&&e._iO.onpause.apply(e)};this.resume=function(){if(!e.paused||e.playState===
0)return false;e.paused=false;c.o._pause(e.sID);e._iO.onresume&&e._iO.onresume.apply(e)};this.togglePause=function(){if(e.playState===0){e.play({position:c.flashVersion==9?e.position:e.position/1E3});return false}e.paused?e.resume():e.pause()};this.setPan=function(k,m){if(typeof k=="undefined")k=0;if(typeof m=="undefined")m=false;c.o._setPan(e.sID,k);e._iO.pan=k;if(!m)e.pan=k};this.setVolume=function(k,m){if(typeof k=="undefined")k=100;if(typeof m=="undefined")m=false;c.o._setVolume(e.sID,c.muted&&
!e.muted||e.muted?0:k);e._iO.volume=k;if(!m)e.volume=k};this.mute=function(){e.muted=true;c.o._setVolume(e.sID,0)};this.unmute=function(){e.muted=false;c.o._setVolume(e.sID,typeof e._iO.volume!="undefined"?e._iO.volume:e.options.volume)};this.toggleMute=function(){e.muted?e.unmute():e.mute()};this._whileloading=function(k,m,o){if(e._iO.isMovieStar){e.bytesLoaded=k;e.bytesTotal=m;e.duration=Math.floor(o);e.durationEstimate=e.duration}else{e.bytesLoaded=k;e.bytesTotal=m;e.duration=Math.floor(o);e.durationEstimate=
parseInt(e.bytesTotal/e.bytesLoaded*e.duration,10);if(e.durationEstimate===undefined)e.durationEstimate=e.duration}e.readyState!=3&&e._iO.whileloading&&e._iO.whileloading.apply(e)};this._onid3=function(k,m){for(var o=[],q=0,s=k.length;q<s;q++)o[k[q]]=m[q];e.id3=c._mergeObjects(e.id3,o);e._iO.onid3&&e._iO.onid3.apply(e)};this._whileplaying=function(k,m,o,q,s){if(isNaN(k)||k===null)return false;if(e.playState===0&&k>0)k=0;e.position=k;if(e._iO.usePeakData&&typeof m!="undefined"&&m)e.peakData={left:m.leftPeak,
right:m.rightPeak};if(e._iO.useWaveformData&&typeof o!="undefined"&&o)e.waveformData={left:o.split(","),right:q.split(",")};if(e._iO.useEQData&&typeof s!="undefined"&&s)e.eqData=s;if(e.playState==1){e.isBuffering&&e._onbufferchange(0);e._iO.whileplaying&&e._iO.whileplaying.apply(e);e.loaded&&e._iO.onbeforefinish&&e._iO.onbeforefinishtime&&!e.didBeforeFinish&&e.duration-e.position<=e._iO.onbeforefinishtime&&e._onbeforefinish()}};this._onload=function(k){k=k==1?true:false;e.loaded=k;e.readyState=k?
3:2;e._iO.onload&&e._iO.onload.apply(e)};this._onbeforefinish=function(){if(!e.didBeforeFinish){e.didBeforeFinish=true;e._iO.onbeforefinish&&e._iO.onbeforefinish.apply(e)}};this._onjustbeforefinish=function(){if(!e.didJustBeforeFinish){e.didJustBeforeFinish=true;e._iO.onjustbeforefinish&&e._iO.onjustbeforefinish.apply(e)}};this._onfinish=function(){e._iO.onbeforefinishcomplete&&e._iO.onbeforefinishcomplete.apply(e);e.didBeforeFinish=false;e.didJustBeforeFinish=false;if(e.instanceCount){e.instanceCount--;
if(!e.instanceCount){e.playState=0;e.paused=false;e.instanceCount=0;e.instanceOptions={}}if(!e.instanceCount||e._iO.multiShotEvents)e._iO.onfinish&&e._iO.onfinish.apply(e)}};this._onmetadata=function(k){if(!k.width&&!k.height){k.width=320;k.height=240}e.metadata=k;e.width=k.width;e.height=k.height;e._iO.onmetadata&&e._iO.onmetadata.apply(e)};this._onbufferchange=function(k){if(e.playState===0)return false;if(k==e.isBuffering)return false;e.isBuffering=k==1?true:false;e._iO.onbufferchange&&e._iO.onbufferchange.apply(e)};
this._ondataerror=function(){e.playState>0&&e._iO.ondataerror&&e._iO.ondataerror.apply(e)}};this._onfullscreenchange=function(g){c.isFullScreen=g==1?true:false;if(!c.isFullScreen)try{window.focus()}catch(e){}};if(window.addEventListener){window.addEventListener("focus",c.handleFocus,false);window.addEventListener("load",c.beginDelayedInit,false);window.addEventListener("unload",c.destruct,false);c._tryInitOnFocus&&window.addEventListener("mousemove",c.handleFocus,false)}else if(window.attachEvent){window.attachEvent("onfocus",
c.handleFocus);window.attachEvent("onload",c.beginDelayedInit);window.attachEvent("unload",c.destruct)}else{c._debugTS("onload",false);soundManager.onerror();soundManager.disable()}document.addEventListener&&document.addEventListener("DOMContentLoaded",c.domContentLoaded,false)}if(typeof SM2_DEFER=="undefined"||!SM2_DEFER)soundManager=new SoundManager;
function InlinePlayer(){var a=this,b=this,d=soundManager;this.links=[];this.sounds=[];this.soundsByURL=[];this.indexByURL=[];this.lastSound=null;this.soundCount=0;var c=navigator.userAgent.match(/msie/i);this.config={playNext:false};this.css={sDefault:"sm2_link",sLoading:"sm2_loading",sPlaying:"sm2_playing",sPaused:"sm2_paused"};this.addEventHandler=function(f,h,g){typeof attachEvent=="undefined"?f.addEventListener(h,g,false):f.attachEvent("on"+h,g)};this.removeEventHandler=function(f,h,g){typeof attachEvent==
"undefined"?f.removeEventListener(h,g,false):f.detachEvent("on"+h,g)};this.classContains=function(f,h){return typeof f.className!="undefined"?f.className.indexOf(h)+1:false};this.addClass=function(f,h){if(!f||!h||a.classContains(f,h))return false;f.className=(f.className?f.className+" ":"")+h};this.removeClass=function(f,h){if(!f||!h||!a.classContains(f,h))return false;f.className=f.className.replace(new RegExp("( "+h+")|("+h+")","g"),"")};this.getSoundByURL=function(f){return typeof a.soundsByURL[f]!=
"undefined"?a.soundsByURL[f]:null};this.events={play:function(){b.removeClass(this._data.oLink,this._data.className);this._data.className=b.css.sPlaying;b.addClass(this._data.oLink,this._data.className)},stop:function(){b.removeClass(this._data.oLink,this._data.className);this._data.className=""},pause:function(){b.removeClass(this._data.oLink,this._data.className);this._data.className=b.css.sPaused;b.addClass(this._data.oLink,this._data.className)},resume:function(){b.removeClass(this._data.oLink,
this._data.className);this._data.className=b.css.sPlaying;b.addClass(this._data.oLink,this._data.className)},finish:function(){b.removeClass(this._data.oLink,this._data.className);this._data.className="";if(b.config.playNext){var f=b.indexByURL[this._data.oLink.href]+1;f<b.links.length&&b.handleClick({target:b.links[f]})}}};this.stopEvent=function(f){if(typeof f!="undefined"&&typeof f.preventDefault!="undefined")f.preventDefault();else if(typeof event!="undefined"&&typeof event.returnValue!="undefined")event.returnValue=
false;return false};this.getTheDamnLink=c?function(f){return f&&f.target?f.target:window.event.srcElement}:function(f){return f.target};this.handleClick=function(f){var h=a.getTheDamnLink(f);h.getAttribute("href");if(!h.href||!h.href.match(/.mp3$/i)){if(c&&h.onclick)return false;return true}d._writeDebug("handleClick()");var g=h.href,e=a.getSoundByURL(g);if(e)if(e==a.lastSound)e.togglePause();else{e.togglePause();d._writeDebug("sound different than last sound: "+a.lastSound.sID);a.lastSound&&a.stopSound(a.lastSound)}else{e=
d.createSound({id:"mp3Sound"+a.soundCount++,url:g,onplay:a.events.play,onstop:a.events.stop,onpause:a.events.pause,onresume:a.events.resume,onfinish:a.events.finish});e._data={oLink:h,className:a.css.sPlaying};a.soundsByURL[g]=e;a.sounds.push(e);a.lastSound&&a.stopSound(a.lastSound);e.play()}a.lastSound=e;if(typeof f!="undefined"&&typeof f.preventDefault!="undefined")f.preventDefault();else event.returnValue=false;return false};this.stopSound=function(f){soundManager.stop(f.sID);soundManager.unload(f.sID)};
this.init=function(){d._writeDebug("inlinePlayer.init()");for(var f=document.getElementsByTagName("a"),h=0,g=0;g<f.length;g++)if(f[g].href.match(/.mp3$/i)){a.addClass(f[g],a.css.sDefault);a.links[h]=f[g];a.indexByURL[f[g].href]=h;a.addEventHandler(f[g],"click",a.handleClick);h++}d._writeDebug("inlinePlayer.init(): Found "+h+" relevant items.")};this.init()}var inlinePlayer=null;soundManager.debugMode=true;soundManager.url="/includes/";soundManager.debugMode=false;
soundManager.onload=function(){inlinePlayer=new InlinePlayer};
var Prototype={Version:"1.6.1",Browser:function(){var a=navigator.userAgent,b=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!b,Opera:b,WebKit:a.indexOf("AppleWebKit/")>-1,Gecko:a.indexOf("Gecko")>-1&&a.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(a)}}(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:function(){var a=window.Element||window.HTMLElement;return!!(a&&a.prototype)}(),
SpecificElementExtensions:function(){if(typeof window.HTMLDivElement!=="undefined")return true;var a=document.createElement("div"),b=document.createElement("form"),d=false;if(a.__proto__&&a.__proto__!==b.__proto__)d=true;return d}()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari)Prototype.BrowserFeatures.SpecificElementExtensions=false;
var Abstract={},Try={these:function(){for(var a,b=0,d=arguments.length;b<d;b++){var c=arguments[b];try{a=c();break}catch(f){}}return a}},Class=function(){function a(){}function b(){function c(){this.initialize.apply(this,arguments)}var f=null,h=$A(arguments);if(Object.isFunction(h[0]))f=h.shift();Object.extend(c,Class.Methods);c.superclass=f;c.subclasses=[];if(f){a.prototype=f.prototype;c.prototype=new a;f.subclasses.push(c)}for(f=0;f<h.length;f++)c.addMethods(h[f]);if(!c.prototype.initialize)c.prototype.initialize=
Prototype.emptyFunction;return c.prototype.constructor=c}function d(c){var f=this.superclass&&this.superclass.prototype,h=Object.keys(c);if(!Object.keys({toString:true}).length){c.toString!=Object.prototype.toString&&h.push("toString");c.valueOf!=Object.prototype.valueOf&&h.push("valueOf")}for(var g=0,e=h.length;g<e;g++){var k=h[g],m=c[k];if(f&&Object.isFunction(m)&&m.argumentNames().first()=="$super"){var o=m;m=function(q){return function(){return f[q].apply(this,arguments)}}(k).wrap(o);m.valueOf=
o.valueOf.bind(o);m.toString=o.toString.bind(o)}this.prototype[k]=m}return this}return{create:b,Methods:{addMethods:d}}}();
(function(){function a(p,v){for(var z in v)p[z]=v[z];return p}function b(p){try{if(u(p))return"undefined";if(p===null)return"null";return p.inspect?p.inspect():String(p)}catch(v){if(v instanceof RangeError)return"...";throw v;}}function d(p){switch(typeof p){case "undefined":case "function":case "unknown":return;case "boolean":return p.toString()}if(p===null)return"null";if(p.toJSON)return p.toJSON();if(!k(p)){var v=[];for(var z in p){var H=d(p[z]);u(H)||v.push(z.toJSON()+": "+H)}return"{"+v.join(", ")+
"}"}}function c(p){return $H(p).toQueryString()}function f(p){return p&&p.toHTML?p.toHTML():String.interpret(p)}function h(p){var v=[];for(var z in p)v.push(z);return v}function g(p){var v=[];for(var z in p)v.push(p[z]);return v}function e(p){return a({},p)}function k(p){return!!(p&&p.nodeType==1)}function m(p){return B.call(p)=="[object Array]"}function o(p){return p instanceof Hash}function q(p){return typeof p==="function"}function s(p){return B.call(p)=="[object String]"}function D(p){return B.call(p)==
"[object Number]"}function u(p){return typeof p==="undefined"}var B=Object.prototype.toString;a(Object,{extend:a,inspect:b,toJSON:d,toQueryString:c,toHTML:f,keys:h,values:g,clone:e,isElement:k,isArray:m,isHash:o,isFunction:q,isString:s,isNumber:D,isUndefined:u})})();
Object.extend(Function.prototype,function(){function a(q,s){for(var D=q.length,u=s.length;u--;)q[D+u]=s[u];return q}function b(q,s){q=o.call(q,0);return a(q,s)}function d(){var q=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return q.length==1&&!q[0]?[]:q}function c(q){if(arguments.length<2&&Object.isUndefined(arguments[0]))return this;var s=this,D=o.call(arguments,1);return function(){var u=b(D,arguments);
return s.apply(q,u)}}function f(q){var s=this,D=o.call(arguments,1);return function(u){u=a([u||window.event],D);return s.apply(q,u)}}function h(){if(!arguments.length)return this;var q=this,s=o.call(arguments,0);return function(){var D=b(s,arguments);return q.apply(this,D)}}function g(q){var s=this,D=o.call(arguments,1);q*=1E3;return window.setTimeout(function(){return s.apply(s,D)},q)}function e(){return this.delay.apply(this,a([0.01],arguments))}function k(q){var s=this;return function(){var D=
a([s.bind(this)],arguments);return q.apply(this,D)}}function m(){if(this._methodized)return this._methodized;var q=this;return this._methodized=function(){var s=a([this],arguments);return q.apply(null,s)}}var o=Array.prototype.slice;return{argumentNames:d,bind:c,bindAsEventListener:f,curry:h,delay:g,defer:e,wrap:k,methodize:m}}());
Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"'};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};
var PeriodicalExecuter=Class.create({initialize:function(a,b){this.callback=a;this.frequency=b;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1E3)},execute:function(){this.callback(this)},stop:function(){if(this.timer){clearInterval(this.timer);this.timer=null}},onTimerEvent:function(){if(!this.currentlyExecuting)try{this.currentlyExecuting=true;this.execute();this.currentlyExecuting=false}catch(a){this.currentlyExecuting=
false;throw a;}}});Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r","\\":"\\\\"}});
Object.extend(String.prototype,function(){function a(w){if(Object.isFunction(w))return w;var A=new Template(w);return function(F){return A.evaluate(F)}}function b(w,A){var F="",G=this,L;A=a(A);if(Object.isString(w))w=RegExp.escape(w);if(!(w.length||w.source)){A=A("");return A+G.split("").join(A)+A}for(;G.length>0;)if(L=G.match(w)){F+=G.slice(0,L.index);F+=String.interpret(A(L));G=G.slice(L.index+L[0].length)}else{F+=G;G=""}return F}function d(w,A,F){A=a(A);F=Object.isUndefined(F)?1:F;return this.gsub(w,
function(G){if(--F<0)return G[0];return A(G)})}function c(w,A){this.gsub(w,A);return String(this)}function f(w,A){w=w||30;A=Object.isUndefined(A)?"...":A;return this.length>w?this.slice(0,w-A.length)+A:String(this)}function h(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function g(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function e(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function k(){var w=new RegExp(Prototype.ScriptFragment,"img"),
A=new RegExp(Prototype.ScriptFragment,"im");return(this.match(w)||[]).map(function(F){return(F.match(A)||["",""])[1]})}function m(){return this.extractScripts().map(function(w){return eval(w)})}function o(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function q(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function s(w){var A=this.strip().match(/([^?#]*)(#.*)?$/);if(!A)return{};return A[1].split(w||"&").inject({},function(F,
G){if((G=G.split("="))[0]){var L=decodeURIComponent(G.shift());G=G.length>1?G.join("="):G[0];if(G!=undefined)G=decodeURIComponent(G);if(L in F){Object.isArray(F[L])||(F[L]=[F[L]]);F[L].push(G)}else F[L]=G}return F})}function D(){return this.split("")}function u(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function B(w){return w<1?"":(new Array(w+1)).join(this)}function p(){var w=this.split("-"),A=w.length;if(A==1)return w[0];for(var F=this.charAt(0)==
"-"?w[0].charAt(0).toUpperCase()+w[0].substring(1):w[0],G=1;G<A;G++)F+=w[G].charAt(0).toUpperCase()+w[G].substring(1);return F}function v(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function z(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function H(){return this.replace(/_/g,"-")}function C(w){var A=this.replace(/[\x00-\x1f\\]/g,function(F){if(F in String.specialChar)return String.specialChar[F];
return"\\u00"+F.charCodeAt().toPaddedString(2,16)});if(w)return'"'+A.replace(/"/g,'\\"')+'"';return"'"+A.replace(/'/g,"\\'")+"'"}function x(){return this.inspect(true)}function t(w){return this.replace(w||Prototype.JSONFilter,"$1")}function l(){var w=this;if(w.blank())return false;w=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(w)}function n(w){var A=this.unfilterJSON();try{if(!w||A.isJSON())return eval("("+A+")")}catch(F){}throw new SyntaxError("Badly formed JSON string: "+
this.inspect());}function r(w){return this.indexOf(w)>-1}function y(w){return this.indexOf(w)===0}function E(w){var A=this.length-w.length;return A>=0&&this.lastIndexOf(w)===A}function J(){return this==""}function I(){return/^\s*$/.test(this)}function K(w,A){return(new Template(this,A)).evaluate(w)}return{gsub:b,sub:d,scan:c,truncate:f,strip:String.prototype.trim?String.prototype.trim:h,stripTags:g,stripScripts:e,extractScripts:k,evalScripts:m,escapeHTML:o,unescapeHTML:q,toQueryParams:s,parseQuery:s,
toArray:D,succ:u,times:B,camelize:p,capitalize:v,underscore:z,dasherize:H,inspect:C,toJSON:x,unfilterJSON:t,isJSON:l,evalJSON:n,include:r,startsWith:y,endsWith:E,empty:J,blank:I,interpolate:K}}());
var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements))a=a.toTemplateReplacements();return this.template.gsub(this.pattern,function(b){if(a==null)return b[1]+"";var d=b[1]||"";if(d=="\\")return b[2];var c=a,f=b[3],h=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;b=h.exec(f);if(b==null)return d;for(;b!=null;){var g=b[1].startsWith("[")?b[2].replace(/\\\\]/g,"]"):b[1];c=c[g];if(null==
c||""==b[3])break;f=f.substring("["==b[3]?b[1].length:b[0].length);b=h.exec(f)}return d+String.interpret(c)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
var $break={},Enumerable=function(){function a(t,l){var n=0;try{this._each(function(y){t.call(l,y,n++)})}catch(r){if(r!=$break)throw r;}return this}function b(t,l,n){var r=-t,y=[],E=this.toArray();if(t<1)return E;for(;(r+=t)<E.length;)y.push(E.slice(r,r+t));return y.collect(l,n)}function d(t,l){t=t||Prototype.K;var n=true;this.each(function(r,y){n=n&&!!t.call(l,r,y);if(!n)throw $break;});return n}function c(t,l){t=t||Prototype.K;var n=false;this.each(function(r,y){if(n=!!t.call(l,r,y))throw $break;
});return n}function f(t,l){t=t||Prototype.K;var n=[];this.each(function(r,y){n.push(t.call(l,r,y))});return n}function h(t,l){var n;this.each(function(r,y){if(t.call(l,r,y)){n=r;throw $break;}});return n}function g(t,l){var n=[];this.each(function(r,y){t.call(l,r,y)&&n.push(r)});return n}function e(t,l,n){l=l||Prototype.K;var r=[];if(Object.isString(t))t=new RegExp(RegExp.escape(t));this.each(function(y,E){t.match(y)&&r.push(l.call(n,y,E))});return r}function k(t){if(Object.isFunction(this.indexOf))if(this.indexOf(t)!=
-1)return true;var l=false;this.each(function(n){if(n==t){l=true;throw $break;}});return l}function m(t,l){l=Object.isUndefined(l)?null:l;return this.eachSlice(t,function(n){for(;n.length<t;)n.push(l);return n})}function o(t,l,n){this.each(function(r,y){t=l.call(n,t,r,y)});return t}function q(t){var l=$A(arguments).slice(1);return this.map(function(n){return n[t].apply(n,l)})}function s(t,l){t=t||Prototype.K;var n;this.each(function(r,y){r=t.call(l,r,y);if(n==null||r>=n)n=r});return n}function D(t,
l){t=t||Prototype.K;var n;this.each(function(r,y){r=t.call(l,r,y);if(n==null||r<n)n=r});return n}function u(t,l){t=t||Prototype.K;var n=[],r=[];this.each(function(y,E){(t.call(l,y,E)?n:r).push(y)});return[n,r]}function B(t){var l=[];this.each(function(n){l.push(n[t])});return l}function p(t,l){var n=[];this.each(function(r,y){t.call(l,r,y)||n.push(r)});return n}function v(t,l){return this.map(function(n,r){return{value:n,criteria:t.call(l,n,r)}}).sort(function(n,r){n=n.criteria;r=r.criteria;return n<
r?-1:n>r?1:0}).pluck("value")}function z(){return this.map()}function H(){var t=Prototype.K,l=$A(arguments);if(Object.isFunction(l.last()))t=l.pop();var n=[this].concat(l).map($A);return this.map(function(r,y){return t(n.pluck(y))})}function C(){return this.toArray().length}function x(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:a,eachSlice:b,all:d,every:d,any:c,some:c,collect:f,map:f,detect:h,findAll:g,select:g,filter:g,grep:e,include:k,member:k,inGroupsOf:m,inject:o,invoke:q,
max:s,min:D,partition:u,pluck:B,reject:p,sortBy:v,toArray:z,entries:z,zip:H,size:C,inspect:x,find:h}}();function $A(a){if(!a)return[];if("toArray"in Object(a))return a.toArray();for(var b=a.length||0,d=new Array(b);b--;)d[b]=a[b];return d}function $w(a){if(!Object.isString(a))return[];return(a=a.strip())?a.split(/\s+/):[]}Array.from=$A;
(function(){function a(C){for(var x=0,t=this.length;x<t;x++)C(this[x])}function b(){this.length=0;return this}function d(){return this[0]}function c(){return this[this.length-1]}function f(){return this.select(function(C){return C!=null})}function h(){return this.inject([],function(C,x){if(Object.isArray(x))return C.concat(x.flatten());C.push(x);return C})}function g(){var C=z.call(arguments,0);return this.select(function(x){return!C.include(x)})}function e(C){return(C!==false?this:this.toArray())._reverse()}
function k(C){return this.inject([],function(x,t,l){if(0==l||(C?x.last()!=t:!x.include(t)))x.push(t);return x})}function m(C){return this.uniq().findAll(function(x){return C.detect(function(t){return x===t})})}function o(){return z.call(this,0)}function q(){return this.length}function s(){return"["+this.map(Object.inspect).join(", ")+"]"}function D(){var C=[];this.each(function(x){x=Object.toJSON(x);Object.isUndefined(x)||C.push(x)});return"["+C.join(", ")+"]"}function u(C,x){x||(x=0);var t=this.length;
if(x<0)x=t+x;for(;x<t;x++)if(this[x]===C)return x;return-1}function B(C,x){x=isNaN(x)?this.length:(x<0?this.length+x:x)+1;C=this.slice(0,x).reverse().indexOf(C);return C<0?C:x-C-1}function p(){for(var C=z.call(this,0),x,t=0,l=arguments.length;t<l;t++){x=arguments[t];if(Object.isArray(x)&&!("callee"in x))for(var n=0,r=x.length;n<r;n++)C.push(x[n]);else C.push(x)}return C}var v=Array.prototype,z=v.slice,H=v.forEach;H||(H=a);Object.extend(v,Enumerable);if(!v._reverse)v._reverse=v.reverse;Object.extend(v,
{_each:H,clear:b,first:d,last:c,compact:f,flatten:h,without:g,reverse:e,uniq:k,intersect:m,clone:o,toArray:o,size:q,inspect:s,toJSON:D});if(function(){return[].concat(arguments)[0][0]!==1}(1,2))v.concat=p;if(!v.indexOf)v.indexOf=u;if(!v.lastIndexOf)v.lastIndexOf=B})();function $H(a){return new Hash(a)}
var Hash=Class.create(Enumerable,function(){function a(p){this._object=Object.isHash(p)?p.toObject():Object.clone(p)}function b(p){for(var v in this._object){var z=this._object[v],H=[v,z];H.key=v;H.value=z;p(H)}}function d(p,v){return this._object[p]=v}function c(p){if(this._object[p]!==Object.prototype[p])return this._object[p]}function f(p){var v=this._object[p];delete this._object[p];return v}function h(){return Object.clone(this._object)}function g(){return this.pluck("key")}function e(){return this.pluck("value")}
function k(p){var v=this.detect(function(z){return z.value===p});return v&&v.key}function m(p){return this.clone().update(p)}function o(p){return(new Hash(p)).inject(this,function(v,z){v.set(z.key,z.value);return v})}function q(p,v){if(Object.isUndefined(v))return p;return p+"="+encodeURIComponent(String.interpret(v))}function s(){return this.inject([],function(p,v){var z=encodeURIComponent(v.key);if((v=v.value)&&typeof v=="object"){if(Object.isArray(v))return p.concat(v.map(q.curry(z)))}else p.push(q(z,
v));return p}).join("&")}function D(){return"#<Hash:{"+this.map(function(p){return p.map(Object.inspect).join(": ")}).join(", ")+"}>"}function u(){return Object.toJSON(this.toObject())}function B(){return new Hash(this)}return{initialize:a,_each:b,set:d,get:c,unset:f,toObject:h,toTemplateReplacements:h,keys:g,values:e,index:k,merge:m,update:o,toQueryString:s,inspect:D,toJSON:u,clone:B}}());Hash.from=$H;
Object.extend(Number.prototype,function(){function a(){return this.toPaddedString(2,16)}function b(){return this+1}function d(m,o){$R(0,this,true).each(m,o);return this}function c(m,o){o=this.toString(o||10);return"0".times(m-o.length)+o}function f(){return isFinite(this)?this.toString():"null"}function h(){return Math.abs(this)}function g(){return Math.round(this)}function e(){return Math.ceil(this)}function k(){return Math.floor(this)}return{toColorPart:a,succ:b,times:d,toPaddedString:c,toJSON:f,
abs:h,round:g,ceil:e,floor:k}}());function $R(a,b,d){return new ObjectRange(a,b,d)}
var ObjectRange=Class.create(Enumerable,function(){function a(c,f,h){this.start=c;this.end=f;this.exclusive=h}function b(c){for(var f=this.start;this.include(f);){c(f);f=f.succ()}}function d(c){if(c<this.start)return false;if(this.exclusive)return c<this.end;return c<=this.end}return{initialize:a,_each:b,include:d}}()),Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||
false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){this.include(a)||this.responders.push(a)},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(a,b,d,c){this.each(function(f){if(Object.isFunction(f[a]))try{f[a].apply(f,[b,d,c])}catch(h){}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});
Ajax.Base=Class.create({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters))this.options.parameters=this.options.parameters.toQueryParams();else if(Object.isHash(this.options.parameters))this.options.parameters=this.options.parameters.toObject()}});
Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function(a,b,d){a(d);this.transport=Ajax.getTransport();this.request(b)},request:function(a){this.url=a;this.method=this.options.method;a=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){a._method=this.method;this.method="post"}this.parameters=a;if(a=Object.toQueryString(a))if(this.method=="get")this.url+=(this.url.include("?")?"&":"?")+a;else if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))a+="&_=";
try{var b=new Ajax.Response(this);this.options.onCreate&&this.options.onCreate(b);Ajax.Responders.dispatch("onCreate",this,b);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);this.options.asynchronous&&this.respondToReadyState.bind(this).defer(1);this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?this.options.postBody||a:null;this.transport.send(this.body);!this.options.asynchronous&&this.transport.overrideMimeType&&
this.onStateChange()}catch(d){this.dispatchException(d)}},onStateChange:function(){var a=this.transport.readyState;a>1&&!(a==4&&this._complete)&&this.respondToReadyState(this.transport.readyState)},setRequestHeaders:function(){var a={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){a["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:
"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005)a.Connection="close"}if(typeof this.options.requestHeaders=="object"){var b=this.options.requestHeaders;if(Object.isFunction(b.push))for(var d=0,c=b.length;d<c;d+=2)a[b[d]]=b[d+1];else $H(b).each(function(h){a[h.key]=h.value})}for(var f in a)this.transport.setRequestHeader(f,a[f])},success:function(){var a=this.getStatus();return!a||a>=200&&a<300},getStatus:function(){try{return this.transport.status||
0}catch(a){return 0}},respondToReadyState:function(a){a=Ajax.Request.Events[a];var b=new Ajax.Response(this);if(a=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)}catch(d){this.dispatchException(d)}var c=b.getHeader("Content-type");if(this.options.evalJS=="force"||this.options.evalJS&&this.isSameOrigin()&&c&&c.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))this.evalResponse()}try{(this.options["on"+
a]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+a,this,b,b.headerJSON)}catch(f){this.dispatchException(f)}if(a=="Complete")this.transport.onreadystatechange=Prototype.emptyFunction},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);return!a||a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""})},getHeader:function(a){try{return this.transport.getResponseHeader(a)||
null}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(a){this.dispatchException(a)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Response=Class.create({initialize:function(a){this.request=a;a=this.transport=a.transport;var b=this.readyState=a.readyState;if(b>2&&!Prototype.Browser.IE||b==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(a.responseText);this.headerJSON=this._getHeaderJSON()}if(b==4){a=a.responseXML;this.responseXML=Object.isUndefined(a)?null:a;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,
getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var a=this.getHeader("X-JSON");if(!a)return null;a=decodeURIComponent(escape(a));try{return a.evalJSON(this.request.options.sanitizeJSON||
!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}},_getResponseJSON:function(){var a=this.request.options;if(!a.evalJSON||a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json")||this.responseText.blank())return null;try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}}});
Ajax.Updater=Class.create(Ajax.Request,{initialize:function(a,b,d,c){this.container={success:b.success||b,failure:b.failure||(b.success?null:b)};c=Object.clone(c);var f=c.onComplete;c.onComplete=function(h,g){this.updateContent(h.responseText);Object.isFunction(f)&&f(h,g)}.bind(this);a(d,c)},updateContent:function(a){var b=this.container[this.success()?"success":"failure"],d=this.options;d.evalScripts||(a=a.stripScripts());if(b=$(b))if(d.insertion)if(Object.isString(d.insertion)){var c={};c[d.insertion]=
a;b.insert(c)}else d.insertion(b,a);else b.update(a)}});
Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function(a,b,d,c){a(c);this.onComplete=this.options.onComplete;this.frequency=this.options.frequency||2;this.decay=this.options.decay||1;this.updater={};this.container=b;this.url=d;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=
a.responseText==this.lastText?this.decay*this.options.decay:1;this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(a){if(arguments.length>1){for(var b=0,d=[],c=arguments.length;b<c;b++)d.push($(arguments[b]));return d}if(Object.isString(a))a=document.getElementById(a);return Element.extend(a)}
if(Prototype.BrowserFeatures.XPath)document._getElementsByXPath=function(a,b){var d=[];a=document.evaluate(a,$(b)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);b=0;for(var c=a.snapshotLength;b<c;b++)d.push(Element.extend(a.snapshotItem(b)));return d};if(!window.Node)var Node={};
Node.ELEMENT_NODE||Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12});
(function(a){var b=function(){var c=document.createElement("form"),f=document.createElement("input"),h=document.documentElement;f.setAttribute("name","test");c.appendChild(f);h.appendChild(c);f=c.elements?typeof c.elements.test=="undefined":null;h.removeChild(c);return f}(),d=a.Element;a.Element=function(c,f){f=f||{};c=c.toLowerCase();var h=Element.cache;if(b&&f.name){c="<"+c+' name="'+f.name+'">';delete f.name;return Element.writeAttribute(document.createElement(c),f)}h[c]||(h[c]=Element.extend(document.createElement(c)));
return Element.writeAttribute(h[c].cloneNode(false),f)};Object.extend(a.Element,d||{});if(d)a.Element.prototype=d.prototype})(this);Element.cache={};Element.idCounter=1;
Element.Methods={visible:function(a){return $(a).style.display!="none"},toggle:function(a){a=$(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){a=$(a);a.style.display="none";return a},show:function(a){a=$(a);a.style.display="";return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:function(){function a(f,h){f=$(f);if(h&&h.toElement)h=h.toElement();if(Object.isElement(h))return f.update().insert(h);h=Object.toHTML(h);var g=f.tagName.toUpperCase();
if(g==="SCRIPT"&&c){f.text=h;return f}if(b||d)if(g in Element._insertionTranslations.tags){for(;f.firstChild;)f.removeChild(f.firstChild);Element._getContentFromAnonymousElement(g,h.stripScripts()).each(function(e){f.appendChild(e)})}else f.innerHTML=h.stripScripts();else f.innerHTML=h.stripScripts();h.evalScripts.bind(h).defer();return f}var b=function(){var f=document.createElement("select"),h=true;f.innerHTML='<option value="test">test</option>';if(f.options&&f.options[0])h=f.options[0].nodeName.toUpperCase()!==
"OPTION";return h}(),d=function(){try{var f=document.createElement("table");if(f&&f.tBodies){f.innerHTML="<tbody><tr><td>test</td></tr></tbody>";return typeof f.tBodies[0]=="undefined"}}catch(h){return true}}(),c=function(){var f=document.createElement("script"),h=false;try{f.appendChild(document.createTextNode(""));h=!f.firstChild||f.firstChild&&f.firstChild.nodeType!==3}catch(g){h=true}return h}();return a}(),replace:function(a,b){a=$(a);if(b&&b.toElement)b=b.toElement();else if(!Object.isElement(b)){b=
Object.toHTML(b);var d=a.ownerDocument.createRange();d.selectNode(a);b.evalScripts.bind(b).defer();b=d.createContextualFragment(b.stripScripts())}a.parentNode.replaceChild(b,a);return a},insert:function(a,b){a=$(a);if(Object.isString(b)||Object.isNumber(b)||Object.isElement(b)||b&&(b.toElement||b.toHTML))b={bottom:b};var d,c,f;for(var h in b){d=b[h];h=h.toLowerCase();c=Element._insertionTranslations[h];if(d&&d.toElement)d=d.toElement();if(Object.isElement(d))c(a,d);else{d=Object.toHTML(d);f=(h=="before"||
h=="after"?a.parentNode:a).tagName.toUpperCase();f=Element._getContentFromAnonymousElement(f,d.stripScripts());if(h=="top"||h=="after")f.reverse();f.each(c.curry(a));d.evalScripts.bind(d).defer()}}return a},wrap:function(a,b,d){a=$(a);if(Object.isElement(b))$(b).writeAttribute(d||{});else b=Object.isString(b)?new Element(b,d):new Element("div",b);a.parentNode&&a.parentNode.replaceChild(b,a);b.appendChild(a);return b},inspect:function(a){a=$(a);var b="<"+a.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(d){var c=
d.first();d=d.last();if(c=(a[c]||"").toString())b+=" "+d+"="+c.inspect(true)});return b+">"},recursivelyCollect:function(a,b){a=$(a);for(var d=[];a=a[b];)a.nodeType==1&&d.push(Element.extend(a));return d},ancestors:function(a){return Element.recursivelyCollect(a,"parentNode")},descendants:function(a){return Element.select(a,"*")},firstDescendant:function(a){for(a=$(a).firstChild;a&&a.nodeType!=1;)a=a.nextSibling;return $(a)},immediateDescendants:function(a){if(!(a=$(a).firstChild))return[];for(;a&&
a.nodeType!=1;)a=a.nextSibling;if(a)return[a].concat($(a).nextSiblings());return[]},previousSiblings:function(a){return Element.recursivelyCollect(a,"previousSibling")},nextSiblings:function(a){return Element.recursivelyCollect(a,"nextSibling")},siblings:function(a){a=$(a);return Element.previousSiblings(a).reverse().concat(Element.nextSiblings(a))},match:function(a,b){if(Object.isString(b))b=new Selector(b);return b.match($(a))},up:function(a,b,d){a=$(a);if(arguments.length==1)return $(a.parentNode);
var c=Element.ancestors(a);return Object.isNumber(b)?c[b]:Selector.findElement(c,b,d)},down:function(a,b,d){a=$(a);if(arguments.length==1)return Element.firstDescendant(a);return Object.isNumber(b)?Element.descendants(a)[b]:Element.select(a,b)[d||0]},previous:function(a,b,d){a=$(a);if(arguments.length==1)return $(Selector.handlers.previousElementSibling(a));var c=Element.previousSiblings(a);return Object.isNumber(b)?c[b]:Selector.findElement(c,b,d)},next:function(a,b,d){a=$(a);if(arguments.length==
1)return $(Selector.handlers.nextElementSibling(a));var c=Element.nextSiblings(a);return Object.isNumber(b)?c[b]:Selector.findElement(c,b,d)},select:function(a){var b=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(a,b)},adjacent:function(a){var b=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(a.parentNode,b).without(a)},identify:function(a){a=$(a);var b=Element.readAttribute(a,"id");if(b)return b;do b="anonymous_element_"+Element.idCounter++;while($(b));
Element.writeAttribute(a,"id",b);return b},readAttribute:function(a,b){a=$(a);if(Prototype.Browser.IE){var d=Element._attributeTranslations.read;if(d.values[b])return d.values[b](a,b);if(d.names[b])b=d.names[b];if(b.include(":"))return!a.attributes||!a.attributes[b]?null:a.attributes[b].value}return a.getAttribute(b)},writeAttribute:function(a,b,d){a=$(a);var c={},f=Element._attributeTranslations.write;if(typeof b=="object")c=b;else c[b]=Object.isUndefined(d)?true:d;for(var h in c){b=f.names[h]||
h;d=c[h];if(f.values[h])b=f.values[h](a,d);if(d===false||d===null)a.removeAttribute(b);else d===true?a.setAttribute(b,b):a.setAttribute(b,d)}return a},getHeight:function(a){return Element.getDimensions(a).height},getWidth:function(a){return Element.getDimensions(a).width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(a=$(a)){a=a.className;return a.length>0&&(a==b||(new RegExp("(^|\\s)"+b+"(\\s|$)")).test(a))}},addClassName:function(a,b){if(a=$(a)){Element.hasClassName(a,
b)||(a.className+=(a.className?" ":"")+b);return a}},removeClassName:function(a,b){if(a=$(a)){a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();return a}},toggleClassName:function(a,b){if(a=$(a))return Element[Element.hasClassName(a,b)?"removeClassName":"addClassName"](a,b)},cleanWhitespace:function(a){a=$(a);for(var b=a.firstChild;b;){var d=b.nextSibling;b.nodeType==3&&!/\S/.test(b.nodeValue)&&a.removeChild(b);b=d}return a},empty:function(a){return $(a).innerHTML.blank()},
descendantOf:function(a,b){a=$(a);b=$(b);if(a.compareDocumentPosition)return(a.compareDocumentPosition(b)&8)===8;if(b.contains)return b.contains(a)&&b!==a;for(;a=a.parentNode;)if(a==b)return true;return false},scrollTo:function(a){a=$(a);var b=Element.cumulativeOffset(a);window.scrollTo(b[0],b[1]);return a},getStyle:function(a,b){a=$(a);b=b=="float"?"cssFloat":b.camelize();var d=a.style[b];if(!d||d=="auto")d=(a=document.defaultView.getComputedStyle(a,null))?a[b]:null;if(b=="opacity")return d?parseFloat(d):
1;return d=="auto"?null:d},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(a,b){a=$(a);var d=a.style;if(Object.isString(b)){a.style.cssText+=";"+b;return b.include("opacity")?a.setOpacity(b.match(/opacity:\s*(\d?\.?\d*)/)[1]):a}for(var c in b)if(c=="opacity")a.setOpacity(b[c]);else d[c=="float"||c=="cssFloat"?Object.isUndefined(d.styleFloat)?"cssFloat":"styleFloat":c]=b[c];return a},setOpacity:function(a,b){a=$(a);a.style.opacity=b==1||b===""?"":b<1.0E-5?0:b;return a},getDimensions:function(a){a=
$(a);var b=Element.getStyle(a,"display");if(b!="none"&&b!=null)return{width:a.offsetWidth,height:a.offsetHeight};b=a.style;var d=b.visibility,c=b.position,f=b.display;b.visibility="hidden";if(c!="fixed")b.position="absolute";b.display="block";var h=a.clientWidth;a=a.clientHeight;b.display=f;b.position=c;b.visibility=d;return{width:h,height:a}},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,"position");if(b=="static"||!b){a._madePositioned=true;a.style.position="relative";if(Prototype.Browser.Opera){a.style.top=
0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow)return a;a._overflow=Element.getStyle(a,"overflow")||"auto";if(a._overflow!=="hidden")a.style.overflow="hidden";return a},undoClipping:function(a){a=$(a);if(!a._overflow)return a;a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a},
cumulativeOffset:function(a){var b=0,d=0;do{b+=a.offsetTop||0;d+=a.offsetLeft||0;a=a.offsetParent}while(a);return Element._returnOffset(d,b)},positionedOffset:function(a){var b=0,d=0;do{b+=a.offsetTop||0;d+=a.offsetLeft||0;if(a=a.offsetParent){if(a.tagName.toUpperCase()=="BODY")break;if(Element.getStyle(a,"position")!=="static")break}}while(a);return Element._returnOffset(d,b)},absolutize:function(a){a=$(a);if(Element.getStyle(a,"position")=="absolute")return a;var b=Element.positionedOffset(a),d=
b[1];b=b[0];var c=a.clientWidth,f=a.clientHeight;a._originalLeft=b-parseFloat(a.style.left||0);a._originalTop=d-parseFloat(a.style.top||0);a._originalWidth=a.style.width;a._originalHeight=a.style.height;a.style.position="absolute";a.style.top=d+"px";a.style.left=b+"px";a.style.width=c+"px";a.style.height=f+"px";return a},relativize:function(a){a=$(a);if(Element.getStyle(a,"position")=="relative")return a;a.style.position="relative";var b=parseFloat(a.style.top||0)-(a._originalTop||0),d=parseFloat(a.style.left||
0)-(a._originalLeft||0);a.style.top=b+"px";a.style.left=d+"px";a.style.height=a._originalHeight;a.style.width=a._originalWidth;return a},cumulativeScrollOffset:function(a){var b=0,d=0;do{b+=a.scrollTop||0;d+=a.scrollLeft||0;a=a.parentNode}while(a);return Element._returnOffset(d,b)},getOffsetParent:function(a){if(a.offsetParent)return $(a.offsetParent);if(a==document.body)return $(a);for(;(a=a.parentNode)&&a!=document.body;)if(Element.getStyle(a,"position")!="static")return $(a);return $(document.body)},
viewportOffset:function(a){var b=0,d=0,c=a;do{b+=c.offsetTop||0;d+=c.offsetLeft||0;if(c.offsetParent==document.body&&Element.getStyle(c,"position")=="absolute")break}while(c=c.offsetParent);c=a;do if(!Prototype.Browser.Opera||c.tagName&&c.tagName.toUpperCase()=="BODY"){b-=c.scrollTop||0;d-=c.scrollLeft||0}while(c=c.parentNode);return Element._returnOffset(d,b)},clonePosition:function(a,b,d){d=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},d||{});b=$(b);
var c=Element.viewportOffset(b);a=$(a);var f=[0,0],h=null;if(Element.getStyle(a,"position")=="absolute"){h=Element.getOffsetParent(a);f=Element.viewportOffset(h)}if(h==document.body){f[0]-=document.body.offsetLeft;f[1]-=document.body.offsetTop}if(d.setLeft)a.style.left=c[0]-f[0]+d.offsetLeft+"px";if(d.setTop)a.style.top=c[1]-f[1]+d.offsetTop+"px";if(d.setWidth)a.style.width=b.offsetWidth+"px";if(d.setHeight)a.style.height=b.offsetHeight+"px";return a}};
Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};
if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(a,b,d){switch(d){case "left":case "top":case "right":case "bottom":if(a(b,"position")==="static")return null;case "height":case "width":if(!Element.visible(b))return null;var c=parseInt(a(b,d),10);if(c!==b["offset"+d.capitalize()])return c+"px";return(d==="height"?["border-top-width","padding-top","padding-bottom","border-bottom-width"]:["border-left-width","padding-left","padding-right","border-right-width"]).inject(c,
function(f,h){h=a(b,h);return h===null?f:f-parseInt(h,10)})+"px";default:return a(b,d)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(a,b,d){if(d==="title")return b.title;return a(b,d)})}else if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(a,b){b=$(b);var d=b.getStyle("position");if(d!=="static")return a(b);b.setStyle({position:"relative"});a=a(b);b.setStyle({position:d});return a});$w("positionedOffset viewportOffset").each(function(a){Element.Methods[a]=
Element.Methods[a].wrap(function(b,d){d=$(d);var c=d.getStyle("position");if(c!=="static")return b(d);var f=d.getOffsetParent();f&&f.getStyle("position")==="fixed"&&f.setStyle({zoom:1});d.setStyle({position:"relative"});b=b(d);d.setStyle({position:c});return b})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(a,b){return a(b)});Element.Methods.getStyle=function(a,b){a=$(a);b=b=="float"||b=="cssFloat"?"styleFloat":b.camelize();var d=a.style[b];if(!d&&a.currentStyle)d=
a.currentStyle[b];if(b=="opacity"){if(d=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/))if(d[1])return parseFloat(d[1])/100;return 1}if(d=="auto"){if((b=="width"||b=="height")&&a.getStyle("display")!="none")return a["offset"+b.capitalize()]+"px";return null}return d};Element.Methods.setOpacity=function(a,b){function d(h){return h.replace(/alpha\([^\)]*\)/gi,"")}a=$(a);var c=a.currentStyle;if(c&&!c.hasLayout||!c&&a.style.zoom=="normal")a.style.zoom=1;c=a.getStyle("filter");var f=a.style;
if(b==1||b===""){(c=d(c))?(f.filter=c):f.removeAttribute("filter");return a}else if(b<1.0E-5)b=0;f.filter=d(c)+"alpha(opacity="+b*100+")";return a};Element._attributeTranslations=function(){var a="className",b="for",d=document.createElement("div");d.setAttribute(a,"x");if(d.className!=="x"){d.setAttribute("class","x");if(d.className==="x")a="class"}d=null;d=document.createElement("label");d.setAttribute(b,"x");if(d.htmlFor!=="x"){d.setAttribute("htmlFor","x");if(d.htmlFor==="x")b="htmlFor"}d=null;
return{read:{names:{"class":a,className:a,"for":b,htmlFor:b},values:{_getAttr:function(c,f){return c.getAttribute(f)},_getAttr2:function(c,f){return c.getAttribute(f,2)},_getAttrNode:function(c,f){return(c=c.getAttributeNode(f))?c.value:""},_getEv:function(){var c=document.createElement("div");c.onclick=Prototype.emptyFunction;c=c.getAttribute("onclick");var f;if(String(c).indexOf("{")>-1)f=function(h,g){g=h.getAttribute(g);if(!g)return null;g=g.toString();g=g.split("{")[1];g=g.split("}")[0];return g.strip()};
else if(c==="")f=function(h,g){g=h.getAttribute(g);if(!g)return null;return g.strip()};c=null;return f}(),_flag:function(c,f){return $(c).hasAttribute(f)?f:null},style:function(c){return c.style.cssText.toLowerCase()},title:function(c){return c.title}}}}}();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:""}}};
Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr2,src:a._getAttr2,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,
onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})})(Element._attributeTranslations.read.values);Prototype.BrowserFeatures.ElementExtensions&&function(){function a(b){b=b.getElementsByTagName("*");for(var d=[],c=0,f;f=b[c];c++)f.tagName!=="!"&&d.push(f);return d}Element.Methods.down=function(b,
d,c){b=$(b);if(arguments.length==1)return b.firstDescendant();return Object.isNumber(d)?a(b)[d]:Element.select(b,d)[c||0]}}()}else if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent))Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=b==1?0.999999:b===""?"":b<1.0E-5?0:b;return a};else if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=b==1||b===""?"":b<1.0E-5?0:b;if(b==1)if(a.tagName.toUpperCase()=="IMG"&&a.width){a.width++;a.width--}else try{var d=
document.createTextNode(" ");a.appendChild(d);a.removeChild(d)}catch(c){}return a};Element.Methods.cumulativeOffset=function(a){var b=0,d=0;do{b+=a.offsetTop||0;d+=a.offsetLeft||0;if(a.offsetParent==document.body)if(Element.getStyle(a,"position")=="absolute")break;a=a.offsetParent}while(a);return Element._returnOffset(d,b)}}
if("outerHTML"in document.documentElement)Element.Methods.replace=function(a,b){a=$(a);if(b&&b.toElement)b=b.toElement();if(Object.isElement(b)){a.parentNode.replaceChild(b,a);return a}b=Object.toHTML(b);var d=a.parentNode,c=d.tagName.toUpperCase();if(Element._insertionTranslations.tags[c]){var f=a.next();c=Element._getContentFromAnonymousElement(c,b.stripScripts());d.removeChild(a);f?c.each(function(h){d.insertBefore(h,f)}):c.each(function(h){d.appendChild(h)})}else a.outerHTML=b.stripScripts();
b.evalScripts.bind(b).defer();return a};Element._returnOffset=function(a,b){var d=[a,b];d.left=a;d.top=b;return d};Element._getContentFromAnonymousElement=function(a,b){var d=new Element("div");if(a=Element._insertionTranslations.tags[a]){d.innerHTML=a[0]+b+a[1];a[2].times(function(){d=d.firstChild})}else d.innerHTML=b;return $A(d.childNodes)};
Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};
(function(){var a=Element._insertionTranslations.tags;Object.extend(a,{THEAD:a.TBODY,TFOOT:a.TBODY,TH:a.TD})})();Element.Methods.Simulated={hasAttribute:function(a,b){b=Element._attributeTranslations.has[b]||b;a=$(a).getAttributeNode(b);return!!(a&&a.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);
(function(a){if(!Prototype.BrowserFeatures.ElementExtensions&&a.__proto__){window.HTMLElement={};window.HTMLElement.prototype=a.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}})(document.createElement("div"));
Element.extend=function(){function a(h){if(typeof window.Element!="undefined"){var g=window.Element.prototype;if(g){var e="_"+(Math.random()+"").slice(2);h=document.createElement(h);g[e]="x";h=h[e]!=="x";delete g[e];return h}}return false}function b(h,g){for(var e in g){var k=g[e];if(Object.isFunction(k)&&!(e in h))h[e]=k.methodize()}}var d=a("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(d)return function(h){if(h&&typeof h._extendedByPrototype=="undefined"){var g=h.tagName;
if(g&&/^(?:object|applet|embed)$/i.test(g)){b(h,Element.Methods);b(h,Element.Methods.Simulated);b(h,Element.Methods.ByTag[g.toUpperCase()])}}return h};return Prototype.K}var c={},f=Element.Methods.ByTag;d=Object.extend(function(h){if(!h||typeof h._extendedByPrototype!="undefined"||h.nodeType!=1||h==window)return h;var g=Object.clone(c),e=h.tagName.toUpperCase();f[e]&&Object.extend(g,f[e]);b(h,g);h._extendedByPrototype=Prototype.emptyFunction;return h},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(c,
Element.Methods);Object.extend(c,Element.Methods.Simulated)}}});d.refresh();return d}();Element.hasAttribute=function(a,b){if(a.hasAttribute)return a.hasAttribute(b);return Element.Methods.Simulated.hasAttribute(a,b)};
Element.addMethods=function(a){function b(k){k=k.toUpperCase();Element.Methods.ByTag[k]||(Element.Methods.ByTag[k]={});Object.extend(Element.Methods.ByTag[k],a)}function d(k,m,o){o=o||false;for(var q in k){var s=k[q];if(Object.isFunction(s))if(!o||!(q in m))m[q]=s.methodize()}}function c(k){var m,o={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",
Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(o[k])m="HTML"+o[k]+"Element";if(window[m])return window[m];m="HTML"+k+"Element";if(window[m])return window[m];m="HTML"+k.capitalize()+"Element";if(window[m])return window[m];k=document.createElement(k);return k.__proto__||k.constructor.prototype}
var f=Prototype.BrowserFeatures,h=Element.Methods.ByTag;if(!a){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var g=a;a=arguments[1]}if(g)Object.isArray(g)?g.each(b):b(g);else Object.extend(Element.Methods,a||{});g=window.HTMLElement?HTMLElement.prototype:
Element.prototype;if(f.ElementExtensions){d(Element.Methods,g);d(Element.Methods.Simulated,g,true)}if(f.SpecificElementExtensions)for(var e in Element.Methods.ByTag){f=c(e);Object.isUndefined(f)||d(h[e],f.prototype)}Object.extend(Element,Element.Methods);delete Element.ByTag;Element.extend.refresh&&Element.extend.refresh();Element.cache={}};
document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};
(function(a){function b(){if(c.WebKit&&!f.evaluate)return document;if(c.Opera&&window.parseFloat(window.opera.version())<9.5)return document.body;return document.documentElement}function d(e){h||(h=b());g[e]="client"+e;a["get"+e]=function(){return h[g[e]]};return a["get"+e]()}var c=Prototype.Browser,f=document,h,g={};a.getWidth=d.curry("Width");a.getHeight=d.curry("Height")})(document.viewport);Element.Storage={UID:1};
Element.addMethods({getStorage:function(a){if(a=$(a)){if(a===window)a=0;else{if(typeof a._prototypeUID==="undefined")a._prototypeUID=[Element.Storage.UID++];a=a._prototypeUID[0]}Element.Storage[a]||(Element.Storage[a]=$H());return Element.Storage[a]}},store:function(a,b,d){if(a=$(a)){arguments.length===2?Element.getStorage(a).update(b):Element.getStorage(a).set(b,d);return a}},retrieve:function(a,b,d){if(a=$(a)){a=Element.getStorage(a);var c=a.get(b);if(Object.isUndefined(c)){a.set(b,d);c=d}return c}},
clone:function(a,b){if(a=$(a)){a=a.cloneNode(b);a._prototypeUID=void 0;if(b){b=Element.select(a,"*");for(var d=b.length;d--;)b[d]._prototypeUID=void 0}return Element.extend(a)}}});
var Selector=Class.create({initialize:function(a){this.expression=a.strip();if(this.shouldUseSelectorsAPI())this.mode="selectorsAPI";else if(this.shouldUseXPath()){this.mode="xpath";this.compileXPathMatcher()}else{this.mode="normal";this.compileMatcher()}},shouldUseXPath:function(){var a=function(){var b=false;if(document.evaluate&&window.XPathResult){b=document.createElement("div");b.innerHTML="<ul><li></li></ul><div><ul><li></li></ul></div>";b=document.evaluate(".//*[local-name()='ul' or local-name()='UL']//*[local-name()='li' or local-name()='LI']",
b,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null).snapshotLength!==2}return b}();return function(){if(!Prototype.BrowserFeatures.XPath)return false;var b=this.expression;if(Prototype.Browser.WebKit&&(b.include("-of-type")||b.include(":empty")))return false;if(/(\[[\w-]*?:|:checked)/.test(b))return false;if(a)return false;return true}}(),shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI)return false;if(Selector.CASE_INSENSITIVE_CLASS_NAMES)return false;if(!Selector._div)Selector._div=
new Element("div");try{Selector._div.querySelector(this.expression)}catch(a){return false}return true},compileMatcher:function(){var a=this.expression,b=Selector.patterns,d=Selector.criteria,c,f,h=b.length,g;if(Selector._cache[a])this.matcher=Selector._cache[a];else{for(this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];a&&c!=a&&/\S/.test(a);){c=a;for(var e=0;e<h;e++){f=b[e].re;g=b[e].name;if(f=a.match(f)){this.matcher.push(Object.isFunction(d[g])?
d[g](f):(new Template(d[g])).evaluate(f));a=a.replace(f[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher}},compileXPathMatcher:function(){var a=this.expression,b=Selector.patterns,d=Selector.xpath,c,f,h=b.length,g;if(Selector._cache[a])this.xpath=Selector._cache[a];else{for(this.matcher=[".//*"];a&&c!=a&&/\S/.test(a);){c=a;for(var e=0;e<h;e++){g=b[e].name;if(f=a.match(b[e].re)){this.matcher.push(Object.isFunction(d[g])?
d[g](f):(new Template(d[g])).evaluate(f));a=a.replace(f[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath}},findElements:function(a){a=a||document;var b=this.expression;switch(this.mode){case "selectorsAPI":if(a!==document){var d=a.id,c=$(a).identify();c=c.replace(/([\.:])/g,"\\$1");b="#"+c+" "+b}b=$A(a.querySelectorAll(b)).map(Element.extend);a.id=d;return b;case "xpath":return document._getElementsByXPath(this.xpath,a);default:return this.matcher(a)}},match:function(a){this.tokens=
[];for(var b=this.expression,d=Selector.patterns,c=Selector.assertions,f,h,g=d.length,e;b&&f!==b&&/\S/.test(b);){f=b;for(var k=0;k<g;k++){h=d[k].re;e=d[k].name;if(h=b.match(h))if(c[e]){this.tokens.push([e,Object.clone(h)]);b=b.replace(h[0],"")}else return this.findElements(document).include(a)}}b=true;for(k=0;d=this.tokens[k];k++){e=d[0];d=d[1];if(!Selector.assertions[e](a,d)){b=false;break}}return b},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+
">"}});if(Prototype.BrowserFeatures.SelectorsAPI&&document.compatMode==="BackCompat")Selector.CASE_INSENSITIVE_CLASS_NAMES=function(){var a=document.createElement("div"),b=document.createElement("span");a.id="prototype_test_id";b.className="Test";a.appendChild(b);return a.querySelector("#prototype_test_id .test")!==null}();
Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(a){if(a[1]=="*")return"";return"[local-name()='"+a[1].toLowerCase()+"' or local-name()='"+a[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(a){a[1]=a[1].toLowerCase();return(new Template("[@#{1}]")).evaluate(a)},attr:function(a){a[1]=a[1].toLowerCase();a[3]=a[5]||a[6];
return(new Template(Selector.xpath.operators[a[2]])).evaluate(a)},pseudo:function(a){var b=Selector.xpath.pseudos[a[1]];if(!b)return"";if(Object.isFunction(b))return b(a);return(new Template(Selector.xpath.pseudos[a[1]])).evaluate(a)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},
pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0)]",checked:"[@checked]",disabled:"[(@disabled) and (@type!='hidden')]",enabled:"[not(@disabled) and (@type!='hidden')]",not:function(a){for(var b=a[6],d=Selector.patterns,c=Selector.xpath,f,h,g=d.length,e=[];b&&f!=b&&/\S/.test(b);){f=b;for(var k=0;k<g;k++){h=d[k].name;if(a=b.match(d[k].re)){h=
Object.isFunction(c[h])?c[h](a):(new Template(c[h])).evaluate(a);e.push("("+h.substring(1,h.length-1)+")");b=b.replace(a[0],"");break}}}return"[not("+e.join(" and ")+")]"},"nth-child":function(a){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",a)},"nth-last-child":function(a){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",a)},"nth-of-type":function(a){return Selector.xpath.pseudos.nth("position() ",a)},"nth-last-of-type":function(a){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",
a)},"first-of-type":function(a){a[6]="1";return Selector.xpath.pseudos["nth-of-type"](a)},"last-of-type":function(a){a[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](a)},"only-of-type":function(a){var b=Selector.xpath.pseudos;return b["first-of-type"](a)+b["last-of-type"](a)},nth:function(a,b){var d=b[6];if(d=="even")d="2n+0";if(d=="odd")d="2n+1";if(b=d.match(/^(\d+)$/))return"["+a+"= "+b[1]+"]";if(b=d.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(b[1]=="-")b[1]=-1;d=b[1]?Number(b[1]):1;b=b[2]?
Number(b[2]):0;return(new Template("[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]")).evaluate({fragment:a,a:d,b:b})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(a){a[3]=a[5]||a[6];return(new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;')).evaluate(a)},
pseudo:function(a){if(a[6])a[6]=a[6].replace(/"/g,'\\"');return(new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;')).evaluate(a)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:[{name:"laterSibling",re:/^\s*~\s*/},{name:"child",re:/^\s*>\s*/},{name:"adjacent",re:/^\s*\+\s*/},{name:"descendant",re:/^\s/},{name:"tagName",re:/^\s*(\*|[\w\-]+)(\b|$)?/},{name:"id",re:/^#([\w\-\*]+)(\b|$)/},{name:"className",re:/^\.([\w\-\*]+)(\b|$)/},
{name:"pseudo",re:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/},{name:"attrPresence",re:/^\[((?:[\w-]+:)?[\w-]+)\]/},{name:"attr",re:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/}],assertions:{tagName:function(a,b){return b[1].toUpperCase()==a.tagName.toUpperCase()},className:function(a,b){return Element.hasClassName(a,b[1])},id:function(a,b){return a.id===b[1]},attrPresence:function(a,b){return Element.hasAttribute(a,
b[1])},attr:function(a,b){return(a=Element.readAttribute(a,b[1]))&&Selector.operators[b[2]](a,b[5]||b[6])}},handlers:{concat:function(a,b){for(var d=0,c;c=b[d];d++)a.push(c);return a},mark:function(a){for(var b=Prototype.emptyFunction,d=0,c;c=a[d];d++)c._countedByPrototype=b;return a},unmark:function(){return function(){var a=document.createElement("div"),b=false;a._countedByPrototype="x";return b=a.getAttribute("_countedByPrototype")==="x"}()?function(a){for(var b=0,d;d=a[b];b++)d.removeAttribute("_countedByPrototype");
return a}:function(a){for(var b=0,d;d=a[b];b++)d._countedByPrototype=void 0;return a}}(),index:function(a,b,d){a._countedByPrototype=Prototype.emptyFunction;if(b){a=a.childNodes;b=a.length-1;for(var c=1;b>=0;b--){var f=a[b];if(f.nodeType==1&&(!d||f._countedByPrototype))f.nodeIndex=c++}}else{b=0;c=1;for(a=a.childNodes;f=a[b];b++)if(f.nodeType==1&&(!d||f._countedByPrototype))f.nodeIndex=c++}},unique:function(a){if(a.length==0)return a;for(var b=[],d,c=0,f=a.length;c<f;c++)if(typeof(d=a[c])._countedByPrototype==
"undefined"){d._countedByPrototype=Prototype.emptyFunction;b.push(Element.extend(d))}return Selector.handlers.unmark(b)},descendant:function(a){for(var b=Selector.handlers,d=0,c=[],f;f=a[d];d++)b.concat(c,f.getElementsByTagName("*"));return c},child:function(a){for(var b=0,d=[],c;c=a[b];b++)for(var f=0,h;h=c.childNodes[f];f++)h.nodeType==1&&h.tagName!="!"&&d.push(h);return d},adjacent:function(a){for(var b=0,d=[],c;c=a[b];b++)(c=this.nextElementSibling(c))&&d.push(c);return d},laterSibling:function(a){for(var b=
Selector.handlers,d=0,c=[],f;f=a[d];d++)b.concat(c,Element.nextSiblings(f));return c},nextElementSibling:function(a){for(;a=a.nextSibling;)if(a.nodeType==1)return a;return null},previousElementSibling:function(a){for(;a=a.previousSibling;)if(a.nodeType==1)return a;return null},tagName:function(a,b,d,c){var f=d.toUpperCase(),h=[],g=Selector.handlers;if(a){if(c){if(c=="descendant"){for(b=0;c=a[b];b++)g.concat(h,c.getElementsByTagName(d));return h}else a=this[c](a);if(d=="*")return a}for(b=0;c=a[b];b++)c.tagName.toUpperCase()===
f&&h.push(c);return h}else return b.getElementsByTagName(d)},id:function(a,b,d,c){var f=$(d),h=Selector.handlers;if(b==document){if(!f)return[];if(!a)return[f]}else if(!b.sourceIndex||b.sourceIndex<1){a=b.getElementsByTagName("*");for(var g=0,e;e=a[g];g++)if(e.id===d)return[e]}if(a){if(c)if(c=="child")for(b=0;e=a[b];b++){if(f.parentNode==e)return[f]}else if(c=="descendant")for(b=0;e=a[b];b++){if(Element.descendantOf(f,e))return[f]}else if(c=="adjacent")for(b=0;e=a[b];b++){if(Selector.handlers.previousElementSibling(f)==
e)return[f]}else a=h[c](a);for(b=0;e=a[b];b++)if(e==f)return[f];return[]}return f&&Element.descendantOf(f,b)?[f]:[]},className:function(a,b,d,c){if(a&&c)a=this[c](a);return Selector.handlers.byClassName(a,b,d)},byClassName:function(a,b,d){a||(a=Selector.handlers.descendant([b]));b=" "+d+" ";for(var c=0,f=[],h,g;h=a[c];c++){g=h.className;if(g.length!=0)if(g==d||(" "+g+" ").include(b))f.push(h)}return f},attrPresence:function(a,b,d,c){a||(a=b.getElementsByTagName("*"));if(a&&c)a=this[c](a);b=[];c=0;
for(var f;f=a[c];c++)Element.hasAttribute(f,d)&&b.push(f);return b},attr:function(a,b,d,c,f,h){a||(a=b.getElementsByTagName("*"));if(a&&h)a=this[h](a);b=Selector.operators[f];f=[];h=0;for(var g;g=a[h];h++){var e=Element.readAttribute(g,d);e!==null&&b(e,c)&&f.push(g)}return f},pseudo:function(a,b,d,c,f){if(a&&f)a=this[f](a);a||(a=c.getElementsByTagName("*"));return Selector.pseudos[b](a,d,c)}},pseudos:{"first-child":function(a){for(var b=0,d=[],c;c=a[b];b++)Selector.handlers.previousElementSibling(c)||
d.push(c);return d},"last-child":function(a){for(var b=0,d=[],c;c=a[b];b++)Selector.handlers.nextElementSibling(c)||d.push(c);return d},"only-child":function(a){for(var b=Selector.handlers,d=0,c=[],f;f=a[d];d++)!b.previousElementSibling(f)&&!b.nextElementSibling(f)&&c.push(f);return c},"nth-child":function(a,b,d){return Selector.pseudos.nth(a,b,d)},"nth-last-child":function(a,b,d){return Selector.pseudos.nth(a,b,d,true)},"nth-of-type":function(a,b,d){return Selector.pseudos.nth(a,b,d,false,true)},
"nth-last-of-type":function(a,b,d){return Selector.pseudos.nth(a,b,d,true,true)},"first-of-type":function(a,b,d){return Selector.pseudos.nth(a,"1",d,false,true)},"last-of-type":function(a,b,d){return Selector.pseudos.nth(a,"1",d,true,true)},"only-of-type":function(a,b,d){var c=Selector.pseudos;return c["last-of-type"](c["first-of-type"](a,b,d),b,d)},getIndices:function(a,b,d){if(a==0)return b>0?[b]:[];return $R(1,d).inject([],function(c,f){0==(f-b)%a&&(f-b)/a>=0&&c.push(f);return c})},nth:function(a,
b,d,c,f){if(a.length==0)return[];if(b=="even")b="2n+0";if(b=="odd")b="2n+1";d=Selector.handlers;var h=[],g=[],e;d.mark(a);for(var k=0;e=a[k];k++)if(!e.parentNode._countedByPrototype){d.index(e.parentNode,c,f);g.push(e.parentNode)}if(b.match(/^\d+$/)){b=Number(b);for(k=0;e=a[k];k++)e.nodeIndex==b&&h.push(e)}else if(e=b.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(e[1]=="-")e[1]=-1;k=e[1]?Number(e[1]):1;e=e[2]?Number(e[2]):0;b=Selector.pseudos.getIndices(k,e,a.length);k=0;for(c=b.length;e=a[k];k++)for(f=0;f<
c;f++)e.nodeIndex==b[f]&&h.push(e)}d.unmark(a);d.unmark(g);return h},empty:function(a){for(var b=0,d=[],c;c=a[b];b++)c.tagName=="!"||c.firstChild||d.push(c);return d},not:function(a,b,d){var c=Selector.handlers;b=(new Selector(b)).findElements(d);c.mark(b);d=0;for(var f=[],h;h=a[d];d++)h._countedByPrototype||f.push(h);c.unmark(b);return f},enabled:function(a){for(var b=0,d=[],c;c=a[b];b++)if(!c.disabled&&(!c.type||c.type!=="hidden"))d.push(c);return d},disabled:function(a){for(var b=0,d=[],c;c=a[b];b++)c.disabled&&
d.push(c);return d},checked:function(a){for(var b=0,d=[],c;c=a[b];b++)c.checked&&d.push(c);return d}},operators:{"=":function(a,b){return a==b},"!=":function(a,b){return a!=b},"^=":function(a,b){return a==b||a&&a.startsWith(b)},"$=":function(a,b){return a==b||a&&a.endsWith(b)},"*=":function(a,b){return a==b||a&&a.include(b)},"~=":function(a,b){return(" "+a+" ").include(" "+b+" ")},"|=":function(a,b){return("-"+(a||"").toUpperCase()+"-").include("-"+(b||"").toUpperCase()+"-")}},split:function(a){var b=
[];a.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(d){b.push(d[1].strip())});return b},matchElements:function(a,b){b=$$(b);var d=Selector.handlers;d.mark(b);for(var c=0,f=[],h;h=a[c];c++)h._countedByPrototype&&f.push(h);d.unmark(b);return f},findElement:function(a,b,d){if(Object.isNumber(b)){d=b;b=false}return Selector.matchElements(a,b||"*")[d||0]},findChildElements:function(a,b){b=Selector.split(b.join(","));for(var d=[],c=Selector.handlers,f=0,h=b.length,g;f<h;f++){g=new Selector(b[f].strip());
c.concat(d,g.findElements(a))}return h>1?c.unique(d):d}});Prototype.Browser.IE&&Object.extend(Selector.handlers,{concat:function(a,b){for(var d=0,c;c=b[d];d++)c.tagName!=="!"&&a.push(c);return a}});function $$(){return Selector.findChildElements(document,$A(arguments))}
var Form={reset:function(a){a=$(a);a.reset();return a},serializeElements:function(a,b){if(typeof b!="object")b={hash:!!b};else if(Object.isUndefined(b.hash))b.hash=true;var d,c,f=false,h=b.submit;a=a.inject({},function(g,e){if(!e.disabled&&e.name){d=e.name;c=$(e).getValue();if(c!=null&&e.type!="file"&&(e.type!="submit"||!f&&h!==false&&(!h||d==h)&&(f=true)))if(d in g){Object.isArray(g[d])||(g[d]=[g[d]]);g[d].push(c)}else g[d]=c}return g});return b.hash?a:Object.toQueryString(a)}};
Form.Methods={serialize:function(a,b){return Form.serializeElements(Form.getElements(a),b)},getElements:function(a){a=$(a).getElementsByTagName("*");for(var b,d=[],c=Form.Element.Serializers,f=0;b=a[f];f++)d.push(b);return d.inject([],function(h,g){c[g.tagName.toLowerCase()]&&h.push(Element.extend(g));return h})},getInputs:function(a,b,d){a=$(a);a=a.getElementsByTagName("input");if(!b&&!d)return $A(a).map(Element.extend);for(var c=0,f=[],h=a.length;c<h;c++){var g=a[c];b&&g.type!=b||d&&g.name!=d||
f.push(Element.extend(g))}return f},disable:function(a){a=$(a);Form.getElements(a).invoke("disable");return a},enable:function(a){a=$(a);Form.getElements(a).invoke("enable");return a},findFirstElement:function(a){a=$(a).getElements().findAll(function(d){return"hidden"!=d.type&&!d.disabled});var b=a.findAll(function(d){return d.hasAttribute("tabIndex")&&d.tabIndex>=0}).sortBy(function(d){return d.tabIndex}).first();return b?b:a.find(function(d){return/^(?:input|select|textarea)$/i.test(d.tagName)})},
focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a},request:function(a,b){a=$(a);b=Object.clone(b||{});var d=b.parameters,c=a.readAttribute("action")||"";if(c.blank())c=window.location.href;b.parameters=a.serialize(true);if(d){if(Object.isString(d))d=d.toQueryParams();Object.extend(b.parameters,d)}if(a.hasAttribute("method")&&!b.method)b.method=a.method;return new Ajax.Request(c,b)}};
Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};
Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var d={};d[a.name]=b;return Object.toQueryString(d)}}return""},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);var d=a.tagName.toLowerCase();Form.Element.Serializers[d](a,b);return a},clear:function(a){$(a).value="";return a},present:function(a){return $(a).value!=""},activate:function(a){a=$(a);try{a.focus();
if(a.select&&(a.tagName.toLowerCase()!="input"||!/^(?:button|reset|submit)$/i.test(a.type)))a.select()}catch(b){}return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element,$F=Form.Element.Methods.getValue;
Form.Element.Serializers={input:function(a,b){switch(a.type.toLowerCase()){case "checkbox":case "radio":return Form.Element.Serializers.inputSelector(a,b);default:return Form.Element.Serializers.textarea(a,b)}},inputSelector:function(a,b){if(Object.isUndefined(b))return a.checked?a.value:null;else a.checked=!!b},textarea:function(a,b){if(Object.isUndefined(b))return a.value;else a.value=b},select:function(a,b){if(Object.isUndefined(b))return this[a.type=="select-one"?"selectOne":"selectMany"](a);
else for(var d,c,f=!Object.isArray(b),h=0,g=a.length;h<g;h++){d=a.options[h];c=this.optionValue(d);if(f){if(c==b){d.selected=true;return}}else d.selected=b.include(c)}},selectOne:function(a){var b=a.selectedIndex;return b>=0?this.optionValue(a.options[b]):null},selectMany:function(a){var b,d=a.length;if(!d)return null;var c=0;for(b=[];c<d;c++){var f=a.options[c];f.selected&&b.push(this.optionValue(f))}return b},optionValue:function(a){return Element.extend(a).hasAttribute("value")?a.value:a.text}};
Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function(a,b,d,c){a(c,d);this.element=$(b);this.lastValue=this.getValue()},execute:function(){var a=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);this.lastValue=a}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});
Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});
Abstract.EventObserver=Class.create({initialize:function(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();this.element.tagName.toLowerCase()=="form"?this.registerFormCallbacks():this.registerCallback(this.element)},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(a){if(a.type)switch(a.type.toLowerCase()){case "checkbox":case "radio":Event.observe(a,
"click",this.onElementEvent.bind(this));break;default:Event.observe(a,"change",this.onElementEvent.bind(this));break}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});
(function(){function a(l){return v(l,0)}function b(l){return v(l,1)}function d(l){return v(l,2)}function c(l){l=u.extend(l);var n=l.target,r=l.type;if((l=l.currentTarget)&&l.tagName)if(r==="load"||r==="error"||r==="click"&&l.tagName.toLowerCase()==="input"&&l.type==="radio")n=l;if(n.nodeType==Node.TEXT_NODE)n=n.parentNode;return Element.extend(n)}function f(l,n){l=u.element(l);if(!n)return l;l=[l].concat(l.ancestors());return Selector.findElement(l,n,0)}function h(l){return{x:g(l),y:e(l)}}function g(l){var n=
document.documentElement,r=document.body||{scrollLeft:0};return l.pageX||l.clientX+(n.scrollLeft||r.scrollLeft)-(n.clientLeft||0)}function e(l){var n=document.documentElement,r=document.body||{scrollTop:0};return l.pageY||l.clientY+(n.scrollTop||r.scrollTop)-(n.clientTop||0)}function k(l){u.extend(l);l.preventDefault();l.stopPropagation();l.stopped=true}function m(l,n,r){var y=Element.retrieve(l,"prototype_event_registry");if(Object.isUndefined(y)){x.push(l);y=Element.retrieve(l,"prototype_event_registry",
$H())}var E=y.get(n);if(Object.isUndefined(E)){E=[];y.set(n,E)}if(E.pluck("handler").include(r))return false;var J;if(n.include(":"))J=function(I){if(Object.isUndefined(I.eventName))return false;if(I.eventName!==n)return false;u.extend(I,l);r.call(l,I)};else if(!p&&(n==="mouseenter"||n==="mouseleave")){if(n==="mouseenter"||n==="mouseleave")J=function(I){u.extend(I,l);for(var K=I.relatedTarget;K&&K!==l;)try{K=K.parentNode}catch(w){K=l}K!==l&&r.call(l,I)}}else J=function(I){u.extend(I,l);r.call(l,I)};
J.handler=r;E.push(J);return J}function o(){for(var l=0,n=x.length;l<n;l++){u.stopObserving(x[l]);x[l]=null}}function q(l,n,r){l=$(l);r=m(l,n,r);if(!r)return l;if(n.include(":"))if(l.addEventListener)l.addEventListener("dataavailable",r,false);else{l.attachEvent("ondataavailable",r);l.attachEvent("onfilterchange",r)}else{n=t(n);l.addEventListener?l.addEventListener(n,r,false):l.attachEvent("on"+n,r)}return l}function s(l,n,r){l=$(l);var y=Element.retrieve(l,"prototype_event_registry");if(Object.isUndefined(y))return l;
if(n&&!r){var E=y.get(n);if(Object.isUndefined(E))return l;E.each(function(K){Element.stopObserving(l,n,K.handler)});return l}else if(!n){y.each(function(K){var w=K.key;K.value.each(function(A){Element.stopObserving(l,w,A.handler)})});return l}if(E=y.get(n)){var J=E.find(function(K){return K.handler===r});if(!J)return l;var I=t(n);if(n.include(":"))if(l.removeEventListener)l.removeEventListener("dataavailable",J,false);else{l.detachEvent("ondataavailable",J);l.detachEvent("onfilterchange",J)}else l.removeEventListener?
l.removeEventListener(I,J,false):l.detachEvent("on"+I,J);y.set(n,E.without(J));return l}}function D(l,n,r,y){l=$(l);if(Object.isUndefined(y))y=true;if(l==document&&document.createEvent&&!l.dispatchEvent)l=document.documentElement;var E;if(document.createEvent){E=document.createEvent("HTMLEvents");E.initEvent("dataavailable",true,true)}else{E=document.createEventObject();E.eventType=y?"ondataavailable":"onfilterchange"}E.eventName=n;E.memo=r||{};document.createEvent?l.dispatchEvent(E):l.fireEvent(E.eventType,
E);return u.extend(E)}var u={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{}},B=document.documentElement,p="onmouseenter"in B&&"onmouseleave"in B,v;if(Prototype.Browser.IE){var z={0:1,1:4,2:2};v=function(l,n){return l.button===z[n]}}else v=Prototype.Browser.WebKit?function(l,n){switch(n){case 0:return l.which==1&&!l.metaKey;case 1:return l.which==1&&l.metaKey;
default:return false}}:function(l,n){return l.which?l.which===n+1:l.button===n};u.Methods={isLeftClick:a,isMiddleClick:b,isRightClick:d,element:c,findElement:f,pointer:h,pointerX:g,pointerY:e,stop:k};var H=Object.keys(u.Methods).inject({},function(l,n){l[n]=u.Methods[n].methodize();return l});if(Prototype.Browser.IE){function C(l){switch(l.type){case "mouseover":l=l.fromElement;break;case "mouseout":l=l.toElement;break;default:return null}return Element.extend(l)}Object.extend(H,{stopPropagation:function(){this.cancelBubble=
true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});u.extend=function(l,n){if(!l)return false;if(l._extendedByPrototype)return l;l._extendedByPrototype=Prototype.emptyFunction;var r=u.pointer(l);Object.extend(l,{target:l.srcElement||n,relatedTarget:C(l),pageX:r.x,pageY:r.y});return Object.extend(l,H)}}else{u.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(u.prototype,H);u.extend=Prototype.K}var x=[];Prototype.Browser.IE&&
window.attachEvent("onunload",o);Prototype.Browser.WebKit&&window.addEventListener("unload",Prototype.emptyFunction,false);var t=Prototype.K;p||(t=function(l){var n={mouseenter:"mouseover",mouseleave:"mouseout"};return l in n?n[l]:l});Object.extend(u,u.Methods);Object.extend(u,{fire:D,observe:q,stopObserving:s});Element.addMethods({fire:D,observe:q,stopObserving:s});Object.extend(document,{fire:D.methodize(),observe:q.methodize(),stopObserving:s.methodize(),loaded:false});if(window.Event)Object.extend(window.Event,
u);else window.Event=u})();
(function(){function a(){if(!document.loaded){c&&window.clearTimeout(c);document.loaded=true;document.fire("dom:loaded")}}function b(){if(document.readyState==="complete"){document.stopObserving("readystatechange",b);a()}}function d(){try{document.documentElement.doScroll("left")}catch(f){c=d.defer();return}a()}var c;if(document.addEventListener)document.addEventListener("DOMContentLoaded",a,false);else{document.observe("readystatechange",b);if(window==top)c=d.defer()}Event.observe(window,"load",
a)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;
var Insertion={Before:function(a,b){return Element.insert(a,{before:b})},Top:function(a,b){return Element.insert(a,{top:b})},Bottom:function(a,b){return Element.insert(a,{bottom:b})},After:function(a,b){return Element.insert(a,{after:b})}},$continue=new Error('"throw $continue" is deprecated, use "return" instead'),Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||
document.documentElement.scrollTop||document.body.scrollTop||0},within:function(a,b,d){if(this.includeScrollOffsets)return this.withinIncludingScrolloffsets(a,b,d);this.xcomp=b;this.ycomp=d;this.offset=Element.cumulativeOffset(a);return d>=this.offset[1]&&d<this.offset[1]+a.offsetHeight&&b>=this.offset[0]&&b<this.offset[0]+a.offsetWidth},withinIncludingScrolloffsets:function(a,b,d){var c=Element.cumulativeScrollOffset(a);this.xcomp=b+c[0]-this.deltaX;this.ycomp=d+c[1]-this.deltaY;this.offset=Element.cumulativeOffset(a);
return this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+a.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+a.offsetWidth},overlap:function(a,b){if(!a)return 0;if(a=="vertical")return(this.offset[1]+b.offsetHeight-this.ycomp)/b.offsetHeight;if(a=="horizontal")return(this.offset[0]+b.offsetWidth-this.xcomp)/b.offsetWidth},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},
relativize:function(a){Position.prepare();return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(a,b,d){d=d||{};return Element.clonePosition(b,a,d)}};
if(!document.getElementsByClassName)document.getElementsByClassName=function(a){function b(d){return d.blank()?null:"[contains(concat(' ', @class, ' '), ' "+d+" ')]"}a.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(d,c){c=c.toString().strip();return(c=/\s/.test(c)?$w(c).map(b).join(""):b(c))?document._getElementsByXPath(".//*"+c,d):[]}:function(d,c){c=c.toString().strip();var f=[],h=/\s/.test(c)?$w(c):null;if(!h&&!c)return f;d=$(d).getElementsByTagName("*");c=" "+c+" ";for(var g=
0,e,k;e=d[g];g++)if(e.className&&(k=" "+e.className+" ")&&(k.include(c)||h&&h.all(function(m){return!m.toString().blank()&&k.include(" "+m+" ")})))f.push(Element.extend(e));return f};return function(d,c){return $(c||document.body).getElementsByClassName(d)}}(Element.Methods);Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0})._each(a)},set:function(a){this.element.className=a},add:function(a){this.include(a)||this.set($A(this).concat(a).join(" "))},remove:function(a){this.include(a)&&this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);
var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(a,b,d){a=a.toUpperCase();var c=document.createElement(this.NODEMAP[a]||"div");try{c.innerHTML="<"+a+"></"+a+">"}catch(f){}var h=c.firstChild||null;if(h&&h.tagName.toUpperCase()!=a)h=h.getElementsByTagName(a)[0];h||(h=document.createElement(a));if(h){if(b)if(this._isStringOrNumber(b)||
b instanceof Array||b.tagName)this._children(h,b);else{var g=this._attributes(b);if(g.length){try{c.innerHTML="<"+a+" "+g+"></"+a+">"}catch(e){}h=c.firstChild||null;if(!h){h=document.createElement(a);for(attr in b)h[attr=="class"?"className":attr]=b[attr]}if(h.tagName.toUpperCase()!=a)h=c.getElementsByTagName(a)[0]}}d&&this._children(h,d);return h}},_text:function(a){return document.createTextNode(a)},ATTR_MAP:{className:"class",htmlFor:"for"},_attributes:function(a){var b=[];for(attribute in a)b.push((attribute in
this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+a[attribute].toString().escapeHTML().gsub(/"/,"&quot;")+'"');return b.join(" ")},_children:function(a,b){if(b.tagName)a.appendChild(b);else if(typeof b=="object")b.flatten().each(function(d){if(typeof d=="object")a.appendChild(d);else Builder._isStringOrNumber(d)&&a.appendChild(Builder._text(d))});else Builder._isStringOrNumber(b)&&a.appendChild(Builder._text(b))},_isStringOrNumber:function(a){return typeof a=="string"||typeof a=="number"},build:function(a){var b=
this.node("div");$(b).update(a.strip());return b.down()},dump:function(a){if(typeof a!="object"&&typeof a!="function")a=window;"A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR".split(/\s+/).each(function(b){a[b]=
function(){return Builder.node.apply(Builder,[b].concat($A(arguments)))}})}};String.prototype.parseColor=function(a){var b="#";if(this.slice(0,4)=="rgb("){var d=this.slice(4,this.length-1).split(","),c=0;do b+=parseInt(d[c]).toColorPart();while(++c<3)}else if(this.slice(0,1)=="#"){if(this.length==4)for(c=1;c<4;c++)b+=(this.charAt(c)+this.charAt(c)).toLowerCase();if(this.length==7)b=this.toLowerCase()}return b.length==7?b:a||this};
Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return b.nodeType==3?b.nodeValue:b.hasChildNodes()?Element.collectTextNodes(b):""}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(d){return d.nodeType==3?d.nodeValue:d.hasChildNodes()&&!Element.hasClassName(d,b)?Element.collectTextNodesIgnoreClass(d,b):""}).flatten().join("")};
Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:b/100+"em"});Prototype.Browser.WebKit&&window.scrollBy(0,0);return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.forceRerendering=function(a){try{a=$(a);var b=document.createTextNode(" ");a.appendChild(b);a.removeChild(b)}catch(d){}};
var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return-Math.cos(a*Math.PI)/2+0.5},reverse:function(a){return 1-a},flicker:function(a){a=-Math.cos(a*Math.PI)/4+0.75+Math.random()/4;return a>1?1:a},wobble:function(a){return-Math.cos(a*Math.PI*9*a)/2+0.5},pulse:function(a,b){b=b||5;return(a%(1/b)*b).round()==0?a*b*2-(a*b*2).floor():
1-(a*b*2-(a*b*2).floor())},spring:function(a){return 1-Math.cos(a*4.5*Math.PI)*Math.exp(-a*6)},none:function(){return 0},full:function(){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";if(Prototype.Browser.IE)b+=";zoom:1";a=$(a);$A(a.childNodes).each(function(d){if(d.nodeType==3){d.nodeValue.toArray().each(function(c){a.insertBefore((new Element("span",{style:b})).update(c==" "?String.fromCharCode(160):
c),d)});Element.remove(d)}})},multiple:function(a,b,d){a=(typeof a=="object"||Object.isFunction(a))&&a.length?a:$(a).childNodes;var c=Object.extend({speed:0.1,delay:0},d||{}),f=c.delay;$A(a).each(function(h,g){new b(h,Object.extend(c,{delay:g*c.speed+f}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(a,b,d){a=$(a);b=(b||"appear").toLowerCase();d=Object.extend({queue:{position:"end",scope:a.id||"global",limit:1}},d||{});Effect[a.visible()?
Effect.PAIRS[b][1]:Effect.PAIRS[b][0]](a,d)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;
Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(a){var b=(new Date).getTime();switch(Object.isString(a.options.queue)?a.options.queue:a.options.queue.position){case "front":this.effects.findAll(function(d){return d.state=="idle"}).each(function(d){d.startOn+=a.finishOn;d.finishOn+=a.finishOn});break;case "with-last":b=this.effects.pluck("startOn").max()||b;break;case "end":b=this.effects.pluck("finishOn").max()||
b;break}a.startOn+=b;a.finishOn+=b;if(!a.options.queue.limit||this.effects.length<a.options.queue.limit)this.effects.push(a);if(!this.interval)this.interval=setInterval(this.loop.bind(this),15)},remove:function(a){this.effects=this.effects.reject(function(b){return b==a});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){for(var a=(new Date).getTime(),b=0,d=this.effects.length;b<d;b++)this.effects[b]&&this.effects[b].loop(a)}});
Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a))return a;return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue)}};Effect.Queue=Effect.Queues.get("global");
Effect.Base=Class.create({position:null,start:function(a){function b(d,c){return(d[c+"Internal"]?"this.options."+c+"Internal(this);":"")+(d[c]?"this.options."+c+"(this);":"")}if(a&&a.transition===false)a.transition=Effect.Transitions.linear;this.options=Object.extend(Object.extend({},Effect.DefaultOptions),a||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1E3;this.finishOn=this.startOn+this.options.duration*1E3;this.fromToDelta=this.options.to-this.options.from;this.totalTime=
this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;eval('this.render = function(pos){ if (this.state=="idle"){this.state="running";'+b(this.options,"beforeSetup")+(this.setup?"this.setup();":"")+b(this.options,"afterSetup")+'};if (this.state=="running"){pos=this.options.transition(pos)*'+this.fromToDelta+"+"+this.options.from+";this.position=pos;"+b(this.options,"beforeUpdate")+(this.update?"this.update(pos);":"")+b(this.options,"afterUpdate")+"}}");this.event("beforeStart");
this.options.sync||Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)},loop:function(a){if(a>=this.startOn)if(a>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");this.finish&&this.finish();this.event("afterFinish")}else{a=(a-this.startOn)/this.totalTime;var b=(a*this.totalFrames).round();if(b>this.currentFrame){this.render(a);this.currentFrame=b}}},cancel:function(){this.options.sync||Effect.Queues.get(Object.isString(this.options.queue)?
"global":this.options.queue.scope).remove(this);this.state="finished"},event:function(a){this.options[a+"Internal"]&&this.options[a+"Internal"](this);this.options[a]&&this.options[a](this)},inspect:function(){var a=$H();for(property in this)Object.isFunction(this[property])||a.set(property,this[property]);return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}});
Effect.Parallel=Class.create(Effect.Base,{initialize:function(a,b){this.effects=a||[];this.start(b)},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");b.finish&&b.finish(a);b.event("afterFinish")})}});
Effect.Tween=Class.create(Effect.Base,{initialize:function(a,b,d){a=Object.isString(a)?$(a):a;var c=$A(arguments),f=c.last();c=c.length==5?c[3]:null;this.method=Object.isFunction(f)?f.bind(a):Object.isFunction(a[f])?a[f].bind(a):function(h){a[f]=h};this.start(Object.extend({from:b,to:d},c||{}))},update:function(a){this.method(a)}});Effect.Event=Class.create(Effect.Base,{initialize:function(a){this.start(Object.extend({duration:0},a||{}))},update:Prototype.emptyFunction});
Effect.Opacity=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&&this.element.setStyle({zoom:1});this.start(Object.extend({from:this.element.getOpacity()||0,to:1},b||{}))},update:function(a){this.element.setOpacity(a)}});
Effect.Move=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({x:0,y:0,mode:"relative"},b||{}))},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x-=this.originalLeft;this.options.y-=this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*
a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})}});Effect.MoveBy=function(a,b,d,c){return new Effect.Move(a,Object.extend({x:d,y:b},c||{}))};
Effect.Scale=Class.create(Effect.Base,{initialize:function(a,b,d){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:b},d||{}))},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=
this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box")this.dims=[this.element.offsetHeight,this.element.offsetWidth];if(/^content/.test(this.options.scaleMode))this.dims=
[this.element.scrollHeight,this.element.scrollWidth];if(!this.dims)this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]},update:function(a){a=this.options.scaleFrom/100+this.factor*a;this.options.scaleContent&&this.fontSize&&this.element.setStyle({fontSize:this.fontSize*a+this.fontSizeType});this.setDimensions(this.dims[0]*a,this.dims[1]*a)},finish:function(){this.restoreAfterFinish&&this.element.setStyle(this.originalStyle)},setDimensions:function(a,b){var d={};
if(this.options.scaleX)d.width=b.round()+"px";if(this.options.scaleY)d.height=a.round()+"px";if(this.options.scaleFromCenter){a=(a-this.dims[0])/2;b=(b-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY)d.top=this.originalTop-a+"px";if(this.options.scaleX)d.left=this.originalLeft-b+"px"}else{if(this.options.scaleY)d.top=-a+"px";if(this.options.scaleX)d.left=-b+"px"}}this.element.setStyle(d)}});
Effect.Highlight=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;this.start(Object.extend({startcolor:"#ffff99"},b||{}))},setup:function(){if(this.element.getStyle("display")=="none")this.cancel();else{this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor)this.options.endcolor=
this.element.getStyle("background-color").parseColor("#ffffff");if(!this.options.restorecolor)this.options.restorecolor=this.element.getStyle("background-color");this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))}},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,d,c){return b+
(this._base[c]+this._delta[c]*a).round().toColorPart()}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(a,b){b=b||{};var d=document.viewport.getScrollOffsets();a=$(a).cumulativeOffset();var c=(window.height||document.body.scrollHeight)-document.viewport.getHeight();if(b.offset)a[1]+=b.offset;return new Effect.Tween(null,d.top,a[1]>c?c:a[1],b,function(f){scrollTo(d.left,f.round())})};
Effect.Fade=function(a,b){a=$(a);var d=a.getInlineOpacity();b=Object.extend({from:a.getOpacity()||1,to:0,afterFinishInternal:function(c){c.options.to==0&&c.element.hide().setStyle({opacity:d})}},b||{});return new Effect.Opacity(a,b)};
Effect.Appear=function(a,b){a=$(a);b=Object.extend({from:a.getStyle("display")=="none"?0:a.getOpacity()||0,to:1,afterFinishInternal:function(d){d.element.forceRerendering()},beforeSetup:function(d){d.element.setOpacity(d.options.from).show()}},b||{});return new Effect.Opacity(a,b)};
Effect.Puff=function(a,b){a=$(a);var d={opacity:a.getInlineOpacity(),position:a.getStyle("position"),top:a.style.top,left:a.style.left,width:a.style.width,height:a.style.height};return new Effect.Parallel([new Effect.Scale(a,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(a,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(c){Position.absolutize(c.effects[0].element)},afterFinishInternal:function(c){c.effects[0].element.hide().setStyle(d)}},
b||{}))};Effect.BlindUp=function(a,b){a=$(a);a.makeClipping();return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(d){d.element.hide().undoClipping()}},b||{}))};
Effect.BlindDown=function(a,b){a=$(a);var d=a.getDimensions();return new Effect.Scale(a,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(c){c.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(c){c.element.undoClipping()}},b||{}))};
Effect.SwitchOff=function(a,b){a=$(a);var d=a.getInlineOpacity();return new Effect.Appear(a,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(c){new Effect.Scale(c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(f){f.element.makePositioned().makeClipping()},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned().setStyle({opacity:d})}})}},b||{}))};
Effect.DropOut=function(a,b){a=$(a);var d={top:a.getStyle("top"),left:a.getStyle("left"),opacity:a.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(a,{x:0,y:100,sync:true}),new Effect.Opacity(a,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(c){c.effects[0].element.makePositioned()},afterFinishInternal:function(c){c.effects[0].element.hide().undoPositioned().setStyle(d)}},b||{}))};
Effect.Shake=function(a,b){a=$(a);b=Object.extend({distance:20,duration:0.5},b||{});var d=parseFloat(b.distance),c=parseFloat(b.duration)/10,f={top:a.getStyle("top"),left:a.getStyle("left")};return new Effect.Move(a,{x:d,y:0,duration:c,afterFinishInternal:function(h){new Effect.Move(h.element,{x:-d*2,y:0,duration:c*2,afterFinishInternal:function(g){new Effect.Move(g.element,{x:d*2,y:0,duration:c*2,afterFinishInternal:function(e){new Effect.Move(e.element,{x:-d*2,y:0,duration:c*2,afterFinishInternal:function(k){new Effect.Move(k.element,
{x:d*2,y:0,duration:c*2,afterFinishInternal:function(m){new Effect.Move(m.element,{x:-d,y:0,duration:c,afterFinishInternal:function(o){o.element.undoPositioned().setStyle(f)}})}})}})}})}})}})};
Effect.SlideDown=function(a,b){a=$(a).cleanWhitespace();var d=a.down().getStyle("bottom"),c=a.getDimensions();return new Effect.Scale(a,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:c.height,originalWidth:c.width},restoreAfterFinish:true,afterSetup:function(f){f.element.makePositioned();f.element.down().makePositioned();window.opera&&f.element.setStyle({top:""});f.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:f.dims[0]-
f.element.clientHeight+"px"})},afterFinishInternal:function(f){f.element.undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:d})}},b||{}))};
Effect.SlideUp=function(a,b){a=$(a).cleanWhitespace();var d=a.down().getStyle("bottom"),c=a.getDimensions();return new Effect.Scale(a,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:c.height,originalWidth:c.width},restoreAfterFinish:true,afterSetup:function(f){f.element.makePositioned();f.element.down().makePositioned();window.opera&&f.element.setStyle({top:""});f.element.makeClipping().show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:f.dims[0]-
f.element.clientHeight+"px"})},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:d})}},b||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()},afterFinishInternal:function(b){b.element.hide().undoClipping()}})};
Effect.Grow=function(a,b){a=$(a);var d=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},b||{}),c={top:a.style.top,left:a.style.left,height:a.style.height,width:a.style.width,opacity:a.getInlineOpacity()},f=a.getDimensions(),h,g,e,k;switch(d.direction){case "top-left":h=g=e=k=0;break;case "top-right":h=f.width;g=k=0;e=-f.width;break;case "bottom-left":h=e=0;g=f.height;k=-f.height;break;
case "bottom-right":h=f.width;g=f.height;e=-f.width;k=-f.height;break;case "center":h=f.width/2;g=f.height/2;e=-f.width/2;k=-f.height/2;break}return new Effect.Move(a,{x:h,y:g,duration:0.01,beforeSetup:function(m){m.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(m){new Effect.Parallel([new Effect.Opacity(m.element,{sync:true,to:1,from:0,transition:d.opacityTransition}),new Effect.Move(m.element,{x:e,y:k,sync:true,transition:d.moveTransition}),new Effect.Scale(m.element,
100,{scaleMode:{originalHeight:f.height,originalWidth:f.width},sync:true,scaleFrom:window.opera?1:0,transition:d.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(o){o.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(o){o.effects[0].element.undoClipping().undoPositioned().setStyle(c)}},d))}})};
Effect.Shrink=function(a,b){a=$(a);b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},b||{});var d={top:a.style.top,left:a.style.left,height:a.style.height,width:a.style.width,opacity:a.getInlineOpacity()},c=a.getDimensions(),f,h;switch(b.direction){case "top-left":f=h=0;break;case "top-right":f=c.width;h=0;break;case "bottom-left":f=0;h=c.height;break;case "bottom-right":f=c.width;h=
c.height;break;case "center":f=c.width/2;h=c.height/2;break}return new Effect.Parallel([new Effect.Opacity(a,{sync:true,to:0,from:1,transition:b.opacityTransition}),new Effect.Scale(a,window.opera?1:0,{sync:true,transition:b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(a,{x:f,y:h,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(g){g.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(g){g.effects[0].element.hide().undoClipping().undoPositioned().setStyle(d)}},
b))};Effect.Pulsate=function(a,b){a=$(a);var d=b||{},c=a.getInlineOpacity(),f=d.transition||Effect.Transitions.sinoidal;b=function(h){return f(1-Effect.Transitions.pulse(h,d.pulses))};b.bind(f);return new Effect.Opacity(a,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(h){h.element.setStyle({opacity:c})}},d),{transition:b}))};
Effect.Fold=function(a,b){a=$(a);var d={top:a.style.top,left:a.style.left,width:a.style.width,height:a.style.height};a.makeClipping();return new Effect.Scale(a,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(){new Effect.Scale(a,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(c){c.element.hide().undoClipping().setStyle(d)}})}},b||{}))};
Effect.Morph=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw Effect._elementDoesNotExistError;a=Object.extend({style:{}},b||{});if(Object.isString(a.style))if(a.style.include(":"))this.style=a.style.parseStyle();else{this.element.addClassName(a.style);this.style=$H(this.element.getStyles());this.element.removeClassName(a.style);var d=this.element.getStyles();this.style=this.style.reject(function(c){return c.value==d[c.key]});a.afterFinishInternal=function(c){c.element.addClassName(c.options.style);
c.transforms.each(function(f){c.element.style[f.style]=""})}}else this.style=$H(a.style);this.start(a)},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b))b="#ffffff";b=b.parseColor();return $R(0,2).map(function(d){return parseInt(b.slice(d*2+1,d*2+3),16)})}this.transforms=this.style.map(function(b){var d=b[0];b=b[1];var c=null;if(b.parseColor("#zzzzzz")!="#zzzzzz"){b=b.parseColor();c="color"}else if(d=="opacity"){b=parseFloat(b);Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&&
this.element.setStyle({zoom:1})}else if(Element.CSS_LENGTH.test(b)){c=b.match(/^([\+\-]?[0-9\.]+)(.*)$/);b=parseFloat(c[1]);c=c.length==3?c[2]:null}var f=this.element.getStyle(d);return{style:d.camelize(),originalValue:c=="color"?a(f):parseFloat(f||0),targetValue:c=="color"?a(b):b,unit:c}}.bind(this)).reject(function(b){return b.originalValue==b.targetValue||b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))})},update:function(a){for(var b={},d,c=this.transforms.length;c--;)b[(d=this.transforms[c]).style]=
d.unit=="color"?"#"+Math.round(d.originalValue[0]+(d.targetValue[0]-d.originalValue[0])*a).toColorPart()+Math.round(d.originalValue[1]+(d.targetValue[1]-d.originalValue[1])*a).toColorPart()+Math.round(d.originalValue[2]+(d.targetValue[2]-d.originalValue[2])*a).toColorPart():(d.originalValue+(d.targetValue-d.originalValue)*a).toFixed(3)+(d.unit===null?"":d.unit);this.element.setStyle(b,true)}});
Effect.Transform=Class.create({initialize:function(a,b){this.tracks=[];this.options=b||{};this.addTracks(a)},addTracks:function(a){a.each(function(b){b=$H(b);var d=b.values().first();this.tracks.push($H({ids:b.keys().first(),effect:Effect.Morph,options:{style:d}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var b=a.get("ids"),d=a.get("effect"),c=a.get("options");return[$(b)||$$(b)].flatten().map(function(f){return new d(f,Object.extend({sync:true},
c))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");
Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");
String.prototype.parseStyle=function(){var a,b=$H();if(Prototype.Browser.WebKit)a=(new Element("div",{style:this})).style;else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';a=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(d){a[d]&&b.set(d,a[d])});Prototype.Browser.IE&&this.include("opacity")&&b.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);return b};
Element.getStyles=document.defaultView&&document.defaultView.getComputedStyle?function(a){var b=document.defaultView.getComputedStyle($(a),null);return Element.CSS_PROPERTIES.inject({},function(d,c){d[c]=b[c];return d})}:function(a){a=$(a);var b=a.currentStyle,d;d=Element.CSS_PROPERTIES.inject({},function(c,f){c[f]=b[f];return c});if(!d.opacity)d.opacity=a.getOpacity();return d};
Effect.Methods={morph:function(a,b,d){a=$(a);new Effect.Morph(a,Object.extend({style:b},d||{}));return a},visualEffect:function(a,b,d){a=$(a);b=b.dasherize().camelize();b=b.charAt(0).toUpperCase()+b.substring(1);new Effect[b](a,d);return a},highlight:function(a,b){a=$(a);new Effect.Highlight(a,b);return a}};
$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(b,d){b=$(b);Effect[a.charAt(0).toUpperCase()+a.substring(1)](b,d);return b}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]});Element.addMethods(Effect.Methods);
var Scriptaculous={Version:"1.8.1",require:function(a){document.write('<script type="text/javascript" src="'+a+'"><\/script>')},REQUIRED_PROTOTYPE:"1.6.0",load:function(){function a(b){b=b.split(".");return parseInt(b[0])*1E5+parseInt(b[1])*1E3+parseInt(b[2])}if(typeof Prototype=="undefined"||typeof Element=="undefined"||typeof Element.Methods=="undefined"||a(Prototype.Version)<a(Scriptaculous.REQUIRED_PROTOTYPE))throw"script.aculo.us requires the Prototype JavaScript framework >= "+Scriptaculous.REQUIRED_PROTOTYPE;
$A(document.getElementsByTagName("script")).findAll(function(b){return b.src&&b.src.match(/scriptaculous\.js(\?.*)?$/)}).each(function(b){var d=b.src.replace(/scriptaculous\.js(\?.*)?$/,"");b=b.src.match(/\?.*load=([a-z,]*)/);(b?b[1]:"builder,effects,dragdrop,controls,slider,sound").split(",").each(function(c){Scriptaculous.require(d+c+".js")})})}};Scriptaculous.load();if(typeof Effect=="undefined")throw"lightwindow.js requires including script.aculo.us' effects.js library!";
try{document.execCommand("BackgroundImageCache",false,true)}catch(e$$52){}var lightwindow=Class.create();
lightwindow.prototype={element:null,contentToFetch:null,windowActive:false,dataEffects:[],dimensions:{cruft:null,container:null,viewport:{height:null,width:null,offsetTop:null,offsetLeft:null}},pagePosition:{x:0,y:0},preloadImage:[],preloadedImage:[],galleries:[],resizeTo:{height:null,heightPercent:null,width:null,widthPercent:null,fixedTop:null,fixedLeft:null},scrollbarOffset:18,navigationObservers:{previous:null,next:null},containerChange:{height:0,width:0},activeGallery:false,galleryLocation:{current:0,
total:0},initialize:function(a){this.options=Object.extend({resizeSpeed:50,contentOffset:{height:20,width:20},dimensions:{image:{height:250,width:250},page:{height:250,width:250},inline:{height:250,width:250},media:{height:250,width:250},external:{height:250,width:250},titleHeight:25},classNames:{standard:"lightwindow",action:"lightwindow_action"},fileTypes:{page:["asp","aspx","cgi","cfm","htm","html","pl","php4","php3","php","php5","phtml","rhtml","shtml","txt","vbs","rb"],media:["aif","aiff","asf",
"avi","divx","m1v","m2a","m2v","m3u","mid","midi","mov","moov","movie","mp2","mp3","mpa","mpa","mpe","mpeg","mpg","mpg","mpga","pps","qt","rm","ram","swf","viv","vivo","wav"],image:["bmp","gif","jpg","png","tiff"]},mimeTypes:{avi:"video/avi",aif:"audio/aiff",aiff:"audio/aiff",gif:"image/gif",bmp:"image/bmp",jpeg:"image/jpeg",m1v:"video/mpeg",m2a:"audio/mpeg",m2v:"video/mpeg",m3u:"audio/x-mpequrl",mid:"audio/x-midi",midi:"audio/x-midi",mjpg:"video/x-motion-jpeg",moov:"video/quicktime",mov:"video/quicktime",
movie:"video/x-sgi-movie",mp2:"audio/mpeg",mp3:"audio/mpeg3",mpa:"audio/mpeg",mpa:"video/mpeg",mpe:"video/mpeg",mpeg:"video/mpeg",mpg:"audio/mpeg",mpg:"video/mpeg",mpga:"audio/mpeg",pdf:"application/pdf",png:"image/png",pps:"application/mspowerpoint",qt:"video/quicktime",ram:"audio/x-pn-realaudio-plugin",rm:"application/vnd.rn-realmedia",swf:"application/x-shockwave-flash",tiff:"image/tiff",viv:"video/vivo",vivo:"video/vivo",wav:"audio/wav",wmv:"application/x-mplayer2"},classids:{mov:"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",
swf:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",wmv:"clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"},codebases:{mov:"http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0",swf:"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0",wmv:"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"},viewportPadding:10,EOLASFix:"swf,wmv,fla,flv",overlay:{opacity:0.7,image:"/includes/lightwindow/images/black.png",presetImage:"/includes/lightwindow/images/black-70.png"},
skin:{main:'<div id="lightwindow_container" ><div id="lightwindow_title_bar" ><div id="lightwindow_title_bar_inner" ><span id="lightwindow_title_bar_title"></span><a id="lightwindow_title_bar_close_link" ><img src="/images/nav/Btn1_Close2.gif" width="47" height="20" onmouseover="fnMouseOver(this, \'/images/nav/Btn1_Close-over.gif\');" onmouseout="fnMouseOut(this);" alt="Close" /></a></div></div><div id="lightwindow_stage" ><div id="lightwindow_contents" ></div><div id="lightwindow_navigation" ><a href="#" id="lightwindow_previous" ><span id="lightwindow_previous_title"></span></a><a href="#" id="lightwindow_next" ><span id="lightwindow_next_title"></span></a><iframe name="lightwindow_navigation_shim" id="lightwindow_navigation_shim" src="javascript:false;" frameBorder="0" scrolling="no"></iframe></div><div id="lightwindow_galleries" style="visibility: hidden;"><div id="lightwindow_galleries_tab_container" ><a href="#" id="lightwindow_galleries_tab" ><span id="lightwindow_galleries_tab_span" class="up" >Galleries</span></a></div><div id="lightwindow_galleries_list" ></div></div></div><div id="lightwindow_data_slide" ><div id="lightwindow_data_slide_inner" ><div id="lightwindow_data_details" ><div id="lightwindow_data_gallery_container" ><span id="lightwindow_data_gallery_current"></span> of <span id="lightwindow_data_gallery_total"></span></div><div id="lightwindow_data_buttons_container" ><span id="lightwindow_data_buttons_previous"><a href="#" id="lightwindow_data_previous"><img src="/includes/lightwindow/images/prevlabel.gif" width="47" height="20" onmouseover="fnMouseOver(this, \'/includes/lightwindow/images/prevlabel-hover.gif\');" onmouseout="fnMouseOut(this);"></a></span><span id="lightwindow_data_buttons_next"><a href="#" id="lightwindow_data_next"><img src="/includes/lightwindow/images/nextlabel.gif" width="47" height="20" onmouseover="fnMouseOver(this, \'/includes/lightwindow/images/nextlabel-hover.gif\');" onmouseout="fnMouseOut(this);"></a></span></div><div id="lightwindow_data_author_container" >by <span id="lightwindow_data_author"></span></div></div><div id="lightwindow_data_caption" ></div></div></div></div>',
loading:'<div id="lightwindow_loading" ><div><img src="/images/icons/Loading.gif" alt="loading" /></div><div>Loading or <a href="javascript: myLightWindow.deactivate();">Cancel</a></div><iframe name="lightwindow_loading_shim" id="lightwindow_loading_shim" src="javascript:false;" frameBorder="0" scrolling="no"></iframe></div>',iframe:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><body>{body_replace}</body></html>',
gallery:{top:'<div class="lightwindow_galleries_list"><h1>{gallery_title_replace}</h1><ul>',middle:"<li>{gallery_link_replace}</li>",bottom:"</ul></div>"}},formMethod:"get",hideFlash:false,hideGalleryTab:false,showTitleBar:true,animationHandler:false,navigationHandler:false,transitionHandler:false,finalAnimationHandler:false,formHandler:false,galleryAnimationHandler:false,showGalleryCount:true},a||{});this.duration=(11-this.options.resizeSpeed)*0.15;this._setupLinks();this._getScroll();this._browserDimensions();
this._addLightWindowMarkup(false);this._setupDimensions();this.buildGalleryList()},activate:function(a,b){this._clearWindowContents(true);this._addLoadingWindowMarkup();this._setupWindowElements(b);this._getScroll();this._browserDimensions();this._setupDimensions();this._toggleTroubleElements("hidden",false);this._displayLightWindow("block","hidden");this._setStatus(true);this._monitorKeyboard(true);this._prepareIE(true);this._loadWindow()},deactivate:function(){this.activeGallery=this.windowActive=
false;this.options.hideGalleryTab||this._handleGalleryAnimation(false);this.animating=false;this.element=null;this._displayLightWindow("none","visible");this._clearWindowContents(false);Effect.Queues.get("lightwindowAnimation").each(function(a){a.cancel()});this._prepareIE(false);this._setupDimensions();this._toggleTroubleElements("visible",false);this._monitorKeyboard(false)},createWindow:function(a){this._processLink($(a))},activateWindow:function(a){this.element=Object.extend({href:null,title:null,
author:null,caption:null,rel:null,top:null,left:null,type:null,showImages:null,height:null,width:null,loadingAnimation:null,iframeEmbed:null,form:null},a||{});this.contentToFetch=this.element.href;this.windowType=this.element.type?this.element.type:this._fileType(this.element.href);this._clearWindowContents(true);this._addLoadingWindowMarkup();this._getScroll();this._browserDimensions();this._setupDimensions();this._toggleTroubleElements("hidden",false);this._displayLightWindow("block","hidden");
this._setStatus(true);this._monitorKeyboard(true);this._prepareIE(true);this._loadWindow()},submitForm:function(a){this.options.formHandler?this.options.formHandler(a):this._defaultFormHandler(a)},openWindow:function(a){a=$(a);this.windowActive=true;this._clearWindowContents(true);this._addLoadingWindowMarkup();this._setupWindowElements(a);this._setStatus(true);this._handleTransition()},navigateWindow:function(a){this._handleNavigation(false);if(a=="previous")this.openWindow(this.navigationObservers.previous);
else a=="next"&&this.openWindow(this.navigationObservers.next)},buildGalleryList:function(){var a="",b;for(i in this.galleries)if(typeof this.galleries[i]=="object"){a+=this.options.skin.gallery.top.replace("{gallery_title_replace}",unescape(i));for(j in this.galleries[i])if(typeof this.galleries[i][j]=="object"){b='<a href="#" id="lightwindow_gallery_'+i+"_"+j+'" >'+unescape(j)+"</a>";a+=this.options.skin.gallery.middle.replace("{gallery_link_replace}",b)}a+=this.options.skin.gallery.bottom}new Insertion.Top("lightwindow_galleries_list",
a);for(i in this.galleries)if(typeof this.galleries[i]=="object")for(j in this.galleries[i])if(typeof this.galleries[i][j]=="object"){Event.observe($("lightwindow_gallery_"+i+"_"+j),"click",this.openWindow.bind(this,this.galleries[i][j][0]),false);$("lightwindow_gallery_"+i+"_"+j).onclick=function(){return false}}},_setupLinks:function(){$$("."+this.options.classNames.standard).each(function(a){this._processLink(a)}.bind(this))},_processLink:function(a){if(gallery=this._getGalleryInfo(a.rel)){this.galleries[gallery[0]]||
(this.galleries[gallery[0]]=[]);this.galleries[gallery[0]][gallery[1]]||(this.galleries[gallery[0]][gallery[1]]=[]);this.galleries[gallery[0]][gallery[1]].push(a)}var b=a.getAttribute("href");if(b.indexOf("?")>-1)b=b.substring(0,b.indexOf("?"));b=b.substring(b.indexOf("#")+1);$(b)&&$(b).setStyle({display:"none"});Event.observe(a,"click",this.activate.bindAsEventListener(this,a),false);a.onclick=function(){return false}},_setupActions:function(){$$("#lightwindow_container ."+this.options.classNames.action).each(function(a){Event.observe(a,
"click",this[a.getAttribute("rel")].bindAsEventListener(this,a),false);a.onclick=function(){return false}}.bind(this))},_addLightWindowMarkup:function(){var a=Element.extend(document.createElement("div"));a.setAttribute("id","lightwindow_overlay");Prototype.Browser.Gecko?a.setStyle({backgroundImage:"url("+this.options.overlay.presetImage+")",backgroundRepeat:"repeat",height:"100%",left:0,top:0,width:"100%",position:"fixed"}):a.setStyle({opacity:this.options.overlay.opacity,backgroundImage:"url("+
this.options.overlay.image+")",backgroundRepeat:"repeat",height:"100%",left:0,top:0,width:"100%",position:"fixed"});var b=document.createElement("div");b.setAttribute("id","lightwindow");b.innerHTML=this.options.skin.main;var d=document.getElementsByTagName("body")[0];d.appendChild(a);d.appendChild(b);if($("lightwindow_title_bar_close_link")){Event.observe("lightwindow_title_bar_close_link","click",this.deactivate.bindAsEventListener(this));$("lightwindow_title_bar_close_link").onclick=function(){return false}}Event.observe($("lightwindow_previous"),
"click",this.navigateWindow.bind(this,"previous"),false);$("lightwindow_previous").onclick=function(){return false};Event.observe($("lightwindow_next"),"click",this.navigateWindow.bind(this,"next"),false);$("lightwindow_next").onclick=function(){return false};Event.observe($("lightwindow_data_previous"),"click",this.navigateWindow.bind(this,"previous"),false);$("lightwindow_data_previous").onclick=function(){return false};Event.observe($("lightwindow_data_next"),"click",this.navigateWindow.bind(this,
"next"),false);$("lightwindow_data_next").onclick=function(){return false};if(!this.options.hideGalleryTab){Event.observe($("lightwindow_galleries_tab"),"click",this._handleGalleryAnimation.bind(this,true),false);$("lightwindow_galleries_tab").onclick=function(){return false}}Prototype.Browser.IE?Event.observe(document,"mousewheel",this._stopScrolling.bindAsEventListener(this),false):Event.observe(window,"DOMMouseScroll",this._stopScrolling.bindAsEventListener(this),false);Event.observe(a,"click",
this.deactivate.bindAsEventListener(this),false);a.onclick=function(){return false}},_addLoadingWindowMarkup:function(){$("lightwindow_contents").innerHTML+=this.options.skin.loading},_setupWindowElements:function(a){this.element=a;this.element.title=a.getAttribute("title");this.element.author=a.getAttribute("author");this.element.caption=a.getAttribute("caption");this.element.rel=a.getAttribute("rel");this.element.params=a.getAttribute("params");this.contentToFetch=this.element.href;this.windowType=
this._getParameter("lightwindow_type")?this._getParameter("lightwindow_type"):this._fileType(this.contentToFetch)},_clearWindowContents:function(a){$("lightwindow_iframe")&&Element.remove($("lightwindow_iframe"));if($("lightwindow_media_primary")){try{$("lightwindow_media_primary").Stop()}catch(b){}Element.remove($("lightwindow_media_primary"))}if($("lightwindow_media_secondary")){try{$("lightwindow_media_secondary").Stop()}catch(d){}Element.remove($("lightwindow_media_secondary"))}this.activeGallery=
false;this._handleNavigation(this.activeGallery);if(a){$("lightwindow_contents").innerHTML="";$("lightwindow_contents").setStyle({overflow:"hidden"});if(!this.windowActive){$("lightwindow_data_slide_inner").setStyle({display:"none"});$("lightwindow_title_bar_title").innerHTML=""}$("lightwindow_data_slide").setStyle({height:"auto"})}this.resizeTo.height=null;this.resizeTo.width=null},_setStatus:function(a){(this.animating=a)&&Element.show("lightwindow_loading");/MSIE 6./i.test(navigator.userAgent)||
this._fixedWindow(a)},_fixedWindow:function(a){if(a)if(this.windowActive){this._getScroll();$("lightwindow").setStyle({position:"absolute",top:parseFloat($("lightwindow").getStyle("top"))+this.pagePosition.y+"px",left:parseFloat($("lightwindow").getStyle("left"))+this.pagePosition.x+"px"})}else $("lightwindow").setStyle({position:"absolute"});else if(this.windowActive){this._getScroll();$("lightwindow").setStyle({position:"fixed",top:parseFloat($("lightwindow").getStyle("top"))-this.pagePosition.y+
"px",left:parseFloat($("lightwindow").getStyle("left"))-this.pagePosition.x+"px"})}else{$("lightwindow_iframe")&&this._browserDimensions();$("lightwindow").setStyle({position:"fixed",top:parseFloat(this._getParameter("lightwindow_top"))?parseFloat(this._getParameter("lightwindow_top"))+"px":this.dimensions.viewport.height/2+"px",left:parseFloat(this._getParameter("lightwindow_left"))?parseFloat(this._getParameter("lightwindow_left"))+"px":this.dimensions.viewport.width/2+"px"})}},_prepareIE:function(a){if(Prototype.Browser.IE){a=
a?"100%":"auto";var b=document.getElementsByTagName("body")[0];document.getElementsByTagName("html")[0].style.height=b.style.height=a}},_stopScrolling:function(a){if(this.animating){a.preventDefault&&a.preventDefault();a.returnValue=false}},_getScroll:function(){if(typeof window.pageYOffset=="number"){this.pagePosition.x=window.pageXOffset;this.pagePosition.y=window.pageYOffset}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){this.pagePosition.x=document.body.scrollLeft;
this.pagePosition.y=document.body.scrollTop}else if(document.documentElement){this.pagePosition.x=document.documentElement.scrollLeft;this.pagePosition.y=document.documentElement.scrollTop}},_setScroll:function(a,b){document.documentElement.scrollLeft=a;document.documentElement.scrollTop=b},_toggleTroubleElements:function(a,b){for(var d=b?$("lightwindow_contents").getElementsByTagName("select"):document.getElementsByTagName("select"),c=0;c<d.length;c++)if(d[c].name!="intTARGETLIST0"&&d[c].name!="intTARGETLIST1")d[c].style.visibility=
a;if(!b){if(this.options.hideFlash){b=document.getElementsByTagName("object");for(c=0;c!=b.length;c++)b[c].style.visibility=a;b=document.getElementsByTagName("embed");for(c=0;c!=b.length;c++)b[c].style.visibility=a}b=document.getElementsByTagName("iframe");for(c=0;c!=b.length;c++)b[c].style.visibility=a}},_displayLightWindow:function(a,b){$("lightwindow_overlay").style.display=$("lightwindow").style.display=$("lightwindow_container").style.display=a;$("lightwindow_overlay").style.visibility=$("lightwindow").style.visibility=
$("lightwindow_container").style.visibility=b},_setupDimensions:function(){var a,b;switch(this.windowType){case "page":a=this.options.dimensions.page.height;b=this.options.dimensions.page.width;break;case "image":a=this.options.dimensions.image.height;b=this.options.dimensions.image.width;break;case "media":a=this.options.dimensions.media.height;b=this.options.dimensions.media.width;break;case "external":a=this.options.dimensions.external.height;b=this.options.dimensions.external.width;break;case "inline":a=
this.options.dimensions.inline.height;b=this.options.dimensions.inline.width;break;default:a=this.options.dimensions.page.height;b=this.options.dimensions.page.width;break}var d=this._getParameter("lightwindow_top")?parseFloat(this._getParameter("lightwindow_top"))+this.pagePosition.y:this.dimensions.viewport.height/2+this.pagePosition.y,c=this._getParameter("lightwindow_left")?parseFloat(this._getParameter("lightwindow_left"))+this.pagePosition.x:this.dimensions.viewport.width/2+this.pagePosition.x;
$("lightwindow").setStyle({top:d+"px",left:c+"px"});$("lightwindow_container").setStyle({height:a+"px",width:b+"px",left:-(b/2)+"px",top:-(a/2)+"px"});$("lightwindow_contents").setStyle({height:a+"px",width:b+"px"})},_fileType:function(a){if((new RegExp("[^.].("+this.options.fileTypes.image.join("|")+")s*$","i")).test(a))return"image";if(a.indexOf("#")>-1&&document.domain==this._getDomain(a))return"inline";if(a.indexOf("?")>-1)a=a.substring(0,a.indexOf("?"));var b="unknown",d=new RegExp("[^.].("+
this.options.fileTypes.page.join("|")+")s*$","i"),c=new RegExp("[^.].("+this.options.fileTypes.media.join("|")+")s*$","i");if(document.domain!=this._getDomain(a))b="external";if(c.test(a))b="media";if(b=="external"||b=="media")return b;if(d.test(a)||a.substr(a.length-1,a.length)=="/")b="page";return b},_fileExtension:function(a){if(a.indexOf("?")>-1)a=a.substring(0,a.indexOf("?"));for(var b="",d=a.length-1;d>-1;d--){if(a.charAt(d)==".")return b;b=a.charAt(d)+b}},_monitorKeyboard:function(a){document.onkeydown=
a?this._eventKeypress.bind(this):""},_eventKeypress:function(a){a=a==null?event.keyCode:a.which;switch(a){case 27:this.deactivate();break;case 13:return;default:break}if(this.animating)return false;switch(String.fromCharCode(a).toLowerCase()){case "p":this.navigationObservers.previous&&this.navigateWindow("previous");break;case "n":this.navigationObservers.next&&this.navigateWindow("next");break;default:break}},_getGalleryInfo:function(a){if(!a)return false;return a.indexOf("[")>-1?new Array(escape(a.substring(0,
a.indexOf("["))),escape(a.substring(a.indexOf("[")+1,a.indexOf("]")))):false},_getDomain:function(a){var b=a.indexOf("//")+2;a=a.substring(b,a.length);b=a.indexOf("/");a=a.substring(0,b);if(a.indexOf(":")>-1){b=a.indexOf(":");a=a.substring(0,b)}return a},_getParameter:function(a,b){if(!this.element)return false;if(a=="lightwindow_top"&&this.element.top)return unescape(this.element.top);else if(a=="lightwindow_left"&&this.element.left)return unescape(this.element.left);else if(a=="lightwindow_type"&&
this.element.type)return unescape(this.element.type);else if(a=="lightwindow_show_images"&&this.element.showImages)return unescape(this.element.showImages);else if(a=="lightwindow_height"&&this.element.height)return unescape(this.element.height);else if(a=="lightwindow_width"&&this.element.width)return unescape(this.element.width);else if(a=="lightwindow_loading_animation"&&this.element.loadingAnimation)return unescape(this.element.loadingAnimation);else if(a=="lightwindow_iframe_embed"&&this.element.iframeEmbed)return unescape(this.element.iframeEmbed);
else if(a=="lightwindow_form"&&this.element.form)return unescape(this.element.form);else{if(!b)if(this.element.params)b=this.element.params;else return;var d;b=b.split(",");a=a+"=";for(var c=a.length,f=0;f<b.length;f++)if(b[f].substr(0,c)==a){d=b[f].split("=")[1];break}return d?unescape(d):false}},_browserDimensions:function(){if(Prototype.Browser.IE){this.dimensions.viewport.height=document.documentElement.clientHeight;this.dimensions.viewport.width=document.documentElement.clientWidth}else{this.dimensions.viewport.height=
window.innerHeight;this.dimensions.viewport.width=document.width||document.body.offsetWidth}},_getScrollerWidth:function(){var a=Element.extend(document.createElement("div"));a.setAttribute("id","lightwindow_scroll_div");a.setStyle({position:"absolute",top:"-10000px",left:"-10000px",width:"100px",height:"100px",overflow:"hidden"});var b=Element.extend(document.createElement("div"));b.setAttribute("id","lightwindow_content_scroll_div");b.setStyle({width:"100%",height:"200px"});a.appendChild(b);document.getElementsByTagName("body")[0].appendChild(a);
b=$("lightwindow_content_scroll_div").offsetWidth;a.style.overflow="auto";a=$("lightwindow_content_scroll_div").offsetWidth;Element.remove($("lightwindow_scroll_div"));this.scrollbarOffset=b-a},_addParamToObject:function(a,b,d,c){var f=document.createElement("param");f.setAttribute("value",b);f.setAttribute("name",a);c&&f.setAttribute("id",c);d.appendChild(f);return d},_outerHTML:function(a){if(Prototype.Browser.IE)return a.outerHTML;else{a=a.cloneNode(true);var b=document.createElement("div");b.appendChild(a);
return b.innerHTML}},_convertToMarkup:function(a,b){var d=this._outerHTML(a).replace("</"+b+">","");if(Prototype.Browser.IE){for(var c=0;c<a.childNodes.length;c++)d+=this._outerHTML(a.childNodes[c]);d+="</"+b+">"}return d},_appendObject:function(a,b,d){if(Prototype.Browser.IE){d.innerHTML+=this._convertToMarkup(a,b);if(this.options.EOLASFix.indexOf(this._fileType(this.element.href))>-1){a=document.getElementsByTagName("object");for(b=0;b<a.length;b++){a[b].getAttribute("data")&&a[b].removeAttribute("data");
a[b].outerHTML=a[b].outerHTML;a[b].style.visibility="visible"}}}else d.appendChild(a)},_appendIframe:function(a){var b=document.createElement("iframe");b.setAttribute("id","lightwindow_iframe");b.setAttribute("name","lightwindow_iframe");b.setAttribute("src","about:blank");b.setAttribute("height","100%");b.setAttribute("width","100%");b.setAttribute("frameborder","0");b.setAttribute("marginwidth","0");b.setAttribute("marginheight","0");Prototype.Browser.IE?b.setAttribute("scrolling","yes"):b.setAttribute("scrolling",
a);this._appendObject(b,"iframe",$("lightwindow_contents"))},_writeToIframe:function(a){var b=this.options.skin.iframe;b=b.replace("{body_replace}",a);if($("lightwindow_iframe").contentWindow){$("lightwindow_iframe").contentWindow.document.open();$("lightwindow_iframe").contentWindow.document.write(b);$("lightwindow_iframe").contentWindow.document.close()}else{$("lightwindow_iframe").contentDocument.open();$("lightwindow_iframe").contentDocument.write(b);$("lightwindow_iframe").contentDocument.close()}},
_loadWindow:function(){switch(this.windowType){case "image":var a=0,b=[];this.checkImage=[];this.resizeTo.height=this.resizeTo.width=0;this.imageCount=this._getParameter("lightwindow_show_images")?parseInt(this._getParameter("lightwindow_show_images")):1;if(gallery=this._getGalleryInfo(this.element.rel)){for(a=0;a<this.galleries[gallery[0]][gallery[1]].length;a++)if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][a].href)>-1)break;this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][a-
this.imageCount]?this.galleries[gallery[0]][gallery[1]][a-this.imageCount]:false;this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][a+this.imageCount]?this.galleries[gallery[0]][gallery[1]][a+this.imageCount]:false;this.activeGallery=true}else{this.navigationObservers.previous=false;this.activeGallery=this.navigationObservers.next=false}for(var d=a;d<a+this.imageCount;d++){if(gallery&&this.galleries[gallery[0]][gallery[1]][d]){this.contentToFetch=this.galleries[gallery[0]][gallery[1]][d].href;
this.galleryLocation={current:(d+1)/this.imageCount,total:this.galleries[gallery[0]][gallery[1]].length/this.imageCount};if(this.galleries[gallery[0]][gallery[1]][d+this.imageCount]){$("lightwindow_next").setStyle({display:"block"});$("lightwindow_data_next").setStyle({display:"block"});$("lightwindow_next_title").innerHTML=this.galleries[gallery[0]][gallery[1]][d+this.imageCount].title}else{$("lightwindow_next").setStyle({display:"none"});$("lightwindow_data_next").setStyle({display:"none"})}if(this.galleries[gallery[0]][gallery[1]][d-
this.imageCount]){$("lightwindow_previous").setStyle({display:"block"});$("lightwindow_data_previous").setStyle({display:"block"});$("lightwindow_previous_title").innerHTML=this.galleries[gallery[0]][gallery[1]][d-this.imageCount].title}else{$("lightwindow_previous").setStyle({display:"none"});$("lightwindow_data_previous").setStyle({display:"none"})}}b[d]=document.createElement("img");b[d].setAttribute("id","lightwindow_image_"+d);b[d].setAttribute("border","0");b[d].setAttribute("src",this.contentToFetch);
$("lightwindow_contents").appendChild(b[d]);this.checkImage[d]=new PeriodicalExecuter(function(c){if($("lightwindow_image_"+c)!=null)if($("lightwindow_image_"+c).complete&&!(typeof $("lightwindow_image_"+c).naturalWidth!="undefined"&&$("lightwindow_image_"+c).naturalWidth==0)){this.checkImage[c].stop();var f=$("lightwindow_image_"+c).getHeight();if(f>this.resizeTo.height)this.resizeTo.height=f;this.resizeTo.width+=$("lightwindow_image_"+c).getWidth();this.imageCount--;$("lightwindow_image_"+c).setStyle({height:"100%",
width:"100%"});this.imageCount==0&&this._processWindow()}}.bind(this,d),1)}break;case "media":a=0;this.resizeTo.height=this.resizeTo.width=0;if(gallery=this._getGalleryInfo(this.element.rel)){for(a=0;a<this.galleries[gallery[0]][gallery[1]].length;a++)if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][a].href)>-1)break;this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][a-1]?this.galleries[gallery[0]][gallery[1]][a-1]:false;this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][a+
1]?this.galleries[gallery[0]][gallery[1]][a+1]:false;this.activeGallery=true}else{this.navigationObservers.previous=false;this.activeGallery=this.navigationObservers.next=false}if(gallery&&this.galleries[gallery[0]][gallery[1]][a]){this.contentToFetch=this.galleries[gallery[0]][gallery[1]][a].href;this.galleryLocation={current:a+1,total:this.galleries[gallery[0]][gallery[1]].length};if(this.galleries[gallery[0]][gallery[1]][a+1]){$("lightwindow_next").setStyle({display:"block"});$("lightwindow_data_next").setStyle({display:"block"});
$("lightwindow_next_title").innerHTML=this.galleries[gallery[0]][gallery[1]][a+1].title}else{$("lightwindow_next").setStyle({display:"none"});$("lightwindow_data_next").setStyle({display:"none"})}if(this.galleries[gallery[0]][gallery[1]][a-1]){$("lightwindow_previous").setStyle({display:"block"});$("lightwindow_data_previous").setStyle({display:"block"});$("lightwindow_previous_title").innerHTML=this.galleries[gallery[0]][gallery[1]][a-1].title}else{$("lightwindow_previous").setStyle({display:"none"});
$("lightwindow_data_previous").setStyle({display:"none"})}}if(this._getParameter("lightwindow_iframe_embed")){this.resizeTo.height=this.dimensions.viewport.height;this.resizeTo.width=this.dimensions.viewport.width}else{this.resizeTo.height=this._getParameter("lightwindow_height");this.resizeTo.width=this._getParameter("lightwindow_width")}this._processWindow();break;case "external":a=0;if(gallery=this._getGalleryInfo(this.element.rel)){for(a=0;a<this.galleries[gallery[0]][gallery[1]].length;a++)if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][a].href)>
-1)break;this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][a-1]?this.galleries[gallery[0]][gallery[1]][a-1]:false;this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][a+1]?this.galleries[gallery[0]][gallery[1]][a+1]:false;this.activeGallery=true}else{this.navigationObservers.previous=false;this.activeGallery=this.navigationObservers.next=false}if(gallery&&this.galleries[gallery[0]][gallery[1]][a]){this.contentToFetch=this.galleries[gallery[0]][gallery[1]][a].href;
this.galleryLocation={current:a+1,total:this.galleries[gallery[0]][gallery[1]].length};if(this.galleries[gallery[0]][gallery[1]][a+1]){$("lightwindow_next").setStyle({display:"block"});$("lightwindow_data_next").setStyle({display:"block"});$("lightwindow_next_title").innerHTML=this.galleries[gallery[0]][gallery[1]][a+1].title}else{$("lightwindow_next").setStyle({display:"none"});$("lightwindow_data_next").setStyle({display:"none"})}if(this.galleries[gallery[0]][gallery[1]][a-1]){$("lightwindow_previous").setStyle({display:"block"});
$("lightwindow_data_previous").setStyle({display:"block"});$("lightwindow_previous_title").innerHTML=this.galleries[gallery[0]][gallery[1]][a-1].title}else{$("lightwindow_previous").setStyle({display:"none"});$("lightwindow_data_previous").setStyle({display:"none"})}}this._appendIframe("auto");this.resizeTo.height=this.dimensions.viewport.height;this.resizeTo.width=this.dimensions.viewport.width;this._processWindow();break;case "page":new Ajax.Request(this.contentToFetch,{method:"get",parameters:"",
onComplete:function(c){$("lightwindow_contents").innerHTML+=c.responseText;this.resizeTo.height=$("lightwindow_contents").scrollHeight+this.options.contentOffset.height;this.resizeTo.width=$("lightwindow_contents").scrollWidth+this.options.contentOffset.width;this._processWindow()}.bind(this)});break;case "inline":a=this.contentToFetch;if(a.indexOf("?")>-1)a=a.substring(0,a.indexOf("?"));a=a.substring(a.indexOf("#")+1);new Insertion.Top($("lightwindow_contents"),$(a).innerHTML);this.resizeTo.height=
$("lightwindow_contents").scrollHeight+this.options.contentOffset.height;this.resizeTo.width=$("lightwindow_contents").scrollWidth+this.options.contentOffset.width;this._toggleTroubleElements("hidden",true);this._processWindow();break;default:throw"Page Type could not be determined, please amend this lightwindow URL "+this.contentToFetch;}},_resizeWindowToFit:function(){if(this.resizeTo.height+this.dimensions.cruft.height>this.dimensions.viewport.height){var a=this.resizeTo.height/this.resizeTo.width;
this.resizeTo.height=this.dimensions.viewport.height-this.dimensions.cruft.height-2*this.options.viewportPadding;if(this.windowType=="image"||this.windowType=="media"&&!this._getParameter("lightwindow_iframe_embed")||this.windowType=="external"){this.resizeTo.width=this.resizeTo.height/a;$("lightwindow_data_slide_inner").setStyle({width:this.resizeTo.width+"px"})}}if(this.resizeTo.width+this.dimensions.cruft.width>this.dimensions.viewport.width){a=this.resizeTo.width/this.resizeTo.height;this.resizeTo.width=
this.dimensions.viewport.width-2*this.dimensions.cruft.width-2*this.options.viewportPadding;if(this.windowType=="image"||this.windowType=="media"&&!this._getParameter("lightwindow_iframe_embed")){this.resizeTo.height=this.resizeTo.width/a;$("lightwindow_data_slide_inner").setStyle({height:this.resizeTo.height+"px"})}}},_presetWindowSize:function(){if(this._getParameter("lightwindow_height"))this.resizeTo.height=parseFloat(this._getParameter("lightwindow_height"));if(this._getParameter("lightwindow_width"))this.resizeTo.width=
parseFloat(this._getParameter("lightwindow_width"))},_processWindow:function(){this.dimensions.dataEffects=[];if(this.element.caption||this.element.author||this.activeGallery&&this.options.showGalleryCount){if(this.element.caption){$("lightwindow_data_caption").innerHTML=this.element.caption;$("lightwindow_data_caption").setStyle({display:"block"})}else $("lightwindow_data_caption").setStyle({display:"none"});if(this.element.author){$("lightwindow_data_author").innerHTML=this.element.author;$("lightwindow_data_author_container").setStyle({display:"block"})}else $("lightwindow_data_author_container").setStyle({display:"none"});
if(this.activeGallery&&this.options.showGalleryCount){$("lightwindow_data_gallery_current").innerHTML=this.galleryLocation.current;$("lightwindow_data_gallery_total").innerHTML=this.galleryLocation.total;$("lightwindow_data_gallery_container").setStyle({display:"block"})}else $("lightwindow_data_gallery_container").setStyle({display:"none"});$("lightwindow_data_slide_inner").setStyle({width:this.resizeTo.width+"px",height:"auto",visibility:"visible",display:"block"});$("lightwindow_data_slide").setStyle({height:$("lightwindow_data_slide").getHeight()+
"px",width:"1px",overflow:"hidden",display:"block"});$("lightwindow_contents").setStyle({borderBottom:"none"})}else{$("lightwindow_data_slide").setStyle({display:"none",width:"auto"});$("lightwindow_data_slide_inner").setStyle({display:"none",visibility:"hidden",width:this.resizeTo.width+"px",height:"0px"});$("lightwindow_contents").setStyle({borderBottom:"1px solid #0062c8"})}if(this.element.title!="null")if(this.element.title.length<100)$("lightwindow_title_bar_title").innerHTML=this.element.title;
else $("lightwindow_title_bar_title").innerHTML=this.element.title.substring(0,100)+"...";else $("lightwindow_title_bar_title").innerHTML="";var a={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};$("lightwindow_container").setStyle({height:"auto",width:$("lightwindow_container").getWidth()+this.options.contentOffset.width-(this.windowActive?this.options.contentOffset.width:0)+"px"});var b={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};
this.containerChange={height:a.height-b.height,width:a.width-b.width};this.dimensions.container={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};this.dimensions.cruft={height:this.dimensions.container.height-$("lightwindow_contents").getHeight()+this.options.contentOffset.height,width:this.dimensions.container.width-$("lightwindow_contents").getWidth()+this.options.contentOffset.width};this._presetWindowSize();this._resizeWindowToFit();this.windowActive||
$("lightwindow_container").setStyle({left:-(this.dimensions.container.width/2)+"px",top:-(this.dimensions.container.height/2)+"px"});$("lightwindow_container").setStyle({height:this.dimensions.container.height+"px",width:this.dimensions.container.width+"px"});this._displayLightWindow("block","visible");this._animateLightWindow()},_animateLightWindow:function(){this.options.animationHandler?this.options.animationHandler().bind(this):this._defaultAnimationHandler()},_handleNavigation:function(a){this.options.navigationHandler?
this.options.navigationHandler().bind(this,a):this._defaultDisplayNavigation(a)},_handleTransition:function(){this.options.transitionHandler?this.options.transitionHandler().bind(this):this._defaultTransitionHandler()},_handleFinalWindowAnimation:function(a){this.options.finalAnimationHandler?this.options.finalAnimationHandler().bind(this,a):this._defaultfinalWindowAnimationHandler(a)},_handleGalleryAnimation:function(a){this.options.galleryAnimationHandler?this.options.galleryAnimationHandler().bind(this,
a):this._defaultGalleryAnimationHandler(a)},_defaultDisplayNavigation:function(a){a?$("lightwindow_navigation").setStyle({display:"none",height:$("lightwindow_contents").getHeight()+"px",width:"100%",marginTop:this.options.dimensions.titleHeight+"px"}):$("lightwindow_navigation").setStyle({display:"none",height:"auto",width:"auto"})},_defaultAnimationHandler:function(){if(this.element.caption||this.element.author||this.activeGallery&&this.options.showGalleryCount){$("lightwindow_data_slide").setStyle({display:"none",
width:"auto"});this.dimensions.dataEffects.push(new Effect.SlideDown("lightwindow_data_slide",{sync:true}),new Effect.Appear("lightwindow_data_slide",{sync:true,from:0,to:1}))}$("lightwindow_title_bar_inner").setStyle({height:"0px",marginTop:this.options.dimensions.titleHeight+"px"});this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_title_bar_inner",{sync:true,style:{height:this.options.dimensions.titleHeight+"px",marginTop:"0px"}}),new Effect.Appear("lightwindow_title_bar_inner",{sync:true,
from:0,to:1}));if(!this.options.hideGalleryTab){this._handleGalleryAnimation(false);if($("lightwindow_galleries_tab_container").getHeight()==0){this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_galleries_tab_container",{sync:true,style:{height:"20px",marginTop:"0px"}}));$("lightwindow_galleries").setStyle({width:"0px"})}}var a=false,b=this.dimensions.container.width-$("lightwindow_contents").getWidth()+this.resizeTo.width+this.options.contentOffset.width;b!=$("lightwindow_container").getWidth()&&
new Effect.Parallel([new Effect.Scale("lightwindow_contents",100*(this.resizeTo.width/$("lightwindow_contents").getWidth()),{scaleFrom:100*($("lightwindow_contents").getWidth()/($("lightwindow_contents").getWidth()+this.options.contentOffset.width)),sync:true,scaleY:false,scaleContent:false}),new Effect.Scale("lightwindow_container",100*(b/this.dimensions.container.width),{sync:true,scaleY:false,scaleFromCenter:true,scaleContent:false})],{duration:this.duration,delay:0.25,queue:{position:"end",scope:"lightwindowAnimation"}});
b=this.dimensions.container.height-$("lightwindow_contents").getHeight()+this.resizeTo.height+this.options.contentOffset.height;if(b!=$("lightwindow_container").getHeight()){new Effect.Parallel([new Effect.Scale("lightwindow_contents",100*(this.resizeTo.height/$("lightwindow_contents").getHeight()),{scaleFrom:100*($("lightwindow_contents").getHeight()/($("lightwindow_contents").getHeight()+this.options.contentOffset.height)),sync:true,scaleX:false,scaleContent:false}),new Effect.Scale("lightwindow_container",
100*(b/this.dimensions.container.height),{sync:true,scaleX:false,scaleFromCenter:true,scaleContent:false})],{duration:this.duration,afterFinish:function(){if(this.dimensions.dataEffects.length>0){this.options.hideGalleryTab||$("lightwindow_galleries").setStyle({width:this.resizeTo.width+"px"});new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,afterFinish:function(){this._finishWindow()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})}}.bind(this),queue:{position:"end",
scope:"lightwindowAnimation"}});a=true}!a&&this.dimensions.dataEffects.length>0&&new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,beforeStart:function(){this.options.hideGalleryTab||$("lightwindow_galleries").setStyle({width:this.resizeTo.width+"px"});if(this.containerChange.height!=0||this.containerChange.width!=0)new Effect.MoveBy("lightwindow_container",this.containerChange.height,this.containerChange.width,{transition:Effect.Transitions.sinoidal})}.bind(this),afterFinish:function(){this._finishWindow()}.bind(this),
queue:{position:"end",scope:"lightwindowAnimation"}})},_defaultfinalWindowAnimationHandler:function(){if(this.windowType=="media"||this._getParameter("lightwindow_loading_animation")){Element.hide("lightwindow_loading");this._handleNavigation(this.activeGallery);this._setStatus(false)}else Effect.Fade("lightwindow_loading",{duration:0.75,delay:1,afterFinish:function(){this.windowType!="image"&&this.windowType!="media"&&this.windowType!="external"&&$("lightwindow_contents").setStyle({overflow:"auto"});
this._handleNavigation(this.activeGallery);this._defaultGalleryAnimationHandler();this._setStatus(false)}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})},_defaultGalleryAnimationHandler:function(a){if(this.activeGallery){$("lightwindow_galleries").setStyle({display:"block",marginBottom:$("lightwindow_data_slide").getHeight()+this.options.contentOffset.height/2+"px"});$("lightwindow_navigation").setStyle({height:$("lightwindow_contents").getHeight()-20+"px"})}else{$("lightwindow_galleries").setStyle({display:"none"});
$("lightwindow_galleries_tab_container").setStyle({height:"0px",marginTop:"20px"});$("lightwindow_galleries_list").setStyle({height:"0px"});return false}if(a){if($("lightwindow_galleries_list").getHeight()==0){a=$("lightwindow_contents").getHeight()*0.8;$("lightwindow_galleries_tab_span").className="down"}else{a=0;$("lightwindow_galleries_tab_span").className="up"}new Effect.Morph("lightwindow_galleries_list",{duration:this.duration,transition:Effect.Transitions.sinoidal,style:{height:a+"px"},beforeStart:function(){$("lightwindow_galleries_list").setStyle({overflow:"hidden"})},
afterFinish:function(){$("lightwindow_galleries_list").setStyle({overflow:"auto"})},queue:{position:"end",scope:"lightwindowAnimation"}})}},_defaultTransitionHandler:function(){this.dimensions.dataEffects=[];$("lightwindow_data_slide").getStyle("display")!="none"&&this.dimensions.dataEffects.push(new Effect.SlideUp("lightwindow_data_slide",{sync:true}),new Effect.Fade("lightwindow_data_slide",{sync:true,from:1,to:0}));if(!this.options.hideGalleryTab){$("lightwindow_galleries").getHeight()!=0&&!this.options.hideGalleryTab&&
this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_galleries_tab_container",{sync:true,style:{height:"0px",marginTop:"20px"}}));if($("lightwindow_galleries_list").getHeight()!=0){$("lightwindow_galleries_tab_span").className="up";this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_galleries_list",{sync:true,style:{height:"0px"},transition:Effect.Transitions.sinoidal,beforeStart:function(){$("lightwindow_galleries_list").setStyle({overflow:"hidden"})},afterFinish:function(){$("lightwindow_galleries_list").setStyle({overflow:"auto"})}}))}}this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_title_bar_inner",
{sync:true,style:{height:"0px",marginTop:this.options.dimensions.titleHeight+"px"}}),new Effect.Fade("lightwindow_title_bar_inner",{sync:true,from:1,to:0}));new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,afterFinish:function(){this._loadWindow()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})},_defaultFormHandler:function(a){a=Event.element(a).parentNode;var b=Form.serialize(this._getParameter("lightwindow_form",a.getAttribute("params")));if(this.options.formMethod==
"post")new Ajax.Request(a.href,{method:"post",postBody:b,onComplete:this.openWindow.bind(this,a)});else this.options.formMethod=="get"&&new Ajax.Request(a.href,{method:"get",parameters:b,onComplete:this.openWindow.bind(this,a)})},_finishWindow:function(){if(this.windowType=="external"){$("lightwindow_iframe").setAttribute("src",this.element.href);this._handleFinalWindowAnimation(1)}else{if(this.windowType=="media"){var a=document.createElement("object");a.setAttribute("classid",this.options.classids[this._fileExtension(this.contentToFetch)]);
a.setAttribute("codebase",this.options.codebases[this._fileExtension(this.contentToFetch)]);a.setAttribute("id","lightwindow_media_primary");a.setAttribute("name","lightwindow_media_primary");a.setAttribute("width",this.resizeTo.width);a.setAttribute("height",this.resizeTo.height);a=this._addParamToObject("movie",this.contentToFetch,a);a=this._addParamToObject("src",this.contentToFetch,a);a=this._addParamToObject("controller","true",a);a=this._addParamToObject("wmode","transparent",a);a=this._addParamToObject("cache",
"false",a);a=this._addParamToObject("quality","high",a);if(!Prototype.Browser.IE){var b=document.createElement("object");b.setAttribute("type",this.options.mimeTypes[this._fileExtension(this.contentToFetch)]);b.setAttribute("data",this.contentToFetch);b.setAttribute("id","lightwindow_media_secondary");b.setAttribute("name","lightwindow_media_secondary");b.setAttribute("width",this.resizeTo.width);b.setAttribute("height",this.resizeTo.height);b=this._addParamToObject("controller","true",b);b=this._addParamToObject("wmode",
"transparent",b);b=this._addParamToObject("cache","false",b);b=this._addParamToObject("quality","high",b);a.appendChild(b)}if(this._getParameter("lightwindow_iframe_embed")){this._appendIframe("no");this._writeToIframe(this._convertToMarkup(a,"object"))}else this._appendObject(a,"object",$("lightwindow_contents"))}this._handleFinalWindowAnimation(0)}this._setupActions()}};Event.observe(window,"load",lightwindowInit,false);var myLightWindow=null;
function lightwindowInit(){myLightWindow=new lightwindow};
