var Prototype={Version:"1.5.1.1",Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:(document.createElement("div").__proto__!==document.createElement("form").__proto__)},ScriptFragment:"<script[^>]*>([\\S\\s]*?)</script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,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(_3f6,_3f7){
for(var _3f8 in _3f7){
_3f6[_3f8]=_3f7[_3f8];
}
return _3f6;
};
Object.extend(String,{interpret:function(_3f9){
return _3f9==null?"":String(_3f9);
},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});
Object.extend(String.prototype,{gsub:function(_3fa,_3fb){
var _3fc="",source=this,match;
_3fb=arguments.callee.prepareReplacement(_3fb);
while(source.length>0){
if(match=source.match(_3fa)){
_3fc+=source.slice(0,match.index);
_3fc+=String.interpret(_3fb(match));
source=source.slice(match.index+match[0].length);
}else{
_3fc+=source,source="";
}
}
return _3fc;
},sub:function(_3fd,_3fe,_3ff){
_3fe=this.gsub.prepareReplacement(_3fe);
_3ff=_3ff===undefined?1:_3ff;
return this.gsub(_3fd,function(_400){
if(--_3ff<0){
return _400[0];
}
return _3fe(_400);
});
},scan:function(_401,_402){
this.gsub(_401,_402);
return this;
},truncate:function(_403,_404){
_403=_403||30;
_404=_404===undefined?"...":_404;
return this.length>_403?this.slice(0,_403-_404.length)+_404:this;
},strip:function(){
return this.replace(/^\s+/,"").replace(/\s+$/,"");
},stripTags:function(){
return this.replace(/<\/?[^>]+>/gi,"");
},escapeHTML:function(){
var self=arguments.callee;
self.text.data=this;
return self.div.innerHTML;
},unescapeHTML:function(){
var div=document.createElement("div");
div.innerHTML=this.stripTags();
return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject("",function(memo,node){
return memo+node.nodeValue;
}):div.childNodes[0].nodeValue):"";
},toQueryParams:function(_409){
var _40a=this.strip().match(/([^?#]*)(#.*)?$/);
if(!_40a){
return {};
}
return _40a[1].split(_409||"&").inject({},function(hash,pair){
if((pair=pair.split("="))[0]){
var key=decodeURIComponent(pair.shift());
var _40e=pair.length>1?pair.join("="):pair[0];
if(_40e!=undefined){
_40e=decodeURIComponent(_40e);
}
if(key in hash){
if(hash[key].constructor!=Array){
hash[key]=[hash[key]];
}
hash[key].push(_40e);
}else{
hash[key]=_40e;
}
}
return hash;
});
},camelize:function(){
var _40f=this.split("-"),len=_40f.length;
if(len==1){
return _40f[0];
}
var _410=this.charAt(0)=="-"?_40f[0].charAt(0).toUpperCase()+_40f[0].substring(1):_40f[0];
for(var i=1;i<len;i++){
_410+=_40f[i].charAt(0).toUpperCase()+_40f[i].substring(1);
}
return _410;
},capitalize:function(){
return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();
},underscore:function(){
return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase();
},dasherize:function(){
return this.gsub(/_/,"-");
}});
if(Prototype.Browser.WebKit||Prototype.Browser.IE){
Object.extend(String.prototype,{escapeHTML:function(){
return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
},unescapeHTML:function(){
return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">");
}});
}
