var folded_box=new Array();
var folded_box_view=new Array();
var skins_working=0;
window.onload=function(){
parseMail();
};
function showHiddenSections(){
var _1=document.getElementById("box-search-sections").childNodes[0];
var _2=_1.getElementsByTagName("li");
for(var i=0;i<_2.length;i++){
_2[i].style.display="block";
if(_2[i].className=="section-showBtn"){
_2[i].style.display="none";
}
}
return true;
}
function hideSections(){
var _4=document.getElementById("box-search-sections").childNodes[0];
var _5=_4.getElementsByTagName("li");
for(var i=0;i<_5.length;i++){
if(_5[i].className=="section-hidden"){
_5[i].style.display="none";
}
if(_5[i].className=="section-showBtn"){
_5[i].style.display="block";
}
}
return true;
}
function hideShow(_7){
var _8=document.getElementById(_7);
if("block"==_8.style.display){
_8.style.display="none";
}else{
_8.style.display="block";
}
return false;
}
function showFold(id){
var _a=$("folds");
for(var i=0;i<_a.childNodes.length;i++){
if(_a.childNodes[i].getAttribute("id")=="fold-content-"+id){
$("fold-menu-"+(i+1)).className="menuItemSelected";
Element.show(_a.childNodes[i]);
}else{
$("fold-menu-"+(i+1)).className="menuItem";
Element.hide(_a.childNodes[i]);
}
}
if(2==id){
Element.hide($("current-fs"));
}else{
Element.show($("current-fs"));
}
$("search-autocomplete").focus();
}
function mshowFold(id,_d){
var _e=$("folds");
for(var i=0;i<3;i++){
if(_e.childNodes[i].getAttribute("id")=="fold-content-"+id){
$("fold-menu-"+(i+1)).className=i+1==1?"menuItemSelectedF":"menuItemSelected";
Element.show(_e.childNodes[i]);
}else{
$("fold-menu-"+(i+1)).className=i+1==1?"menuItemF":"menuItem";
Element.hide(_e.childNodes[i]);
}
}
_d.blur();
}
function fav_add(_10){
var _11={method:"post",postBody:"func=fav_add&url_sw="+_10,onSuccess:function(r){
if(!r.responseText.match(/^[0-9]+$/)&&r.responseText!="CHYBA"){
location.href=r.responseText;
}else{
if(r.responseText.match(/^[0-9]+$/)){
alert("Program byl p\u0159id\xe1n mezi v\xe1\u0161 obl\xedben\xfd software!");
$("uqi-fav-info").getElementsByTagName("strong")[0].innerHTML=r.responseText;
}else{
alert("Software ji\u017e pat\u0159\xed mezi v\xe1\u0161 obl\xedben\xfd!");
}
}
}};
add=new Ajax.Request("/direct/ajax/",_11);
}
function fav_change_info(_13,_14,_15,_16){
var _17={method:"post",postBody:"func=fav_change_info&url_sw="+_13+"&user="+_14+"&value="+_15,onSuccess:function(r){
if(r.responseText=="OK"){
var _19=$("item-"+_13).getElementsByTagName("select")[0];
_19.blur();
fav_remove_alert();
$("favourite-alert").innerHTML="<div class=\"greenBox\">OK: Stav upozon\u011bn\xed na software "+_16+" byl zm\u011bn\u011bn na \""+_19.options[_19.selectedIndex].firstChild.nodeValue+"\"!</div>";
}else{
fav_remove_alert();
$("favourite-alert").innerHTML="<div class=\"redBox\">Chyba: Nepoda\u0159ilo se upravit stav upozorn\u011bn\xed na software "+_16+", opakujte akci pozd\u011bji. D\u011bkujeme za pochopen\xed!</div>";
}
}};
remove=new Ajax.Request("/direct/ajax/",_17);
}
function fav_remove(_1a,_1b){
var _1c={method:"post",postBody:"func=fav_remove&url_sw="+_1a+"&user="+_1b,onSuccess:function(r){
if(r.responseText=="OK"){
var _1e=$("fav-list").removeChild($("item-"+_1a));
fav_remove_alert();
$("favourite-alert").innerHTML="<div class=\"greenBox\">OK: Software byl odebr\xe1n ze seznamu va\u0105ich obl\xedben\xfdch!</div>";
}else{
fav_remove_alert();
$("favourite-alert").innerHTML="<div class=\"redBox\">Chyba: Nepoda\u0159ilo se smazat software z obl\xedben\xfdch, opakujte akci pozd\u011bji. D\u011bkujeme za pochopen\xed!</div>";
}
}};
remove=new Ajax.Request("/direct/ajax/",_1c);
}
function fav_remove_alert(){
$("favourite-alert").innerHTML="";
}
function rate_rating(_1f,_20,cid){
var _22=new Ajax.Request("/direct/ajax/",{parameters:"func=rate_rating&rateId="+_1f+"&skore="+_20+"&cid="+cid,onComplete:function(r){
if("hlasovano"==r.responseText){
alert("U\u017e jste hlasoval(a)!");
}else{
if("CHYBA"!=r.responseText){
$("rr-"+_1f).innerHTML="<strong>D\u011bkujeme, v\xe1\u0161 hlas byl ulo\u017een!</strong>";
}
}
}});
}
function rate_rating_service(_24,_25,cid){
var _27=new Ajax.Request("/direct/ajax/",{parameters:"func=rate_rating_service&rateId="+_24+"&skore="+_25+"&cid="+cid,onComplete:function(r){
if("hlasovano"==r.responseText){
alert("U\u017e jste hlasoval(a)!");
}else{
if("CHYBA"!=r.responseText){
$("rate-rating-"+_24).innerHTML="<strong>D\u011bkujeme, v\xe1\u0161 hlas byl ulo\u017een!</strong>";
}
}
}});
}
function username_changed(){
var _29={method:"post",postBody:"func=username_changed",onSuccess:function(_2a){
if(2==_2a.responseText){
alert("Omlouv\xe1ma se, ale na serveru se vyskytla chyba, kter\xe1 znemo\u017e\u0148uje zm\u011bnu Va\u0161eho nastaven\xed. Na oprav\u011b se usilovn\u011b pracuje, d\u011bkujeme za pochopen\xed!");
}else{
$("username_changed_infobox").className="blueBox";
$("username_changed_infobox").innerHTML="OK: U\u017e nebudete upozor\u0148ov\xe1n(a) na zm\u011bnu va\u0161\xed p\u0159ezd\xedvky.";
}
}};
var _2b=new Ajax.Request("/direct/ajax/",_29);
}
function check_username(_2c){
var _2d={method:"post",postBody:"func=username_check&username="+_2c,onSuccess:function(_2e){
if(1==_2e.responseText){
$("desired_username").style.borderColor="Green";
alert("Zadan\xe1 p\u0159ezd\xedvka je v tuto chv\xedli voln\xe1!");
}else{
$("desired_username").style.borderColor="Crimson";
alert("Omlouv\xe1me se, ale na Stahuj.cz ji\u017e existuje u\u017eivatel s touto p\u0159ezd\xedvkou!");
}
}};
var _2f=new Ajax.Request("/direct/ajax/",_2d);
}
function mailAnchor(_30,_31,_32,_33){
email=_30+"@"+_31;
if(typeof (_32)=="undefined"){
_32=email;
}
if(typeof (_33)!="undefined"){
_33=" title=\""+_33+"\"";
}
document.write("<a href=\"mailto:"+email+"\""+_33+">"+_32+"</a>");
}
function parseMail(){
var _34="bezpecny-email";
var _35=document.getElementsByTagName("a");
for(var i=0;i<_35.length;i++){
if(_35[i].className!=_34){
continue;
}else{
var _37=_35[i].getAttribute("href").replace(/\(te[cè]ka\)/gi,".").replace(/\(na\)/gi,"@");
_35[i].setAttribute("href",_37);
if(null==_35[i].getAttribute("title")||""==_35[i].getAttribute("title")){
_35[i].firstChild.nodeValue=_37.substr(7);
}else{
}
}
}
}
function parseMailClick(_38){
var _38=_38.replace(/\(te[cè]ka\)/gi,".").replace(/\(na\)/gi,"@");
location.href="mailto:"+_38;
}
function diskuseReagovat(_39){
$("f_text").value=_39+": "+$("f_text").value;
$("f_text").focus();
}
function diskuseSmazat(id){
if(confirm("Opravdu chcete smazat tento p\u0159\xedsp\u011bvek?")){
$("f_admin_delete").value=id;
$("f_admin_form").submit();
}
}
function article_rate_show(_3b){
var _3c=new Array("Bezcenn\xfd","\u0160patn\xfd","Pr\u016fm\u011brn\xfd","Dobr\xfd","Skv\u011bl\xfd");
for(i=1;i<6;i++){
if(i<=_3b){
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/star\_[01]/i,"star_1");
$("user-rating-info").innerHTML=_3c[i-1];
}else{
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/star\_[01]/i,"star_0");
}
}
}
function article_rate_clear(){
for(i=1;i<6;i++){
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/star\_[01]/i,"star_0");
}
$("user-rating-info").innerHTML=" ";
}
function article_rate(_3d,_3e){
var _3f=new Ajax.Request("/direct/ajax/",{parameters:"func=article_rate&articleId="+_3d+"&mark="+_3e,onComplete:function(r){
if("hlasovano"!=r.responseText){
tmp=r.responseText.split("/");
znamka=Math.floor(parseFloat(tmp[0]));
pocet=tmp[1];
$("user-rating-count").innerHTML="("+pocet+" \u010dten\xe1\u0159\u016f)";
for(i=1;i<=znamka;i++){
$("rating-"+i).src=$("rating-"+i).src.replace(/star\_[01]/i,"star_1");
}
for(i=i;i<=5;i++){
$("rating-"+i).src=$("rating-"+i).src.replace(/star\_[01]/i,"star_0");
}
$("user-rating-container").onmouseout=null;
$("user-rating-container").innerHTML="D\u011bkujeme za V\xe1\u0161 hlas!";
}else{
$("user-rating-container").innerHTML="U\u017e jste hlasoval!";
}
$("user-rating-info").innerHTML=" ";
}});
}
function hratelne_rate(_41,_42){
var _43=new Ajax.Request("/direct/ajax/",{parameters:"func=hratelne_rate&articleId="+_41+"&mark="+_42,onComplete:function(r){
if("hlasovano"!=r.responseText){
tmp=r.responseText.split("/");
znamka=Math.floor(parseFloat(tmp[0]));
pocet=tmp[1];
$("user-rating-count").innerHTML="("+pocet+" \u010dten\xe1\u0159\u016f)";
for(i=1;i<=znamka;i++){
$("rating-"+i).src=$("rating-"+i).src.replace(/ico\-starH\-[01]/i,"ico-starH-1");
}
for(i=i;i<=5;i++){
$("rating-"+i).src=$("rating-"+i).src.replace(/ico\-starH\-[01]/i,"ico-starH-0");
}
$("user-rating-container").onmouseout=null;
$("user-rating-container").innerHTML="D\u011bkujeme za V\xe1\u0161 hlas!";
}else{
$("user-rating-container").innerHTML="U\u017e jste hlasoval!";
}
$("user-rating-info").innerHTML=" ";
}});
}
function hratelne_rate_show(_45){
var _46=new Array("Bezcenn\xfd","\u0160patn\xfd","Pr\u016fm\u011brn\xfd","Dobr\xfd","Skv\u011bl\xfd");
for(i=1;i<6;i++){
if(i<=_45){
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/ico\-starH\-[01]/i,"ico-starH-1");
$("user-rating-info").innerHTML=_46[i-1];
}else{
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/ico\-starH\-[01]/i,"ico-starH-0");
}
}
}
function software_rate_show(_47){
var _48=new Array("Bezcenn\xfd","\u0160patn\xfd","Pr\u016fm\u011brn\xfd","Dobr\xfd","Skv\u011bl\xfd");
for(i=1;i<6;i++){
if(i<=_47){
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/star\_[01]/i,"star_1");
$("user-rating-info").innerHTML=_48[i-1];
}else{
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/star\_[01]/i,"star_0");
}
}
}
function software_rate_show_mark(_49){
var _4a=new Array("Bezcenn\xfd","\u0160patn\xfd","Pr\u016fm\u011brn\xfd","Dobr\xfd","Skv\u011bl\xfd");
for(i=1;i<6;i++){
if(i<=_49){
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/star\-[01]/i,"star-1");
$("user-rating-info").innerHTML=_4a[i-1];
}else{
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/star\-[01]/i,"star-0");
}
}
}
function software_frate_clear(){
var _4b=new Array("Bez hodnocen\xed","Bezcenn\xfd","\u0160patn\xfd","Pr\u016fm\u011brn\xfd","Dobr\xfd","Skv\u011bl\xfd");
var _4c=$("mark").value;
for(i=1;i<6;i++){
if(i<=_4c){
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/star\_[01]/i,"star_1");
$("user-rating-info").innerHTML=_4b[i-1];
}else{
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/star\_[01]/i,"star_0");
}
}
$("user-rating-info").innerHTML=_4b[_4c];
}
function software_rate_clear(){
for(i=1;i<6;i++){
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/star\_[01]/i,"star_0");
}
$("user-rating-info").innerHTML=" ";
}
function software_rate(_4d){
var _4e=$("rate-software");
$("mark").value=_4d;
_4e.submit();
}
function software_frate(_4f){
$("mark").value=_4f;
}
function gallery_showPhoto(id,_51){
gallery_clearSelected();
var _52=$("nahled-"+id);
if(null==_52){
return;
}else{
_52.className="selected";
if(_52.src.match(/katalog-mobil/)){
var _53=_52.src.replace(/^(.*\-\-)[^\.]+(.*)$/i,"$1--x-$2");
}else{
if(_51){
if(_51=="stahuj"){
var _53=_52.src.replace(/^(.*\-\-)[^\.]+(.*)$/i,"$1mm580x464$2");
}else{
var _53=_52.src.replace(/^(.*\-\-)[^\.]+(.*)$/i,"$1mm300x225$2");
}
}else{
var _53=_52.src.replace(/^(.*\-\-)[^\.]+(.*)$/i,"$1mm580x464$2");
}
}
var _54=$("photo-detail").getElementsByTagName("img")[0];
_54.style.visibility="hidden";
_54.removeAttribute("width");
_54.parentNode.setAttribute("href",_52.src.replace(/^(.*)\-\-[^\.]+(.*)$/i,"$1$2"));
gallery_showAlert();
_54.src=_53;
_54.onload=function(){
_54.style.visibility="visible";
gallery_hideAlert();
};
_54.setAttribute("id","photo-"+id);
_54.setAttribute("alt",_52.getAttribute("alt"));
_54.setAttribute("longdesc",_52.getAttribute("longdesc"));
_54.parentNode.setAttribute("title",_52.getAttribute("alt"));
var _55=null!=_52.getAttribute("longdesc")&&""!=_52.getAttribute("longdesc")?_52.getAttribute("longdesc"):_52.getAttribute("alt");
$("photo-text").innerHTML=_55;
if($("photo-aktual-number")){
$("photo-aktual-number").innerHTML=gallery_aktualNumberFoto();
}
if(!_51){
gallery_showPrewName();
gallery_showNextName();
}
gallery_updateAddress(id);
if(null!=$("photo-show-full")){
$("photo-show-full").href=_52.src.replace(/^(.*)\-\-[^\.]+(.*)$/i,"$1$2");
}
_52.blur();
}
}
function gallery_showAlert(){
return;
}
function gallery_hideAlert(){
return;
}
function gallery_aktualNumberFoto(){
var _56=gallery_getPhotosList();
curId=$("photo-detail").getElementsByTagName("img")[0].id.replace(/photo\-([0-9]+)/,"$1");
var cur=_56.indexOf(curId)+1;
return cur;
}
function gallery_showPrewName(){
var _58=gallery_getPhotosList();
curId=$("photo-detail").getElementsByTagName("img")[0].id.replace(/photo\-([0-9]+)/,"$1");
var cur=_58.indexOf(curId);
if(0==cur){
var _5a=_58.last();
}else{
var _5a=_58[cur-1];
}
if($("prevName")){
if($("nahled-"+_5a)){
$("prevName").innerHTML=$("nahled-"+_5a).getAttribute("alt")!=""?$("nahled-"+_5a).getAttribute("alt"):"P\u0159echoz\xed fotka";
}else{
$("prevName").innerHTML="P\u0159edchoz\xed fotka";
}
}
}
function gallery_showNextName(){
var _5b=gallery_getPhotosList();
curId=$("photo-detail").getElementsByTagName("img")[0].id.replace(/photo\-([0-9]+)/,"$1");
var cur=_5b.indexOf(curId);
if(_5b.length-1==cur){
var _5d=_5b[0];
}else{
var _5d=_5b[cur+1];
}
if($("nextName")){
if($("nahled-"+_5d)){
$("nextName").innerHTML=$("nahled-"+_5d).getAttribute("alt")!=""?$("nahled-"+_5d).getAttribute("alt"):"Dal\u0161\xed fotka";
}else{
$("nextName").innerHTML="Dal\u0161\xed fotka";
}
}
}
function gallery_showNext(_5e){
var _5f=gallery_getPhotosList();
curId=$("photo-detail").getElementsByTagName("img")[0].id.replace(/photo\-([0-9]+)/,"$1");
var cur=_5f.indexOf(curId);
if(_5f.length-1!=cur){
gallery_showPhoto(_5f[cur+1],_5e);
}else{
gallery_showPhoto(_5f[0],_5e);
}
}
function gallery_showPrev(_61){
var _62=gallery_getPhotosList();
curId=$("photo-detail").getElementsByTagName("img")[0].id.replace(/photo\-([0-9]+)/,"$1");
var cur=_62.indexOf(curId);
if(0!=cur){
gallery_showPhoto(_62[cur-1],_61);
}else{
gallery_showPhoto(_62.last(),_61);
}
}
function gallery_fullPhoto(elm){
window.open(elm.href);
}
function gallery_updateAddress(id){
if(-1==location.href.indexOf("#")){
location.href=location.href+"#"+id;
}else{
location.href=location.href.replace(/^(.*)#[0-9]+$/i,"$1#"+id);
}
}
function gallery_detectPhoto(){
if(-1!=location.href.indexOf("#")){
res=location.href.match(/.*#([0-9]+)$/);
if(null!=res&&null!=$("photo-detail")){
gallery_showPhoto(res[1]);
}
}
}
function gallery_clearSelected(){
var _66=gallery_getPhotosList();
for(var i=0;i<_66.length;i++){
$("nahled-"+_66[i]).className="";
}
}
function gallery_getPhotosList(){
var _68=new Array();
var _69=$("photos-row").getElementsByTagName("img");
for(var i=0;i<_69.length;i++){
var res=_69[i].id.match(/\-([0-9]+)$/i);
_68[i]=res[1];
}
return _68;
}
function get_cookie(_6c){
var _6d=document.cookie.indexOf(_6c+"=");
var len=_6d+_6c.length+1;
if((!_6d)&&(_6c!=document.cookie.substring(0,_6c.length))){
return null;
}
if(_6d==-1){
return null;
}
var end=document.cookie.indexOf(";",len);
if(end==-1){
end=document.cookie.length;
}
return unescape(document.cookie.substring(len,end));
}
function set_cookie(_70,_71,_72,_73,_74,_75){
var _76=new Date();
_76.setTime(_76.getTime());
if(_72){
_72=_72*1000*60*60*24;
}
var _77=new Date(_76.getTime()+(_72));
document.cookie=_70+"="+escape(_71)+((_72)?";expires="+_77.toGMTString():"")+((_73)?";path="+_73:"")+((_74)?";domain="+_74:"")+((_75)?";secure":"");
}
function zobrazit(elm){
var box=elm.parentNode.parentNode;
var _7a=document.getElementsByClassName("box-content",box)[0];
if(true==Element.visible(_7a)){
elm.className="folded";
set_cookie(box.id,0,365,"/","","");
Element.hide(_7a);
}else{
elm.className="unfolded";
set_cookie(box.id,1,365,"/","","");
Element.show(_7a);
}
elm.blur();
}
function load_fold_status(){
var _7b=document.getElementsByClassName("box");
for(var i=0;i<_7b.length;i++){
var _7d=document.getElementsByClassName("box-title",_7b[i]);
if(_7d.length<=0){
continue;
}else{
if(_7d[0].firstChild.nodeName=="SPAN"){
_7d=_7d[0].firstChild;
}else{
continue;
}
}
var _7e=document.getElementsByClassName("box-content",_7b[i])[0];
var _7f=get_cookie(_7b[i].id);
if(typeof (_7f)=="string"){
_7f=_7f;
}else{
_7f=null;
}
if(_7f==0||(_7f==null&&_7d.className=="folded")){
_7d.className="folded";
Element.hide(_7e);
}else{
_7d.setAttribute("class","unfolded");
}
}
}
function in_array(_80,_81){
for(var i=0;i<_80.length;i++){
if(_80[i]==_81){
return true;
}
}
return false;
}
function checkFreeSoftware(id){
var _84=$("fs-"+id);
if(_84.checked){
return true;
}else{
alert("Pro z\xedsk\xe1n\xed software zdarma mus\xedte odsouhlasit podm\xednky nab\xeddky!");
return false;
}
}
function moveSky(){
if(document.documentElement.scrollTop>160){
$("banner-skyscraper").style.top=document.documentElement.scrollTop+5+"px";
}else{
$("banner-skyscraper").style.top=160+"px";
}
setTimeout("moveSky()",20);
}
function inquiry_vote(_85,_86,cid){
var _88=new Ajax.Request("/direct/ajax/",{parameters:"func=inquiry_vote&aid="+_85+"&oid="+_86+"&cid="+cid,onComplete:inquiry_vote_process});
}
function inquiry_vote_process(r){
var _8a=r.responseText;
var _8b=0;
if(_8a!="hlasovano"){
var tmp=_8a.split("||");
_8b=tmp[0];
for(var i=1;i<tmp.length;i++){
var _8e=tmp[i].split("-");
var _8f=$("inq-"+_8e[0]).firstChild.removeChild($("inq-"+_8e[0]).firstChild.firstChild);
$("inq-"+_8e[0]).firstChild.appendChild(Builder.node("span",_8f.firstChild.nodeValue));
var _90=Math.round(_8e[1]/_8b*100);
var _91=$("inq-"+_8e[0]).getElementsByTagName("img");
for(var j=0;j<3;j++){
if(j==1){
_91[j].setAttribute("width",_90);
}
_91[j].setAttribute("onclick","");
}
var _8a=$("inq-"+_8e[0]).getElementsByTagName("span")[2].firstChild;
_8a.nodeValue=" "+_90+"%";
}
$("inq-alert").innerHTML="D\u011bkujeme za hlas!";
}else{
$("inq-alert").innerHTML="U\u017e jste hlasoval(a)!";
}
}
function fullImage(url,w,h){
var _96=window.open("","obrazek","width="+(w)+",height="+(h));
_96.document.title="Obr\xe1zek - Digit\xe1ln\u011b Stahuj.cz";
if(typeof (_96.document.body.childNodes.length)=="number"&&_96.document.body.childNodes.length>0){
_96.document.body.innerHTML="";
}
_96.document.write("<a href=\"#\" onclick=\"window.top.close();\"><img border=\"0\" src=\""+url+"\" alt=\"\" width=\""+w+"\" height=\""+h+"\" /></a>");
_96.document.body.style.margin="0";
_96.focus();
}
function checkDiscussionAdd(_97){
var _98=new RegExp("^[_a-zA-Z0-9.-]+@[_a-zA-Z0-9.-]+.[a-zA-Z]{2,6}$","i");
if($("upozornit").checked){
if(!_98.test($("f_email").value)){
alert("Pokud chcete b\xfdt upozorn\u011bn(a) na odpov\u011bdi na v\xe1\u0161 p\xedsp\u011bvek, mus\xedte zadat spr\xe1vnou elektronickou adresu!");
$("f_email").focus();
return false;
}else{
return true;
}
}else{
return true;
}
}
function checkDiscsussionForm(){
if($F("f_text")==""||$F("f_text").match(/^\s+$/)){
alert("Mus\xedte vyplnit text va\u0161eho p\u0159\xedsp\u011bvku!");
return false;
}else{
return true;
}
}
function addToFav(){
var _99=window.document.title;
var url=window.location;
if(window.sidebar){
window.sidebar.addPanel(_99,"http://www.stahuj.cz/?from-fav","");
}else{
if(window.external){
window.external.AddFavorite("http://www.stahuj.cz/?from-fav",_99);
}else{
if(window.opera&&window.print){
alert("Pro ulo\u017een\xed Stahuj.cz do obl\xedben\xfdch stiskn\u011bte CTRL + D!");
}
}
}
}
function setAsHP(){
if(navigator.appName!="Netscape"){
document.body.style.behavior="url(#default#homepage)";
document.body.setHomePage("http://www.stahuj.cz/?from-fav");
return false;
}else{
return true;
}
}
function rss_news_load(_9b){
Element.show("rss-ind");
var _9c=new Ajax.Request("/direct/ajax/",{parameters:"func=rss_news_load&pocet="+_9b,onSuccess:function(r){
Element.hide("rss-ind");
$("rss-cont").innerHTML=r.responseText;
setTimeout("rss_news_refresh()",10000);
}});
}
function rss_news_refresh(){
var _9e=new Ajax.Request("/direct/ajax/",{parameters:"func=rss_news_refresh&last="+$("f_rss-last").value,onSuccess:rss_news_refresh_cb});
}
function rss_news_refresh_cb(r){
if(""!=r.responseText){
var tmp=r.responseText.split("|||");
for(var i=0;i<(tmp.length-1);i++){
var li=document.createElement("li");
li.innerHTML=tmp[i];
li.style.display="none";
$("rss-list").insertBefore(li,$("rss-list").firstChild);
new Effect.BlindDown($("rss-list").firstChild,{duration:0.5,afterFinish:function(obj){
obj.element.display="block";
$("rss-list").removeChild($("rss-list").lastChild);
}});
}
$("f_rss-last").value=tmp[tmp.length-1];
}
setTimeout("rss_news_refresh()",10000);
}
function skins_sh_list(_a4){
var elm=$("skins-menu");
if(elm.style.display=="block"){
elm.style.display="none";
}else{
elm.style.display="block";
}
if(_a4.tagName.toLowerCase()=="a"){
_a4.blur();
}
}
function skins_icon_over(_a6){
$("skins-show").src=$("skins-show").src.replace(/userbar_change[12]/i,"userbar_change"+_a6);
}
function skins_select(id,_a8){
if(0>skins_working){
return;
}else{
if(Element.visible("f_user_conf")){
Element.hide("f_user_conf");
}
}
skins_working++;
skins_show_alert();
var _a9=document.getElementsByTagName("link");
skinCount=0;
for(var i=0;i<_a9.length;i++){
if(_a9[i].getAttribute("rel")=="stylesheet"&&_a9[i].className=="userstyle"){
var _ab=_a9[i].parentNode.removeChild(_a9[i]);
}
}
if(_a8==true){
var _ac=$("skins-menu").getElementsByTagName("img");
for(i=0;i<_ac.length;i++){
_ac[i].parentNode.className="";
}
if(id!=0){
_ac[id-2].parentNode.className="selected";
$("change-theme-ico").src=_ac[id-2].src;
}else{
_ac[id].parentNode.className="selected";
$("change-theme-ico").src=_ac[id].src;
}
}
var url="http://"+location.host.replace(/diskuse/,"www");
var _ae=document.createElement("link");
_ae.setAttribute("rel","stylesheet");
_ae.setAttribute("type","text/css");
_ae.setAttribute("media","screen");
_ae.setAttribute("class","userstyle");
_ae.className="userstyle";
_ae.setAttribute("href",url+"/direct/css/userstyle.php?style="+id);
document.getElementsByTagName("head")[0].appendChild(_ae);
var _af=new Ajax.Request("/direct/ajax/",{parameters:"func=style_set&style="+id,onSuccess:skins_hide_alert});
}
function skins_show_alert(){
Element.hide("uqi-fav-info");
Element.show("f_user_alert");
if($("f_skins_ualert")){
Element.show("f_skins_ualert");
}
}
function skins_hide_alert(){
skins_working--;
Element.hide("f_user_alert");
Element.show("f_user_conf");
if($("f_skins_ualert")){
Element.hide("f_skins_ualert");
}
setTimeout("skins_hide_conf()",1000);
}
function skins_hide_conf(){
new Effect.Fade("f_user_conf",{duration:1,afterFinish:function(){
Element.hide("f_user_conf");
if(0==skins_working){
Element.show("uqi-fav-info");
}
}});
}
var JobsScroll={offset:1,maxCount:300,count:0,curMode:"down",timer:null,start:function(_b0){
JobsScroll.maxCount=350;
JobsScroll.curMode=_b0;
JobsScroll.timer=setTimeout("JobsScroll.scroll(\""+_b0+"\")",10000);
},scroll:function(_b1){
if(_b1=="down"){
$("jobs-viewport").scrollTop=$("jobs-viewport").scrollTop+JobsScroll.offset;
}else{
$("jobs-viewport").scrollTop=$("jobs-viewport").scrollTop-JobsScroll.offset;
}
if(JobsScroll.count++<JobsScroll.maxCount){
JobsScroll.timer=setTimeout("JobsScroll.scroll(\""+_b1+"\")",1);
}else{
JobsScroll.count=0;
var _b2=_b1=="up"?"down":"up";
JobsScroll.curMode=_b2;
JobsScroll.timer=setTimeout("JobsScroll.scroll(\""+_b2+"\")",10000);
}
},stop:function(){
clearTimeout(JobsScroll.timer);
},restart:function(){
JobsScroll.timer=setTimeout("JobsScroll.scroll(\""+JobsScroll.curMode+"\")",1);
}};
function newsletter_check(_b3,_b4){
var _b5=document.getElementsByName(_b4);
for(var i=0;i<_b5.length;i++){
if(Element.visible(_b5[i].parentNode.parentNode)){
Element.hide(_b5[i].parentNode.parentNode);
}else{
Element.show(_b5[i].parentNode.parentNode);
}
_b5[i].disabled=!_b3;
}
}
var tempFunc=window.onload;
window.onload=function(){
if(typeof (tempFunc)=="function"){
try{
tempFunc();
}
catch(e){
}
}
gallery_detectPhoto();
};
function jeCislo(elm){
if(elm.value!=""){
if(parseInt(elm.value)!=elm.value){
elm.value="";
elm.focus();
alert("Odpov\u011bd\xed na ot\xe1zku mus\xed b\xfdt \u010d\xedslo");
}
}
}
var Video={indicatorStart:function(){
var elm=$("video-indicator");
elm.value="Na\u010d\xedt\xe1m...";
Element.show($("prubeh"));
elm.disabled=true;
},indicatorStop:function(){
var elm=$("video-indicator");
elm.value="St\xe1hnout";
Element.hide($("prubeh"));
elm.disabled=false;
},download:function(url){
this.indicatorElm=$("video-indicator");
this.indicatorStart();
var _bb={method:"post",postBody:"func=video_downloader&url="+encodeURIComponent(url),onSuccess:function(r){
Video.indicatorStop();
var _bd=new String(r.getResponseHeader("X-Status"));
if("ERROR"==_bd){
alert(r.responseText);
}else{
location.href=r.responseText;
}
}};
add=new Ajax.Request("/direct/ajax/",_bb);
}};
var AlertTextBox={active:false,show:function(_be,_bf,_c0){
if(_c0){
InlineNotifikator.create(_c0);
}
var _c1=new Ajax.Request("/direct/ajax/",{parameters:"func="+_bf,onComplete:function(r){
AlertBox.show(_be,r.responseText);
if(_c0){
InlineNotifikator.destroy(_c0);
}
}});
}};
var InlineNotifikator={inClassName:"inline-not",create:function(elm){
var _c4=this.createNewElement();
var _c5=elm.childNodes;
var i;
for(i=0;i<_c5.length;i++){
if(1==_c5[i].nodeType){
Element.hide(_c5[i]);
}
}
elm.insertBefore(_c4,elm.firstChild);
},destroy:function(elm){
elm.removeChild(document.getElementsByClassName(this.inClassName,elm)[0]);
var _c8=elm.childNodes;
var i;
for(i=0;i<_c8.length;i++){
if(1==_c8[i].nodeType){
Element.show(_c8[i]);
}
}
},createNewElement:function(){
return Builder.node("span",{"className":this.inClassName},[Builder.node("img",{"src":"/direct/css/image/inline-notification.gif","width":21,"height":5,"alt":"Na\u010d\xedt\xe1m..."})]);
}};
function getPageSize(){
var _ca,_cb;
if(window.innerHeight&&window.scrollMaxY){
_ca=window.innerWidth+window.scrollMaxX;
_cb=window.innerHeight+window.scrollMaxY;
}else{
if(document.body.scrollHeight>document.body.offsetHeight){
_ca=document.body.scrollWidth;
_cb=document.body.scrollHeight;
}else{
_ca=document.body.offsetWidth;
_cb=document.body.offsetHeight;
}
}
var _cc,_cd;
if(self.innerHeight){
if(document.documentElement.clientWidth){
_cc=document.documentElement.clientWidth;
}else{
_cc=self.innerWidth;
}
_cd=self.innerHeight;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
_cc=document.documentElement.clientWidth;
_cd=document.documentElement.clientHeight;
}else{
if(document.body){
_cc=document.body.clientWidth;
_cd=document.body.clientHeight;
}
}
}
if(_cb<_cd){
pageHeight=_cd;
}else{
pageHeight=_cb;
}
if(_ca<_cc){
pageWidth=_ca;
}else{
pageWidth=_cc;
}
arrayPageSize=new Array(pageWidth,pageHeight,_cc,_cd);
return arrayPageSize;
}
var AlertBox={topOffset:150,arrayPageSize:null,scrollTimer:null,show:function(_ce,_cf){
this.arrayPageSize=this.arrayPageSize||getPageSize();
this.showOverlay();
var elm=this.createNewElement();
elm.style.top=this.topOffset+"px";
elm.style.left=((this.arrayPageSize[0]-592)/2)+"px";
document.getElementsByClassName("title",elm)[0].innerHTML=_ce;
document.getElementsByClassName("content",elm)[0].innerHTML=_cf;
this.scrollCheck();
Element.show(elm);
},hide:function(){
this.scrollCheckStop();
Element.hide("blackbox");
new Effect.Fade("overlay",{duration:0});
},scrollCheck:function(){
var _d1=AlertBox.createNewElement();
if(document.documentElement.scrollTop>0){
_d1.style.top=(document.documentElement.scrollTop+AlertBox.topOffset)+"px";
}else{
_d1.style.top=AlertBox.topOffset+"px";
}
AlertBox.scrollTimer=setTimeout(AlertBox.scrollCheck,200);
},scrollCheckStop:function(){
if(null!=this.scrollTimeout){
clearTimeout(this.scrollTimeout);
}
},showOverlay:function(){
var _d2=document.getElementsByTagName("body").item(0);
var _d3=document.createElement("div");
_d3.setAttribute("id","overlay");
_d3.style.display="none";
_d3.onclick=function(){
AlertBox.hide();
};
_d2.appendChild(_d3);
$("overlay").style.width=this.arrayPageSize[0]+"px";
$("overlay").style.height=this.arrayPageSize[1]+"px";
new Effect.Appear("overlay",{duration:0,from:0,to:0.8});
},createNewElement:function(){
var elm=$("blackbox");
if(!elm){
var _d5=Builder.node("div",{"id":"blackbox","style":"display: none; position: absolute; z-index: 91;"},[Builder.node("div",{"className":"header"},""),Builder.node("div",{"className":"body"},[Builder.node("h3",{"className":"title"},"titulek"),Builder.node("span",{"className":"close"},[Builder.node("img",{"src":"/direct/css/image/close-m.gif","width":"18","height":"18","alt":"Zav\u0159\xedt okno!","onclick":"AlertBox.hide(); return false;","onmouseover":"AlertBox.closeOver(this, 'close-a');","onmouseout":"AlertBox.closeOver(this, 'close-m');"})]),Builder.node("div",{"className":"content"},"")]),Builder.node("div",{"className":"footer"},"")]);
_d5.firstChild.innerHTML="&nbsp;";
_d5.lastChild.innerHTML="&nbsp;";
document.body.appendChild(_d5);
return document.body.lastChild;
}else{
return elm;
}
},closeOver:function(elm,img){
elm.src=elm.src.replace(/close\-[am]/,img);
}};
var Check={emailRegExp:new RegExp("^[_a-z0-9.-]+@[_a-z0-9.-]+.[a-z]{2,5}$","i"),emptyRegExp:new RegExp("^s+$"),webRegExp:new RegExp("http://[_a-zA-Z0-9.-]+.[a-zA-Z]{2,4}[-_~&=?.a-z0-9/]","i"),email:function(str){
str=str.replace(/\s+/,"");
if(-1==str.indexOf(",")){
return this.testRe(str,this.emailRegExp);
}else{
var tmp=str.split(/, ?/);
for(var i=0;i<tmp.length;i++){
if(!this.testRe(tmp[i],this.emailRegExp)){
return false;
}
}
return true;
}
},webPage:function(str){
if(str==""){
return false;
}else{
if(this.testRe(str,this.webRegExp)){
return true;
}else{
return false;
}
}
},empty:function(str){
if(str==""){
return true;
}else{
if(this.testRe(str,this.emptyRegExp)){
return true;
}else{
return false;
}
}
},testRe:function(str,_de){
var _df=null==str.match(_de)?false:true;
return _df;
}};
var Notifikator={previousElm:null,timer:null,zobrazVelkyUser:function(elm,id){
if(null!=this.previousElm&&this.previousElm!=id){
this.hide(this.previousElm);
}
Notifikator.hideMess(id);
this.previousElm=id;
this._zobrazVelky(elm,id);
elm.blur();
},zobrazVelky:function(elm,id){
if(null!=this.previousElm&&this.previousElm!=id){
this.hide(this.previousElm);
}
Notifikator.hideMess(id);
UserList.hideAll();
this.previousElm=id;
this._zobrazVelky(elm,id);
elm.blur();
},_zobrazVelky:function(elm,id){
if(Element.visible(id)){
Element.hide(id);
}else{
var _e6=$(id).style,_e7=new Array(2);
_e6.position="absolute";
_e6.visibility="hidden";
Element.show(id);
_e7[0]=$(id).offsetWidth;
_e7[1]=$(id).offsetHeight;
Element.hide(id);
_e6.visibility="visible";
var _e8=Position.cumulativeOffset(elm);
_e6.top=(_e8[1]+20)+"px";
var _e9=this._getWindowSize();
if(_e8[0]+_e7[0]>_e9[0]){
_e6.left=(_e9[0]-_e7[0]-30)+"px";
}else{
_e6.left=(_e8[0]-30)+"px";
}
if(_e8[1]+_e7[1]>_e9[1]){
_e6.top=(_e8[1]-_e7[1])+"px";
}else{
_e6.top=(_e8[1]+20)+"px";
}
Element.show(id);
}
},_getWindowSize:function(){
var _ea=0,_eb=0;
if(typeof (window.innerWidth)=="number"){
_ea=window.innerWidth;
_eb=window.innerHeight;
}else{
if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){
_ea=document.documentElement.clientWidth;
_eb=document.documentElement.clientHeight;
}else{
if(document.body&&(document.body.clientWidth||document.body.clientHeight)){
_ea=document.body.clientWidth;
_eb=document.body.clientHeight;
}
}
}
return [_ea,_eb];
},hide:function(id){
Element.hide(id);
},showMess:function(elm,_ee,_ef){
var _f0=document.getElementsByClassName("notifikator-mess",elm)[0];
if(_f0){
_f0.innerHTML=_ee;
_f0.className=_ef+" notifikator-mess";
Element.show(_f0);
}
},showError:function(elm,_f2){
Notifikator.showMess(elm,_f2,"redBox");
},showOk:function(elm,_f4){
Notifikator.showMess(elm,_f4,"greenBox");
},hideMess:function(elm){
var elm=$(elm);
var _f6=document.getElementsByClassName("notifikator-mess",elm),i;
for(i=0;i<_f6.length;i++){
Element.hide(_f6[i]);
_f6[i].innerHTML="";
Element.addClassName(_f6[i],"redBox");
}
},clearValues:function(_f8){
var _f9=$(_f8).getElementsByTagName("textarea"),i;
for(i=0;i<_f9.length;i++){
_f9[i].value="";
}
}};
function sendInfoMessage(elm,_fc){
if(!Check.email(_fc.od_mail.value)){
Notifikator.showError($(elm),"CHYBA: Va\u0161e elektronick\xe1 adresa nen\xed ve spr\xe1vn\xe9m form\xe1tu!");
}else{
if(Check.empty(_fc.text.value)){
Notifikator.showError($(elm),"CHYBA: text informace nebyl vypln\u011bn!");
}else{
_fc.submit.value="Odes\xedl\xe1m...";
var _fd=new Ajax.Request("/direct/ajax/",{parameters:"func=odesli_info_mail&adresa="+location.href+"&text="+encodeURIComponent(_fc.text.value)+"&od_email="+encodeURIComponent(_fc.od_mail.value),onComplete:function(r){
if("ok"==r.responseText){
Notifikator.showOk($(elm),"OK: Zpr\xe1va byla \xfasp\u011b&scaron;n\u011b odesl\xe1na!");
Notifikator.clearValues(elm);
}else{
Notifikator.showError($(elm),"CHYBA: "+r.responseText);
}
}});
}
}
}
function sluzba_rate_show(_ff){
var text=new Array("Bezcenn\xe1","\u0160patn\xe1","Pr\u016fm\u011brn\xe1","Dobr\xe1","Skv\u011bl\xe1");
for(i=1;i<6;i++){
if(i<=_ff){
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/ico\-star\-[01]/i,"ico-star-1");
$("user-rating-info").innerHTML=text[i-1];
}else{
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/ico\-star\-[01]/i,"ico-star-0");
}
}
}
function sluzba_rate_show_mark(_101){
var text=new Array("Bezcenn\xe1","\u0160patn\xe1","Pr\u016fm\u011brn\xe1","Dobr\xe1","Skv\u011bl\xe1");
for(i=1;i<6;i++){
if(i<=_101){
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/ico\-star\-[01]/i,"ico-star-1");
$("user-rating-info").innerHTML=text[i-1];
}else{
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/ico\-star\-[01]/i,"ico-star-0");
}
}
}
function sluzba_rate_clear(){
for(i=1;i<6;i++){
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/ico\-star\-[01]/i,"ico-star-0");
}
$("user-rating-info").innerHTML=" ";
}
function sluzba_frate_clear(){
var text=new Array("Bez hodnocen\xed","Bezcenn\xe1","\u0160patn\xe1","Pr\u016fm\u011brn\xe1","Dobr\xe1","Skv\u011bl\xe1");
var _104=$("mark").value;
for(i=1;i<6;i++){
if(i<=_104){
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/ico\-star\-[01]/i,"ico-star-1");
$("user-rating-info").innerHTML=text[i-1];
}else{
$("user-rating-"+i).src=$("user-rating-"+i).src.replace(/ico\-star\-[01]/i,"ico-star-0");
}
}
$("user-rating-info").innerHTML=text[_104];
}
function sluzba_rate(mark){
var form=$("rate-software");
$("mark").value=mark;
form.submit();
}
function sluzba_frate(mark){
$("mark").value=mark;
}
function nejArticle_show(id){
var _109=$("nejImageArticle-"+id);
if(null==_109){
return;
}else{
link=$("nejArticle-"+id).getAttribute("href");
nadpis=_109.getAttribute("alt");
title="<h3><a href=\""+link+"\">"+nadpis+"</a></h3>";
perex="<p>"+_109.getAttribute("longdesc")+"</p>";
obrazek="<img src=\""+_109.getAttribute("src")+"\" alt=\""+nadpis+"\" />";
celyClanek="<span class=\"allArticle\"><a href=\""+link+"\">Cel\xfd \u010dl\xe1nek</a></span>";
$("showNejArticleHere").innerHTML="<div>"+obrazek+title+perex+celyClanek+"</div>";
}
}
function newPhotogallery_show(id){
var _10b=$("newPhotogallery-"+id);
if(null==_10b){
return;
}else{
link=$("newPhotogalleryLink-"+id).getAttribute("href");
nadpis=_10b.getAttribute("alt");
title="<div class=\"box-fotoclanky-nadpis\"><a href=\""+link+"\">"+nadpis+"</a></div>";
obrazek="<img src=\""+_10b.getAttribute("src")+"\" alt=\""+nadpis+"\" />";
$("showNewPhotogalleryHere").innerHTML="<div class=\"box-fotoclanky-foto\">"+obrazek+title+"</div>";
}
}
function newPhotogallery_show_next(){
$("next").style.display="block";
$("first").style.display="none";
$("prevLink").style.display="block";
$("nextLink").style.display="none";
}
function newPhotogallery_show_prev(){
$("next").style.display="none";
$("first").style.display="block";
$("prevLink").style.display="none";
$("nextLink").style.display="block";
}
function showOtherCategory(div){
if($(div).style.display=="none"){
$(div).style.display="block";
}else{
$(div).style.display="none";
}
}
function showReportButton(){
if($("report").value=="null"){
$("reportButton").style.display="none";
}else{
$("reportButton").style.display="block";
}
}
function add_report(_10d){
var _10e={method:"post",postBody:"func=add_report&url_sw="+_10d+"&report="+$("report").value,onSuccess:function(r){
if(r.responseText!="CHYBA"){
$("report-box").innerHTML="D\u011bkujeme za zasl\xe1n\xed Va\u0161eho podn\u011btu.";
}else{
alert("Nahl\xe1\u0161en\xed probl\xe9mu se nezda\u0159ilo");
}
}};
add=new Ajax.Request("/direct/ajax/",_10e);
}
function savesw(type,url){
var _112={method:"post",postBody:"func=save_sw&type="+type,onSuccess:function(r){
window.location.href=url;
}};
add=new Ajax.Request("/direct/ajax/",_112);
}
function savedownload(type,url){
var _116={method:"post",postBody:"func=save_download&type="+type,onSuccess:function(r){
window.location.href=url;
}};
add=new Ajax.Request("/direct/ajax/",_116);
}
var google_num_ads=0;
var google_last_ad_type="";
function google_ad_request_done(_118){
var s;
if(_118.length==0){
return;
}
google_num_ads+=_118.length;
google_last_ad_type=_118[0].type;
s="<div class=\"ad_header\"><a class=\"ad_attribution\" href=\""+google_info.feedback_url+"\">Reklamy Google</a></div>";
if(_118[0].type=="image"){
s+="<a href=\""+_118[0].url+"\" target=\"_top\" title=\"go to "+_118[0].visible_url+"\"><img border=\"0\" src=\""+_118[0].image_url+"\"width=\""+_118[0].image_width+"\"height=\""+_118[0].image_height+"\"></a>";
}else{
if(_118[0].type=="html"){
s+=_118[0].snippet;
}else{
if(_118[0].type=="text"){
if(_118.length==1){
ad_title_class="ad_title_large";
ad_text_class="ad_text_large";
ad_url_class="ad_url_large";
}else{
ad_title_class="ad_title";
ad_text_class="ad_text";
ad_url_class="ad_url";
}
for(var i=0;i<_118.length;i++){
if(i==(_118.length-1)){
last=" last";
}else{
last="";
}
s+="<div class=\"ad_ads"+last+"\"><a class=\""+ad_title_class+"\" href=\""+_118[i].url+"\" >"+_118[i].line1+"</a><br><span class=\""+ad_text_class+"\">"+_118[i].line2+" "+_118[i].line3+"</span><br>"+"<a class=\""+ad_url_class+"\" href=\""+_118[i].url+"\" >"+_118[i].visible_url+"</a></div>";
}
}
}
}
document.write(s);
return;
}
var Prototype={Version:"1.5.0",BrowserFeatures:{XPath:!!document.evaluate},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(_11c,_11d){
for(var _11e in _11d){
_11c[_11e]=_11d[_11e];
}
return _11c;
};
Object.extend(Object,{inspect:function(_11f){
try{
if(_11f===undefined){
return "undefined";
}
if(_11f===null){
return "null";
}
return _11f.inspect?_11f.inspect():_11f.toString();
}
catch(e){
if(e instanceof RangeError){
return "...";
}
throw e;
}
},keys:function(_120){
var keys=[];
for(var _122 in _120){
keys.push(_122);
}
return keys;
},values:function(_123){
var _124=[];
for(var _125 in _123){
_124.push(_123[_125]);
}
return _124;
},clone:function(_126){
return Object.extend({},_126);
}});
Function.prototype.bind=function(){
var _127=this,args=$A(arguments),_129=args.shift();
return function(){
return _127.apply(_129,args.concat($A(arguments)));
};
};
Function.prototype.bindAsEventListener=function(_12a){
var _12b=this,args=$A(arguments),_12a=args.shift();
return function(_12d){
return _12b.apply(_12a,[(_12d||window.event)].concat(args).concat($A(arguments)));
};
};
Object.extend(Number.prototype,{toColorPart:function(){
var _12e=this.toString(16);
if(this<16){
return "0"+_12e;
}
return _12e;
},succ:function(){
return this+1;
},times:function(_12f){
$R(0,this,true).each(_12f);
return this;
}});
var Try={these:function(){
var _130;
for(var i=0,_132=arguments.length;i<_132;i++){
var _133=arguments[i];
try{
_130=_133();
break;
}
catch(e){
}
}
return _130;
}};
var PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(_134,_135){
this.callback=_134;
this.frequency=_135;
this.currentlyExecuting=false;
this.registerCallback();
},registerCallback:function(){
this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},stop:function(){
if(!this.timer){
return;
}
clearInterval(this.timer);
this.timer=null;
},onTimerEvent:function(){
if(!this.currentlyExecuting){
try{
this.currentlyExecuting=true;
this.callback(this);
}
finally{
this.currentlyExecuting=false;
}
}
}};
String.interpret=function(_136){
return _136==null?"":String(_136);
};
Object.extend(String.prototype,{gsub:function(_137,_138){
var _139="",_13a=this,_13b;
_138=arguments.callee.prepareReplacement(_138);
while(_13a.length>0){
if(_13b=_13a.match(_137)){
_139+=_13a.slice(0,_13b.index);
_139+=String.interpret(_138(_13b));
_13a=_13a.slice(_13b.index+_13b[0].length);
}else{
_139+=_13a,_13a="";
}
}
return _139;
},sub:function(_13c,_13d,_13e){
_13d=this.gsub.prepareReplacement(_13d);
_13e=_13e===undefined?1:_13e;
return this.gsub(_13c,function(_13f){
if(--_13e<0){
return _13f[0];
}
return _13d(_13f);
});
},scan:function(_140,_141){
this.gsub(_140,_141);
return this;
},truncate:function(_142,_143){
_142=_142||30;
_143=_143===undefined?"...":_143;
return this.length>_142?this.slice(0,_142-_143.length)+_143:this;
},strip:function(){
return this.replace(/^\s+/,"").replace(/\s+$/,"");
},stripTags:function(){
return this.replace(/<\/?[^>]+>/gi,"");
},stripScripts:function(){
return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");
},extractScripts:function(){
var _144=new RegExp(Prototype.ScriptFragment,"img");
var _145=new RegExp(Prototype.ScriptFragment,"im");
return (this.match(_144)||[]).map(function(_146){
return (_146.match(_145)||["",""])[1];
});
},evalScripts:function(){
return this.extractScripts().map(function(_147){
return eval(_147);
});
},escapeHTML:function(){
var div=document.createElement("div");
var text=document.createTextNode(this);
div.appendChild(text);
return 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(_14d){
var _14e=this.strip().match(/([^?#]*)(#.*)?$/);
if(!_14e){
return {};
}
return _14e[1].split(_14d||"&").inject({},function(hash,pair){
if((pair=pair.split("="))[0]){
var name=decodeURIComponent(pair[0]);
var _152=pair[1]?decodeURIComponent(pair[1]):undefined;
if(hash[name]!==undefined){
if(hash[name].constructor!=Array){
hash[name]=[hash[name]];
}
if(_152){
hash[name].push(_152);
}
}else{
hash[name]=_152;
}
}
return hash;
});
},toArray:function(){
return this.split("");
},succ:function(){
return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1);
},camelize:function(){
var _153=this.split("-"),len=_153.length;
if(len==1){
return _153[0];
}
var _155=this.charAt(0)=="-"?_153[0].charAt(0).toUpperCase()+_153[0].substring(1):_153[0];
for(var i=1;i<len;i++){
_155+=_153[i].charAt(0).toUpperCase()+_153[i].substring(1);
}
return _155;
},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(/_/,"-");
},inspect:function(_157){
var _158=this.replace(/\\/g,"\\\\");
if(_157){
return "\""+_158.replace(/"/g,"\\\"")+"\"";
}else{
return "'"+_158.replace(/'/g,"\\'")+"'";
}
}});
String.prototype.gsub.prepareReplacement=function(_159){
if(typeof _159=="function"){
return _159;
}
var _15a=new Template(_159);
return function(_15b){
return _15a.evaluate(_15b);
};
};
String.prototype.parseQuery=String.prototype.toQueryParams;
var Template=Class.create();
Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
Template.prototype={initialize:function(_15c,_15d){
this.template=_15c.toString();
this.pattern=_15d||Template.Pattern;
},evaluate:function(_15e){
return this.template.gsub(this.pattern,function(_15f){
var _160=_15f[1];
if(_160=="\\"){
return _15f[2];
}
return _160+String.interpret(_15e[_15f[3]]);
});
}};
var $break=new Object();
var $continue=new Object();
var Enumerable={each:function(_161){
var _162=0;
try{
this._each(function(_163){
try{
_161(_163,_162++);
}
catch(e){
if(e!=$continue){
throw e;
}
}
});
}
catch(e){
if(e!=$break){
throw e;
}
}
return this;
},eachSlice:function(_164,_165){
var _166=-_164,_167=[],_168=this.toArray();
while((_166+=_164)<_168.length){
_167.push(_168.slice(_166,_166+_164));
}
return _167.map(_165);
},all:function(_169){
var _16a=true;
this.each(function(_16b,_16c){
_16a=_16a&&!!(_169||Prototype.K)(_16b,_16c);
if(!_16a){
throw $break;
}
});
return _16a;
},any:function(_16d){
var _16e=false;
this.each(function(_16f,_170){
if(_16e=!!(_16d||Prototype.K)(_16f,_170)){
throw $break;
}
});
return _16e;
},collect:function(_171){
var _172=[];
this.each(function(_173,_174){
_172.push((_171||Prototype.K)(_173,_174));
});
return _172;
},detect:function(_175){
var _176;
this.each(function(_177,_178){
if(_175(_177,_178)){
_176=_177;
throw $break;
}
});
return _176;
},findAll:function(_179){
var _17a=[];
this.each(function(_17b,_17c){
if(_179(_17b,_17c)){
_17a.push(_17b);
}
});
return _17a;
},grep:function(_17d,_17e){
var _17f=[];
this.each(function(_180,_181){
var _182=_180.toString();
if(_182.match(_17d)){
_17f.push((_17e||Prototype.K)(_180,_181));
}
});
return _17f;
},include:function(_183){
var _184=false;
this.each(function(_185){
if(_185==_183){
_184=true;
throw $break;
}
});
return _184;
},inGroupsOf:function(_186,_187){
_187=_187===undefined?null:_187;
return this.eachSlice(_186,function(_188){
while(_188.length<_186){
_188.push(_187);
}
return _188;
});
},inject:function(memo,_18a){
this.each(function(_18b,_18c){
memo=_18a(memo,_18b,_18c);
});
return memo;
},invoke:function(_18d){
var args=$A(arguments).slice(1);
return this.map(function(_18f){
return _18f[_18d].apply(_18f,args);
});
},max:function(_190){
var _191;
this.each(function(_192,_193){
_192=(_190||Prototype.K)(_192,_193);
if(_191==undefined||_192>=_191){
_191=_192;
}
});
return _191;
},min:function(_194){
var _195;
this.each(function(_196,_197){
_196=(_194||Prototype.K)(_196,_197);
if(_195==undefined||_196<_195){
_195=_196;
}
});
return _195;
},partition:function(_198){
var _199=[],_19a=[];
this.each(function(_19b,_19c){
((_198||Prototype.K)(_19b,_19c)?_199:_19a).push(_19b);
});
return [_199,_19a];
},pluck:function(_19d){
var _19e=[];
this.each(function(_19f,_1a0){
_19e.push(_19f[_19d]);
});
return _19e;
},reject:function(_1a1){
var _1a2=[];
this.each(function(_1a3,_1a4){
if(!_1a1(_1a3,_1a4)){
_1a2.push(_1a3);
}
});
return _1a2;
},sortBy:function(_1a5){
return this.map(function(_1a6,_1a7){
return {value:_1a6,criteria:_1a5(_1a6,_1a7)};
}).sort(function(left,_1a9){
var a=left.criteria,b=_1a9.criteria;
return a<b?-1:a>b?1:0;
}).pluck("value");
},toArray:function(){
return this.map();
},zip:function(){
var _1ac=Prototype.K,args=$A(arguments);
if(typeof args.last()=="function"){
_1ac=args.pop();
}
var _1ae=[this].concat(args).map($A);
return this.map(function(_1af,_1b0){
return _1ac(_1ae.pluck(_1b0));
});
},size:function(){
return this.toArray().length;
},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(_1b1){
if(!_1b1){
return [];
}
if(_1b1.toArray){
return _1b1.toArray();
}else{
var _1b2=[];
for(var i=0,_1b4=_1b1.length;i<_1b4;i++){
_1b2.push(_1b1[i]);
}
return _1b2;
}
};
Object.extend(Array.prototype,Enumerable);
if(!Array.prototype._reverse){
Array.prototype._reverse=Array.prototype.reverse;
}
Object.extend(Array.prototype,{_each:function(_1b5){
for(var i=0,_1b7=this.length;i<_1b7;i++){
_1b5(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(_1b8){
return _1b8!=null;
});
},flatten:function(){
return this.inject([],function(_1b9,_1ba){
return _1b9.concat(_1ba&&_1ba.constructor==Array?_1ba.flatten():[_1ba]);
});
},without:function(){
var _1bb=$A(arguments);
return this.select(function(_1bc){
return !_1bb.include(_1bc);
});
},indexOf:function(_1bd){
for(var i=0,_1bf=this.length;i<_1bf;i++){
if(this[i]==_1bd){
return i;
}
}
return -1;
},reverse:function(_1c0){
return (_1c0!==false?this:this.toArray())._reverse();
},reduce:function(){
return this.length>1?this:this[0];
},uniq:function(){
return this.inject([],function(_1c1,_1c2){
return _1c1.include(_1c2)?_1c1:_1c1.concat([_1c2]);
});
},clone:function(){
return [].concat(this);
},size:function(){
return this.length;
},inspect:function(){
return "["+this.map(Object.inspect).join(", ")+"]";
}});
Array.prototype.toArray=Array.prototype.clone;
function $w(_1c3){
_1c3=_1c3.strip();
return _1c3?_1c3.split(/\s+/):[];
}
if(window.opera){
Array.prototype.concat=function(){
var _1c4=[];
for(var i=0,_1c6=this.length;i<_1c6;i++){
_1c4.push(this[i]);
}
for(var i=0,_1c6=arguments.length;i<_1c6;i++){
if(arguments[i].constructor==Array){
for(var j=0,_1c8=arguments[i].length;j<_1c8;j++){
_1c4.push(arguments[i][j]);
}
}else{
_1c4.push(arguments[i]);
}
}
return _1c4;
};
}
var Hash=function(obj){
Object.extend(this,obj||{});
};
Object.extend(Hash,{toQueryString:function(obj){
var _1cb=[];
this.prototype._each.call(obj,function(pair){
if(!pair.key){
return;
}
if(pair.value&&pair.value.constructor==Array){
var _1cd=pair.value.compact();
if(_1cd.length<2){
pair.value=_1cd.reduce();
}else{
key=encodeURIComponent(pair.key);
_1cd.each(function(_1ce){
_1ce=_1ce!=undefined?encodeURIComponent(_1ce):"";
_1cb.push(key+"="+encodeURIComponent(_1ce));
});
return;
}
}
if(pair.value==undefined){
pair[1]="";
}
_1cb.push(pair.map(encodeURIComponent).join("="));
});
return _1cb.join("&");
}});
Object.extend(Hash.prototype,Enumerable);
Object.extend(Hash.prototype,{_each:function(_1cf){
for(var key in this){
var _1d1=this[key];
if(_1d1&&_1d1==Hash.prototype[key]){
continue;
}
var pair=[key,_1d1];
pair.key=key;
pair.value=_1d1;
_1cf(pair);
}
},keys:function(){
return this.pluck("key");
},values:function(){
return this.pluck("value");
},merge:function(hash){
return $H(hash).inject(this,function(_1d4,pair){
_1d4[pair.key]=pair.value;
return _1d4;
});
},remove:function(){
var _1d6;
for(var i=0,_1d8=arguments.length;i<_1d8;i++){
var _1d9=this[arguments[i]];
if(_1d9!==undefined){
if(_1d6===undefined){
_1d6=_1d9;
}else{
if(_1d6.constructor!=Array){
_1d6=[_1d6];
}
_1d6.push(_1d9);
}
}
delete this[arguments[i]];
}
return _1d6;
},toQueryString:function(){
return Hash.toQueryString(this);
},inspect:function(){
return "#<Hash:{"+this.map(function(pair){
return pair.map(Object.inspect).join(": ");
}).join(", ")+"}>";
}});
function $H(_1db){
if(_1db&&_1db.constructor==Hash){
return _1db;
}
return new Hash(_1db);
}
ObjectRange=Class.create();
Object.extend(ObjectRange.prototype,Enumerable);
Object.extend(ObjectRange.prototype,{initialize:function(_1dc,end,_1de){
this.start=_1dc;
this.end=end;
this.exclusive=_1de;
},_each:function(_1df){
var _1e0=this.start;
while(this.include(_1e0)){
_1df(_1e0);
_1e0=_1e0.succ();
}
},include:function(_1e1){
if(_1e1<this.start){
return false;
}
if(this.exclusive){
return _1e1<this.end;
}
return _1e1<=this.end;
}});
var $R=function(_1e2,end,_1e4){
return new ObjectRange(_1e2,end,_1e4);
};
var Ajax={getTransport:function(){
return Try.these(function(){
return new XMLHttpRequest();
},function(){
return new ActiveXObject("Msxml2.XMLHTTP");
},function(){
return new ActiveXObject("Microsoft.XMLHTTP");
})||false;
},activeRequestCount:0};
Ajax.Responders={responders:[],_each:function(_1e5){
this.responders._each(_1e5);
},register:function(_1e6){
if(!this.include(_1e6)){
this.responders.push(_1e6);
}
},unregister:function(_1e7){
this.responders=this.responders.without(_1e7);
},dispatch:function(_1e8,_1e9,_1ea,json){
this.each(function(_1ec){
if(typeof _1ec[_1e8]=="function"){
try{
_1ec[_1e8].apply(_1ec,[_1e9,_1ea,json]);
}
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(_1ed){
this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:""};
Object.extend(this.options,_1ed||{});
this.options.method=this.options.method.toLowerCase();
if(typeof this.options.parameters=="string"){
this.options.parameters=this.options.parameters.toQueryParams();
}
}};
Ajax.Request=Class.create();
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Request.prototype=Object.extend(new Ajax.Base(),{_complete:false,initialize:function(url,_1ef){
this.transport=Ajax.getTransport();
this.setOptions(_1ef);
this.request(url);
},request:function(url){
this.url=url;
this.method=this.options.method;
var _1f1=this.options.parameters;
if(!["get","post"].include(this.method)){
_1f1["_method"]=this.method;
this.method="post";
}
_1f1=Hash.toQueryString(_1f1);
if(_1f1&&/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
_1f1+="&_=";
}
if(this.method=="get"&&_1f1){
this.url+=(this.url.indexOf("?")>-1?"&":"?")+_1f1;
}
try{
Ajax.Responders.dispatch("onCreate",this,this.transport);
this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);
if(this.options.asynchronous){
setTimeout(function(){
this.respondToReadyState(1);
}.bind(this),10);
}
this.transport.onreadystatechange=this.onStateChange.bind(this);
this.setRequestHeaders();
var body=this.method=="post"?(this.options.postBody||_1f1):null;
this.transport.send(body);
if(!this.options.asynchronous&&this.transport.overrideMimeType){
this.onStateChange();
}
}
catch(e){
this.dispatchException(e);
}
},onStateChange:function(){
var _1f3=this.transport.readyState;
if(_1f3>1&&!((_1f3==4)&&this._complete)){
this.respondToReadyState(this.transport.readyState);
}
},setRequestHeaders:function(){
var _1f4={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};
if(this.method=="post"){
_1f4["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");
if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){
_1f4["Connection"]="close";
}
}
if(typeof this.options.requestHeaders=="object"){
var _1f5=this.options.requestHeaders;
if(typeof _1f5.push=="function"){
for(var i=0,_1f7=_1f5.length;i<_1f7;i+=2){
_1f4[_1f5[i]]=_1f5[i+1];
}
}else{
$H(_1f5).each(function(pair){
_1f4[pair.key]=pair.value;
});
}
}
for(var name in _1f4){
this.transport.setRequestHeader(name,_1f4[name]);
}
},success:function(){
return !this.transport.status||(this.transport.status>=200&&this.transport.status<300);
},respondToReadyState:function(_1fa){
var _1fb=Ajax.Request.Events[_1fa];
var _1fc=this.transport,json=this.evalJSON();
if(_1fb=="Complete"){
try{
this._complete=true;
(this.options["on"+this.transport.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(_1fc,json);
}
catch(e){
this.dispatchException(e);
}
if((this.getHeader("Content-type")||"text/javascript").strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)){
this.evalResponse();
}
}
try{
(this.options["on"+_1fb]||Prototype.emptyFunction)(_1fc,json);
Ajax.Responders.dispatch("on"+_1fb,this,_1fc,json);
}
catch(e){
this.dispatchException(e);
}
if(_1fb=="Complete"){
this.transport.onreadystatechange=Prototype.emptyFunction;
}
},getHeader:function(name){
try{
return this.transport.getResponseHeader(name);
}
catch(e){
return null;
}
},evalJSON:function(){
try{
var json=this.getHeader("X-JSON");
return json?eval("("+json+")"):null;
}
catch(e){
return null;
}
},evalResponse:function(){
try{
return eval(this.transport.responseText);
}
catch(e){
this.dispatchException(e);
}
},dispatchException:function(_200){
(this.options.onException||Prototype.emptyFunction)(this,_200);
Ajax.Responders.dispatch("onException",this,_200);
}});
Ajax.Updater=Class.create();
Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_201,url,_203){
this.container={success:(_201.success||_201),failure:(_201.failure||(_201.success?null:_201))};
this.transport=Ajax.getTransport();
this.setOptions(_203);
var _204=this.options.onComplete||Prototype.emptyFunction;
this.options.onComplete=(function(_205,_206){
this.updateContent();
_204(_205,_206);
}).bind(this);
this.request(url);
},updateContent:function(){
var _207=this.container[this.success()?"success":"failure"];
var _208=this.transport.responseText;
if(!this.options.evalScripts){
_208=_208.stripScripts();
}
if(_207=$(_207)){
if(this.options.insertion){
new this.options.insertion(_207,_208);
}else{
_207.update(_208);
}
}
if(this.success()){
if(this.onComplete){
setTimeout(this.onComplete.bind(this),10);
}
}
}});
Ajax.PeriodicalUpdater=Class.create();
Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(_209,url,_20b){
this.setOptions(_20b);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=_209;
this.url=url;
this.start();
},start:function(){
this.options.onComplete=this.updateComplete.bind(this);
this.onTimerEvent();
},stop:function(){
this.updater.options.onComplete=undefined;
clearTimeout(this.timer);
(this.onComplete||Prototype.emptyFunction).apply(this,arguments);
},updateComplete:function(_20c){
if(this.options.decay){
this.decay=(_20c.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=_20c.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);
}});
function $(_20d){
if(arguments.length>1){
for(var i=0,_20f=[],_210=arguments.length;i<_210;i++){
_20f.push($(arguments[i]));
}
return _20f;
}
if(typeof _20d=="string"){
_20d=document.getElementById(_20d);
}
return Element.extend(_20d);
}
if(Prototype.BrowserFeatures.XPath){
document._getElementsByXPath=function(_211,_212){
var _213=[];
var _214=document.evaluate(_211,$(_212)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for(var i=0,_216=_214.snapshotLength;i<_216;i++){
_213.push(_214.snapshotItem(i));
}
return _213;
};
}
document.getElementsByClassName=function(_217,_218){
if(Prototype.BrowserFeatures.XPath){
var q=".//*[contains(concat(' ', @class, ' '), ' "+_217+" ')]";
return document._getElementsByXPath(q,_218);
}else{
var _21a=($(_218)||document.body).getElementsByTagName("*");
var _21b=[],_21c;
for(var i=0,_21e=_21a.length;i<_21e;i++){
_21c=_21a[i];
if(Element.hasClassName(_21c,_217)){
_21b.push(Element.extend(_21c));
}
}
return _21b;
}
};
if(!window.Element){
var Element=new Object();
}
Element.extend=function(_21f){
if(!_21f||_nativeExtensions||_21f.nodeType==3){
return _21f;
}
if(!_21f._extended&&_21f.tagName&&_21f!=window){
var _220=Object.clone(Element.Methods),_221=Element.extend.cache;
if(_21f.tagName=="FORM"){
Object.extend(_220,Form.Methods);
}
if(["INPUT","TEXTAREA","SELECT"].include(_21f.tagName)){
Object.extend(_220,Form.Element.Methods);
}
Object.extend(_220,Element.Methods.Simulated);
for(var _222 in _220){
var _223=_220[_222];
if(typeof _223=="function"&&!(_222 in _21f)){
_21f[_222]=_221.findOrStore(_223);
}
}
}
_21f._extended=true;
return _21f;
};
Element.extend.cache={findOrStore:function(_224){
return this[_224]=this[_224]||function(){
return _224.apply(null,[this].concat($A(arguments)));
};
}};
Element.Methods={visible:function(_225){
return $(_225).style.display!="none";
},toggle:function(_226){
_226=$(_226);
Element[Element.visible(_226)?"hide":"show"](_226);
return _226;
},hide:function(_227){
$(_227).style.display="none";
return _227;
},show:function(_228){
$(_228).style.display="";
return _228;
},remove:function(_229){
_229=$(_229);
_229.parentNode.removeChild(_229);
return _229;
},update:function(_22a,html){
html=typeof html=="undefined"?"":html.toString();
$(_22a).innerHTML=html.stripScripts();
setTimeout(function(){
html.evalScripts();
},10);
return _22a;
},replace:function(_22c,html){
_22c=$(_22c);
html=typeof html=="undefined"?"":html.toString();
if(_22c.outerHTML){
_22c.outerHTML=html.stripScripts();
}else{
var _22e=_22c.ownerDocument.createRange();
_22e.selectNodeContents(_22c);
_22c.parentNode.replaceChild(_22e.createContextualFragment(html.stripScripts()),_22c);
}
setTimeout(function(){
html.evalScripts();
},10);
return _22c;
},inspect:function(_22f){
_22f=$(_22f);
var _230="<"+_22f.tagName.toLowerCase();
$H({"id":"id","className":"class"}).each(function(pair){
var _232=pair.first(),_233=pair.last();
var _234=(_22f[_232]||"").toString();
if(_234){
_230+=" "+_233+"="+_234.inspect(true);
}
});
return _230+">";
},recursivelyCollect:function(_235,_236){
_235=$(_235);
var _237=[];
while(_235=_235[_236]){
if(_235.nodeType==1){
_237.push(Element.extend(_235));
}
}
return _237;
},ancestors:function(_238){
return $(_238).recursivelyCollect("parentNode");
},descendants:function(_239){
return $A($(_239).getElementsByTagName("*"));
},immediateDescendants:function(_23a){
if(!(_23a=$(_23a).firstChild)){
return [];
}
while(_23a&&_23a.nodeType!=1){
_23a=_23a.nextSibling;
}
if(_23a){
return [_23a].concat($(_23a).nextSiblings());
}
return [];
},previousSiblings:function(_23b){
return $(_23b).recursivelyCollect("previousSibling");
},nextSiblings:function(_23c){
return $(_23c).recursivelyCollect("nextSibling");
},siblings:function(_23d){
_23d=$(_23d);
return _23d.previousSiblings().reverse().concat(_23d.nextSiblings());
},match:function(_23e,_23f){
if(typeof _23f=="string"){
_23f=new Selector(_23f);
}
return _23f.match($(_23e));
},up:function(_240,_241,_242){
return Selector.findElement($(_240).ancestors(),_241,_242);
},down:function(_243,_244,_245){
return Selector.findElement($(_243).descendants(),_244,_245);
},previous:function(_246,_247,_248){
return Selector.findElement($(_246).previousSiblings(),_247,_248);
},next:function(_249,_24a,_24b){
return Selector.findElement($(_249).nextSiblings(),_24a,_24b);
},getElementsBySelector:function(){
var args=$A(arguments),_24d=$(args.shift());
return Selector.findChildElements(_24d,args);
},getElementsByClassName:function(_24e,_24f){
return document.getElementsByClassName(_24f,_24e);
},readAttribute:function(_250,name){
_250=$(_250);
if(document.all&&!window.opera){
var t=Element._attributeTranslations;
if(t.values[name]){
return t.values[name](_250,name);
}
if(t.names[name]){
name=t.names[name];
}
var _253=_250.attributes[name];
if(_253){
return _253.nodeValue;
}
}
return _250.getAttribute(name);
},getHeight:function(_254){
return $(_254).getDimensions().height;
},getWidth:function(_255){
return $(_255).getDimensions().width;
},classNames:function(_256){
return new Element.ClassNames(_256);
},hasClassName:function(_257,_258){
if(!(_257=$(_257))){
return;
}
var _259=_257.className;
if(_259.length==0){
return false;
}
if(_259==_258||_259.match(new RegExp("(^|\\s)"+_258+"(\\s|$)"))){
return true;
}
return false;
},addClassName:function(_25a,_25b){
if(!(_25a=$(_25a))){
return;
}
Element.classNames(_25a).add(_25b);
return _25a;
},removeClassName:function(_25c,_25d){
if(!(_25c=$(_25c))){
return;
}
Element.classNames(_25c).remove(_25d);
return _25c;
},toggleClassName:function(_25e,_25f){
if(!(_25e=$(_25e))){
return;
}
Element.classNames(_25e)[_25e.hasClassName(_25f)?"remove":"add"](_25f);
return _25e;
},observe:function(){
Event.observe.apply(Event,arguments);
return $A(arguments).first();
},stopObserving:function(){
Event.stopObserving.apply(Event,arguments);
return $A(arguments).first();
},cleanWhitespace:function(_260){
_260=$(_260);
var node=_260.firstChild;
while(node){
var _262=node.nextSibling;
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
_260.removeChild(node);
}
node=_262;
}
return _260;
},empty:function(_263){
return $(_263).innerHTML.match(/^\s*$/);
},descendantOf:function(_264,_265){
_264=$(_264),_265=$(_265);
while(_264=_264.parentNode){
if(_264==_265){
return true;
}
}
return false;
},scrollTo:function(_266){
_266=$(_266);
var pos=Position.cumulativeOffset(_266);
window.scrollTo(pos[0],pos[1]);
return _266;
},getStyle:function(_268,_269){
_268=$(_268);
if(["float","cssFloat"].include(_269)){
_269=(typeof _268.style.styleFloat!="undefined"?"styleFloat":"cssFloat");
}
_269=_269.camelize();
var _26a=_268.style[_269];
if(!_26a){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_268,null);
_26a=css?css[_269]:null;
}else{
if(_268.currentStyle){
_26a=_268.currentStyle[_269];
}
}
}
if((_26a=="auto")&&["width","height"].include(_269)&&(_268.getStyle("display")!="none")){
_26a=_268["offset"+_269.capitalize()]+"px";
}
if(window.opera&&["left","top","right","bottom"].include(_269)){
if(Element.getStyle(_268,"position")=="static"){
_26a="auto";
}
}
if(_269=="opacity"){
if(_26a){
return parseFloat(_26a);
}
if(_26a=(_268.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){
if(_26a[1]){
return parseFloat(_26a[1])/100;
}
}
return 1;
}
return _26a=="auto"?null:_26a;
},setStyle:function(_26c,_26d){
_26c=$(_26c);
for(var name in _26d){
var _26f=_26d[name];
if(name=="opacity"){
if(_26f==1){
_26f=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1;
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_26c.style.filter=_26c.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"");
}
}else{
if(_26f===""){
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_26c.style.filter=_26c.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"");
}
}else{
if(_26f<0.00001){
_26f=0;
}
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_26c.style.filter=_26c.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+_26f*100+")";
}
}
}
}else{
if(["float","cssFloat"].include(name)){
name=(typeof _26c.style.styleFloat!="undefined")?"styleFloat":"cssFloat";
}
}
_26c.style[name.camelize()]=_26f;
}
return _26c;
},getDimensions:function(_270){
_270=$(_270);
var _271=$(_270).getStyle("display");
if(_271!="none"&&_271!=null){
return {width:_270.offsetWidth,height:_270.offsetHeight};
}
var els=_270.style;
var _273=els.visibility;
var _274=els.position;
var _275=els.display;
els.visibility="hidden";
els.position="absolute";
els.display="block";
var _276=_270.clientWidth;
var _277=_270.clientHeight;
els.display=_275;
els.position=_274;
els.visibility=_273;
return {width:_276,height:_277};
},makePositioned:function(_278){
_278=$(_278);
var pos=Element.getStyle(_278,"position");
if(pos=="static"||!pos){
_278._madePositioned=true;
_278.style.position="relative";
if(window.opera){
_278.style.top=0;
_278.style.left=0;
}
}
return _278;
},undoPositioned:function(_27a){
_27a=$(_27a);
if(_27a._madePositioned){
_27a._madePositioned=undefined;
_27a.style.position=_27a.style.top=_27a.style.left=_27a.style.bottom=_27a.style.right="";
}
return _27a;
},makeClipping:function(_27b){
_27b=$(_27b);
if(_27b._overflow){
return _27b;
}
_27b._overflow=_27b.style.overflow||"auto";
if((Element.getStyle(_27b,"overflow")||"visible")!="hidden"){
_27b.style.overflow="hidden";
}
return _27b;
},undoClipping:function(_27c){
_27c=$(_27c);
if(!_27c._overflow){
return _27c;
}
_27c.style.overflow=_27c._overflow=="auto"?"":_27c._overflow;
_27c._overflow=null;
return _27c;
}};
Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf});
Element._attributeTranslations={};
Element._attributeTranslations.names={colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc"};
Element._attributeTranslations.values={_getAttr:function(_27d,_27e){
return _27d.getAttribute(_27e,2);
},_flag:function(_27f,_280){
return $(_27f).hasAttribute(_280)?_280:null;
},style:function(_281){
return _281.style.cssText.toLowerCase();
},title:function(_282){
var node=_282.getAttributeNode("title");
return node.specified?node.nodeValue:null;
}};
Object.extend(Element._attributeTranslations.values,{href:Element._attributeTranslations.values._getAttr,src:Element._attributeTranslations.values._getAttr,disabled:Element._attributeTranslations.values._flag,checked:Element._attributeTranslations.values._flag,readonly:Element._attributeTranslations.values._flag,multiple:Element._attributeTranslations.values._flag});
Element.Methods.Simulated={hasAttribute:function(_284,_285){
var t=Element._attributeTranslations;
_285=t.names[_285]||_285;
return $(_284).getAttributeNode(_285).specified;
}};
if(document.all&&!window.opera){
Element.Methods.update=function(_287,html){
_287=$(_287);
html=typeof html=="undefined"?"":html.toString();
var _289=_287.tagName.toUpperCase();
if(["THEAD","TBODY","TR","TD"].include(_289)){
var div=document.createElement("div");
switch(_289){
case "THEAD":
case "TBODY":
div.innerHTML="<table><tbody>"+html.stripScripts()+"</tbody></table>";
depth=2;
break;
case "TR":
div.innerHTML="<table><tbody><tr>"+html.stripScripts()+"</tr></tbody></table>";
depth=3;
break;
case "TD":
div.innerHTML="<table><tbody><tr><td>"+html.stripScripts()+"</td></tr></tbody></table>";
depth=4;
}
$A(_287.childNodes).each(function(node){
_287.removeChild(node);
});
depth.times(function(){
div=div.firstChild;
});
$A(div.childNodes).each(function(node){
_287.appendChild(node);
});
}else{
_287.innerHTML=html.stripScripts();
}
setTimeout(function(){
html.evalScripts();
},10);
return _287;
};
}
Object.extend(Element,Element.Methods);
var _nativeExtensions=false;
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
["","Form","Input","TextArea","Select"].each(function(tag){
var _28e="HTML"+tag+"Element";
if(window[_28e]){
return;
}
var _28f=window[_28e]={};
_28f.prototype=document.createElement(tag?tag.toLowerCase():"div").__proto__;
});
}
Element.addMethods=function(_290){
Object.extend(Element.Methods,_290||{});
function copy(_291,_292,_293){
_293=_293||false;
var _294=Element.extend.cache;
for(var _295 in _291){
var _296=_291[_295];
if(!_293||!(_295 in _292)){
_292[_295]=_294.findOrStore(_296);
}
}
}
if(typeof HTMLElement!="undefined"){
copy(Element.Methods,HTMLElement.prototype);
copy(Element.Methods.Simulated,HTMLElement.prototype,true);
copy(Form.Methods,HTMLFormElement.prototype);
[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(_297){
copy(Form.Element.Methods,_297.prototype);
});
_nativeExtensions=true;
}
};
var Toggle=new Object();
Toggle.display=Element.toggle;
Abstract.Insertion=function(_298){
this.adjacency=_298;
};
Abstract.Insertion.prototype={initialize:function(_299,_29a){
this.element=$(_299);
this.content=_29a.stripScripts();
if(this.adjacency&&this.element.insertAdjacentHTML){
try{
this.element.insertAdjacentHTML(this.adjacency,this.content);
}
catch(e){
var _29b=this.element.tagName.toUpperCase();
if(["TBODY","TR"].include(_29b)){
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(){
_29a.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(_29d){
_29d.each((function(_29e){
this.element.parentNode.insertBefore(_29e,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(_29f){
_29f.reverse(false).each((function(_2a0){
this.element.insertBefore(_2a0,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(_2a1){
_2a1.each((function(_2a2){
this.element.appendChild(_2a2);
}).bind(this));
}});
Insertion.After=Class.create();
Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){
this.range.setStartAfter(this.element);
},insertContent:function(_2a3){
_2a3.each((function(_2a4){
this.element.parentNode.insertBefore(_2a4,this.element.nextSibling);
}).bind(this));
}});
Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(_2a5){
this.element=$(_2a5);
},_each:function(_2a6){
this.element.className.split(/\s+/).select(function(name){
return name.length>0;
})._each(_2a6);
},set:function(_2a8){
this.element.className=_2a8;
},add:function(_2a9){
if(this.include(_2a9)){
return;
}
this.set($A(this).concat(_2a9).join(" "));
},remove:function(_2aa){
if(!this.include(_2aa)){
return;
}
this.set($A(this).without(_2aa).join(" "));
},toString:function(){
return $A(this).join(" ");
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
var Selector=Class.create();
Selector.prototype={initialize:function(_2ab){
this.params={classNames:[]};
this.expression=_2ab.toString().strip();
this.parseExpression();
this.compileMatcher();
},parseExpression:function(){
function abort(_2ac){
throw "Parse error in selector: "+_2ac;
}
if(this.expression==""){
abort("empty expression");
}
var _2ad=this.params,expr=this.expression,_2af,_2b0,_2b1,rest;
while(_2af=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){
_2ad.attributes=_2ad.attributes||[];
_2ad.attributes.push({name:_2af[2],operator:_2af[3],value:_2af[4]||_2af[5]||""});
expr=_2af[1];
}
if(expr=="*"){
return this.params.wildcard=true;
}
while(_2af=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){
_2b0=_2af[1],_2b1=_2af[2],rest=_2af[3];
switch(_2b0){
case "#":
_2ad.id=_2b1;
break;
case ".":
_2ad.classNames.push(_2b1);
break;
case "":
case undefined:
_2ad.tagName=_2b1.toUpperCase();
break;
default:
abort(expr.inspect());
}
expr=rest;
}
if(expr.length>0){
abort(expr.inspect());
}
},buildMatchExpression:function(){
var _2b3=this.params,_2b4=[],_2b5;
if(_2b3.wildcard){
_2b4.push("true");
}
if(_2b5=_2b3.id){
_2b4.push("element.readAttribute(\"id\") == "+_2b5.inspect());
}
if(_2b5=_2b3.tagName){
_2b4.push("element.tagName.toUpperCase() == "+_2b5.inspect());
}
if((_2b5=_2b3.classNames).length>0){
for(var i=0,_2b7=_2b5.length;i<_2b7;i++){
_2b4.push("element.hasClassName("+_2b5[i].inspect()+")");
}
}
if(_2b5=_2b3.attributes){
_2b5.each(function(_2b8){
var _2b9="element.readAttribute("+_2b8.name.inspect()+")";
var _2ba=function(_2bb){
return _2b9+" && "+_2b9+".split("+_2bb.inspect()+")";
};
switch(_2b8.operator){
case "=":
_2b4.push(_2b9+" == "+_2b8.value.inspect());
break;
case "~=":
_2b4.push(_2ba(" ")+".include("+_2b8.value.inspect()+")");
break;
case "|=":
_2b4.push(_2ba("-")+".first().toUpperCase() == "+_2b8.value.toUpperCase().inspect());
break;
case "!=":
_2b4.push(_2b9+" != "+_2b8.value.inspect());
break;
case "":
case undefined:
_2b4.push("element.hasAttribute("+_2b8.name.inspect()+")");
break;
default:
throw "Unknown operator "+_2b8.operator+" in selector";
}
});
}
return _2b4.join(" && ");
},compileMatcher:function(){
this.match=new Function("element","if (!element.tagName) return false;       element = $(element);       return "+this.buildMatchExpression());
},findElements:function(_2bc){
var _2bd;
if(_2bd=$(this.params.id)){
if(this.match(_2bd)){
if(!_2bc||Element.childOf(_2bd,_2bc)){
return [_2bd];
}
}
}
_2bc=(_2bc||document).getElementsByTagName(this.params.tagName||"*");
var _2be=[];
for(var i=0,_2c0=_2bc.length;i<_2c0;i++){
if(this.match(_2bd=_2bc[i])){
_2be.push(Element.extend(_2bd));
}
}
return _2be;
},toString:function(){
return this.expression;
}};
Object.extend(Selector,{matchElements:function(_2c1,_2c2){
var _2c3=new Selector(_2c2);
return _2c1.select(_2c3.match.bind(_2c3)).map(Element.extend);
},findElement:function(_2c4,_2c5,_2c6){
if(typeof _2c5=="number"){
_2c6=_2c5,_2c5=false;
}
return Selector.matchElements(_2c4,_2c5||"*")[_2c6||0];
},findChildElements:function(_2c7,_2c8){
return _2c8.map(function(_2c9){
return _2c9.match(/[^\s"]+(?:"[^"]*"[^\s"]+)*/g).inject([null],function(_2ca,expr){
var _2cc=new Selector(expr);
return _2ca.inject([],function(_2cd,_2ce){
return _2cd.concat(_2cc.findElements(_2ce||_2c7));
});
});
}).flatten();
}});
function $$(){
return Selector.findChildElements(document,$A(arguments));
}
var Form={reset:function(form){
$(form).reset();
return form;
},serializeElements:function(_2d0,_2d1){
var data=_2d0.inject({},function(_2d3,_2d4){
if(!_2d4.disabled&&_2d4.name){
var key=_2d4.name,_2d6=$(_2d4).getValue();
if(_2d6!=undefined){
if(_2d3[key]){
if(_2d3[key].constructor!=Array){
_2d3[key]=[_2d3[key]];
}
_2d3[key].push(_2d6);
}else{
_2d3[key]=_2d6;
}
}
}
return _2d3;
});
return _2d1?data:Hash.toQueryString(data);
}};
Form.Methods={serialize:function(form,_2d8){
return Form.serializeElements(Form.getElements(form),_2d8);
},getElements:function(form){
return $A($(form).getElementsByTagName("*")).inject([],function(_2da,_2db){
if(Form.Element.Serializers[_2db.tagName.toLowerCase()]){
_2da.push(Element.extend(_2db));
}
return _2da;
});
},getInputs:function(form,_2dd,name){
form=$(form);
var _2df=form.getElementsByTagName("input");
if(!_2dd&&!name){
return $A(_2df).map(Element.extend);
}
for(var i=0,_2e1=[],_2e2=_2df.length;i<_2e2;i++){
var _2e3=_2df[i];
if((_2dd&&_2e3.type!=_2dd)||(name&&_2e3.name!=name)){
continue;
}
_2e1.push(Element.extend(_2e3));
}
return _2e1;
},disable:function(form){
form=$(form);
form.getElements().each(function(_2e5){
_2e5.blur();
_2e5.disabled="true";
});
return form;
},enable:function(form){
form=$(form);
form.getElements().each(function(_2e7){
_2e7.disabled="";
});
return form;
},findFirstElement:function(form){
return $(form).getElements().find(function(_2e9){
return _2e9.type!="hidden"&&!_2e9.disabled&&["input","select","textarea"].include(_2e9.tagName.toLowerCase());
});
},focusFirstElement:function(form){
form=$(form);
form.findFirstElement().activate();
return form;
}};
Object.extend(Form,Form.Methods);
Form.Element={focus:function(_2eb){
$(_2eb).focus();
return _2eb;
},select:function(_2ec){
$(_2ec).select();
return _2ec;
}};
Form.Element.Methods={serialize:function(_2ed){
_2ed=$(_2ed);
if(!_2ed.disabled&&_2ed.name){
var _2ee=_2ed.getValue();
if(_2ee!=undefined){
var pair={};
pair[_2ed.name]=_2ee;
return Hash.toQueryString(pair);
}
}
return "";
},getValue:function(_2f0){
_2f0=$(_2f0);
var _2f1=_2f0.tagName.toLowerCase();
return Form.Element.Serializers[_2f1](_2f0);
},clear:function(_2f2){
$(_2f2).value="";
return _2f2;
},present:function(_2f3){
return $(_2f3).value!="";
},activate:function(_2f4){
_2f4=$(_2f4);
_2f4.focus();
if(_2f4.select&&(_2f4.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(_2f4.type))){
_2f4.select();
}
return _2f4;
},disable:function(_2f5){
_2f5=$(_2f5);
_2f5.disabled=true;
return _2f5;
},enable:function(_2f6){
_2f6=$(_2f6);
_2f6.blur();
_2f6.disabled=false;
return _2f6;
}};
Object.extend(Form.Element,Form.Element.Methods);
var Field=Form.Element;
var $F=Form.Element.getValue;
Form.Element.Serializers={input:function(_2f7){
switch(_2f7.type.toLowerCase()){
case "checkbox":
case "radio":
return Form.Element.Serializers.inputSelector(_2f7);
default:
return Form.Element.Serializers.textarea(_2f7);
}
},inputSelector:function(_2f8){
return _2f8.checked?_2f8.value:null;
},textarea:function(_2f9){
return _2f9.value;
},select:function(_2fa){
return this[_2fa.type=="select-one"?"selectOne":"selectMany"](_2fa);
},selectOne:function(_2fb){
var _2fc=_2fb.selectedIndex;
return _2fc>=0?this.optionValue(_2fb.options[_2fc]):null;
},selectMany:function(_2fd){
var _2fe,_2ff=_2fd.length;
if(!_2ff){
return null;
}
for(var i=0,_2fe=[];i<_2ff;i++){
var opt=_2fd.options[i];
if(opt.selected){
_2fe.push(this.optionValue(opt));
}
}
return _2fe;
},optionValue:function(opt){
return Element.extend(opt).hasAttribute("value")?opt.value:opt.text;
}};
Abstract.TimedObserver=function(){
};
Abstract.TimedObserver.prototype={initialize:function(_303,_304,_305){
this.frequency=_304;
this.element=$(_303);
this.callback=_305;
this.lastValue=this.getValue();
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
var _306=this.getValue();
var _307=("string"==typeof this.lastValue&&"string"==typeof _306?this.lastValue!=_306:String(this.lastValue)!=String(_306));
if(_307){
this.callback(this.element,_306);
this.lastValue=_306;
}
}};
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(_308,_309){
this.element=$(_308);
this.callback=_309;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){
this.registerFormCallbacks();
}else{
this.registerCallback(this.element);
}
},onElementEvent:function(){
var _30a=this.getValue();
if(this.lastValue!=_30a){
this.callback(this.element,_30a);
this.lastValue=_30a;
}
},registerFormCallbacks:function(){
Form.getElements(this.element).each(this.registerCallback.bind(this));
},registerCallback:function(_30b){
if(_30b.type){
switch(_30b.type.toLowerCase()){
case "checkbox":
case "radio":
Event.observe(_30b,"click",this.onElementEvent.bind(this));
break;
default:
Event.observe(_30b,"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,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(_30c){
return _30c.target||_30c.srcElement;
},isLeftClick:function(_30d){
return (((_30d.which)&&(_30d.which==1))||((_30d.button)&&(_30d.button==1)));
},pointerX:function(_30e){
return _30e.pageX||(_30e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_30f){
return _30f.pageY||(_30f.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stop:function(_310){
if(_310.preventDefault){
_310.preventDefault();
_310.stopPropagation();
}else{
_310.returnValue=false;
_310.cancelBubble=true;
}
},findElement:function(_311,_312){
var _313=Event.element(_311);
while(_313.parentNode&&(!_313.tagName||(_313.tagName.toUpperCase()!=_312.toUpperCase()))){
_313=_313.parentNode;
}
return _313;
},observers:false,_observeAndCache:function(_314,name,_316,_317){
if(!this.observers){
this.observers=[];
}
if(_314.addEventListener){
this.observers.push([_314,name,_316,_317]);
_314.addEventListener(name,_316,_317);
}else{
if(_314.attachEvent){
this.observers.push([_314,name,_316,_317]);
_314.attachEvent("on"+name,_316);
}
}
},unloadCache:function(){
if(!Event.observers){
return;
}
for(var i=0,_319=Event.observers.length;i<_319;i++){
Event.stopObserving.apply(this,Event.observers[i]);
Event.observers[i][0]=null;
}
Event.observers=false;
},observe:function(_31a,name,_31c,_31d){
_31a=$(_31a);
_31d=_31d||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_31a.attachEvent)){
name="keydown";
}
Event._observeAndCache(_31a,name,_31c,_31d);
},stopObserving:function(_31e,name,_320,_321){
_31e=$(_31e);
_321=_321||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_31e.detachEvent)){
name="keydown";
}
if(_31e.removeEventListener){
_31e.removeEventListener(name,_320,_321);
}else{
if(_31e.detachEvent){
try{
_31e.detachEvent("on"+name,_320);
}
catch(e){
}
}
}
}});
if(navigator.appVersion.match(/\bMSIE\b/)){
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(_322){
var _323=0,_324=0;
do{
_323+=_322.scrollTop||0;
_324+=_322.scrollLeft||0;
_322=_322.parentNode;
}while(_322);
return [_324,_323];
},cumulativeOffset:function(_325){
var _326=0,_327=0;
do{
_326+=_325.offsetTop||0;
_327+=_325.offsetLeft||0;
_325=_325.offsetParent;
}while(_325);
return [_327,_326];
},positionedOffset:function(_328){
var _329=0,_32a=0;
do{
_329+=_328.offsetTop||0;
_32a+=_328.offsetLeft||0;
_328=_328.offsetParent;
if(_328){
if(_328.tagName=="BODY"){
break;
}
var p=Element.getStyle(_328,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_328);
return [_32a,_329];
},offsetParent:function(_32c){
if(_32c.offsetParent){
return _32c.offsetParent;
}
if(_32c==document.body){
return _32c;
}
while((_32c=_32c.parentNode)&&_32c!=document.body){
if(Element.getStyle(_32c,"position")!="static"){
return _32c;
}
}
return document.body;
},within:function(_32d,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_32d,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_32d);
return (y>=this.offset[1]&&y<this.offset[1]+_32d.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_32d.offsetWidth);
},withinIncludingScrolloffsets:function(_330,x,y){
var _333=this.realOffset(_330);
this.xcomp=x+_333[0]-this.deltaX;
this.ycomp=y+_333[1]-this.deltaY;
this.offset=this.cumulativeOffset(_330);
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_330.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_330.offsetWidth);
},overlap:function(mode,_335){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset[1]+_335.offsetHeight)-this.ycomp)/_335.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset[0]+_335.offsetWidth)-this.xcomp)/_335.offsetWidth;
}
},page:function(_336){
var _337=0,_338=0;
var _339=_336;
do{
_337+=_339.offsetTop||0;
_338+=_339.offsetLeft||0;
if(_339.offsetParent==document.body){
if(Element.getStyle(_339,"position")=="absolute"){
break;
}
}
}while(_339=_339.offsetParent);
_339=_336;
do{
if(!window.opera||_339.tagName=="BODY"){
_337-=_339.scrollTop||0;
_338-=_339.scrollLeft||0;
}
}while(_339=_339.parentNode);
return [_338,_337];
},clone:function(_33a,_33b){
var _33c=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
_33a=$(_33a);
var p=Position.page(_33a);
_33b=$(_33b);
var _33e=[0,0];
var _33f=null;
if(Element.getStyle(_33b,"position")=="absolute"){
_33f=Position.offsetParent(_33b);
_33e=Position.page(_33f);
}
if(_33f==document.body){
_33e[0]-=document.body.offsetLeft;
_33e[1]-=document.body.offsetTop;
}
if(_33c.setLeft){
_33b.style.left=(p[0]-_33e[0]+_33c.offsetLeft)+"px";
}
if(_33c.setTop){
_33b.style.top=(p[1]-_33e[1]+_33c.offsetTop)+"px";
}
if(_33c.setWidth){
_33b.style.width=_33a.offsetWidth+"px";
}
if(_33c.setHeight){
_33b.style.height=_33a.offsetHeight+"px";
}
},absolutize:function(_340){
_340=$(_340);
if(_340.style.position=="absolute"){
return;
}
Position.prepare();
var _341=Position.positionedOffset(_340);
var top=_341[1];
var left=_341[0];
var _344=_340.clientWidth;
var _345=_340.clientHeight;
_340._originalLeft=left-parseFloat(_340.style.left||0);
_340._originalTop=top-parseFloat(_340.style.top||0);
_340._originalWidth=_340.style.width;
_340._originalHeight=_340.style.height;
_340.style.position="absolute";
_340.style.top=top+"px";
_340.style.left=left+"px";
_340.style.width=_344+"px";
_340.style.height=_345+"px";
},relativize:function(_346){
_346=$(_346);
if(_346.style.position=="relative"){
return;
}
Position.prepare();
_346.style.position="relative";
var top=parseFloat(_346.style.top||0)-(_346._originalTop||0);
var left=parseFloat(_346.style.left||0)-(_346._originalLeft||0);
_346.style.top=top+"px";
_346.style.left=left+"px";
_346.style.height=_346._originalHeight;
_346.style.width=_346._originalWidth;
}};
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
Position.cumulativeOffset=function(_349){
var _34a=0,_34b=0;
do{
_34a+=_349.offsetTop||0;
_34b+=_349.offsetLeft||0;
if(_349.offsetParent==document.body){
if(Element.getStyle(_349,"position")=="absolute"){
break;
}
}
_349=_349.offsetParent;
}while(_349);
return [_34b,_34a];
};
}
Element.addMethods();
function setHandy(_34c){
if($("mobil_znacky").selectedIndex!=0&&$("telefon_id").selectedIndex!=0){
_34c.style.display="none";
$("loaderGif").style.display="block";
$("stahuj-mobil").style.cursor="wait";
$("formTelefon").submit();
}
}
function updateMobileTypes(_34d){
var url="/direct/ajax/mobilTypy.php";
var pars="brand="+encodeURI(_34d);
var _350=new Ajax.Request(url,{method:"get",parameters:pars,onComplete:function(resp){
var _352=resp.responseText.parseJSON();
fillPhones(_352);
$("telefon_id").style.visibility="visible";
}});
}
function fillPhones(_353){
var _354=$("telefon_id");
if(_354.length>1){
dropOptions();
}
for(var i=0;i<_353.length;i++){
var _356=document.createElement("option");
_356.setAttribute("value",_353[i].id);
_356.appendChild(document.createTextNode(_353[i].name));
addOption(_354,_356);
}
}
function addOption(_357,_358){
try{
_357.add(_358,null);
}
catch(e){
_357.appendChild(_358);
}
}
function dropOptions(){
var _359=$("telefon_id");
var _35a=_359.childNodes;
var _35b=_35a.length;
for(var i=1;i<_35b;i++){
_359.removeChild(_359.childNodes[1]);
}
}
(function(){
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;
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[a.length]=v;
b=true;
}
}
}
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){
if(x){
if(x instanceof Array){
return s.array(x);
}
var a=["{"],b,f,i,v;
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.push(s.string(i),":",v);
b=true;
}
}
}
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(){
return s.object(this);
};
Array.prototype.toJSONString=function(){
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;
}
};
function toEroticSection(){
if(get_cookie("stahuj_er")){
return true;
}else{
if(confirm("Tato sekce obsahuje erotickou t\xe9matiku. Kliknit\xedm na tla\u010d\xedtko OK potvrzujete, \u017ee jste star\u0161\xed 18ti let!")){
set_cookie("stahuj_er",1,365,"/","","");
return true;
}else{
return false;
}
}
}
function get_cookie(name){
var _374=document.cookie.indexOf(name+"=");
var len=_374+name.length+1;
if((!_374)&&(name!=document.cookie.substring(0,name.length))){
return null;
}
if(_374==-1){
return null;
}
var end=document.cookie.indexOf(";",len);
if(end==-1){
end=document.cookie.length;
}
return unescape(document.cookie.substring(len,end));
}
function set_cookie(name,_378,_379,path,_37b,_37c){
var _37d=new Date();
_37d.setTime(_37d.getTime());
if(_379){
_379=_379*1000*60*60*24;
}
var _37e=new Date(_37d.getTime()+(_379));
document.cookie=name+"="+escape(_378)+((_379)?";expires="+_37e.toGMTString():"")+((path)?";path="+path:"")+((_37b)?";domain="+_37b:"")+((_37c)?";secure":"");
}


