// base64.js
/* Copyright (C) 1999 Masanao Izumo <mo@goice.co.jp>
 * Version: 1.0
 * LastModified: Dec 25 1999
 * This library is free.  You can redistribute it and/or modify it.
 */
// controls.js
// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//           (c) 2005 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
//           (c) 2005 Jon Tirsen (http://www.tirsen.com)
// Contributors:
//  Richard Livsey
//  Rahul Bhargava
//  Rob Wills
// 
// See scriptaculous.js for full license.
// json.js
// prototype.js
/*  Prototype JavaScript framework, version 1.4.0(fix by keisuke.watanabe@mysystem.jp at Fri Sep 29 16:16:14 JST 2006)
 *  (c) 2005 Sam Stephenson <sam@conio.net>
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://prototype.conio.net/
 *
/*--------------------------------------------------------------------------*/
// sha1.js
/*
 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
 * in FIPS PUB 180-1
 * Version 2.1 Copyright Paul Johnston 2000 - 2002.
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for details.
 */
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
// wsse.js
/* wsse.js - Generate WSSE authentication header in JavaScript
 * (C) 2006 Keisuke Watanabe <keisuke.watanabe@mysystem.jp>
 */
// Other source
/* Copyright (C) 2006 ZuKool.inc */
var URLMain="http://www.zukool.com/zwiBeta/main/";
var URLSignUp="https://www.zukool.com/zwiBeta/main/signup.html";
var base64EncodeChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var base64DecodeChars=new Array(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1);
function base64encode(_1){
var _2,i,_4;
var c1,c2,c3;
_4=_1.length;
i=0;
_2="";
while(i<_4){
c1=_1.charCodeAt(i++)&255;
if(i==_4){
_2+=base64EncodeChars.charAt(c1>>2);
_2+=base64EncodeChars.charAt((c1&3)<<4);
_2+="==";
break;
}
c2=_1.charCodeAt(i++);
if(i==_4){
_2+=base64EncodeChars.charAt(c1>>2);
_2+=base64EncodeChars.charAt(((c1&3)<<4)|((c2&240)>>4));
_2+=base64EncodeChars.charAt((c2&15)<<2);
_2+="=";
break;
}
c3=_1.charCodeAt(i++);
_2+=base64EncodeChars.charAt(c1>>2);
_2+=base64EncodeChars.charAt(((c1&3)<<4)|((c2&240)>>4));
_2+=base64EncodeChars.charAt(((c2&15)<<2)|((c3&192)>>6));
_2+=base64EncodeChars.charAt(c3&63);
}
return _2;
}
function base64decode(_8){
var c1,c2,c3,c4;
var i,_e,_f;
_e=_8.length;
i=0;
_f="";
while(i<_e){
do{
c1=base64DecodeChars[_8.charCodeAt(i++)&255];
}while(i<_e&&c1==-1);
if(c1==-1){
break;
}
do{
c2=base64DecodeChars[_8.charCodeAt(i++)&255];
}while(i<_e&&c2==-1);
if(c2==-1){
break;
}
_f+=String.fromCharCode((c1<<2)|((c2&48)>>4));
do{
c3=_8.charCodeAt(i++)&255;
if(c3==61){
return _f;
}
c3=base64DecodeChars[c3];
}while(i<_e&&c3==-1);
if(c3==-1){
break;
}
_f+=String.fromCharCode(((c2&15)<<4)|((c3&60)>>2));
do{
c4=_8.charCodeAt(i++)&255;
if(c4==61){
return _f;
}
c4=base64DecodeChars[c4];
}while(i<_e&&c4==-1);
if(c4==-1){
break;
}
_f+=String.fromCharCode(((c3&3)<<6)|c4);
}
return _f;
}
(function(){
var _10="\t";
var _11="\n";
var pPr=false;
var _13=0;
var _14=function(a){
if(!pPr){
return a;
}
for(var l=0;l<_13;l++){
a[a.length]=_10;
}
return a;
};
var _17=function(a){
if(pPr){
a[a.length]=_11;
}
return a;
};
var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"},s={array:function(x){
var a=["["],b,f,i,l=x.length,v;
a=_17(a);
_13++;
for(i=0;i<l;i+=1){
v=x[i];
f=s[typeof v];
if(f){
v=f(v);
if(typeof v=="string"){
if(b){
a[a.length]=",";
a=_17(a);
}
a=_14(a);
a[a.length]=v;
b=true;
}
}
}
_13--;
a=_17(a);
a=_14(a);
a[a.length]="]";
return a.join("");
},"boolean":function(x){
return String(x);
},"null":function(x){
return "null";
},number:function(x){
return isFinite(x)?String(x):"null";
},object:function(x,_26){
if(x){
if(x instanceof Array){
return s.array(x);
}
var a=["{"],b,f,i,v;
a=_17(a);
_13++;
for(i in x){
v=x[i];
f=s[typeof v];
if(f){
v=f(v);
if(typeof v=="string"){
if(b){
a[a.length]=",";
a=_17(a);
}
a=_14(a);
a.push(s.string(i),((pPr)?" : ":":"),v);
b=true;
}
}
}
_13--;
a=_17(a);
a=_14(a);
a[a.length]="}";
return a.join("");
}
return "null";
},string:function(x){
if(/["\\\x00-\x1f]/.test(x)){
x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){
var c=m[b];
if(c){
return c;
}
c=b.charCodeAt();
return "\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);
});
}
return "\""+x+"\"";
}};
Object.prototype.toJSONString=function(_30){
pPr=_30;
return s.object(this);
};
Array.prototype.toJSONString=function(_31){
pPr=_31;
return s.array(this);
};
})();
String.prototype.parseJSON=function(){
try{
return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+this+")");
}
catch(e){
return false;
}
};
var Prototype={Version:"1.4.0",ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:</script>)",emptyFunction:function(){
},K:function(x){
return x;
}};
var Class={create:function(){
return function(){
this.initialize.apply(this,arguments);
};
}};
var Abstract=new Object();
Object.extend=function(_33,_34){
for(property in _34){
_33[property]=_34[property];
}
return _33;
};
Object.inspect=function(_35){
try{
if(_35==undefined){
return "undefined";
}
if(_35==null){
return "null";
}
return _35.inspect?_35.inspect():_35.toString();
}
catch(e){
if(e instanceof RangeError){
return "...";
}
throw e;
}
};
Function.prototype.bind=function(){
var _36=this,_37=$A(arguments),_38=_37.shift();
return function(){
return _36.apply(_38,_37.concat($A(arguments)));
};
};
Function.prototype.bindAsEventListener=function(_39){
var _3a=this;
return function(_3b){
return _3a.call(_39,_3b||window.event);
};
};
Object.extend(Number.prototype,{toColorPart:function(){
var _3c=this.toString(16);
if(this<16){
return "0"+_3c;
}
return _3c;
},succ:function(){
return this+1;
},times:function(_3d){
$R(0,this,true).each(_3d);
return this;
}});
var Try={these:function(){
var _3e;
for(var i=0;i<arguments.length;i++){
var _40=arguments[i];
try{
_3e=_40();
break;
}
catch(e){
}
}
return _3e;
}};
var PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(_41,_42){
this.callback=_41;
this.frequency=_42;
this.currentlyExecuting=false;
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
if(!this.currentlyExecuting){
try{
this.currentlyExecuting=true;
this.callback();
}
finally{
this.currentlyExecuting=false;
}
}
}};
function $(){
var _43=new Array();
for(var i=0;i<arguments.length;i++){
var _45=arguments[i];
if(typeof _45=="string"){
_45=document.getElementById(_45);
}
if(arguments.length==1){
return _45;
}
_43.push(_45);
}
return _43;
}
Object.extend(String.prototype,{stripTags:function(){
return this.replace(/<\/?[^>]+>/gi,"");
},stripScripts:function(){
return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");
},extractScripts:function(){
var _46=new RegExp(Prototype.ScriptFragment,"img");
var _47=new RegExp(Prototype.ScriptFragment,"im");
return (this.match(_46)||[]).map(function(_48){
return (_48.match(_47)||["",""])[1];
});
},evalScripts:function(){
return this.extractScripts().map(eval);
},escapeHTML:function(){
var div=document.createElement("div");
var _4a=document.createTextNode(this);
div.appendChild(_4a);
return div.innerHTML;
},unescapeHTML:function(){
var div=document.createElement("div");
div.innerHTML=this.stripTags();
return div.childNodes[0]?div.childNodes[0].nodeValue:"";
},toQueryParams:function(){
var _4c=this.match(/^\??(.*)$/)[1].split("&");
return _4c.inject({},function(_4d,_4e){
var _4f=_4e.split("=");
_4d[_4f[0]]=_4f[1];
return _4d;
});
},toArray:function(){
return this.split("");
},camelize:function(){
var _50=this.split("-");
if(_50.length==1){
return _50[0];
}
var _51=this.indexOf("-")==0?_50[0].charAt(0).toUpperCase()+_50[0].substring(1):_50[0];
for(var i=1,len=_50.length;i<len;i++){
var s=_50[i];
_51+=s.charAt(0).toUpperCase()+s.substring(1);
}
return _51;
},inspect:function(){
return "'"+this.replace("\\","\\\\").replace("'","\\'")+"'";
}});
String.prototype.parseQuery=String.prototype.toQueryParams;
var $break=new Object();
var $continue=new Object();
var Enumerable={each:function(_55){
var _56=0;
try{
this._each(function(_57){
try{
_55(_57,_56++);
}
catch(e){
if(e!=$continue){
throw e;
}
}
});
}
catch(e){
if(e!=$break){
throw e;
}
}
},all:function(_58){
var _59=true;
this.each(function(_5a,_5b){
_59=_59&&!!(_58||Prototype.K)(_5a,_5b);
if(!_59){
throw $break;
}
});
return _59;
},any:function(_5c){
var _5d=true;
this.each(function(_5e,_5f){
if(_5d=!!(_5c||Prototype.K)(_5e,_5f)){
throw $break;
}
});
return _5d;
},collect:function(_60){
var _61=[];
this.each(function(_62,_63){
_61.push(_60(_62,_63));
});
return _61;
},detect:function(_64){
var _65;
this.each(function(_66,_67){
if(_64(_66,_67)){
_65=_66;
throw $break;
}
});
return _65;
},findAll:function(_68){
var _69=[];
this.each(function(_6a,_6b){
if(_68(_6a,_6b)){
_69.push(_6a);
}
});
return _69;
},grep:function(_6c,_6d){
var _6e=[];
this.each(function(_6f,_70){
var _71=_6f.toString();
if(_71.match(_6c)){
_6e.push((_6d||Prototype.K)(_6f,_70));
}
});
return _6e;
},include:function(_72){
var _73=false;
this.each(function(_74){
if(_74==_72){
_73=true;
throw $break;
}
});
return _73;
},inject:function(_75,_76){
this.each(function(_77,_78){
_75=_76(_75,_77,_78);
});
return _75;
},invoke:function(_79){
var _7a=$A(arguments).slice(1);
return this.collect(function(_7b){
return _7b[_79].apply(_7b,_7a);
});
},max:function(_7c){
var _7d;
this.each(function(_7e,_7f){
_7e=(_7c||Prototype.K)(_7e,_7f);
if(_7e>=(_7d||_7e)){
_7d=_7e;
}
});
return _7d;
},min:function(_80){
var _81;
this.each(function(_82,_83){
_82=(_80||Prototype.K)(_82,_83);
if(_82<=(_81||_82)){
_81=_82;
}
});
return _81;
},partition:function(_84){
var _85=[],_86=[];
this.each(function(_87,_88){
((_84||Prototype.K)(_87,_88)?_85:_86).push(_87);
});
return [_85,_86];
},pluck:function(_89){
var _8a=[];
this.each(function(_8b,_8c){
_8a.push(_8b[_89]);
});
return _8a;
},reject:function(_8d){
var _8e=[];
this.each(function(_8f,_90){
if(!_8d(_8f,_90)){
_8e.push(_8f);
}
});
return _8e;
},sortBy:function(_91){
return this.collect(function(_92,_93){
return {value:_92,criteria:_91(_92,_93)};
}).sort(function(_94,_95){
var a=_94.criteria,b=_95.criteria;
return a<b?-1:a>b?1:0;
}).pluck("value");
},toArray:function(){
return this.collect(Prototype.K);
},zip:function(){
var _98=Prototype.K,_99=$A(arguments);
if(typeof _99.last()=="function"){
_98=_99.pop();
}
var _9a=[this].concat(_99).map($A);
return this.map(function(_9b,_9c){
_98(_9b=_9a.pluck(_9c));
return _9b;
});
},inspect:function(){
return "#<Enumerable:"+this.toArray().inspect()+">";
}};
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});
var $A=Array.from=function(_9d){
if(!_9d){
return [];
}
if(_9d.toArray){
return _9d.toArray();
}else{
var _9e=[];
for(var i=0;i<_9d.length;i++){
_9e.push(_9d[i]);
}
return _9e;
}
};
Object.extend(Array.prototype,Enumerable);
Array.prototype._reverse=Array.prototype.reverse;
Object.extend(Array.prototype,{_each:function(_a0){
for(var i=0;i<this.length;i++){
_a0(this[i]);
}
},clear:function(){
this.length=0;
return this;
},first:function(){
return this[0];
},last:function(){
return this[this.length-1];
},compact:function(){
return this.select(function(_a2){
return _a2!=undefined||_a2!=null;
});
},flatten:function(){
return this.inject([],function(_a3,_a4){
return _a3.concat(_a4.constructor==Array?_a4.flatten():[_a4]);
});
},without:function(){
var _a5=$A(arguments);
return this.select(function(_a6){
return !_a5.include(_a6);
});
},indexOf:function(_a7){
for(var i=0;i<this.length;i++){
if(this[i]==_a7){
return i;
}
}
return -1;
},reverse:function(_a9){
return (_a9!==false?this:this.toArray())._reverse();
},shift:function(){
var _aa=this[0];
for(var i=0;i<this.length-1;i++){
this[i]=this[i+1];
}
this.length--;
return _aa;
},inspect:function(){
return "["+this.map(Object.inspect).join(", ")+"]";
}});
var Hash={_each:function(_ac){
for(key in this){
var _ad=this[key];
if(typeof _ad=="function"){
continue;
}
var _ae=[key,_ad];
_ae.key=key;
_ae.value=_ad;
_ac(_ae);
}
},keys:function(){
return this.pluck("key");
},values:function(){
return this.pluck("value");
},merge:function(_af){
return $H(_af).inject($H(this),function(_b0,_b1){
_b0[_b1.key]=_b1.value;
return _b0;
});
},toQueryString:function(){
return this.map(function(_b2){
return _b2.map(encodeURIComponent).join("=");
}).join("&");
},inspect:function(){
return "#<Hash:{"+this.map(function(_b3){
return _b3.map(Object.inspect).join(": ");
}).join(", ")+"}>";
}};
function $H(_b4){
var _b5=Object.extend({},_b4||{});
Object.extend(_b5,Enumerable);
Object.extend(_b5,Hash);
return _b5;
}
ObjectRange=Class.create();
Object.extend(ObjectRange.prototype,Enumerable);
Object.extend(ObjectRange.prototype,{initialize:function(_b6,end,_b8){
this.start=_b6;
this.end=end;
this.exclusive=_b8;
},_each:function(_b9){
var _ba=this.start;
do{
_b9(_ba);
_ba=_ba.succ();
}while(this.include(_ba));
},include:function(_bb){
if(_bb<this.start){
return false;
}
if(this.exclusive){
return _bb<this.end;
}
return _bb<=this.end;
}});
var $R=function(_bc,end,_be){
return new ObjectRange(_bc,end,_be);
};
var Ajax={getTransport:function(){
return Try.these(function(){
return new ActiveXObject("Msxml2.XMLHTTP");
},function(){
return new ActiveXObject("Microsoft.XMLHTTP");
},function(){
return new XMLHttpRequest();
})||false;
},activeRequestCount:0};
Ajax.Responders={responders:[],_each:function(_bf){
this.responders._each(_bf);
},register:function(_c0){
if(!this.include(_c0)){
this.responders.push(_c0);
}
},unregister:function(_c1){
this.responders=this.responders.without(_c1);
},dispatch:function(_c2,_c3,_c4,_c5){
this.each(function(_c6){
if(_c6[_c2]&&typeof _c6[_c2]=="function"){
try{
_c6[_c2].apply(_c6,[_c3,_c4,_c5]);
}
catch(e){
}
}
});
}};
Object.extend(Ajax.Responders,Enumerable);
Ajax.Responders.register({onCreate:function(){
Ajax.activeRequestCount++;
},onComplete:function(){
Ajax.activeRequestCount--;
}});
Ajax.Base=function(){
};
Ajax.Base.prototype={setOptions:function(_c7){
this.options={method:"post",asynchronous:true,parameters:""};
Object.extend(this.options,_c7||{});
},responseIsSuccess:function(){
return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300);
},responseIsFailure:function(){
return !this.responseIsSuccess();
}};
Ajax.Request=Class.create();
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(url,_c9){
this.transport=Ajax.getTransport();
this.setOptions(_c9);
this.request(url);
},request:function(url){
var _cb=this.options.parameters||"";
if(_cb.length>0){
_cb+="&_=";
}
try{
this.url=url;
if(_cb.length>0){
this.url+=(this.url.match(/\?/)?"&":"?")+_cb;
}
Ajax.Responders.dispatch("onCreate",this,this.transport);
this.transport.open(this.options.method,this.url,this.options.asynchronous);
if(this.options.asynchronous){
this.transport.onreadystatechange=this.onStateChange.bind(this);
setTimeout((function(){
this.respondToReadyState(1);
}).bind(this),10);
}
this.setRequestHeaders();
var _cc=this.options.postBody?this.options.postBody:_cb;
this.transport.send((this.options.method=="post"||this.options.method=="put")?_cc:null);
}
catch(e){
this.dispatchException(e);
}
},setRequestHeaders:function(){
var _cd=["X-Requested-With","XMLHttpRequest","X-Prototype-Version",Prototype.Version];
if(this.options.method=="post"||this.options.method=="put"){
_cd.push("Content-type","application/x-www-form-urlencoded");
if(this.transport.overrideMimeType){
_cd.push("Connection","close");
}
}
if(this.options.requestHeaders){
_cd.push.apply(_cd,this.options.requestHeaders);
}
for(var i=0;i<_cd.length;i+=2){
this.transport.setRequestHeader(_cd[i],_cd[i+1]);
}
},onStateChange:function(){
var _cf=this.transport.readyState;
if(_cf!=1){
this.respondToReadyState(this.transport.readyState);
}
},header:function(_d0){
try{
return this.transport.getResponseHeader(_d0);
}
catch(e){
}
},evalJSON:function(){
try{
return eval(this.header("X-JSON"));
}
catch(e){
}
},evalResponse:function(){
try{
return eval(this.transport.responseText);
}
catch(e){
this.dispatchException(e);
}
},respondToReadyState:function(_d1){
var _d2=Ajax.Request.Events[_d1];
var _d3=this.transport,_d4=this.evalJSON();
if(_d2=="Complete"){
try{
(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(_d3,_d4);
}
catch(e){
this.dispatchException(e);
}
if((this.header("Content-type")||"").match(/^text\/javascript/i)){
this.evalResponse();
}
}
try{
(this.options["on"+_d2]||Prototype.emptyFunction)(_d3,_d4);
Ajax.Responders.dispatch("on"+_d2,this,_d3,_d4);
}
catch(e){
this.dispatchException(e);
}
if(_d2=="Complete"){
this.transport.onreadystatechange=Prototype.emptyFunction;
}
},dispatchException:function(_d5){
(this.options.onException||Prototype.emptyFunction)(this,_d5);
Ajax.Responders.dispatch("onException",this,_d5);
}});
Ajax.Updater=Class.create();
Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_d6,url,_d8){
this.containers={success:_d6.success?$(_d6.success):$(_d6),failure:_d6.failure?$(_d6.failure):(_d6.success?null:$(_d6))};
this.transport=Ajax.getTransport();
this.setOptions(_d8);
var _d9=this.options.onComplete||Prototype.emptyFunction;
this.options.onComplete=(function(_da,_db){
this.updateContent();
_d9(_da,_db);
}).bind(this);
this.request(url);
},updateContent:function(){
var _dc=this.responseIsSuccess()?this.containers.success:this.containers.failure;
var _dd=this.transport.responseText;
if(!this.options.evalScripts){
_dd=_dd.stripScripts();
}
if(_dc){
if(this.options.insertion){
new this.options.insertion(_dc,_dd);
}else{
Element.update(_dc,_dd);
}
}
if(this.responseIsSuccess()){
if(this.onComplete){
setTimeout(this.onComplete.bind(this),10);
}
}
}});
Ajax.PeriodicalUpdater=Class.create();
Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(_de,url,_e0){
this.setOptions(_e0);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=_de;
this.url=url;
this.start();
},start:function(){
this.options.onComplete=this.updateComplete.bind(this);
this.onTimerEvent();
},stop:function(){
this.updater.onComplete=undefined;
clearTimeout(this.timer);
(this.onComplete||Prototype.emptyFunction).apply(this,arguments);
},updateComplete:function(_e1){
if(this.options.decay){
this.decay=(_e1.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=_e1.responseText;
}
this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);
},onTimerEvent:function(){
this.updater=new Ajax.Updater(this.container,this.url,this.options);
}});
document.getElementsByClassName=function(_e2,_e3){
var _e4=($(_e3)||document.body).getElementsByTagName("*");
return $A(_e4).inject([],function(_e5,_e6){
if(_e6.className.match(new RegExp("(^|\\s)"+_e2+"(\\s|$)"))){
_e5.push(_e6);
}
return _e5;
});
};
if(!window.Element){
var Element=new Object();
}
Object.extend(Element,{visible:function(_e7){
return $(_e7).style.display!="none";
},toggle:function(){
for(var i=0;i<arguments.length;i++){
var _e9=$(arguments[i]);
Element[Element.visible(_e9)?"hide":"show"](_e9);
}
},hide:function(){
for(var i=0;i<arguments.length;i++){
var _eb=$(arguments[i]);
_eb.style.display="none";
}
},show:function(){
for(var i=0;i<arguments.length;i++){
var _ed=$(arguments[i]);
_ed.style.display="";
}
},remove:function(_ee){
_ee=$(_ee);
_ee.parentNode.removeChild(_ee);
},update:function(_ef,_f0){
$(_ef).innerHTML=_f0.stripScripts();
setTimeout(function(){
_f0.evalScripts();
},10);
},getHeight:function(_f1){
_f1=$(_f1);
return _f1.offsetHeight;
},classNames:function(_f2){
return new Element.ClassNames(_f2);
},hasClassName:function(_f3,_f4){
if(!(_f3=$(_f3))){
return;
}
return Element.classNames(_f3).include(_f4);
},addClassName:function(_f5,_f6){
if(!(_f5=$(_f5))){
return;
}
return Element.classNames(_f5).add(_f6);
},removeClassName:function(_f7,_f8){
if(!(_f7=$(_f7))){
return;
}
return Element.classNames(_f7).remove(_f8);
},cleanWhitespace:function(_f9){
_f9=$(_f9);
for(var i=0;i<_f9.childNodes.length;i++){
var _fb=_f9.childNodes[i];
if(_fb.nodeType==3&&!/\S/.test(_fb.nodeValue)){
Element.remove(_fb);
}
}
},empty:function(_fc){
return $(_fc).innerHTML.match(/^\s*$/);
},scrollTo:function(_fd){
_fd=$(_fd);
var x=_fd.x?_fd.x:_fd.offsetLeft,y=_fd.y?_fd.y:_fd.offsetTop;
window.scrollTo(x,y);
},getStyle:function(_100,_101){
_100=$(_100);
var _102=_100.style[_101.camelize()];
if(!_102){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_100,null);
_102=css?css.getPropertyValue(_101):null;
}else{
if(_100.currentStyle){
_102=_100.currentStyle[_101.camelize()];
}
}
}
if(window.opera&&["left","top","right","bottom"].include(_101)){
if(Element.getStyle(_100,"position")=="static"){
_102="auto";
}
}
return _102=="auto"?null:_102;
},setStyle:function(_104,_105){
_104=$(_104);
for(name in _105){
_104.style[name.camelize()]=_105[name];
}
},getDimensions:function(_106){
_106=$(_106);
if(Element.getStyle(_106,"display")!="none"){
return {width:_106.offsetWidth,height:_106.offsetHeight};
}
var els=_106.style;
var _108=els.visibility;
var _109=els.position;
els.visibility="hidden";
els.position="absolute";
els.display="";
var _10a=_106.clientWidth;
var _10b=_106.clientHeight;
els.display="none";
els.position=_109;
els.visibility=_108;
return {width:_10a,height:_10b};
},makePositioned:function(_10c){
_10c=$(_10c);
var pos=Element.getStyle(_10c,"position");
if(pos=="static"||!pos){
_10c._madePositioned=true;
_10c.style.position="relative";
if(window.opera){
_10c.style.top=0;
_10c.style.left=0;
}
}
},undoPositioned:function(_10e){
_10e=$(_10e);
if(_10e._madePositioned){
_10e._madePositioned=undefined;
_10e.style.position=_10e.style.top=_10e.style.left=_10e.style.bottom=_10e.style.right="";
}
},makeClipping:function(_10f){
_10f=$(_10f);
if(_10f._overflow){
return;
}
_10f._overflow=_10f.style.overflow;
if((Element.getStyle(_10f,"overflow")||"visible")!="hidden"){
_10f.style.overflow="hidden";
}
},undoClipping:function(_110){
_110=$(_110);
if(_110._overflow){
return;
}
_110.style.overflow=_110._overflow;
_110._overflow=undefined;
}});
var Toggle=new Object();
Toggle.display=Element.toggle;
Abstract.Insertion=function(_111){
this.adjacency=_111;
};
Abstract.Insertion.prototype={initialize:function(_112,_113){
this.element=$(_112);
this.content=_113.stripScripts();
if(this.adjacency&&this.element.insertAdjacentHTML){
try{
this.element.insertAdjacentHTML(this.adjacency,this.content);
}
catch(e){
if(this.element.tagName.toLowerCase()=="tbody"){
this.insertContent(this.contentFromAnonymousTable());
}else{
throw e;
}
}
}else{
this.range=this.element.ownerDocument.createRange();
if(this.initializeRange){
this.initializeRange();
}
this.insertContent([this.range.createContextualFragment(this.content)]);
}
setTimeout(function(){
_113.evalScripts();
},10);
},contentFromAnonymousTable:function(){
var div=document.createElement("div");
div.innerHTML="<table><tbody>"+this.content+"</tbody></table>";
return $A(div.childNodes[0].childNodes[0].childNodes);
}};
var Insertion=new Object();
Insertion.Before=Class.create();
Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){
this.range.setStartBefore(this.element);
},insertContent:function(_115){
_115.each((function(_116){
this.element.parentNode.insertBefore(_116,this.element);
}).bind(this));
}});
Insertion.Top=Class.create();
Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(true);
},insertContent:function(_117){
_117.reverse(false).each((function(_118){
this.element.insertBefore(_118,this.element.firstChild);
}).bind(this));
}});
Insertion.Bottom=Class.create();
Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(this.element);
},insertContent:function(_119){
_119.each((function(_11a){
this.element.appendChild(_11a);
}).bind(this));
}});
Insertion.After=Class.create();
Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){
this.range.setStartAfter(this.element);
},insertContent:function(_11b){
_11b.each((function(_11c){
this.element.parentNode.insertBefore(_11c,this.element.nextSibling);
}).bind(this));
}});
Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(_11d){
this.element=$(_11d);
},_each:function(_11e){
this.element.className.split(/\s+/).select(function(name){
return name.length>0;
})._each(_11e);
},set:function(_120){
this.element.className=_120;
},add:function(_121){
if(this.include(_121)){
return;
}
this.set(this.toArray().concat(_121).join(" "));
},remove:function(_122){
if(!this.include(_122)){
return;
}
this.set(this.select(function(_123){
return _123!=_122;
}).join(" "));
},toString:function(){
return this.toArray().join(" ");
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
var Field={clear:function(){
for(var i=0;i<arguments.length;i++){
$(arguments[i]).value="";
}
},focus:function(_125){
$(_125).focus();
},present:function(){
for(var i=0;i<arguments.length;i++){
if($(arguments[i]).value==""){
return false;
}
}
return true;
},select:function(_127){
$(_127).select();
},activate:function(_128){
_128=$(_128);
_128.focus();
if(_128.select){
_128.select();
}
}};
var Form={serialize:function(form){
var _12a=Form.getElements($(form));
var _12b=new Array();
for(var i=0;i<_12a.length;i++){
var _12d=Form.Element.serialize(_12a[i]);
if(_12d){
_12b.push(_12d);
}
}
return _12b.join("&");
},getElements:function(form){
form=$(form);
var _12f=new Array();
for(tagName in Form.Element.Serializers){
var _130=form.getElementsByTagName(tagName);
for(var j=0;j<_130.length;j++){
_12f.push(_130[j]);
}
}
return _12f;
},getInputs:function(form,_133,name){
form=$(form);
var _135=form.getElementsByTagName("input");
if(!_133&&!name){
return _135;
}
var _136=new Array();
for(var i=0;i<_135.length;i++){
var _138=_135[i];
if((_133&&_138.type!=_133)||(name&&_138.name!=name)){
continue;
}
_136.push(_138);
}
return _136;
},disable:function(form){
var _13a=Form.getElements(form);
for(var i=0;i<_13a.length;i++){
var _13c=_13a[i];
_13c.blur();
_13c.disabled="true";
}
},enable:function(form){
var _13e=Form.getElements(form);
for(var i=0;i<_13e.length;i++){
var _140=_13e[i];
_140.disabled="";
}
},findFirstElement:function(form){
return Form.getElements(form).find(function(_142){
return _142.type!="hidden"&&!_142.disabled&&["input","select","textarea"].include(_142.tagName.toLowerCase());
});
},focusFirstElement:function(form){
Field.activate(Form.findFirstElement(form));
},reset:function(form){
$(form).reset();
}};
Form.Element={serialize:function(_145){
_145=$(_145);
var _146=_145.tagName.toLowerCase();
var _147=Form.Element.Serializers[_146](_145);
if(_147){
var key=encodeURIComponent(_147[0]);
if(key.length==0){
return;
}
if(_147[1].constructor!=Array){
_147[1]=[_147[1]];
}
return _147[1].map(function(_149){
return key+"="+encodeURIComponent(_149);
}).join("&");
}
},getValue:function(_14a){
_14a=$(_14a);
var _14b=_14a.tagName.toLowerCase();
var _14c=Form.Element.Serializers[_14b](_14a);
if(_14c){
return _14c[1];
}
}};
Form.Element.Serializers={input:function(_14d){
switch(_14d.type.toLowerCase()){
case "submit":
case "hidden":
case "password":
case "text":
return Form.Element.Serializers.textarea(_14d);
case "checkbox":
case "radio":
return Form.Element.Serializers.inputSelector(_14d);
}
return false;
},inputSelector:function(_14e){
if(_14e.checked){
return [_14e.name,_14e.value];
}
},textarea:function(_14f){
return [_14f.name,_14f.value];
},select:function(_150){
return Form.Element.Serializers[_150.type=="select-one"?"selectOne":"selectMany"](_150);
},selectOne:function(_151){
var _152="",opt,_154=_151.selectedIndex;
if(_154>=0){
opt=_151.options[_154];
_152=opt.value;
if(!_152&&!("value" in opt)){
_152=opt.text;
}
}
return [_151.name,_152];
},selectMany:function(_155){
var _156=new Array();
for(var i=0;i<_155.length;i++){
var opt=_155.options[i];
if(opt.selected){
var _159=opt.value;
if(!_159&&!("value" in opt)){
_159=opt.text;
}
_156.push(_159);
}
}
return [_155.name,_156];
}};
var $F=Form.Element.getValue;
Abstract.TimedObserver=function(){
};
Abstract.TimedObserver.prototype={initialize:function(_15a,_15b,_15c){
this.frequency=_15b;
this.element=$(_15a);
this.callback=_15c;
this.lastValue=this.getValue();
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
var _15d=this.getValue();
if(this.lastValue!=_15d){
this.callback(this.element,_15d);
this.lastValue=_15d;
}
}};
Form.Element.Observer=Class.create();
Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.Observer=Class.create();
Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){
return Form.serialize(this.element);
}});
Abstract.EventObserver=function(){
};
Abstract.EventObserver.prototype={initialize:function(_15e,_15f){
this.element=$(_15e);
this.callback=_15f;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){
this.registerFormCallbacks();
}else{
this.registerCallback(this.element);
}
},onElementEvent:function(){
var _160=this.getValue();
if(this.lastValue!=_160){
this.callback(this.element,_160);
this.lastValue=_160;
}
},registerFormCallbacks:function(){
var _161=Form.getElements(this.element);
for(var i=0;i<_161.length;i++){
this.registerCallback(_161[i]);
}
},registerCallback:function(_163){
if(_163.type){
switch(_163.type.toLowerCase()){
case "checkbox":
case "radio":
Event.observe(_163,"click",this.onElementEvent.bind(this));
break;
case "password":
case "text":
case "textarea":
case "select-one":
case "select-multiple":
Event.observe(_163,"change",this.onElementEvent.bind(this));
break;
}
}
}};
Form.Element.EventObserver=Class.create();
Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.EventObserver=Class.create();
Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){
return Form.serialize(this.element);
}});
if(!window.Event){
var Event=new Object();
}
Object.extend(Event,{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,element:function(_164){
return _164.target||_164.srcElement;
},isLeftClick:function(_165){
return (((_165.which)&&(_165.which==1))||((_165.button)&&(_165.button==1)));
},pointerX:function(_166){
return _166.pageX||(_166.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_167){
return _167.pageY||(_167.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stop:function(_168){
if(_168.preventDefault){
_168.preventDefault();
_168.stopPropagation();
}else{
_168.returnValue=false;
_168.cancelBubble=true;
}
},findElement:function(_169,_16a){
var _16b=Event.element(_169);
while(_16b.parentNode&&(!_16b.tagName||(_16b.tagName.toUpperCase()!=_16a.toUpperCase()))){
_16b=_16b.parentNode;
}
return _16b;
},observers:false,_observeAndCache:function(_16c,name,_16e,_16f){
if(!this.observers){
this.observers=[];
}
if(_16c.addEventListener){
this.observers.push([_16c,name,_16e,_16f]);
_16c.addEventListener(name,_16e,_16f);
}else{
if(_16c.attachEvent){
this.observers.push([_16c,name,_16e,_16f]);
_16c.attachEvent("on"+name,_16e);
}
}
},unloadCache:function(){
if(!Event.observers){
return;
}
for(var i=0;i<Event.observers.length;i++){
Event.stopObserving.apply(this,Event.observers[i]);
Event.observers[i][0]=null;
}
Event.observers=false;
},observe:function(_171,name,_173,_174){
var _171=$(_171);
_174=_174||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_171.attachEvent)){
name="keydown";
}
this._observeAndCache(_171,name,_173,_174);
},stopObserving:function(_175,name,_177,_178){
var _175=$(_175);
_178=_178||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_175.detachEvent)){
name="keydown";
}
if(_175.removeEventListener){
_175.removeEventListener(name,_177,_178);
}else{
if(_175.detachEvent){
_175.detachEvent("on"+name,_177);
}
}
}});
Event.observe(window,"unload",Event.unloadCache,false);
var 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;
},realOffset:function(_179){
var _17a=0,_17b=0;
do{
_17a+=_179.scrollTop||0;
_17b+=_179.scrollLeft||0;
_179=_179.parentNode;
}while(_179);
return [_17b,_17a];
},cumulativeOffset:function(_17c){
var _17d=0,_17e=0;
do{
_17d+=_17c.offsetTop||0;
_17e+=_17c.offsetLeft||0;
_17c=_17c.offsetParent;
}while(_17c);
return [_17e,_17d];
},positionedOffset:function(_17f){
var _180=0,_181=0;
do{
_180+=_17f.offsetTop||0;
_181+=_17f.offsetLeft||0;
_17f=_17f.offsetParent;
if(_17f){
p=Element.getStyle(_17f,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_17f);
return [_181,_180];
},offsetParent:function(_182){
if(_182.offsetParent){
return _182.offsetParent;
}
if(_182==document.body){
return _182;
}
while((_182=_182.parentNode)&&_182!=document.body){
if(Element.getStyle(_182,"position")!="static"){
return _182;
}
}
return document.body;
},within:function(_183,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_183,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_183);
return (y>=this.offset[1]&&y<this.offset[1]+_183.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_183.offsetWidth);
},withinIncludingScrolloffsets:function(_186,x,y){
var _189=this.realOffset(_186);
this.xcomp=x+_189[0]-this.deltaX;
this.ycomp=y+_189[1]-this.deltaY;
this.offset=this.cumulativeOffset(_186);
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_186.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_186.offsetWidth);
},overlap:function(mode,_18b){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset[1]+_18b.offsetHeight)-this.ycomp)/_18b.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset[0]+_18b.offsetWidth)-this.xcomp)/_18b.offsetWidth;
}
},clone:function(_18c,_18d){
_18c=$(_18c);
_18d=$(_18d);
_18d.style.position="absolute";
var _18e=this.cumulativeOffset(_18c);
_18d.style.top=_18e[1]+"px";
_18d.style.left=_18e[0]+"px";
_18d.style.width=_18c.offsetWidth+"px";
_18d.style.height=_18c.offsetHeight+"px";
},page:function(_18f){
var _190=0,_191=0;
var _192=_18f;
do{
_190+=_192.offsetTop||0;
_191+=_192.offsetLeft||0;
if(_192.offsetParent==document.body){
if(Element.getStyle(_192,"position")=="absolute"){
break;
}
}
}while(_192=_192.offsetParent);
_192=_18f;
do{
_190-=_192.scrollTop||0;
_191-=_192.scrollLeft||0;
}while(_192=_192.parentNode);
return [_191,_190];
},clone:function(_193,_194){
var _195=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
_193=$(_193);
var p=Position.page(_193);
_194=$(_194);
var _197=[0,0];
var _198=null;
if(Element.getStyle(_194,"position")=="absolute"){
_198=Position.offsetParent(_194);
_197=Position.page(_198);
}
if(_198==document.body){
_197[0]-=document.body.offsetLeft;
_197[1]-=document.body.offsetTop;
}
if(_195.setLeft){
_194.style.left=(p[0]-_197[0]+_195.offsetLeft)+"px";
}
if(_195.setTop){
_194.style.top=(p[1]-_197[1]+_195.offsetTop)+"px";
}
if(_195.setWidth){
_194.style.width=_193.offsetWidth+"px";
}
if(_195.setHeight){
_194.style.height=_193.offsetHeight+"px";
}
},absolutize:function(_199){
_199=$(_199);
if(_199.style.position=="absolute"){
return;
}
Position.prepare();
var _19a=Position.positionedOffset(_199);
var top=_19a[1];
var left=_19a[0];
var _19d=_199.clientWidth;
var _19e=_199.clientHeight;
_199._originalLeft=left-parseFloat(_199.style.left||0);
_199._originalTop=top-parseFloat(_199.style.top||0);
_199._originalWidth=_199.style.width;
_199._originalHeight=_199.style.height;
_199.style.position="absolute";
_199.style.top=top+"px";
_199.style.left=left+"px";
_199.style.width=_19d+"px";
_199.style.height=_19e+"px";
},relativize:function(_19f){
_19f=$(_19f);
if(_19f.style.position=="relative"){
return;
}
Position.prepare();
_19f.style.position="relative";
var top=parseFloat(_19f.style.top||0)-(_19f._originalTop||0);
var left=parseFloat(_19f.style.left||0)-(_19f._originalLeft||0);
_19f.style.top=top+"px";
_19f.style.left=left+"px";
_19f.style.height=_19f._originalHeight;
_19f.style.width=_19f._originalWidth;
}};
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
Position.cumulativeOffset=function(_1a2){
var _1a3=0,_1a4=0;
do{
_1a3+=_1a2.offsetTop||0;
_1a4+=_1a2.offsetLeft||0;
if(_1a2.offsetParent==document.body){
if(Element.getStyle(_1a2,"position")=="absolute"){
break;
}
}
_1a2=_1a2.offsetParent;
}while(_1a2);
return [_1a4,_1a3];
};
}
var hexcase=0;
var b64pad="";
var chrsz=8;
function hex_sha1(s){
return binb2hex(core_sha1(str2binb(s),s.length*chrsz));
}
function b64_sha1(s){
return binb2b64(core_sha1(str2binb(s),s.length*chrsz));
}
function str_sha1(s){
return binb2str(core_sha1(str2binb(s),s.length*chrsz));
}
function hex_hmac_sha1(key,data){
return binb2hex(core_hmac_sha1(key,data));
}
function b64_hmac_sha1(key,data){
return binb2b64(core_hmac_sha1(key,data));
}
function str_hmac_sha1(key,data){
return binb2str(core_hmac_sha1(key,data));
}
function sha1_vm_test(){
return hex_sha1("abc")=="a9993e364706816aba3e25717850c26c9cd0d89d";
}
function core_sha1(x,len){
x[len>>5]|=128<<(24-len%32);
x[((len+64>>9)<<4)+15]=len;
var w=Array(80);
var a=1732584193;
var b=-271733879;
var c=-1732584194;
var d=271733878;
var e=-1009589776;
for(var i=0;i<x.length;i+=16){
var olda=a;
var oldb=b;
var oldc=c;
var oldd=d;
var olde=e;
for(var j=0;j<80;j++){
if(j<16){
w[j]=x[i+j];
}else{
w[j]=rol(w[j-3]^w[j-8]^w[j-14]^w[j-16],1);
}
var t=safe_add(safe_add(rol(a,5),sha1_ft(j,b,c,d)),safe_add(safe_add(e,w[j]),sha1_kt(j)));
e=d;
d=c;
c=rol(b,30);
b=a;
a=t;
}
a=safe_add(a,olda);
b=safe_add(b,oldb);
c=safe_add(c,oldc);
d=safe_add(d,oldd);
e=safe_add(e,olde);
}
return Array(a,b,c,d,e);
}
function sha1_ft(t,b,c,d){
if(t<20){
return (b&c)|((~b)&d);
}
if(t<40){
return b^c^d;
}
if(t<60){
return (b&c)|(b&d)|(c&d);
}
return b^c^d;
}
function sha1_kt(t){
return (t<20)?1518500249:(t<40)?1859775393:(t<60)?-1894007588:-899497514;
}
function core_hmac_sha1(key,data){
var bkey=str2binb(key);
if(bkey.length>16){
bkey=core_sha1(bkey,key.length*chrsz);
}
var ipad=Array(16),opad=Array(16);
for(var i=0;i<16;i++){
ipad[i]=bkey[i]^909522486;
opad[i]=bkey[i]^1549556828;
}
var hash=core_sha1(ipad.concat(str2binb(data)),512+data.length*chrsz);
return core_sha1(opad.concat(hash),512+160);
}
function safe_add(x,y){
var lsw=(x&65535)+(y&65535);
var msw=(x>>16)+(y>>16)+(lsw>>16);
return (msw<<16)|(lsw&65535);
}
function rol(num,cnt){
return (num<<cnt)|(num>>>(32-cnt));
}
function str2binb(str){
var bin=Array();
var mask=(1<<chrsz)-1;
for(var i=0;i<str.length*chrsz;i+=chrsz){
bin[i>>5]|=(str.charCodeAt(i/chrsz)&mask)<<(24-i%32);
}
return bin;
}
function binb2str(bin){
var str="";
var mask=(1<<chrsz)-1;
for(var i=0;i<bin.length*32;i+=chrsz){
str+=String.fromCharCode((bin[i>>5]>>>(24-i%32))&mask);
}
return str;
}
function binb2hex(_1d8){
var _1d9=hexcase?"0123456789ABCDEF":"0123456789abcdef";
var str="";
for(var i=0;i<_1d8.length*4;i++){
str+=_1d9.charAt((_1d8[i>>2]>>((3-i%4)*8+4))&15)+_1d9.charAt((_1d8[i>>2]>>((3-i%4)*8))&15);
}
return str;
}
function binb2b64(_1dc){
var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var str="";
for(var i=0;i<_1dc.length*4;i+=3){
var _1e0=(((_1dc[i>>2]>>8*(3-i%4))&255)<<16)|(((_1dc[i+1>>2]>>8*(3-(i+1)%4))&255)<<8)|((_1dc[i+2>>2]>>8*(3-(i+2)%4))&255);
for(var j=0;j<4;j++){
if(i*8+j*6>_1dc.length*32){
str+=b64pad;
}else{
str+=tab.charAt((_1e0>>6*(3-j))&63);
}
}
}
return str;
}
function generateNonce(_1e2){
var _1e3="0123456789abcdef";
var _1e4="";
for(var i=0;i<_1e2;i++){
_1e4+=_1e3.charAt(Math.floor(Math.random()*_1e3.length));
}
return _1e4;
}
function getW3CDate(date){
var yyyy=date.getUTCFullYear();
var mm=(date.getUTCMonth()+1);
if(mm<10){
mm="0"+mm;
}
var dd=(date.getUTCDate());
if(dd<10){
dd="0"+dd;
}
var hh=(date.getUTCHours());
if(hh<10){
hh="0"+hh;
}
var mn=(date.getUTCMinutes());
if(mn<10){
mn="0"+mn;
}
var ss=(date.getUTCSeconds());
if(ss<10){
ss="0"+ss;
}
return yyyy+"-"+mm+"-"+dd+"T"+hh+":"+mn+":"+ss+"Z";
}
function wsseHeader(_1ed,_1ee){
var _1ef,_1f0,_1f1;
_1f0=getW3CDate(new Date());
_1f1=generateNonce(16);
_1ef=b64_sha1(_1f1+_1f0+_1ee);
var _1f2="UsernameToken Username=\""+encodeURIComponent(_1ed)+"\", PasswordDigest=\""+_1ef+"\", Created=\""+_1f0+"\", Nonce=\""+_1f1+"\"";
return _1f2;
}
String.prototype.parseColor=function(){
var _1f3="#";
if(this.slice(0,4)=="rgb("){
var cols=this.slice(4,this.length-1).split(",");
var i=0;
do{
_1f3+=parseInt(cols[i]).toColorPart();
}while(++i<3);
}else{
if(this.slice(0,1)=="#"){
if(this.length==4){
for(var i=1;i<4;i++){
_1f3+=(this.charAt(i)+this.charAt(i)).toLowerCase();
}
}
if(this.length==7){
_1f3=this.toLowerCase();
}
}
}
return (_1f3.length==7?_1f3:(arguments[0]||this));
};
Element.collectTextNodes=function(_1f6){
return $A($(_1f6).childNodes).collect(function(node){
return (node.nodeType==3?node.nodeValue:(node.hasChildNodes()?Element.collectTextNodes(node):""));
}).flatten().join("");
};
Element.collectTextNodesIgnoreClass=function(_1f8,_1f9){
return $A($(_1f8).childNodes).collect(function(node){
return (node.nodeType==3?node.nodeValue:((node.hasChildNodes()&&!Element.hasClassName(node,_1f9))?Element.collectTextNodesIgnoreClass(node,_1f9):""));
}).flatten().join("");
};
Element.setStyle=function(_1fb,_1fc){
_1fb=$(_1fb);
for(k in _1fc){
_1fb.style[k.camelize()]=_1fc[k];
}
};
Element.setContentZoom=function(_1fd,_1fe){
Element.setStyle(_1fd,{fontSize:(_1fe/100)+"em"});
if(navigator.appVersion.indexOf("AppleWebKit")>0){
window.scrollBy(0,0);
}
};
Element.getOpacity=function(_1ff){
var _200;
if(_200=Element.getStyle(_1ff,"opacity")){
return parseFloat(_200);
}
if(_200=(Element.getStyle(_1ff,"filter")||"").match(/alpha\(opacity=(.*)\)/)){
if(_200[1]){
return parseFloat(_200[1])/100;
}
}
return 1;
};
Element.setOpacity=function(_201,_202){
_201=$(_201);
if(_202==1){
Element.setStyle(_201,{opacity:(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:null});
if(/MSIE/.test(navigator.userAgent)){
Element.setStyle(_201,{filter:Element.getStyle(_201,"filter").replace(/alpha\([^\)]*\)/gi,"")});
}
}else{
if(_202<0.00001){
_202=0;
}
Element.setStyle(_201,{opacity:_202});
if(/MSIE/.test(navigator.userAgent)){
Element.setStyle(_201,{filter:Element.getStyle(_201,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+_202*100+")"});
}
}
};
Element.getInlineOpacity=function(_203){
return $(_203).style.opacity||"";
};
Element.childrenWithClassName=function(_204,_205){
return $A($(_204).getElementsByTagName("*")).select(function(c){
return Element.hasClassName(c,_205);
});
};
Array.prototype.call=function(){
var args=arguments;
this.each(function(f){
f.apply(this,args);
});
};
var Effect={tagifyText:function(_209){
var _20a="position:relative";
if(/MSIE/.test(navigator.userAgent)){
_20a+=";zoom:1";
}
_209=$(_209);
$A(_209.childNodes).each(function(_20b){
if(_20b.nodeType==3){
_20b.nodeValue.toArray().each(function(_20c){
_209.insertBefore(Builder.node("span",{style:_20a},_20c==" "?String.fromCharCode(160):_20c),_20b);
});
Element.remove(_20b);
}
});
},multiple:function(_20d,_20e){
var _20f;
if(((typeof _20d=="object")||(typeof _20d=="function"))&&(_20d.length)){
_20f=_20d;
}else{
_20f=$(_20d).childNodes;
}
var _210=Object.extend({speed:0.1,delay:0},arguments[2]||{});
var _211=_210.delay;
$A(_20f).each(function(_212,_213){
new _20e(_212,Object.extend(_210,{delay:_213*_210.speed+_211}));
});
},PAIRS:{"slide":["SlideDown","SlideUp"],"blind":["BlindDown","BlindUp"],"appear":["Appear","Fade"]},toggle:function(_214,_215){
_214=$(_214);
_215=(_215||"appear").toLowerCase();
var _216=Object.extend({queue:{position:"end",scope:(_214.id||"global"),limit:1}},arguments[2]||{});
Effect[Element.visible(_214)?Effect.PAIRS[_215][1]:Effect.PAIRS[_215][0]](_214,_216);
}};
var Effect2=Effect;
Effect.Transitions={};
Effect.Transitions.linear=function(pos){
return pos;
};
Effect.Transitions.sinoidal=function(pos){
return (-Math.cos(pos*Math.PI)/2)+0.5;
};
Effect.Transitions.reverse=function(pos){
return 1-pos;
};
Effect.Transitions.flicker=function(pos){
return ((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;
};
Effect.Transitions.wobble=function(pos){
return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;
};
Effect.Transitions.pulse=function(pos){
return (Math.floor(pos*10)%2==0?(pos*10-Math.floor(pos*10)):1-(pos*10-Math.floor(pos*10)));
};
Effect.Transitions.none=function(pos){
return 0;
};
Effect.Transitions.full=function(pos){
return 1;
};
Effect.ScopedQueue=Class.create();
Object.extend(Object.extend(Effect.ScopedQueue.prototype,Enumerable),{initialize:function(){
this.effects=[];
this.interval=null;
},_each:function(_21f){
this.effects._each(_21f);
},add:function(_220){
var _221=new Date().getTime();
var _222=(typeof _220.options.queue=="string")?_220.options.queue:_220.options.queue.position;
switch(_222){
case "front":
this.effects.findAll(function(e){
return e.state=="idle";
}).each(function(e){
e.startOn+=_220.finishOn;
e.finishOn+=_220.finishOn;
});
break;
case "end":
_221=this.effects.pluck("finishOn").max()||_221;
break;
}
_220.startOn+=_221;
_220.finishOn+=_221;
if(!_220.options.queue.limit||(this.effects.length<_220.options.queue.limit)){
this.effects.push(_220);
}
if(!this.interval){
this.interval=setInterval(this.loop.bind(this),40);
}
},remove:function(_225){
this.effects=this.effects.reject(function(e){
return e==_225;
});
if(this.effects.length==0){
clearInterval(this.interval);
this.interval=null;
}
},loop:function(){
var _227=new Date().getTime();
this.effects.invoke("loop",_227);
}});
Effect.Queues={instances:$H(),get:function(_228){
if(typeof _228!="string"){
return _228;
}
if(!this.instances[_228]){
this.instances[_228]=new Effect.ScopedQueue();
}
return this.instances[_228];
}};
Effect.Queue=Effect.Queues.get("global");
Effect.DefaultOptions={transition:Effect.Transitions.sinoidal,duration:1,fps:25,sync:false,from:0,to:1,delay:0,queue:"parallel"};
Effect.Base=function(){
};
Effect.Base.prototype={position:null,start:function(_229){
this.options=Object.extend(Object.extend({},Effect.DefaultOptions),_229||{});
this.currentFrame=0;
this.state="idle";
this.startOn=this.options.delay*1000;
this.finishOn=this.startOn+(this.options.duration*1000);
this.event("beforeStart");
if(!this.options.sync){
Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).add(this);
}
},loop:function(_22a){
if(_22a>=this.startOn){
if(_22a>=this.finishOn){
this.render(1);
this.cancel();
this.event("beforeFinish");
if(this.finish){
this.finish();
}
this.event("afterFinish");
return;
}
var pos=(_22a-this.startOn)/(this.finishOn-this.startOn);
var _22c=Math.round(pos*this.options.fps*this.options.duration);
if(_22c>this.currentFrame){
this.render(pos);
this.currentFrame=_22c;
}
}
},render:function(pos){
if(this.state=="idle"){
this.state="running";
this.event("beforeSetup");
if(this.setup){
this.setup();
}
this.event("afterSetup");
}
if(this.state=="running"){
if(this.options.transition){
pos=this.options.transition(pos);
}
pos*=(this.options.to-this.options.from);
pos+=this.options.from;
this.position=pos;
this.event("beforeUpdate");
if(this.update){
this.update(pos);
}
this.event("afterUpdate");
}
},cancel:function(){
if(!this.options.sync){
Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).remove(this);
}
this.state="finished";
},event:function(_22e){
if(this.options[_22e+"Internal"]){
this.options[_22e+"Internal"](this);
}
if(this.options[_22e]){
this.options[_22e](this);
}
},inspect:function(){
return "#<Effect:"+$H(this).inspect()+",options:"+$H(this.options).inspect()+">";
}};
Effect.Parallel=Class.create();
Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(_22f){
this.effects=_22f||[];
this.start(arguments[1]);
},update:function(_230){
this.effects.invoke("render",_230);
},finish:function(_231){
this.effects.each(function(_232){
_232.render(1);
_232.cancel();
_232.event("beforeFinish");
if(_232.finish){
_232.finish(_231);
}
_232.event("afterFinish");
});
}});
Effect.Opacity=Class.create();
Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(_233){
this.element=$(_233);
if(/MSIE/.test(navigator.userAgent)&&(!this.element.hasLayout)){
Element.setStyle(this.element,{zoom:1});
}
var _234=Object.extend({from:Element.getOpacity(this.element)||0,to:1},arguments[1]||{});
this.start(_234);
},update:function(_235){
Element.setOpacity(this.element,_235);
}});
Effect.Move=Class.create();
Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(_236){
this.element=$(_236);
var _237=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});
this.start(_237);
},setup:function(){
Element.makePositioned(this.element);
this.originalLeft=parseFloat(Element.getStyle(this.element,"left")||"0");
this.originalTop=parseFloat(Element.getStyle(this.element,"top")||"0");
if(this.options.mode=="absolute"){
this.options.x=this.options.x-this.originalLeft;
this.options.y=this.options.y-this.originalTop;
}
},update:function(_238){
Element.setStyle(this.element,{left:this.options.x*_238+this.originalLeft+"px",top:this.options.y*_238+this.originalTop+"px"});
}});
Effect.MoveBy=function(_239,_23a,_23b){
return new Effect.Move(_239,Object.extend({x:_23b,y:_23a},arguments[3]||{}));
};
Effect.Scale=Class.create();
Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(_23c,_23d){
this.element=$(_23c);
var _23e=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_23d},arguments[2]||{});
this.start(_23e);
},setup:function(){
this.restoreAfterFinish=this.options.restoreAfterFinish||false;
this.elementPositioning=Element.getStyle(this.element,"position");
this.originalStyle={};
["top","left","width","height","fontSize"].each(function(k){
this.originalStyle[k]=this.element.style[k];
}.bind(this));
this.originalTop=this.element.offsetTop;
this.originalLeft=this.element.offsetLeft;
var _240=Element.getStyle(this.element,"font-size")||"100%";
["em","px","%"].each(function(_241){
if(_240.indexOf(_241)>0){
this.fontSize=parseFloat(_240);
this.fontSizeType=_241;
}
}.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(_242){
var _243=(this.options.scaleFrom/100)+(this.factor*_242);
if(this.options.scaleContent&&this.fontSize){
Element.setStyle(this.element,{fontSize:this.fontSize*_243+this.fontSizeType});
}
this.setDimensions(this.dims[0]*_243,this.dims[1]*_243);
},finish:function(_244){
if(this.restoreAfterFinish){
Element.setStyle(this.element,this.originalStyle);
}
},setDimensions:function(_245,_246){
var d={};
if(this.options.scaleX){
d.width=_246+"px";
}
if(this.options.scaleY){
d.height=_245+"px";
}
if(this.options.scaleFromCenter){
var topd=(_245-this.dims[0])/2;
var _249=(_246-this.dims[1])/2;
if(this.elementPositioning=="absolute"){
if(this.options.scaleY){
d.top=this.originalTop-topd+"px";
}
if(this.options.scaleX){
d.left=this.originalLeft-_249+"px";
}
}else{
if(this.options.scaleY){
d.top=-topd+"px";
}
if(this.options.scaleX){
d.left=-_249+"px";
}
}
}
Element.setStyle(this.element,d);
}});
Effect.Highlight=Class.create();
Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(_24a){
this.element=$(_24a);
var _24b=Object.extend({startcolor:"#ffff99"},arguments[1]||{});
this.start(_24b);
},setup:function(){
if(Element.getStyle(this.element,"display")=="none"){
this.cancel();
return;
}
this.oldStyle={backgroundImage:Element.getStyle(this.element,"background-image")};
Element.setStyle(this.element,{backgroundImage:"none"});
if(!this.options.endcolor){
this.options.endcolor=Element.getStyle(this.element,"background-color").parseColor("#ffffff");
}
if(!this.options.restorecolor){
this.options.restorecolor=Element.getStyle(this.element,"background-color");
}
this._base=$R(0,2).map(function(i){
return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16);
}.bind(this));
this._delta=$R(0,2).map(function(i){
return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i];
}.bind(this));
},update:function(_24e){
Element.setStyle(this.element,{backgroundColor:$R(0,2).inject("#",function(m,v,i){
return m+(Math.round(this._base[i]+(this._delta[i]*_24e)).toColorPart());
}.bind(this))});
},finish:function(){
Element.setStyle(this.element,Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}));
}});
Effect.ScrollTo=Class.create();
Object.extend(Object.extend(Effect.ScrollTo.prototype,Effect.Base.prototype),{initialize:function(_252){
this.element=$(_252);
this.start(arguments[1]||{});
},setup:function(){
Position.prepare();
var _253=Position.cumulativeOffset(this.element);
if(this.options.offset){
_253[1]+=this.options.offset;
}
var max=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);
this.scrollStart=Position.deltaY;
this.delta=(_253[1]>max?max:_253[1])-this.scrollStart;
},update:function(_255){
Position.prepare();
window.scrollTo(Position.deltaX,this.scrollStart+(_255*this.delta));
}});
Effect.Fade=function(_256){
var _257=Element.getInlineOpacity(_256);
var _258=Object.extend({from:Element.getOpacity(_256)||1,to:0,afterFinishInternal:function(_259){
with(Element){
if(_259.options.to!=0){
return;
}
hide(_259.element);
setStyle(_259.element,{opacity:_257});
}
}},arguments[1]||{});
return new Effect.Opacity(_256,_258);
};
Effect.Appear=function(_25a){
var _25b=Object.extend({from:(Element.getStyle(_25a,"display")=="none"?0:Element.getOpacity(_25a)||0),to:1,beforeSetup:function(_25c){
with(Element){
setOpacity(_25c.element,_25c.options.from);
show(_25c.element);
}
}},arguments[1]||{});
return new Effect.Opacity(_25a,_25b);
};
Effect.Puff=function(_25d){
_25d=$(_25d);
var _25e={opacity:Element.getInlineOpacity(_25d),position:Element.getStyle(_25d,"position")};
return new Effect.Parallel([new Effect.Scale(_25d,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(_25d,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(_25f){
with(Element){
setStyle(_25f.effects[0].element,{position:"absolute"});
}
},afterFinishInternal:function(_260){
with(Element){
hide(_260.effects[0].element);
setStyle(_260.effects[0].element,_25e);
}
}},arguments[1]||{}));
};
Effect.BlindUp=function(_261){
_261=$(_261);
Element.makeClipping(_261);
return new Effect.Scale(_261,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_262){
with(Element){
[hide,undoClipping].call(_262.element);
}
}},arguments[1]||{}));
};
Effect.BlindDown=function(_263){
_263=$(_263);
var _264=Element.getDimensions(_263);
return new Effect.Scale(_263,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_264.height,originalWidth:_264.width},restoreAfterFinish:true,afterSetup:function(_265){
with(Element){
makeClipping(_265.element);
setStyle(_265.element,{height:"0px"});
show(_265.element);
}
},afterFinishInternal:function(_266){
Element.undoClipping(_266.element);
}},arguments[1]||{}));
};
Effect.SwitchOff=function(_267){
_267=$(_267);
var _268=Element.getInlineOpacity(_267);
return new Effect.Appear(_267,{duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(_269){
new Effect.Scale(_269.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(_26a){
with(Element){
[makePositioned,makeClipping].call(_26a.element);
}
},afterFinishInternal:function(_26b){
with(Element){
[hide,undoClipping,undoPositioned].call(_26b.element);
setStyle(_26b.element,{opacity:_268});
}
}});
}});
};
Effect.DropOut=function(_26c){
_26c=$(_26c);
var _26d={top:Element.getStyle(_26c,"top"),left:Element.getStyle(_26c,"left"),opacity:Element.getInlineOpacity(_26c)};
return new Effect.Parallel([new Effect.Move(_26c,{x:0,y:100,sync:true}),new Effect.Opacity(_26c,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(_26e){
with(Element){
makePositioned(_26e.effects[0].element);
}
},afterFinishInternal:function(_26f){
with(Element){
[hide,undoPositioned].call(_26f.effects[0].element);
setStyle(_26f.effects[0].element,_26d);
}
}},arguments[1]||{}));
};
Effect.Shake=function(_270){
_270=$(_270);
var _271={top:Element.getStyle(_270,"top"),left:Element.getStyle(_270,"left")};
return new Effect.Move(_270,{x:20,y:0,duration:0.05,afterFinishInternal:function(_272){
new Effect.Move(_272.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_273){
new Effect.Move(_273.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_274){
new Effect.Move(_274.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_275){
new Effect.Move(_275.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_276){
new Effect.Move(_276.element,{x:-20,y:0,duration:0.05,afterFinishInternal:function(_277){
with(Element){
undoPositioned(_277.element);
setStyle(_277.element,_271);
}
}});
}});
}});
}});
}});
}});
};
Effect.SlideDown=function(_278){
_278=$(_278);
Element.cleanWhitespace(_278);
var _279=Element.getStyle(_278.firstChild,"bottom");
var _27a=Element.getDimensions(_278);
return new Effect.Scale(_278,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_27a.height,originalWidth:_27a.width},restoreAfterFinish:true,afterSetup:function(_27b){
with(Element){
makePositioned(_27b.element);
makePositioned(_27b.element.firstChild);
if(window.opera){
setStyle(_27b.element,{top:""});
}
makeClipping(_27b.element);
setStyle(_27b.element,{height:"0px"});
show(_278);
}
},afterUpdateInternal:function(_27c){
with(Element){
setStyle(_27c.element.firstChild,{bottom:(_27c.dims[0]-_27c.element.clientHeight)+"px"});
}
},afterFinishInternal:function(_27d){
with(Element){
undoClipping(_27d.element);
if(/MSIE/.test(navigator.userAgent)){
undoPositioned(_27d.element);
undoPositioned(_27d.element.firstChild);
}else{
undoPositioned(_27d.element.firstChild);
undoPositioned(_27d.element);
}
setStyle(_27d.element.firstChild,{bottom:_279});
}
}},arguments[1]||{}));
};
Effect.SlideUp=function(_27e){
_27e=$(_27e);
Element.cleanWhitespace(_27e);
var _27f=Element.getStyle(_27e.firstChild,"bottom");
return new Effect.Scale(_27e,0,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_280){
with(Element){
makePositioned(_280.element);
makePositioned(_280.element.firstChild);
if(window.opera){
setStyle(_280.element,{top:""});
}
makeClipping(_280.element);
show(_27e);
}
},afterUpdateInternal:function(_281){
with(Element){
setStyle(_281.element.firstChild,{bottom:(_281.dims[0]-_281.element.clientHeight)+"px"});
}
},afterFinishInternal:function(_282){
with(Element){
[hide,undoClipping].call(_282.element);
undoPositioned(_282.element.firstChild);
undoPositioned(_282.element);
setStyle(_282.element.firstChild,{bottom:_27f});
}
}},arguments[1]||{}));
};
Effect.Squish=function(_283){
return new Effect.Scale(_283,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(_284){
with(Element){
makeClipping(_284.element);
}
},afterFinishInternal:function(_285){
with(Element){
hide(_285.element);
undoClipping(_285.element);
}
}});
};
Effect.Grow=function(_286){
_286=$(_286);
var _287=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});
var _288={top:_286.style.top,left:_286.style.left,height:_286.style.height,width:_286.style.width,opacity:Element.getInlineOpacity(_286)};
var dims=Element.getDimensions(_286);
var _28a,_28b;
var _28c,_28d;
switch(_287.direction){
case "top-left":
_28a=_28b=_28c=_28d=0;
break;
case "top-right":
_28a=dims.width;
_28b=_28d=0;
_28c=-dims.width;
break;
case "bottom-left":
_28a=_28c=0;
_28b=dims.height;
_28d=-dims.height;
break;
case "bottom-right":
_28a=dims.width;
_28b=dims.height;
_28c=-dims.width;
_28d=-dims.height;
break;
case "center":
_28a=dims.width/2;
_28b=dims.height/2;
_28c=-dims.width/2;
_28d=-dims.height/2;
break;
}
return new Effect.Move(_286,{x:_28a,y:_28b,duration:0.01,beforeSetup:function(_28e){
with(Element){
hide(_28e.element);
makeClipping(_28e.element);
makePositioned(_28e.element);
}
},afterFinishInternal:function(_28f){
new Effect.Parallel([new Effect.Opacity(_28f.element,{sync:true,to:1,from:0,transition:_287.opacityTransition}),new Effect.Move(_28f.element,{x:_28c,y:_28d,sync:true,transition:_287.moveTransition}),new Effect.Scale(_28f.element,100,{scaleMode:{originalHeight:dims.height,originalWidth:dims.width},sync:true,scaleFrom:window.opera?1:0,transition:_287.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(_290){
with(Element){
setStyle(_290.effects[0].element,{height:"0px"});
show(_290.effects[0].element);
}
},afterFinishInternal:function(_291){
with(Element){
[undoClipping,undoPositioned].call(_291.effects[0].element);
setStyle(_291.effects[0].element,_288);
}
}},_287));
}});
};
Effect.Shrink=function(_292){
_292=$(_292);
var _293=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});
var _294={top:_292.style.top,left:_292.style.left,height:_292.style.height,width:_292.style.width,opacity:Element.getInlineOpacity(_292)};
var dims=Element.getDimensions(_292);
var _296,_297;
switch(_293.direction){
case "top-left":
_296=_297=0;
break;
case "top-right":
_296=dims.width;
_297=0;
break;
case "bottom-left":
_296=0;
_297=dims.height;
break;
case "bottom-right":
_296=dims.width;
_297=dims.height;
break;
case "center":
_296=dims.width/2;
_297=dims.height/2;
break;
}
return new Effect.Parallel([new Effect.Opacity(_292,{sync:true,to:0,from:1,transition:_293.opacityTransition}),new Effect.Scale(_292,window.opera?1:0,{sync:true,transition:_293.scaleTransition,restoreAfterFinish:true}),new Effect.Move(_292,{x:_296,y:_297,sync:true,transition:_293.moveTransition})],Object.extend({beforeStartInternal:function(_298){
with(Element){
[makePositioned,makeClipping].call(_298.effects[0].element);
}
},afterFinishInternal:function(_299){
with(Element){
[hide,undoClipping,undoPositioned].call(_299.effects[0].element);
setStyle(_299.effects[0].element,_294);
}
}},_293));
};
Effect.Pulsate=function(_29a){
_29a=$(_29a);
var _29b=arguments[1]||{};
var _29c=Element.getInlineOpacity(_29a);
var _29d=_29b.transition||Effect.Transitions.sinoidal;
var _29e=function(pos){
return _29d(1-Effect.Transitions.pulse(pos));
};
_29e.bind(_29d);
return new Effect.Opacity(_29a,Object.extend(Object.extend({duration:3,from:0,afterFinishInternal:function(_2a0){
Element.setStyle(_2a0.element,{opacity:_29c});
}},_29b),{transition:_29e}));
};
Effect.Fold=function(_2a1){
_2a1=$(_2a1);
var _2a2={top:_2a1.style.top,left:_2a1.style.left,width:_2a1.style.width,height:_2a1.style.height};
Element.makeClipping(_2a1);
return new Effect.Scale(_2a1,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(_2a3){
new Effect.Scale(_2a1,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_2a4){
with(Element){
[hide,undoClipping].call(_2a4.element);
setStyle(_2a4.element,_2a2);
}
}});
}},arguments[1]||{}));
};
var Autocompleter={};
Autocompleter.Base=function(){
};
Autocompleter.Base.prototype={baseInitialize:function(_2a5,_2a6,_2a7){
this.element=$(_2a5);
this.update=$(_2a6);
this.hasFocus=false;
this.changed=false;
this.active=false;
this.index=0;
this.entryCount=0;
if(this.setOptions){
this.setOptions(_2a7);
}else{
this.options=_2a7||{};
}
this.options.paramName=this.options.paramName||this.element.name;
this.options.tokens=this.options.tokens||[];
this.options.frequency=this.options.frequency||0.4;
this.options.minChars=this.options.minChars||1;
this.options.onShow=this.options.onShow||function(_2a8,_2a9){
if(!_2a9.style.position||_2a9.style.position=="absolute"){
_2a9.style.position="absolute";
_2a9.style.zIndex="10";
Position.clone(_2a8,_2a9,{setHeight:false,offsetTop:_2a8.offsetHeight});
}
Effect.Appear(_2a9,{duration:0.15});
};
this.options.onHide=this.options.onHide||function(_2aa,_2ab){
new Effect.Fade(_2ab,{duration:0.15});
};
if(typeof (this.options.tokens)=="string"){
this.options.tokens=new Array(this.options.tokens);
}
this.observer=null;
this.element.setAttribute("autocomplete","off");
Element.hide(this.update);
Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));
Event.observe(this.element,"keypress",this.onKeyPress.bindAsEventListener(this));
},show:function(){
if(Element.getStyle(this.update,"display")=="none"){
this.options.onShow(this.element,this.update);
}
if(!this.iefix&&(navigator.appVersion.indexOf("MSIE")>0)&&(navigator.userAgent.indexOf("Opera")<0)&&(Element.getStyle(this.update,"position")=="absolute")){
new Insertion.After(this.update,"<iframe id=\""+this.update.id+"_iefix\" "+"style=\"display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);\" "+"src=\"javascript:false;\" frameborder=\"0\" scrolling=\"no\"></iframe>");
this.iefix=$(this.update.id+"_iefix");
}
if(this.iefix){
setTimeout(this.fixIEOverlapping.bind(this),50);
}
},fixIEOverlapping:function(){
Position.clone(this.update,this.iefix);
this.iefix.style.zIndex=10;
this.update.style.zIndex=20;
Element.show(this.iefix);
},hide:function(){
this.stopIndicator();
if(Element.getStyle(this.update,"display")!="none"){
this.options.onHide(this.element,this.update);
}
if(this.iefix){
Element.hide(this.iefix);
}
},startIndicator:function(){
if(this.options.indicator){
Element.show(this.options.indicator);
}
},stopIndicator:function(){
if(this.options.indicator){
Element.hide(this.options.indicator);
}
},onKeyPress:function(_2ac){
if(this.active){
switch(_2ac.keyCode){
case Event.KEY_TAB:
case Event.KEY_RETURN:
this.selectEntry();
Event.stop(_2ac);
case Event.KEY_ESC:
this.hide();
this.active=false;
Event.stop(_2ac);
return;
case Event.KEY_LEFT:
case Event.KEY_RIGHT:
return;
case Event.KEY_UP:
this.markPrevious();
this.render();
if(navigator.appVersion.indexOf("AppleWebKit")>0){
Event.stop(_2ac);
}
return;
case Event.KEY_DOWN:
this.markNext();
this.render();
if(navigator.appVersion.indexOf("AppleWebKit")>0){
Event.stop(_2ac);
}
return;
}
}else{
if(_2ac.keyCode==Event.KEY_TAB||_2ac.keyCode==Event.KEY_RETURN){
return;
}
}
this.changed=true;
this.hasFocus=true;
if(this.observer){
clearTimeout(this.observer);
}
this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000);
},activate:function(){
this.changed=false;
this.hasFocus=true;
this.getUpdatedChoices();
},onHover:function(_2ad){
var _2ae=Event.findElement(_2ad,"LI");
if(this.index!=_2ae.autocompleteIndex){
this.index=_2ae.autocompleteIndex;
this.render();
}
Event.stop(_2ad);
},onClick:function(_2af){
var _2b0=Event.findElement(_2af,"LI");
this.index=_2b0.autocompleteIndex;
this.selectEntry();
this.hide();
},onBlur:function(_2b1){
setTimeout(this.hide.bind(this),250);
this.hasFocus=false;
this.active=false;
},render:function(){
if(this.entryCount>0){
for(var i=0;i<this.entryCount;i++){
this.index==i?Element.addClassName(this.getEntry(i),"selected"):Element.removeClassName(this.getEntry(i),"selected");
}
if(this.hasFocus){
this.show();
this.active=true;
}
}else{
this.active=false;
this.hide();
}
},markPrevious:function(){
if(this.index>0){
this.index--;
}else{
this.index=this.entryCount-1;
}
},markNext:function(){
if(this.index<this.entryCount-1){
this.index++;
}else{
this.index=0;
}
},getEntry:function(_2b3){
return this.update.firstChild.childNodes[_2b3];
},getCurrentEntry:function(){
return this.getEntry(this.index);
},selectEntry:function(){
this.active=false;
this.updateElement(this.getCurrentEntry());
},updateElement:function(_2b4){
if(this.options.updateElement){
this.options.updateElement(_2b4);
return;
}
var _2b5="";
if(this.options.select){
var _2b6=document.getElementsByClassName(this.options.select,_2b4)||[];
if(_2b6.length>0){
_2b5=Element.collectTextNodes(_2b6[0],this.options.select);
}
}else{
_2b5=Element.collectTextNodesIgnoreClass(_2b4,"informal");
}
var _2b7=this.findLastToken();
if(_2b7!=-1){
var _2b8=this.element.value.substr(0,_2b7+1);
var _2b9=this.element.value.substr(_2b7+1).match(/^\s+/);
if(_2b9){
_2b8+=_2b9[0];
}
this.element.value=_2b8+_2b5;
}else{
this.element.value=_2b5;
}
this.element.focus();
if(this.options.afterUpdateElement){
this.options.afterUpdateElement(this.element,_2b4);
}
},updateChoices:function(_2ba){
if(!this.changed&&this.hasFocus){
this.update.innerHTML=_2ba;
Element.cleanWhitespace(this.update);
Element.cleanWhitespace(this.update.firstChild);
if(this.update.firstChild&&this.update.firstChild.childNodes){
this.entryCount=this.update.firstChild.childNodes.length;
for(var i=0;i<this.entryCount;i++){
var _2bc=this.getEntry(i);
_2bc.autocompleteIndex=i;
this.addObservers(_2bc);
}
}else{
this.entryCount=0;
}
this.stopIndicator();
this.index=0;
this.render();
}
},addObservers:function(_2bd){
Event.observe(_2bd,"mouseover",this.onHover.bindAsEventListener(this));
Event.observe(_2bd,"click",this.onClick.bindAsEventListener(this));
},onObserverEvent:function(){
this.changed=false;
if(this.getToken().length>=this.options.minChars){
this.startIndicator();
this.getUpdatedChoices();
}else{
this.active=false;
this.hide();
}
},getToken:function(){
var _2be=this.findLastToken();
if(_2be!=-1){
var ret=this.element.value.substr(_2be+1).replace(/^\s+/,"").replace(/\s+$/,"");
}else{
var ret=this.element.value;
}
return /\n/.test(ret)?"":ret;
},findLastToken:function(){
var _2c0=-1;
for(var i=0;i<this.options.tokens.length;i++){
var _2c2=this.element.value.lastIndexOf(this.options.tokens[i]);
if(_2c2>_2c0){
_2c0=_2c2;
}
}
return _2c0;
}};
Ajax.Autocompleter=Class.create();
Object.extend(Object.extend(Ajax.Autocompleter.prototype,Autocompleter.Base.prototype),{initialize:function(_2c3,_2c4,url,_2c6){
this.baseInitialize(_2c3,_2c4,_2c6);
this.options.asynchronous=true;
this.options.onComplete=this.onComplete.bind(this);
this.options.defaultParams=this.options.parameters||null;
this.url=url;
},getUpdatedChoices:function(){
entry=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());
this.options.parameters=this.options.callback?this.options.callback(this.element,entry):entry;
if(this.options.defaultParams){
this.options.parameters+="&"+this.options.defaultParams;
}
new Ajax.Request(this.url,this.options);
},onComplete:function(_2c7){
this.updateChoices(_2c7.responseText);
}});
Autocompleter.Local=Class.create();
Autocompleter.Local.prototype=Object.extend(new Autocompleter.Base(),{initialize:function(_2c8,_2c9,_2ca,_2cb){
this.baseInitialize(_2c8,_2c9,_2cb);
this.options.array=_2ca;
},getUpdatedChoices:function(){
this.updateChoices(this.options.selector(this));
},setOptions:function(_2cc){
this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(_2cd){
var ret=[];
var _2cf=[];
var _2d0=_2cd.getToken();
var _2d1=0;
for(var i=0;i<_2cd.options.array.length&&ret.length<_2cd.options.choices;i++){
var elem=_2cd.options.array[i];
var _2d4=_2cd.options.ignoreCase?elem.toLowerCase().indexOf(_2d0.toLowerCase()):elem.indexOf(_2d0);
while(_2d4!=-1){
if(_2d4==0&&elem.length!=_2d0.length){
ret.push("<li><strong>"+elem.substr(0,_2d0.length)+"</strong>"+elem.substr(_2d0.length)+"</li>");
break;
}else{
if(_2d0.length>=_2cd.options.partialChars&&_2cd.options.partialSearch&&_2d4!=-1){
if(_2cd.options.fullSearch||/\s/.test(elem.substr(_2d4-1,1))){
_2cf.push("<li>"+elem.substr(0,_2d4)+"<strong>"+elem.substr(_2d4,_2d0.length)+"</strong>"+elem.substr(_2d4+_2d0.length)+"</li>");
break;
}
}
}
_2d4=_2cd.options.ignoreCase?elem.toLowerCase().indexOf(_2d0.toLowerCase(),_2d4+1):elem.indexOf(_2d0,_2d4+1);
}
}
if(_2cf.length){
ret=ret.concat(_2cf.slice(0,_2cd.options.choices-ret.length));
}
return "<ul>"+ret.join("")+"</ul>";
}},_2cc||{});
}});
Field.scrollFreeActivate=function(_2d5){
setTimeout(function(){
Field.activate(_2d5);
},1);
};
Ajax.InPlaceEditor=Class.create();
Ajax.InPlaceEditor.defaultHighlightColor="#FFFF99";
Ajax.InPlaceEditor.prototype={initialize:function(_2d6,url,_2d8){
this.url=url;
this.element=$(_2d6);
this.options=Object.extend({okButton:true,okText:"ok",cancelLink:true,cancelText:"cancel",savingText:"Saving...",clickToEditText:"Click to edit",okText:"ok",rows:1,onComplete:function(_2d9,_2da){
new Effect.Highlight(_2da,{startcolor:this.options.highlightcolor});
},onFailure:function(_2db){
alert("Error communicating with the server: "+_2db.responseText.stripTags());
},callback:function(form){
return Form.serialize(form);
},handleLineBreaks:true,loadingText:"Loading...",savingClassName:"inplaceeditor-saving",loadingClassName:"inplaceeditor-loading",formClassName:"inplaceeditor-form",highlightcolor:Ajax.InPlaceEditor.defaultHighlightColor,highlightendcolor:"#FFFFFF",externalControl:null,submitOnBlur:false,ajaxOptions:{},evalScripts:false},_2d8||{});
if(!this.options.formId&&this.element.id){
this.options.formId=this.element.id+"-inplaceeditor";
if($(this.options.formId)){
this.options.formId=null;
}
}
if(this.options.externalControl){
this.options.externalControl=$(this.options.externalControl);
}
this.originalBackground=Element.getStyle(this.element,"background-color");
if(!this.originalBackground){
this.originalBackground="transparent";
}
this.element.title=this.options.clickToEditText;
this.onclickListener=this.enterEditMode.bindAsEventListener(this);
this.mouseoverListener=this.enterHover.bindAsEventListener(this);
this.mouseoutListener=this.leaveHover.bindAsEventListener(this);
Event.observe(this.element,"click",this.onclickListener);
Event.observe(this.element,"mouseover",this.mouseoverListener);
Event.observe(this.element,"mouseout",this.mouseoutListener);
if(this.options.externalControl){
Event.observe(this.options.externalControl,"click",this.onclickListener);
Event.observe(this.options.externalControl,"mouseover",this.mouseoverListener);
Event.observe(this.options.externalControl,"mouseout",this.mouseoutListener);
}
},enterEditMode:function(evt){
if(this.saving){
return;
}
if(this.editing){
return;
}
this.editing=true;
this.onEnterEditMode();
if(this.options.externalControl){
Element.hide(this.options.externalControl);
}
Element.hide(this.element);
this.createForm();
this.element.parentNode.insertBefore(this.form,this.element);
Field.scrollFreeActivate(this.editField);
if(evt){
Event.stop(evt);
}
return false;
},createForm:function(){
this.form=document.createElement("form");
this.form.id=this.options.formId;
Element.addClassName(this.form,this.options.formClassName);
this.form.onsubmit=this.onSubmit.bind(this);
this.createEditField();
if(this.options.textarea){
var br=document.createElement("br");
this.form.appendChild(br);
}
if(this.options.okButton){
okButton=document.createElement("input");
okButton.type="submit";
okButton.value=this.options.okText;
okButton.className="editor_ok_button";
this.form.appendChild(okButton);
}
if(this.options.cancelLink){
cancelLink=document.createElement("a");
cancelLink.href="#";
cancelLink.appendChild(document.createTextNode(this.options.cancelText));
cancelLink.onclick=this.onclickCancel.bind(this);
cancelLink.className="editor_cancel";
this.form.appendChild(cancelLink);
}
},hasHTMLLineBreaks:function(_2df){
if(!this.options.handleLineBreaks){
return false;
}
return _2df.match(/<br/i)||_2df.match(/<p>/i);
},convertHTMLLineBreaks:function(_2e0){
return _2e0.replace(/<br>/gi,"\n").replace(/<br\/>/gi,"\n").replace(/<\/p>/gi,"\n").replace(/<p>/gi,"");
},createEditField:function(){
var text;
if(this.options.loadTextURL){
text=this.options.loadingText;
}else{
text=this.getText();
}
var obj=this;
if(this.options.rows==1&&!this.hasHTMLLineBreaks(text)){
this.options.textarea=false;
var _2e3=document.createElement("input");
_2e3.obj=this;
_2e3.type="text";
_2e3.name="value";
_2e3.value=text;
_2e3.style.backgroundColor=this.options.highlightcolor;
_2e3.className="editor_field";
var size=this.options.size||this.options.cols||0;
if(size!=0){
_2e3.size=size;
}
if(this.options.submitOnBlur){
_2e3.onblur=this.onSubmit.bind(this);
}
this.editField=_2e3;
}else{
this.options.textarea=true;
var _2e5=document.createElement("textarea");
_2e5.obj=this;
_2e5.name="value";
_2e5.value=this.convertHTMLLineBreaks(text);
_2e5.rows=this.options.rows;
_2e5.cols=this.options.cols||40;
_2e5.className="editor_field";
if(this.options.submitOnBlur){
_2e5.onblur=this.onSubmit.bind(this);
}
this.editField=_2e5;
}
if(this.options.loadTextURL){
this.loadExternalText();
}
this.form.appendChild(this.editField);
},getText:function(){
return this.element.innerHTML;
},loadExternalText:function(){
Element.addClassName(this.form,this.options.loadingClassName);
this.editField.disabled=true;
new Ajax.Request(this.options.loadTextURL,Object.extend({asynchronous:true,onComplete:this.onLoadedExternalText.bind(this)},this.options.ajaxOptions));
},onLoadedExternalText:function(_2e6){
Element.removeClassName(this.form,this.options.loadingClassName);
this.editField.disabled=false;
this.editField.value=_2e6.responseText.stripTags();
},onclickCancel:function(){
this.onComplete();
this.leaveEditMode();
return false;
},onFailure:function(_2e7){
this.options.onFailure(_2e7);
if(this.oldInnerHTML){
this.element.innerHTML=this.oldInnerHTML;
this.oldInnerHTML=null;
}
return false;
},onSubmit:function(){
var form=this.form;
var _2e9=this.editField.value;
this.onLoading();
if(this.options.evalScripts){
new Ajax.Request(this.url,Object.extend({parameters:this.options.callback(form,_2e9),onComplete:this.onComplete.bind(this),onFailure:this.onFailure.bind(this),asynchronous:true,evalScripts:true},this.options.ajaxOptions));
}else{
new Ajax.Updater({success:this.element,failure:null},this.url,Object.extend({parameters:this.options.callback(form,_2e9),onComplete:this.onComplete.bind(this),onFailure:this.onFailure.bind(this)},this.options.ajaxOptions));
}
if(arguments.length>1){
Event.stop(arguments[0]);
}
return false;
},onLoading:function(){
this.saving=true;
this.removeForm();
this.leaveHover();
this.showSaving();
},showSaving:function(){
this.oldInnerHTML=this.element.innerHTML;
this.element.innerHTML=this.options.savingText;
Element.addClassName(this.element,this.options.savingClassName);
this.element.style.backgroundColor=this.originalBackground;
Element.show(this.element);
},removeForm:function(){
if(this.form){
if(this.form.parentNode){
Element.remove(this.form);
}
this.form=null;
}
},enterHover:function(){
if(this.saving){
return;
}
this.element.style.backgroundColor=this.options.highlightcolor;
if(this.effect){
this.effect.cancel();
}
Element.addClassName(this.element,this.options.hoverClassName);
},leaveHover:function(){
if(this.options.backgroundColor){
this.element.style.backgroundColor=this.oldBackground;
}
Element.removeClassName(this.element,this.options.hoverClassName);
if(this.saving){
return;
}
this.effect=new Effect.Highlight(this.element,{startcolor:this.options.highlightcolor,endcolor:this.options.highlightendcolor,restorecolor:this.originalBackground});
},leaveEditMode:function(){
Element.removeClassName(this.element,this.options.savingClassName);
this.removeForm();
this.leaveHover();
this.element.style.backgroundColor=this.originalBackground;
Element.show(this.element);
if(this.options.externalControl){
Element.show(this.options.externalControl);
}
this.editing=false;
this.saving=false;
this.oldInnerHTML=null;
this.onLeaveEditMode();
},onComplete:function(_2ea){
this.leaveEditMode();
this.options.onComplete.bind(this)(_2ea,this.element);
},onEnterEditMode:function(){
},onLeaveEditMode:function(){
},dispose:function(){
if(this.oldInnerHTML){
this.element.innerHTML=this.oldInnerHTML;
}
this.leaveEditMode();
Event.stopObserving(this.element,"click",this.onclickListener);
Event.stopObserving(this.element,"mouseover",this.mouseoverListener);
Event.stopObserving(this.element,"mouseout",this.mouseoutListener);
if(this.options.externalControl){
Event.stopObserving(this.options.externalControl,"click",this.onclickListener);
Event.stopObserving(this.options.externalControl,"mouseover",this.mouseoverListener);
Event.stopObserving(this.options.externalControl,"mouseout",this.mouseoutListener);
}
}};
Ajax.InPlaceCollectionEditor=Class.create();
Object.extend(Ajax.InPlaceCollectionEditor.prototype,Ajax.InPlaceEditor.prototype);
Object.extend(Ajax.InPlaceCollectionEditor.prototype,{createEditField:function(){
if(!this.cached_selectTag){
var _2eb=document.createElement("select");
var _2ec=this.options.collection||[];
var _2ed;
_2ec.each(function(e,i){
_2ed=document.createElement("option");
_2ed.value=(e instanceof Array)?e[0]:e;
if(this.options.value==_2ed.value){
_2ed.selected=true;
}
_2ed.appendChild(document.createTextNode((e instanceof Array)?e[1]:e));
_2eb.appendChild(_2ed);
}.bind(this));
this.cached_selectTag=_2eb;
}
this.editField=this.cached_selectTag;
if(this.options.loadTextURL){
this.loadExternalText();
}
this.form.appendChild(this.editField);
this.options.callback=function(form,_2f1){
return "value="+encodeURIComponent(_2f1);
};
}});
Form.Element.DelayedObserver=Class.create();
Form.Element.DelayedObserver.prototype={initialize:function(_2f2,_2f3,_2f4){
this.delay=_2f3||0.5;
this.element=$(_2f2);
this.callback=_2f4;
this.timer=null;
this.lastValue=$F(this.element);
Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this));
},delayedListener:function(_2f5){
if(this.lastValue==$F(this.element)){
return;
}
if(this.timer){
clearTimeout(this.timer);
}
this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);
this.lastValue=$F(this.element);
},onTimerEvent:function(){
this.timer=null;
this.callback(this.element,$F(this.element));
}};
Ajax.AutocompleterZM=Class.create();
Object.extend(Object.extend(Ajax.AutocompleterZM.prototype,Autocompleter.Base.prototype),{initialize:function(_2f6,_2f7,url,_2f9){
this.baseInitialize(_2f6,_2f7,_2f9);
this.options.asynchronous=true;
this.options.onComplete=this.onComplete.bind(this);
this.options.defaultParams=this.options.parameters||null;
this.url=url;
},getRadioChecked:function(){
if(true==document.getElementById("target_artist").checked){
return "artist";
}else{
if(true==document.getElementById("target_album").checked){
return "album";
}else{
return "song";
}
}
},getUpdatedChoices:function(){
entry=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());
this.options.parameters=this.options.callback?this.options.callback(this.element,entry):entry;
if(this.options.defaultParams){
this.options.parameters+="&"+this.options.defaultParams;
}
this.options.parameters+="&"+"radio="+this.getRadioChecked();
new Ajax.Request(this.url,this.options);
},onComplete:function(_2fa){
this.updateChoices(_2fa.responseText);
}});
if(typeof deconcept=="undefined"){
var deconcept=new Object();
}
if(typeof deconcept.util=="undefined"){
deconcept.util=new Object();
}
if(typeof deconcept.SWFObjectUtil=="undefined"){
deconcept.SWFObjectUtil=new Object();
}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){
if(!document.getElementById){
return;
}
this.DETECT_KEY=_a?_a:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){
this.setAttribute("swf",_1);
}
if(id){
this.setAttribute("id",id);
}
if(w){
this.setAttribute("width",w);
}
if(h){
this.setAttribute("height",h);
}
if(_5){
this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));
}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(!window.opera&&document.all&&this.installedVer.major>7){
deconcept.SWFObject.doPrepUnload=true;
}
if(c){
this.addParam("bgcolor",c);
}
var q=_7?_7:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",false);
this.setAttribute("doExpressInstall",false);
var _c=(_8)?_8:window.location;
this.setAttribute("xiRedirectUrl",_c);
this.setAttribute("redirectUrl","");
if(_9){
this.setAttribute("redirectUrl",_9);
}
};
deconcept.SWFObject.prototype={useExpressInstall:function(_d){
this.xiSWFPath=!_d?"expressinstall.swf":_d;
this.setAttribute("useExpressInstall",true);
},setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){
_16[_16.length]=key+"="+_18[key];
}
return _16;
},getSWFHTML:function(){
var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");
this.setAttribute("swf",this.xiSWFPath);
}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){
_19+=[key]+"=\""+_1a[key]+"\" ";
}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){
_19+="flashvars=\""+_1c+"\"";
}
_19+="/>";
}else{
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","ActiveX");
this.setAttribute("swf",this.xiSWFPath);
}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){
_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";
}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){
_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";
}
_19+="</object>";
}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);
}
}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();
return true;
}else{
if(this.getAttribute("redirectUrl")!=""){
document.location.replace(this.getAttribute("redirectUrl"));
}
}
return false;
}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){
_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));
}
}else{
if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){
var axo=1;
var _26=3;
while(axo){
try{
_26++;
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);
_23=new deconcept.PlayerVersion([_26,0,0]);
}
catch(e){
axo=null;
}
}
}else{
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
}
catch(e){
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);
axo.AllowScriptAccess="always";
}
catch(e){
if(_23.major==6){
return _23;
}
}
try{
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
}
catch(e){
}
}
if(axo!=null){
_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
}
}
}
return _23;
};
deconcept.PlayerVersion=function(_29){
this.major=_29[0]!=null?parseInt(_29[0]):0;
this.minor=_29[1]!=null?parseInt(_29[1]):0;
this.rev=_29[2]!=null?parseInt(_29[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){
return false;
}
if(this.major>fv.major){
return true;
}
if(this.minor<fv.minor){
return false;
}
if(this.minor>fv.minor){
return true;
}
if(this.rev<fv.rev){
return false;
}
return true;
};
deconcept.util={getRequestParameter:function(_2b){
var q=document.location.search||document.location.hash;
if(_2b==null){
return q;
}
if(q){
var _2d=q.substring(1).split("&");
for(var i=0;i<_2d.length;i++){
if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){
return _2d[i].substring((_2d[i].indexOf("=")+1));
}
}
}
return "";
}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){
var _2f=document.getElementsByTagName("OBJECT");
for(var i=_2f.length-1;i>=0;i--){
_2f[i].style.display="none";
for(var x in _2f[i]){
if(typeof _2f[i][x]=="function"){
_2f[i][x]=function(){
};
}
}
}
};
if(deconcept.SWFObject.doPrepUnload){
if(!deconcept.unloadSet){
deconcept.SWFObjectUtil.prepUnload=function(){
__flash_unloadHandler=function(){
};
__flash_savedUnloadHandler=function(){
};
window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);
};
window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);
deconcept.unloadSet=true;
}
}
if(!document.getElementById&&document.all){
document.getElementById=function(id){
return document.all[id];
};
}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;
function Cookie_isWork(){
var Key="T";
Cookie_set(Key,"1",1);
var _32b=Cookie_get(Key);
Cookie_delete(Key);
if(_32b=="1"){
return true;
}else{
return false;
}
}
function Cookie_set(_32c,_32d,_32e){
var _32f=(new Date()).getTime();
var dt2=new Date();
dt2.setTime(_32f+(_32e*1000*60));
var _331=dt2.toGMTString();
document.cookie=_32c+"="+escape(_32d)+";expires="+_331;
}
function Cookie_get(_332){
var _333=_332+"=";
var _334=document.cookie+";";
var _335=_334.indexOf(_333);
if(_335!=-1){
var _336=_334.indexOf(";",_335);
var _337=unescape(_334.substring(_335+_333.length,_336));
return _337;
}else{
return "";
}
}
function Cookie_delete(_338){
var dt=new Date();
dt.setYear(dt.getYear()-1);
document.cookie=_338+"="+";expires="+dt.toGMTString();
}
function dumpCookie(){
return document.cookie;
}
var g_CryptSID_CryptLength=540;
var g_CryptSID_HeaderLength=10;
var g_CryptSID_hiddenSwapSeq="087910890808908190879";
function CryptSID_encrypt(_33a){
if(_33a.length>=(g_CryptSID_CryptLength-7)){
return "";
}
var _33b=CryptSID_randFigure8();
var _33c=CryptSID_makeCryptHeader(_33b);
var _33d=CryptSID_encryptVer1(_33a);
var _33e=CryptSID_swap(_33d,_33b);
return _33c+_33e;
}
function CryptSID_decrypt(_33f){
if(_33f==""){
return "";
}else{
if(_33f.length!=(g_CryptSID_CryptLength+g_CryptSID_HeaderLength)){
return "";
}
}
var _340=CryptSID_getHeaderSwapSequence(_33f);
var _341=_33f.substr(g_CryptSID_HeaderLength,g_CryptSID_CryptLength);
var _342=CryptSID_deswap(_341,_340);
var _343=CryptSID_decryptVer1(_342);
return _343;
}
function CryptSID_makeCryptHeader(_344){
return ("Z1"+_344);
}
function CryptSID_getHeaderSwapSequence(_345){
var _346="";
if(_345.length>=g_CryptSID_HeaderLength){
_346=_345.substr(2,8);
}
return _346;
}
function CryptSID_decryptVer1(_347){
var _348=_347.substr(0,3);
var _349=Number(_348);
var _34a=_347.substr(3,3);
var _34b=_347.substr(6,_349);
var _34c=CryptSID_cryptDataCheckSumF3(_34b);
if(_34a!=_34c){
return "";
}else{
return _34b;
}
}
function CryptSID_encryptVer1(_34d){
var _34e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,/-*";
var _34f=_34e.length;
var _350=new Array(g_CryptSID_CryptLength);
for(var i=0;i<g_CryptSID_CryptLength;i++){
var _352=Math.random();
var _353=Math.floor(_352*_34f);
_350[i]=_34e.charAt(_353);
}
var _354=_34d.length;
var _355=CryptSID_toF3(_354);
var _356=CryptSID_cryptDataCheckSumF3(_34d);
_350[0]=_355.substr(0,1);
_350[1]=_355.substr(1,1);
_350[2]=_355.substr(2,1);
_350[3]=_356.substr(0,1);
_350[4]=_356.substr(1,1);
_350[5]=_356.substr(2,1);
var _357;
for(var i=0;i<_354;i++){
_357=6+i;
_350[_357]=_34d.substr(i,1);
}
cryptStr=_350.join("");
return cryptStr;
}
function CryptSID_randFigure8(){
var _358="";
for(var i=0;i<8;i++){
var rand=Math.random();
var _35b=Math.floor(rand*9);
_358+=String(_35b);
}
return _358;
}
function CryptSID_swap(_35c,_35d){
var _35e=g_CryptSID_hiddenSwapSeq+_35d;
var _35f=_35c;
var _360;
var _361=_35e.length;
for(var i=0;i<_361;i++){
_35f=CryptSID_swapDispatch(_35e,i,_35f);
}
return _35f;
}
function CryptSID_deswap(_363,_364){
var _365=g_CryptSID_hiddenSwapSeq+_364;
var _366=_363;
var _367;
var _368=_365.length;
for(var i=(_368-1);i>=0;i--){
_366=CryptSID_swapDispatch(_365,i,_366);
}
return _366;
}
function CryptSID_swapDispatch(_36a,_36b,_36c){
var _36d;
var _36e=_36a.substr(_36b,1);
switch(_36e){
case "0":
_36d=CryptSID_swap0(_36c);
break;
case "1":
_36d=CryptSID_swapA(1,_36c);
break;
case "2":
_36d=CryptSID_swapA(2,_36c);
break;
case "3":
case "4":
case "5":
case "6":
_36d=_36c;
break;
case "7":
_36d=CryptSID_swap7(_36c);
break;
case "8":
_36d=CryptSID_swap8(_36c);
break;
case "9":
_36d=CryptSID_swap9(_36c);
break;
default:
alert("CryptSID_swapDispatch  swapType unknown error index_i="+_36b+" swapType="+_36e);
break;
}
return _36d;
}
function CryptSID_swap0(_36f){
var _370=new Array(g_CryptSID_CryptLength);
for(var x=0;x<g_CryptSID_CryptLength;x++){
_370[x]=_36f.substr(x,1);
}
var swap="";
for(var x=0;x<g_CryptSID_CryptLength;x+=4){
swap+=_370[x+1]+_370[x]+_370[x+3]+_370[x+2];
}
return swap;
}
function CryptSID_swapA(_373,_374){
var _375=new Array(18);
for(var i=0;i<=17;i++){
_375[i]=_374.substr((i*30),30);
}
var swap;
if(_373==1){
swap=_375[17]+_375[16]+_375[15]+_375[14]+_375[13]+_375[12]+_375[11]+_375[10]+_375[9]+_375[8]+_375[7]+_375[6]+_375[5]+_375[4]+_375[3]+_375[2]+_375[1]+_375[0];
}else{
if(_373==2){
swap=_375[1]+_375[0]+_375[3]+_375[2]+_375[5]+_375[4]+_375[7]+_375[6]+_375[9]+_375[8]+_375[11]+_375[10]+_375[13]+_375[12]+_375[15]+_375[14]+_375[17]+_375[16];
}else{
alert("CryptSID_swapA  type unknown error type_i="+_373);
}
}
return swap;
}
function CryptSID_swap7(_378){
var _379=new Array(g_CryptSID_CryptLength);
for(var x=0;x<g_CryptSID_CryptLength;x++){
_379[x]=_378.substr(x,1);
}
var _37b="";
var _37c=new Array(20);
for(var x=0;x<g_CryptSID_CryptLength;x+=20){
for(var y=0;y<=19;y++){
_37c[y]=_379[x+y];
}
_37b+=_37c[19]+_37c[11]+_37c[17]+_37c[13]+_37c[15]+_37c[14]+_37c[16]+_37c[12]+_37c[18]+_37c[10]+_37c[9]+_37c[1]+_37c[7]+_37c[3]+_37c[5]+_37c[4]+_37c[6]+_37c[2]+_37c[8]+_37c[0];
}
return _37b;
}
function CryptSID_swap8(_37e){
var _37f=new Array(g_CryptSID_CryptLength);
for(var x=0;x<g_CryptSID_CryptLength;x++){
_37f[x]=_37e.substr(x,1);
}
var swap="";
for(var x=0;x<g_CryptSID_CryptLength;x+=6){
swap+=_37f[x+1]+_37f[x]+_37f[x+2]+_37f[x+4]+_37f[x+3]+_37f[x+5];
}
return swap;
}
function CryptSID_swap9(_382){
var _383="";
for(var x=(g_CryptSID_CryptLength-1);x>=0;x--){
_383+=_382.substr(x,1);
}
return _383;
}
function CryptSID_toF3(_385){
var _386="";
if(0<=_385&&_385<=9){
_386="00"+String(_385);
}else{
if(10<=_385&&_385<=99){
_386="0"+String(_385);
}else{
_386=String(_385);
}
}
return _386;
}
function CryptSID_cryptDataCheckSumF3(_387){
var len=_387.length;
var sum=0;
for(var i=0;i<len;i++){
var code=_387.charCodeAt(i);
sum+=code;
}
var _38c=String(sum);
var _38d=_38c.length;
var _38e;
if(_38d==1){
_38e="00"+_38c;
}else{
if(_38d==2){
_38e="0"+_38c;
}else{
if(_38d==3){
_38e=_38c;
}else{
_38e=_38c.substr(_38d-3,3);
}
}
}
return _38e;
}
var g_WsseCache_wsseH="";
var g_WsseCache_cookieSaveTimeSec;
var g_WsseCache_cookieSaveTermMin=60*24*3;
var g_WsseCache_isCookieWork=false;
var g_WsseCache_isSidCookieUse=false;
var g_WsseCache_cookieRefreshMin=30;
var g_WsseCache_KSScookieSaveTermMin=60*24*31;
var g_WsseCache_userType=0;
function WsseCache_init(){
if(true==Cookie_isWork()){
g_WsseCache_isCookieWork=true;
}else{
g_WsseCache_isCookieWork=false;
}
g_WsseCache_userType=0;
g_WsseCache_isSidCookieUse=WsseCache_isKeepSignIn();
}
function WsseCache_isKeepSignIn(){
var _38f=Cookie_get("IsKeepSignIn");
if(_38f==""){
return false;
}else{
return true;
}
}
function WsseCache_setSidCookieUse(_390){
g_WsseCache_isSidCookieUse=_390;
if(g_WsseCache_isSidCookieUse==true){
Cookie_set("IsKeepSignIn","TRUE",g_WsseCache_KSScookieSaveTermMin);
}else{
Cookie_delete("IsKeepSignIn");
}
}
function WsseCache_initGet(){
if(g_WsseCache_isSidCookieUse==false){
return "";
}
if(true==g_WsseCache_isCookieWork){
var _391=Cookie_get("SID");
if(_391==""){
return "";
}else{
g_WsseCache_wsseH=CryptSID_decrypt(_391);
if(g_WsseCache_wsseH!=""){
WsseCache_set(g_WsseCache_wsseH);
}
g_WsseCache_userType=1;
return g_WsseCache_wsseH;
}
}else{
return "";
}
}
function WsseCache_set(_392,_393){
g_WsseCache_wsseH=_392;
if(_393=="guest"){
g_WsseCache_userType=0;
}else{
g_WsseCache_userType=1;
}
if(g_WsseCache_userType==0){
return;
}
if(g_WsseCache_isSidCookieUse==false){
return;
}
if(true==g_WsseCache_isCookieWork){
var _394=CryptSID_encrypt(_392);
if(_394!=""){
Cookie_set("SID",_394,g_WsseCache_cookieSaveTermMin);
}
}
g_WsseCache_cookieSaveTimeSec=WsseCache_getTimeSec();
}
function WsseCache_getUserIdFromWsseH(_395){
if(typeof (_395)=="undefined"){
return "";
}
var _396=_395.match(/Username=\"([^\"]+)\"/i);
return decodeURIComponent(_396[1]);
}
function WsseCache_get(){
if(g_WsseCache_userType!=0){
var _397=WsseCache_getTimeSec();
var _398=_397-g_WsseCache_cookieSaveTimeSec;
if(_398>(60*g_WsseCache_cookieRefreshMin)){
if(g_WsseCache_userType!=0){
if(g_WsseCache_isSidCookieUse==true){
WsseCache_set(g_WsseCache_wsseH);
}
}
}
return g_WsseCache_wsseH;
}else{
return undefined;
}
}
function WsseCache_changeGuest(){
g_WsseCache_userType=0;
g_WsseCache_wsseH=undefined;
Cookie_delete("SID");
}
function WsseCache_getTimeSec(){
var _399=(new Date()).getTime();
return (_399/1000);
}
var playerId="zukool";
var currentPosition=0;
var currentVolume=0;
var currentItem=0;
var currentCollectionType="";
var playerCollectionId="";
var playerEntryIdSet=new Array();
var currentItemSetSize=0;
var currentMode="stop";
function getPlayerHandle(_39a){
if(navigator.appName.indexOf("Microsoft")!=-1){
return window[_39a];
}else{
return document[_39a];
}
}
function doPlayerSendEvent(type,_39c){
getPlayerHandle(playerId).sendEvent(type,_39c);
}
function doPlayerLoadFile(URI,_39e,link,id,_3a1,_3a2,_3a3,_3a4,_3a5,_3a6,type){
var _3a8="{file:'"+URI+","+_39e+","+link+","+id+","+_3a1+","+_3a2+","+_3a3+","+_3a4+","+_3a5+","+_3a6+","+type+","+"'}";
getPlayerHandle(playerId).loadFile(_3a8);
}
function doPlayerAddItem(URI,_3aa,_3ab,_3ac){
var _3ad={file:URI,title:_3aa,author:_3ab,type:"mp3"};
getPlayerHandle(playerId).addItem(_3ad,_3ac);
}
function doPlayerRemoveItem(_3ae){
getPlayerHandle(playerId).removeItem(_3ae);
}
function doPlayerRemoveAll(){
if(currentItemSetSize>0){
for(var _3af=(currentItemSetSize-1);_3af>=0;_3af--){
getPlayerHandle(playerId).removeItem(_3af);
}
}
}
function getUpdate(type,_3b1,_3b2,pid){
if(type=="time"){
currentPosition=_3b1;
var _3b4="play : 0: "+Math.round(_3b1);
Element.update($(currentCollectionType+"playerTrackPlayed"),_3b4);
}else{
if(type=="load"){
var _3b5="load : "+Math.round(_3b1)+"%";
Element.update($(currentCollectionType+"playerTrackLoaded"),_3b5);
}else{
if(type=="volume"){
currentVolume=_3b1;
var _3b6="vol : "+Math.round(_3b1)+"%";
Element.update($(currentCollectionType+"playerTrackVolume"),_3b6);
}else{
if(type=="item"&&currentMode!="stop"){
if(_3b1==currentItem){
var _3b7="";
var _3b8="";
if(_3b1<currentItem&&currentItem<playerEntryIdSet.length){
_3b7=playerEntryIdSet[currentItem];
_3b8=playerCollectionId;
this.doItemInfoBoxClose(_3b8,_3b7,"play");
}
_3b7=playerEntryIdSet[_3b1];
_3b8=playerCollectionId;
var _3b9=_3b8+"_"+_3b7+"_ItemInfoBox_Open";
if(!$(_3b9)){
if(_3b8&&_3b7){
this.doItemInfoBoxOpen(_3b8,_3b7,"play");
}
}
}else{
if(_3b1>currentItem&&currentItem>=0){
if(_3b1<playerEntryIdSet.length){
var _3b7=playerEntryIdSet[currentItem];
var _3b8=playerCollectionId;
this.doItemInfoBoxClose(_3b8,_3b7,"play");
_3b7=playerEntryIdSet[_3b1];
var _3b9=_3b8+"_"+_3b7+"_ItemInfoBox_Open";
if(!$(_3b9)){
if(_3b8&&_3b7){
this.doItemInfoBoxOpen(_3b8,_3b7,"play");
}
}
}
}else{
if(_3b1<currentItem&&currentItem<playerEntryIdSet.length){
var _3b7=playerEntryIdSet[currentItem];
var _3b8=playerCollectionId;
this.doItemInfoBoxClose(_3b8,_3b7,"play");
_3b7=playerEntryIdSet[_3b1];
var _3b9=_3b8+"_"+_3b7+"_ItemInfoBox_Open";
if(!$(_3b9)){
if(_3b8&&_3b7){
this.doItemInfoBoxOpen(_3b8,_3b7,"play");
}
}
}
}
}
if(_3b1<playerEntryIdSet.length){
currentItem=_3b1;
var _3ba="track : "+(_3b1+1);
Element.update($(currentCollectionType+"playerTrackQueueIndex"),_3ba);
setTimeout("getPlayerItemData( currentItem )",100);
}
}else{
if(type=="state"&&_3b1==3){
if(currentItem>=(currentItemSetSize-1)&&currentMode!="stop"){
doPlayerStopAll(currentCollectionType,currentCollectionType);
}
}
}
}
}
}
}
function getPlayerItemData(_3bb){
var _3bc=getPlayerHandle(playerId).itemData(_3bb);
if(_3bc){
var file=_3bc["file"];
var _3be=_3bc["title"];
var link=_3bc["link"];
var id=_3bc["id"];
var _3c1=_3bc["image"];
var _3c2=_3bc["author"];
var _3c3=_3bc["captions"];
var _3c4=_3bc["audio"];
var _3c5=_3bc["category"];
var _3c6=_3bc["start"];
var type=_3bc["type"];
if($(currentCollectionType+"playerTrackData")){
Element.update($(currentCollectionType+"playerTrackData"),_3be);
}
if($(currentCollectionType+"playerTrackData2")){
Element.update($(currentCollectionType+"playerTrackData2"),_3c2);
}
}
}
function doPlayerPlay(_3c8,_3c9,_3ca,_3cb,_3cc,_3cd){
if(currentMode=="play"){
doPlayerStopAll(_3cb,currentCollectionType);
}
currentCollectionType=_3cd;
var _3ce="__songlist__";
var _3cf="__recommendations__";
if(_3cd=="__search__"){
_3ce="__songlist__";
_3cf="__recommendations__";
}else{
if(_3cd=="__songlist__"){
_3ce="__search__";
_3cf="__recommendations__";
}else{
if(_3cd=="__recommendations__"){
_3ce="__songlist__";
_3cf="__search__";
}
}
}
if($("currentlyPlaying")){
var _3d0=$("currentlyPlaying").getAttribute("streamPath");
var _3d1=$("currentlyPlaying").getAttribute("songTitle");
var _3d2=$("currentlyPlaying").getAttribute("artistName");
var _3d3=$("currentlyPlaying").getAttribute("collectionId");
var _3d4=$("currentlyPlaying").getAttribute("entryId");
var _3d5=$("currentlyPlaying").getAttribute("collectionType");
doPlayerStop(_3d0,_3d1,_3d2,_3d3,_3d4,_3d5);
}
doPlayerRemoveAll();
doTurnOFFScreenDisplay(_3ce);
doTurnOFFScreenDisplay(_3cf);
doTurnONScreenDisplay(_3cd);
var _3d6=0;
currentItem=_3d6;
currentItemSetSize=1;
currentMode="play_single";
playerCollectionId=_3cb;
playerEntryIdSet=new Array(1);
playerEntryIdSet[0]=_3cc;
doPlayerAddItem(_3c8,_3c9,_3ca,_3d6);
doPlayerSendEvent("playitem",_3d6);
var _3d7=_3cb+"_"+_3cc+"_playerControl";
if($(_3d7)){
var _3d8=new PlayerBox();
Element.update($(_3d7),_3d8.getStopButtonHTML(_3c8,_3c9,_3ca,_3cb,_3cc,_3cd));
}
this.doItemInfoBoxOpen(_3cb,_3cc,"play");
}
function doPlayerPlayAll(_3d9,_3da){
var done=0;
if(currentMode=="play"){
if(currentCollectionType==_3da){
doPlayerSendEvent("playpause");
currentMode="pause";
done=1;
$(currentCollectionType+"playerPlayButton").style.zIndex="3";
$(currentCollectionType+"playerPauseButton").style.zIndex="2";
}else{
$(currentCollectionType+"playerPlayButton").style.zIndex="3";
$(currentCollectionType+"playerPauseButton").style.zIndex="2";
doPlayerStopAll(_3d9,currentCollectionType);
}
}else{
if(currentMode=="pause"){
if(currentCollectionType==_3da){
doPlayerSendEvent("playpause");
currentMode="play";
done=1;
$(currentCollectionType+"playerPlayButton").style.zIndex="2";
$(currentCollectionType+"playerPauseButton").style.zIndex="3";
}else{
$(currentCollectionType+"playerPlayButton").style.zIndex="2";
$(currentCollectionType+"playerPauseButton").style.zIndex="3";
doPlayerStopAll(_3d9,currentCollectionType);
}
}else{
if(currentMode=="play_single"){
if($("currentlyPlaying")){
var _3dc=$("currentlyPlaying").getAttribute("streamPath");
var _3dd=$("currentlyPlaying").getAttribute("songTitle");
var _3de=$("currentlyPlaying").getAttribute("artistName");
var _3df=$("currentlyPlaying").getAttribute("collectionId");
var _3e0=$("currentlyPlaying").getAttribute("entryId");
var _3e1=$("currentlyPlaying").getAttribute("collectionType");
doPlayerStop(_3dc,_3dd,_3de,_3df,_3e0,_3e1);
}
}
}
}
if(!done){
var _3e2="";
var _3e3="";
var _3e4="";
if(_3da=="__search__"){
_3e2=collectionCollection.currentSearch;
_3e3="__songlist__";
_3e4="__recommendations__";
}else{
if(_3da=="__songlist__"){
_3e2=collectionCollection.currentSonglist;
_3e3="__search__";
_3e4="__recommendations__";
}else{
if(_3da=="__recommendations__"){
_3e2=collectionCollection.currentRecommendations;
_3e3="__songlist__";
_3e4="__search__";
}else{
_3e2=collectionCollection.currentSonglist;
}
}
}
var _3e5=_3e2.data.feed.$.entry.length;
if(_3e5>0){
doPlayerRemoveAll();
currentItemSetSize=_3e5;
currentCollectionType=_3da;
playerCollectionId=_3e2.data.feed.$.id;
playerEntryIdSet=new Array(_3e5);
currentItem=0;
var _3e6="";
var _3e7="";
var _3e8="";
var _3e9=0;
doTurnOFFScreenDisplay(_3e3);
doTurnOFFScreenDisplay(_3e4);
doTurnONScreenDisplay(_3da);
for(var _3ea=0;_3ea<_3e5;_3ea++){
var _3eb="";
if(_3da=="__songlist__"){
var _3ec=(_3e5-1)-_3ea;
_3eb=_3e2.data.feed.$.entry[_3ec];
}else{
_3eb=_3e2.data.feed.$.entry[_3ea];
}
_3e6="";
_3e7=_3eb.$.author.$.name;
_3e8=_3eb.$.title;
_3e9=_3eb.$.id;
for(var l=0;l<_3eb.$.link.length;l++){
if(_3eb.$.link[l].rel=="enclosure"){
_3e6=_3eb.$.link[l].href;
}
}
doPlayerAddItem(_3e6,_3e8,_3e7,_3ea);
playerEntryIdSet[_3ea]=_3e9;
}
$(currentCollectionType+"playerPlayButton").style.zIndex="2";
$(currentCollectionType+"playerPauseButton").style.zIndex="3";
currentMode="play";
doPlayerSendEvent("next");
doPlayerSendEvent("prev");
doPlayerSendEvent("playitem",0);
}
}
}
function doPlayerStop(_3ee,_3ef,_3f0,_3f1,_3f2,_3f3){
if($("currentlyPlaying")){
var _3f4=new PlayerBox();
new Insertion.After($("currentlyPlaying"),_3f4.getPlayButtonHTML(_3ee,_3ef,_3f0,_3f1,_3f2,_3f3));
Element.remove($("currentlyPlaying"));
}
doPlayerStopAll(_3f1,_3f3);
}
function doPlayerStopAll(_3f5,_3f6){
if(currentCollectionType==_3f6){
if(currentMode=="play"){
$(currentCollectionType+"playerPlayButton").style.zIndex="3";
$(currentCollectionType+"playerPauseButton").style.zIndex="2";
}
if(playerEntryIdSet.length>0){
var _3f7=playerEntryIdSet[currentItem];
var _3f5=playerCollectionId;
this.doItemInfoBoxClose(_3f5,_3f7);
doTurnOFFScreenDisplay(_3f6);
doTurnOFFScreenDisplay(currentCollectionType);
currentMode="stop";
doPlayerSendEvent("stop");
doPlayerRemoveAll();
currentItem=0;
playerEntryIdSet=new Array();
currentItemSetSize=0;
playerCollectionId="";
currentCollectionType="";
}
}
}
function doTurnOFFScreenDisplay(_3f8){
var _3f9="play : ";
Element.update($(_3f8+"playerTrackPlayed"),_3f9);
var _3fa="load : ";
Element.update($(_3f8+"playerTrackLoaded"),_3fa);
var _3fb="vol : 80%";
Element.update($(_3f8+"playerTrackVolume"),_3fb);
var _3fc="track : ";
Element.update($(_3f8+"playerTrackQueueIndex"),_3fc);
var _3fd=" ";
Element.update($(_3f8+"playerTrackData"),_3fd);
var _3fe=" ";
Element.update($(_3f8+"playerTrackData2"),_3fe);
var _3ff=_3f8+"playerMessageBox_ON";
var _400=_3f8+"playerMessageBox_OFF";
$(_3ff).style.zIndex="2";
$(_400).style.zIndex="3";
}
function doTurnONScreenDisplay(_401){
var _402=_401+"playerMessageBox_ON";
var _403=_401+"playerMessageBox_OFF";
$(_402).style.zIndex="3";
$(_403).style.zIndex="2";
}
function zukoolAppSignInit(_404){
user=getGuestUser();
if(_404=="signin"){
if($("header")){
var _405=new HeaderBox();
new Insertion.Top($("header"),_405.getHTML());
}
popUpSignIn();
}else{
if(_404=="signup"){
if($("header")){
var _405=new HeaderBox();
new Insertion.Top($("header"),_405.getHTML());
}
popUpSignUp();
}
}
}
function getGuestUser(){
var feed={user_id:null,name:"guest",feed:{$:{link:[{rel:"self",href:"/core/atom2json/zwibeta/user/guest/"}]}}};
var user=new ZukoolUser(feed);
return user;
}
ZukoolUser=Class.create();
ZukoolUser.prototype={initialize:function(data){
this.data=data;
WsseCache_init();
},initWsse:function(){
return WsseCache_initGet();
},setWsse:function(_409,_40a){
WsseCache_set(_409,_40a);
},getWsse:function(){
return WsseCache_get();
},changeGuest:function(){
WsseCache_changeGuest();
},isGuest:function(){
return (this.data.name=="guest");
}};
function popUpSignUp(){
if(!user.isGuest()){
return;
}
if($("signInBox")){
Element.remove($("signInBox"));
}
if($("signUpBox")){
Element.remove($("signUpBox"));
if($("overlay")){
$("overlay").style.zIndex="-1000";
}
}else{
if($("overlay")){
$("overlay").style.zIndex="9998";
}
var _40b=new SignUpBox();
new Insertion.Bottom($("header"),_40b.getHTML());
var _40c="<p> Your User Name and Password should be more than 6 characters <br /> in length, [ A-Z,a-z,0-9, . @ - _ ] are acceptable characters</p>";
Element.update($("signUpMessage"),_40c);
}
}
function doSignUpCancel(){
window.location=URLMain;
}
function doSignUp(){
var url="/core/atom2json/zwibeta/user/";
var _40e=Form.serialize($("signUpForm"));
var _40f=new Ajax.Request(url,{method:"post",requestHeaders:["X-WSSE",user.getWsse()],parameters:_40e,asynchronous:false});
if(_40f.transport.status==201){
var str=_40f.transport.responseText;
user=new ZukoolUser(eval("("+str+")"));
user.name=$F("signUpName");
var wsse=wsseHeader($F("signUpName"),$F("signUpPassword"));
WsseCache_setSidCookieUse(true);
user.setWsse(wsse,"signInUser");
alert("Welcome "+user.name+" ! You are now logged in.");
window.location=URLMain;
}else{
var str=_40f.transport.responseText;
var res=eval("("+str+")");
var _413="<p  class=\"alert\">Sorry, "+res+"</p>";
Element.update($("signUpMessage"),_413);
}
}
function popUpSignIn(){
if(!user.isGuest()){
return;
}
if($("signUpBox")){
Element.remove($("signUpBox"));
}
if($("signInBox")){
Element.remove($("signInBox"));
if($("overlay")){
$("overlay").style.zIndex="-1000";
}
}else{
if($("overlay")){
$("overlay").style.zIndex="9998";
}
var _414=new SignInBox();
if($("header")){
new Insertion.Bottom($("header"),_414.getHTML());
}
}
}
function doSignInCancel(){
if($("signInBox")){
Element.remove($("signInBox"));
}
if($("overlay")){
$("overlay").style.zIndex="-1000";
}
}
function doSignIn(){
var name=$F("signInName");
var _416=$F("signInPassword");
var _417=$F("keepSignIn");
if(name==""&&_416==""){
if($("signInAlert")){
Element.update($("signInAlert"),"Please input your User Name and Password.");
}
return;
}
if(name==""){
if($("signInAlert")){
Element.update($("signInAlert"),"Please input your User Name.");
}
return;
}
if(_416==""){
if($("signInAlert")){
Element.update($("signInAlert"),"Please input your Password.");
}
return;
}
if($("signInAlert")){
Element.update($("signInAlert"),"Securely authenticating your sign in details .... ");
}
if(_417==undefined){
WsseCache_setSidCookieUse(false);
}else{
WsseCache_setSidCookieUse(true);
}
var wsse=wsseHeader(name,_416);
doSignInByWsseH(wsse,name,false);
}
function doSignInByWsseH(_419,_41a,_41b){
var url="/core/atom2json/zwibeta/user/"+encodeURIComponent(_41a)+"/";
var _41d=new Ajax.Request(url+"null/",{method:"post",requestHeaders:["X-WSSE",_419],asynchronous:false});
if(_41d.transport.status==201){
_41d=new Ajax.Request(url,{method:"get",requestHeaders:["X-WSSE",_419],asynchronous:false});
if(_41d.transport.status==200){
if($("signInAlert")){
Element.update($("signInAlert"),"Sign in authenticated. ");
}
var str=_41d.transport.responseText;
user=new ZukoolUser(eval("("+str+")"));
user.name=_41a;
user.setWsse(_419,"signInUser");
if($("signUpBox")){
Element.remove($("signUpBox"));
}
if($("signInBox")){
Element.remove($("signInBox"));
}
if($("overlay")){
$("overlay").style.zIndex="-1000";
}
var _41f=new SignOutBox();
Element.update($("signInOut"),_41f.getHTML());
Element.update($("signUpAccount"),"<div id=\"myAccountLink\"></div>");
if(_41b==true){
doFlashMessage("Welcome back "+escapeHTML(user.name)+". You are now signed in. ");
}else{
doFlashMessage("Welcome "+escapeHTML(user.name)+". You are now signed in. ");
}
}else{
var str=_41d.transport.responseText;
var res=eval("("+str+")");
if($("signInAlert")){
Element.update($("signInAlert"),"Sorry, there was a problem authenticating your details, please try again.");
}
user.changeGuest();
}
}else{
var str=_41d.transport.responseText;
var res=eval("("+str+")");
if($("signInAlert")){
Element.update($("signInAlert"),"Sorry, Your User Name and/or Password were entered incorrectly, please try again.");
}
user.changeGuest();
}
}
function doSignOut(){
user.changeGuest();
location.href="../../";
}
function zukoolAppToolsInit(){
}
function escapeHTML(str){
if(str==null){
return "";
}
var div=document.createElement("div");
var text=document.createTextNode(str);
div.appendChild(text);
return div.innerHTML;
}
Zukool=function(){
};
Zukool.GetFeedRequest=Class.create();
Zukool.GetFeedRequest.prototype=Object.extend(new Ajax.Request(),{getFeed:function(){
if(200<=this.transport.status&&this.transport.status<300){
var str=this.transport.responseText;
return eval("("+str+")");
}else{
var str=this.transport.responseText;
var res=eval("("+str+")");
doFlashAlert(res);
}
}});
function doSearch(){
if($F("target_artist")||$F("target_album")||$F("target_music")){
doMusicSearch();
}else{
doCommunitySearch();
}
}
function doArtistSearch(_426){
Form.reset("searchForm");
$("search").value=_426;
$("target_artist").checked=true;
doMusicSearch();
}
function doAlbumSearch(_427){
Form.reset("searchForm");
$("search").value=_427;
$("target_album").checked=true;
doMusicSearch();
}
function doSongSearch(_428){
Form.reset("searchForm");
$("search").value=_428;
$("target_song").checked=true;
doMusicSearch();
}
function doMusicSearch(){
var _429=Form.Element.getValue("search");
if((_429!="")&&(_429!=null)){
doFlashMessage("Searching .... ");
var _42a="<input id=\"search_btn\" type=\"image\" src=\"img/anim_search.gif\" value=\"Search\" style=\"vertical-align: top; margin-top: 7px;\" />";
Element.update($("searchButton"),_42a);
var url="/core/atom2json/music/";
var _42c=Form.serialize($("searchForm"));
var _42d=new Ajax.Request(url,{method:"get",requestHeaders:["X-WSSE",user.getWsse()],parameters:_42c,onComplete:doSearchResult});
}else{
doFlashMessage("Please enter an artist, album or song name then press Search");
}
}
function doSimpleMusicSearch(){
var _42e=Form.Element.getValue("simplesearchautocomplete");
if((_42e!="")&&(_42e!=null)){
var _42f=new FirstContentsBox();
var _430=_42f.getLoadingHTML();
if($("simpletarget_artist").checked){
Element.update($("simplesearchControl"),_430);
doArtistSearch(_42e);
}else{
if($("simpletarget_album").checked){
Element.update($("simplesearchControl"),_430);
doAlbumSearch(_42e);
}else{
if($("simpletarget_song").checked){
Element.update($("simplesearchControl"),_430);
doSongSearch(_42e);
}else{
Element.update($("simplesearchControl"),_430);
doSongSearch(_42e);
}
}
}
}else{
doFlashMessage("Please enter an artist, album or song name then press Search");
}
}
function doCollectionFeedSearch(_431){
if(_431){
doFlashMessage("Searching .... ");
var _432="<input id=\"search_btn\" type=\"image\" src=\"img/anim_search.gif\" value=\"Search\" style=\"vertical-align: top; margin-top: 7px;\" />";
Element.update($("searchButton"),_432);
var _433=new Ajax.Request(_431,{method:"get",requestHeaders:["X-WSSE",user.getWsse()],onComplete:doSearchResultInSonglist});
}else{
doFlashMessage("Please enter a url of collection feed then press Search");
}
}
function doCommunitySearch(){
doFlashMessage("Searching .... ");
var _434="<input id=\"search_btn\" type=\"image\" src=\"img/anim_search.gif\" value=\"Search\" style=\"vertical-align: top; margin-top: 7px;\" />";
Element.update($("searchButton"),_434);
var url="/core/atom2json/zwibeta/music/";
var _436=Form.serialize($("searchForm"));
var _437=new Ajax.Request(url,{method:"get",requestHeaders:["X-WSSE",user.getWsse()],parameters:_436,onComplete:doSearchResult});
}
function doSearchResult(_438){
var _439="<input id=\"search_btn\" type=\"image\" src=\"img/btn_search.gif\" value=\"Search\" style=\"vertical-align: top; margin-top: 7px;\" />";
Element.update($("searchButton"),_439);
if($("simplesearch")){
Element.remove($("simplesearch"));
}
if(_438.status==200){
var str=_438.responseText;
var res=eval("("+str+")");
if(res.feed.$.summary=="0 Songs"){
doFlashAlert("Sorry, we currently do not have anything in our database matching your search.");
}else{
doFlashMessage(("Search results : "+res.feed.$.summary));
collectionCollection.setSearch(res);
}
}
}
function doSearchResultInSonglist(_43c){
var _43d="<input id=\"search_btn\" type=\"image\" src=\"img/btn_search.gif\" value=\"Search\" style=\"vertical-align: top; margin-top: 7px;\" />";
Element.update($("searchButton"),_43d);
if($("simplesearch")){
Element.remove($("simplesearch"));
}
if(_43c.status==200){
var str=_43c.responseText;
var res=eval("("+str+")");
if(res.feed.$.summary=="0 Songs"){
doFlashAlert("Sorry, we currently do not have anything in our database matching your search.");
}else{
doFlashMessage(("Search results : "+res.feed.$.summary));
collectionCollection.setSonglist(res);
}
}
}
function doAgentMusicPostResult(_440,_441){
if(_440.status==201){
var str=_440.responseText;
var res=eval("("+str+")");
var url=res.entry.$.link.href;
var _445=new Ajax.Request(url,{method:"get",onComplete:function(_446){
doAgentMusicObjectGetResult(_446,_441);
}});
}
}
function doAgentMusicObjectGetResult(_447,_448){
if(_447.status==200){
var str=_447.responseText;
var res=eval("("+str+")");
var url=res.feed.$.link.find(function(_44c,_44d){
return (_44c.rel==_448);
}).href;
var _44e=new Ajax.Request(url,{method:"get",onComplete:function(_44f){
doAgentMusicObjectRecommendationGetResult(_44f,res);
}});
}
}
function doRestoreAgentMusicObjectGetResult(_450){
if(_450.status==200){
var str=_450.responseText;
var _452=eval("("+str+")");
_452.currentHistory=0;
collectionCollection.currentRecommendations.data.agent=_452;
}
}
function doAgentMusicObjectPutResult(_453,_454,_455){
if(_453.status==200){
var _456=new Ajax.Request(_454.feed.$.link.find(function(_457,_458){
return (_457.rel==_455);
}).href,{method:"get",onComplete:function(_459){
doAgentMusicObjectRecommendationGetResult(_459,_454);
}});
}
}
function doAgentMusicObjectRecommendationGetResult(_45a,_45b){
doRecommendIconAnimation(false);
if(_45a.status==200){
var str=_45a.responseText;
var res=eval("("+str+")");
doFlashMessage("New recommendations below.");
res.agent=_45b;
collectionCollection.setRecommendations(res);
}else{
doFlashMessage("Sorry, recommendations are not available at this time, please try again later.");
}
}
function getPageEntrys(_45e,url){
var _460=new Ajax.Request(url,{method:"get",onComplete:function(_461){
doPageEntrysGetResult(_461,_45e);
}});
}
function doPageEntrysGetResult(_462,_463){
if(_462.status==200){
var str=_462.responseText;
var res=eval("("+str+")");
collectionCollection.get(_463).reloadEntrys(_463,res);
collectionCollection.paintSearch();
}
}
function doProductRecommendationGet(){
var url="/core/atom2json/agent/music/1111/product_recommendation/";
var _467=new Ajax.Request(url,{method:"get",onComplete:doProductRecommendationGetResult});
}
function doProductRecommendationGetResult(_468){
if(_468.status==200){
var str=_468.responseText;
var res=eval("("+str+")");
collectionCollection.setProductRecommendation(new ProductCollectionBox(res));
}
}
function doSponsoredRecommendationGetResult(_46b){
if(_46b.status==200){
var str=_46b.responseText;
var res=eval("("+str+")");
collectionCollection.setSponsoredRecommendation(new SponsoredCollectionBox(res));
}
}
function doFlashMessage(_46e){
if(_46e=="null"){
_46e="";
}
if($("infoBox")){
Element.update($("infoBox"),_46e);
}
}
function doFlashAlert(_46f){
if(_46f=="null"){
_46f="";
}
_46f="<p class=\"alert\">"+_46f+"</p>";
_46f="<img class=\"icon\" src=\"img/icon_exclamation.png\" alt=\"Status Alert\" style=\"display: inline; margin-right: 10px;\" />"+_46f;
if($("infoBox")){
Element.update($("infoBox"),_46f);
}
}
function doSignUpMessage(_470,_471,_472){
if(_470=="<p class=\"alert\">null</p>"){
_470="";
}
if(_471==null){
_471="#ffff99";
}
if(_472==null){
_472=3;
}
if($("signUpMessage")){
Element.update($("signUpMessage"),_470);
}
}
function doRecommendIconAnimation(_473){
if(_473==false){
if($("recommendIcon")){
var _474="<img src=\"img/icon_zukool_recommend.png\" class=\"recommend_icon_image\" alt=\"Recommend\" title=\"Click here to get new recommendations\" />";
Element.update($("recommendIcon"),_474);
if(isPNGTransparencyFixRequired){
doFixPNGTransparency();
}
}
}else{
if($("recommendIcon")){
var _474="<img src=\"img/icon_zukool_recommend_anim.gif\" class=\"recommend_icon_image\" alt=\"Recommending\" title=\"Finding your recommendations ... \" />";
Element.update($("recommendIcon"),_474);
}
}
}
function doItemInfoBoxOpen(_475,_476,_477){
var _478=_475+"_"+_476+"_Entry";
var _479=_475+"_"+_476+"_ItemInfoBox";
var _47a=_475+"_"+_476+"_ItemInfoBox_Open";
if($(_479)){
if(($(_47a))&&(_477!="play")){
var _47b="";
Element.update($(_479),_47b);
$(_478).style.borderTop="0px dotted #aaaaaa";
}else{
var _47c=new ItemInfoBox();
var _47b=_47c.getHTML(_475,_476);
Element.update($(_479),_47b);
_47c.setEventObservers(_475,_476);
$(_478).style.borderTop="1px dotted #aaaaaa";
}
}
}
function doItemInfoBoxClose(_47d,_47e,_47f){
var _480=_47d+"_"+_47e+"_Entry";
var _481=_47d+"_"+_47e+"_ItemInfoBox";
var _482=_47d+"_"+_47e+"_ItemInfoBox_Open";
if($(_481)){
if($(_482)){
var _483="";
Element.update($(_481),_483);
$(_480).style.borderTop="0px dotted #aaaaaa";
}
}
}
function doUserProfileBoxOpen(){
var _484="userProfile";
var _485="userProfileOuterBox";
var _486="";
var _487="";
if($(_484)){
if($(_485)){
_487="";
Element.update($(_484),_487);
}else{
_486=new UserProfileBox();
_487=_486.getHTML();
Element.update($(_484),_487);
}
}
_484="communityProfile";
_485="communityProfileOuterBox";
var _488="";
var _489="";
if($(_484)){
if($(_485)){
_489="";
Element.update($(_484),_489);
}else{
_488=new CommunityProfileBox();
_489=_488.getHTML();
Element.update($(_484),_489);
this.doCommunityProfileGetAll();
}
}
doFixPNGTransparency();
}
function doUserProfileBoxClose(){
var _48a="userProfile";
var _48b="userProfileOuterBox";
var _48c="";
var _48d="";
if($(_48a)){
if($(_48b)){
_48d="";
Element.update($(_48a),_48d);
}
}
_48a="communityProfile";
_48b="communityProfileOuterBox";
var _48e="";
var _48f="";
if($(_48a)){
if($(_48b)){
_48f="";
Element.update($(_48a),_48f);
}
}
}
function doRatingChange(_490){
if(_490){
if(_490.srcElement){
doRealRatingChange(_490.srcElement.id);
}else{
doRealRatingChange(_490.target.id);
}
}else{
if(window.event){
doRealRatingChange(window.event.srcElement.id);
}else{
this.doFlashAlert("Unable to complete this command, our apologies.");
}
}
}
function doRealRatingChange(_491){
var _492=$(_491).getAttribute("entryId");
var _493=$(_491).getAttribute("collectionId");
var _494=$(_491).getAttribute("rating");
var _495=collectionCollection.getRecommendations();
var _496=new ZukoolGradingFeed();
_496.addEntryId(_492,_494);
var url=_495.data.agent.feed.$.link.find(function(_498,_499){
return (_498.rel=="grading_by_music");
}).href;
var _49a=new Ajax.Request(url,{method:"put",requestHeaders:["X-WSSE",user.getWsse()],postBody:_496.xml(),onComplete:function(_49b){
ratingChanged(_49b,_493,_492,_494);
}});
}
function ratingChanged(_49c,_49d,_49e,_49f){
if(_49f!=0){
var _4a0="img/icon_rating_0.gif";
if(_49f==1){
_4a0="img/icon_rating_1.gif";
}
if(_49f==2){
_4a0="img/icon_rating_2.gif";
}
if(_49f==3){
_4a0="img/icon_rating_3.gif";
}
if(_49f==4){
_4a0="img/icon_rating_4.gif";
}
if(_49f==5){
_4a0="img/icon_rating_5.gif";
}
var _4a1=_49e+"_rating_0";
var str=""+"<div id=\""+_49d+"_"+_49e+"_ItemRating\" class=\"itemRating\" >"+"<h2>Click to change</h2>"+"<ul class=\"star-rating\" >"+"<li>"+"<a onclick=\"doRealRatingChange('"+_4a1+"'); return false;\" id=\""+_49e+"_rating_0\" collectionId=\""+_49d+"\" entryId=\""+_49e+"\" rating=\"0\" >"+"<img src=\""+_4a0+"\" alt=\"Rated\" />"+"</a>"+"</li>"+"</ul>"+"</div>";
var _4a3=_49d+"_"+_49e+"_ItemRating";
var _4a4=_49d+"_"+_49e+"_AlbumArt";
if($(_4a3)){
Element.remove($(_4a3));
new Insertion.After($(_4a4),str);
}
if($(_49d+"_"+_49e+"_Entry")){
$(_49d+"_"+_49e+"_Entry").setAttribute("current_rating",_49f);
}
}else{
var str=""+"<div id=\""+_49d+"_"+_49e+"_ItemRating\" class=\"itemRating\">"+"<h2>Rate this song</h2>"+"<ul class=\"star-rating\">"+"<li>"+"<a onclick=\"doRealRatingChange('"+_49e+"_rating_1"+"'); return false;\" class=\"one-stars\" id=\""+_49e+"_rating_1\" collectionId=\""+_49d+"\" entryId=\""+_49e+"\" rating=\"1\" >"+"</a>"+"</li>"+"<li>"+"<a onclick=\"doRealRatingChange('"+_49e+"_rating_2"+"'); return false;\" class=\"two-stars\" id=\""+_49e+"_rating_2\" collectionId=\""+_49d+"\" entryId=\""+_49e+"\" rating=\"2\" >"+"</a>"+"</li>"+"<li>"+"<a onclick=\"doRealRatingChange('"+_49e+"_rating_3"+"'); return false;\" class=\"three-stars\" id=\""+_49e+"_rating_3\" collectionId=\""+_49d+"\" entryId=\""+_49e+"\" rating=\"3\" >"+"</a>"+"</li>"+"<li>"+"<a onclick=\"doRealRatingChange('"+_49e+"_rating_4"+"'); return false;\" class=\"four-stars\" id=\""+_49e+"_rating_4\" collectionId=\""+_49d+"\" entryId=\""+_49e+"\" rating=\"4\" >"+"</a>"+"</li>"+"<li>"+"<a onclick=\"doRealRatingChange('"+_49e+"_rating_5"+"'); return false;\" class=\"five-stars\" id=\""+_49e+"_rating_5\" collectionId=\""+_49d+"\" entryId=\""+_49e+"\" rating=\"5\" >"+"</a>"+"</li>"+"</ul>"+"</div>";
var _4a3=_49d+"_"+_49e+"_ItemRating";
var _4a4=_49d+"_"+_49e+"_AlbumArt";
if($(_4a3)){
Element.remove($(_4a3));
new Insertion.After($(_4a4),str);
}
if($(_49d+"_"+_49e+"_Entry")){
$(_49d+"_"+_49e+"_Entry").setAttribute("current_rating",_49f);
}
}
}
function getItemRating(_4a5){
var _4a6="";
if(event){
_4a6=event.target.id;
}else{
if(window.event){
_4a6=window.event.srcElement.id;
}else{
this.doFlashAlert("Unable to complete this command, our apologies.");
}
}
var _4a5=$(_4a6).getAttribute("entryId");
var _4a7=$(_4a6).getAttribute("collectionId");
var _4a8=$(_4a6).getAttribute("rating");
}
function doFixPNGTransparency(){
var _4a9=navigator.appVersion.split("MSIE");
var _4aa=parseFloat(_4a9[1]);
if((_4aa>=5.5)&&(document.body.filters)){
for(var i=0;i<document.images.length;i++){
var img=document.images[i];
var _4ad=img.src.toUpperCase();
if(_4ad.substring(_4ad.length-3,_4ad.length)=="PNG"){
var _4ae=(img.id)?"id='"+img.id+"' ":"";
var _4af=(img.className)?"class='"+img.className+"' ":"";
var _4b0=(img.title)?"title='"+img.title+"' ":"title='"+img.alt+"' ";
var _4b1="display:inline-block;"+img.style.cssText;
var _4b2=img.width;
var _4b3=img.height;
if((_4af=="icon")||(_4af=="iconToolbar")){
_4b2=16;
_4b3=16;
}
if(img.align=="left"){
_4b1="float:left;"+_4b1;
}
if(img.align=="right"){
_4b1="float:right;"+_4b1;
}
if(img.parentElement.href){
_4b1="cursor:hand;"+_4b1;
}
var _4b4="<span "+_4ae+_4af+_4b0+" style=\""+"width:"+_4b2+"px; height:"+_4b3+"px;"+_4b1+";"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"+"(src='"+img.src+"', sizingMethod='scale');\"></span>";
img.outerHTML=_4b4;
i=i-1;
}
}
}
}
ZukoolGradingFeed=Class.create();
ZukoolGradingFeed.prototype={initialize:function(){
var _4b5=new Ajax.Request("template/feed.xml",{method:"get",requestHeaders:["X-WSSE",user.getWsse()],asynchronous:false});
this.doc=_4b5.transport.responseXML;
},addEntryId:function(id,_4b7){
var _4b8=this.doc.createElement("id");
_4b8.appendChild(this.doc.createTextNode(id));
var _4b9=this.doc.createElement("content");
_4b9.appendChild(this.doc.createTextNode(_4b7));
var _4ba=this.doc.createElement("entry");
_4ba.appendChild(_4b8);
_4ba.appendChild(_4b9);
var feed=this.doc.getElementsByTagName("feed").item(0);
feed.appendChild(_4ba);
},xml:function(){
return this.doc.xml;
}};
var collectionCollectionCollection;
var collectionCollection;
var currentCollectionCollectionId=1;
function getQuery(){
if(location.search.length>1){
var get=new Object();
var ret=location.search.substr(1).split("&");
for(var i=0;i<ret.length;i++){
var r=ret[i].split("=");
get[r[0]]=decodeURIComponent(r[1].replace("+"," "));
}
return get;
}else{
return false;
}
}
function zukoolAppInit(){
if($("header")){
var _4c0=new HeaderBox();
new Insertion.Top($("header"),_4c0.getHTML());
if($("logoBox")){
var _4c1="<div id=\"messageBox\"></div>";
new Insertion.After($("logoBox"),_4c1);
}
}
if($("messageBox")){
var _4c2=new Mes