function cpaint(){this.version="2.0.3";var a=[];a.debugging=-1;a.proxy_url="";a.transfer_mode="GET";a.async=true;a.response_type="OBJECT";a.persistent_connection=false;a.use_cpaint_api=true;var b=0;this.capable=function(){return(new cpaint_call(0,a,this.version)).test_ajax_capability()}();this.set_debug=function(d){if(typeof d=="boolean")a.debugging=d===true?1:0;else if(typeof d=="number")a.debugging=Math.round(d)};this.set_proxy_url=function(d){if(typeof d=="string")a.proxy_url=d};this.set_transfer_mode=
function(d){if(d.toUpperCase()=="GET"||d.toUpperCase()=="POST")a.transfer_mode=d.toUpperCase()};this.set_async=function(d){if(typeof d=="boolean")a.async=d};this.set_response_type=function(d){if(d.toUpperCase()=="TEXT"||d.toUpperCase()=="XML"||d.toUpperCase()=="OBJECT"||d.toUpperCase()=="E4X"||d.toUpperCase()=="JSON")a.response_type=d.toUpperCase()};this.set_persistent_connection=function(d){if(typeof d=="boolean")a.persistent_connection=d};this.set_use_cpaint_api=function(d){if(typeof d=="boolean")a.use_cpaint_api=
d};this.call=function(){var d=-1;if(a.persistent_connection==true&&__cpaint_stack[0]!=null)switch(__cpaint_stack[0].get_http_state()){case -1:d=0;c("no XMLHttpObject object to re-use for persistence, creating new one later",2);break;case 4:d=0;c("re-using the persistent connection",2);break;default:c("the persistent connection is in use - skipping this request",2)}else if(a.persistent_connection==true){d=0;__cpaint_stack[d]=new cpaint_call(d,a,this.version);c("no cpaint_call object available for re-use, created new one",
2)}else{d=b;__cpaint_stack[d]=new cpaint_call(d,a,this.version);c("no cpaint_call object created new one",2)}if(d!=-1){__cpaint_stack[d].set_client_callback(arguments[2]);a.proxy_url!=""?__cpaint_stack[d].call_proxy(arguments):__cpaint_stack[d].call_direct(arguments);b++;c("stack size: "+__cpaint_stack.length,2)}};var c=function(d,e){var l="[CPAINT Debug] ";if(e<1)l="[CPAINT Error] ";a.debugging>=e&&alert(l+d)}}var __cpaint_stack=[],__cpaint_transformer=new cpaint_transformer;
function cpaint_call(a,b,c){var d=[];d.debugging=b.debugging;d.proxy_url=b.proxy_url;d.transfer_mode=b.transfer_mode;d.async=b.async;d.response_type=b.response_type;d.persistent_connection=b.persistent_connection;d.use_cpaint_api=b.use_cpaint_api;var e=false,l;this.set_client_callback=function(h){if(typeof h=="function")l=h};this.get_http_state=function(){var h=-1;if(typeof e=="object")h=e.readyState;return h};this.call_direct=function(h){var p=h[0],w=h[1],r="",u=0;if(p=="SELF")p=document.location.href;
if(d.use_cpaint_api==true){for(u=3;u<h.length;u++)r+=typeof h[u]=="string"&&h[u]!=""&&h[u].search(/^\s+$/g)==-1&&!isNaN(h[u])&&isFinite(h[u])?"&cpaint_argument[]="+encodeURIComponent(JSON.stringify(Number(h[u]))):"&cpaint_argument[]="+encodeURIComponent(JSON.stringify(h[u]));r+="&cpaint_response_type="+d.response_type;if(d.transfer_mode=="GET")p=p.indexOf("?")!=-1?p+"&cpaint_function="+w+r:p+"?cpaint_function="+w+r;else r="cpaint_function="+w+r}else{for(u=3;u<h.length;u++)r+=u==3?encodeURIComponent(h[u]):
"&"+encodeURIComponent(h[u]);if(d.transfer_mode=="GET")p+=r}t();x('opening connection to "'+p+'"',1);e.open(d.transfer_mode,p,d.async);if(d.transfer_mode=="POST")try{e.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(C){x("POST cannot be completed due to incompatible browser.  Use GET as your request method.",0)}e.setRequestHeader("X-Powered-By","CPAINT v"+c+" :: http://sf.net/projects/cpaint");e.onreadystatechange=B;if(d.transfer_mode=="GET")e.send(null);else{x("sending query: "+
r,1);e.send(r)}d.async==true&&B()};this.call_proxy=function(h){var p=d.proxy_url,w=h[0],r=h[1],u="",C=0,L="cpaint_argument[]=";if(d.use_cpaint_api==false)L="";for(C=3;C<h.length;C++)u+=d.use_cpaint_api==true?typeof h[C]=="string"&&h[C]!=""&&h[C].search(/^\s+$/g)==-1&&!isNaN(h[C])&&isFinite(h[C])?encodeURIComponent(L+JSON.stringify(Number(h[C]))+"&"):encodeURIComponent(L+JSON.stringify(h[C])+"&"):encodeURIComponent(L+h[C]+"&");if(d.use_cpaint_api==true){u+=encodeURIComponent("&cpaint_function="+r);
u+=encodeURIComponent("&cpaint_responsetype="+d.response_type)}if(d.transfer_mode=="GET")p+="?cpaint_remote_url="+encodeURIComponent(w)+"&cpaint_remote_query="+u+"&cpaint_remote_method="+d.transfer_mode+"&cpaint_response_type="+d.response_type;else u="cpaint_remote_url="+encodeURIComponent(w)+"&cpaint_remote_query="+u+"&cpaint_remote_method="+d.transfer_mode+"&cpaint_response_type="+d.response_type;t();x('opening connection to proxy "'+p+'"',1);e.open(d.transfer_mode,p,d.async);if(d.transfer_mode==
"POST")try{e.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(H){x("POST cannot be completed due to incompatible browser.  Use GET as your request method.",0)}e.setRequestHeader("X-Powered-By","CPAINT v"+c);e.onreadystatechange=B;if(d.transfer_mode=="GET")e.send(null);else{x("sending query: "+u,1);e.send(u)}d.async==false&&B()};this.test_ajax_capability=function(){return t()};var t=function(){var h=false,p=false;if(d.persistent_connection==false){x("Using new connection object",
1);p=true}else{x("Using shared connection object.",1);if(typeof e!="object"){x("Getting new persistent connection object.",1);p=true}}if(p==true){try{e=new XMLHttpRequest}catch(w){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(r){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(u){e=null}}}if(e)h=true;else x("Could not create connection object",0)}e.readyState!=4&&e.abort();return h},B=function(){var h=null;if(e.readyState==4&&e.status==200){x(e.responseText,1);x("using response type "+d.response_type,
2);switch(d.response_type){case "XML":x(e.responseXML,2);h=__cpaint_transformer.xml_conversion(e.responseXML);break;case "OBJECT":h=__cpaint_transformer.object_conversion(e.responseXML);break;case "TEXT":h=__cpaint_transformer.text_conversion(e.responseText);break;case "E4X":h=__cpaint_transformer.e4x_conversion(e.responseText);break;case "JSON":h=__cpaint_transformer.json_conversion(e.responseText);break;default:x("invalid response type '"+response_type+"'",0)}h!=null&&typeof l=="function"&&l(h,
e.responseText);if(typeof a=="number"&&__cpaint_stack[a]&&d.persistent_connection==false)__cpaint_stack[a]=null}else e.readyState==4&&e.status!=200&&x("invalid HTTP response code '"+Number(e.status)+"'",0)},x=function(h,p){var w="[CPAINT Debug] ";if(d.debugging<1)w="[CPAINT Error] ";d.debugging>=p&&alert(w+h)}}
function cpaint_transformer(){this.object_conversion=function(c){var d=new cpaint_result_object,e=0,l="";if(typeof c=="object"&&c!=null){for(e=0;e<c.childNodes.length;e++)if(c.childNodes[e].nodeType==1){l=c.childNodes[e].nodeName;break}c=c.getElementsByTagName(l);d[l]=[];for(e=0;e<c.length;e++){var t=a(c[e]);t.id=c[e].getAttribute("id");d[l].push(t)}}else debug("received invalid XML response",0);return d};this.xml_conversion=function(c){return c};this.text_conversion=function(c){return b(c)};this.e4x_conversion=
function(c){c=c.replace(/^\<\?xml[^>]+\>/,"");return new XML(c)};this.json_conversion=function(c){return JSON.parse(c)};var a=function(c){var d=new cpaint_result_object,e="",l=0,t=0;if(c.hasChildNodes()==true)for(l=0;l<c.childNodes.length;l++){e=c.childNodes[l].nodeName;e=e.replace(/[^a-zA-Z0-9_]*/g,"");if(typeof d[e]!="object")d[e]=[];if(c.childNodes[l].nodeType==1){var B=a(c.childNodes[l]);for(t=0;t<c.childNodes[l].attributes.length;t++)B.set_attribute(c.childNodes[l].attributes[t].nodeName,c.childNodes[l].attributes[t].nodeValue);
d[e].push(B)}else if(c.childNodes[l].nodeType==3)d.data=b(String(c.firstChild.data))}return d},b=function(c){for(var d="",e=0,l=0,t=0;e<c.length;)if(c.charAt(e)=="\\"&&c.charAt(e+1)=="u"){l=0;for(j=2;j<6;j+=1){t=parseInt(c.charAt(e+j),16);if(!isFinite(t))break;l=l*16+t}d+=String.fromCharCode(l);e+=6}else{d+=c.charAt(e);e++}if(d!=""&&d.search(/^\s+$/g)==-1&&!isNaN(d)&&isFinite(d))d=Number(d);return d}}
function cpaint_result_object(){this.id=0;this.data="";var a=[];this.find_item_by_id=function(b,c){var d=null,e=0;if(this[b])for(e=0;e<this[b].length;e++)if(this[b][e].get_attribute("id")==c){d=this[b][e];break}return d};this.get_attribute=function(b){var c=null;if(typeof a[b]!="undefined")c=a[b];return c};this.set_attribute=function(b,c){a[b]=c}}Array.prototype.______array="______array";
var JSON={org:"http://www.JSON.org",copyright:"(c)2005 JSON.org",license:"http://www.crockford.com/JSON/license.html",stringify:function(a){var b,c,d,e="";b=true;switch(typeof a){case "object":if(a)if(a.______array=="______array"){for(c in a)if(c!="______array"&&(isNaN(c)||!isFinite(c))){b=false;break}if(b==true){for(c=0;c<a.length;++c)if(typeof a[c]!="undefined"){b=this.stringify(a[c]);if(e)e+=",";e+=b}else e+=",null";return"["+e+"]"}else{for(c in a)if(c!="______array"){b=a[c];if(typeof b!="undefined"&&
typeof b!="function"){b=this.stringify(b);if(e)e+=",";e+=this.stringify(c)+":"+b}}return"{"+e+"}"}}else if(typeof a.toString!="undefined"){for(c in a){b=a[c];if(typeof b!="undefined"&&typeof b!="function"){b=this.stringify(b);if(e)e+=",";e+=this.stringify(c)+":"+b}}return"{"+e+"}"}return"null";case "number":return isFinite(a)?String(a):"null";case "string":d=a.length;e='"';for(c=0;c<d;c+=1){b=a.charAt(c);if(b>=" "){if(b=="\\"||b=='"')e+="\\";e+=b}else switch(b){case "\u0008":e+="\\b";break;case "\u000c":e+=
"\\f";break;case "\n":e+="\\n";break;case "\r":e+="\\r";break;case "\t":e+="\\t";break;default:b=b.charCodeAt();e+="\\u00"+Math.floor(b/16).toString(16)+(b%16).toString(16)}}return e+'"';case "boolean":return String(a);default:return"null"}},parse:function(a){function b(p){throw{name:"JSONError",message:p,at:x-1,text:a};}function c(){h=a.charAt(x);x+=1;return h}function d(){for(;h!=""&&h<=" ";)c()}function e(){var p,w="",r,u;if(h=='"')a:for(;c();)if(h=='"'){c();return w}else if(h=="\\")switch(c()){case "b":w+=
"\u0008";break;case "f":w+="\u000c";break;case "n":w+="\n";break;case "r":w+="\r";break;case "t":w+="\t";break;case "u":for(p=u=0;p<4;p+=1){r=parseInt(c(),16);if(!isFinite(r))break a;u=u*16+r}w+=String.fromCharCode(u);break;default:w+=h}else w+=h;b("Bad string")}function l(){var p="";if(h=="-"){p="-";c()}for(;h>="0"&&h<="9";){p+=h;c()}if(h==".")for(p+=".";c()&&h>="0"&&h<="9";)p+=h;if(h=="e"||h=="E"){p+="e";c();if(h=="-"||h=="+"){p+=h;c()}for(;h>="0"&&h<="9";){p+=h;c()}}p=+p;if(isFinite(p))return p;
else b("Bad number")}function t(){switch(h){case "t":if(c()=="r"&&c()=="u"&&c()=="e"){c();return true}break;case "f":if(c()=="a"&&c()=="l"&&c()=="s"&&c()=="e"){c();return false}break;case "n":if(c()=="u"&&c()=="l"&&c()=="l"){c();return null}}b("Syntax error")}function B(){d();switch(h){case "{":var p;a:{var w,r={};if(h=="{"){c();d();if(h=="}"){c();p=r;break a}for(;h;){w=e();d();if(h!=":")break;c();r[w]=B();d();if(h=="}"){c();p=r;break a}else if(h!=",")break;c();d()}}b("Bad object")}return p;case "[":a:{p=
[];if(h=="["){c();d();if(h=="]"){c();r=p;break a}for(;h;){p.push(B());d();if(h=="]"){c();r=p;break a}else if(h!=",")break;c();d()}}b("Bad array")}return r;case "<":a:{r=[];if(h=="<"){c();d();if(h==">"){c();w=r;break a}for(;h;){p=e();d();if(h!=":")break;c();r[p]=B();d();if(h==">"){c();w=r;break a}else if(h!=",")break;c();d()}}b("Bad associative array")}return w;case '"':return e();case "-":return l();default:return h>="0"&&h<="9"?l():t()}}var x=0,h=" ";return B()}};var dbArray=[],dbreport,recordcount,coloumcount,cp=new cpaint;cp.set_debug(false);cp.set_response_type("XML");var baseurl="http://www.videotube.sk",dbLloaded=true;function executeDB(a){cp.call(baseurl+"/ajax/myphpajax.php","executeDB",return_value,a)}
function return_value(a){dbreport=a.getElementsByTagName("dbreport").item(0).firstChild.data;if(dbreport=="1"){recordcount=a.getElementsByTagName("recordcount").item(0).firstChild.data;coloumcount=a.getElementsByTagName("coloumcount").item(0).firstChild.data;for(i=0;i<recordcount;i++){dbArray[i]=Array(recordcount);for(ii=0;ii<coloumcount;ii++)dbArray[i][ii]=a.getElementsByTagName("dbvalue"+i+ii).item(0).firstChild.data}}dbLoaded=false}
function insertInToTable(a,b,c,d){try{document.getElementById(a).rows[b].cells[c].innerHTML=d;return false}catch(e){return false}}function txtBoxValidation(a,b,c){try{me=document.getElementById(a);if(me.value==""){me.style.background=c;return false}else{me.style.background=b;return true}}catch(d){return"Err"}}function hideMe(a){document.getElementById(a).style.display="none"}function showMe(a){document.getElementById(a).style.display="block"}
function directMyvalueto(a,b){document.getElementById(b).value=a}function fxVideoComment(a,b,c,d){commentdetails=document.getElementById(b).value;if(commentdetails==""||commentdetails.length>200)alert($("addcommentError").innerHTML);else{hideMe(a);hideMe("addcommentError");cp.call(baseurl+"/ajax/myajaxphp.php","video_comments",video_comment_response,commentdetails,c,d)}}
function video_comment_response(a){if(a.getElementsByTagName("vcommsg").item(0).firstChild.data==0){showMe("vcommentsfailure");showMe("addcommentdiv")}else alert($("vcommentssuccess").innerHTML)}function fxDelCom(a,b,c){a!=""&&b!=""&&c!=""&&cp.call(baseurl+"/ajax/myajaxphp.php","del_com",del_com_response,a,b,c)}function del_com_response(){}
function fxCheckUsername(a,b){cusername=document.getElementById(b).value;if(cusername==""){hideMe("isavailable");hideMe("isnotavailable");showMe("usernameisempty")}else{hideMe("usernameisempty");hideMe(a);cp.call(baseurl+"/ajax/myajaxphp.php","check_username",check_username_response,cusername)}}
function check_username_response(a){if(a.getElementsByTagName("cunamemsg").item(0).firstChild.data==0){hideMe("isavailable");showMe("isnotavailable")}else if(a.getElementsByTagName("cunamemsg").item(0).firstChild.data==2){hideMe("isavailable");hideMe("isnotavailable");showMe("usernameisempty")}else{hideMe("isnotavailable");showMe("isavailable")}showMe("checkagain")}
function fxProfileComment(a,b,c,d){commentdetails=document.getElementById(b).value;if(commentdetails=="")showMe("addcommentError");else{hideMe(a);hideMe("addcommentError");cp.call(baseurl+"/ajax/myajaxphp.php","profile_comments",profile_comment_response,commentdetails,c,d)}}function profile_comment_response(a){if(a.getElementsByTagName("pcommsg").item(0).firstChild.data==0){showMe("vcommentsfailure");showMe("addcommentdiv")}else showMe("vcommentssuccess")}
function fxChannelComment(a,b,c,d){commentdetails=document.getElementById(b).value;if(commentdetails=="")showMe("addcommentError");else{hideMe(a);hideMe("addcommentError");hideMe("vcommentsnotmember");cp.call(baseurl+"/ajax/myajaxphp.php","channel_comments",channel_comment_response,commentdetails,c,d)}}
function channel_comment_response(a){if(a.getElementsByTagName("chancommsg").item(0).firstChild.data==2){showMe("vcommentsnotmember");showMe("addcommentdiv")}else if(a.getElementsByTagName("chancommsg").item(0).firstChild.data==0){showMe("vcommentsfailure");showMe("addcommentdiv")}else showMe("vcommentssuccess")}
function fxReportVideo(a,b,c,d,e){videoreportremarks=document.getElementById(b).value;videoreportreason=document.getElementById(c).value;if(videoreportreason=="")showMe("vreportreasonError");else{hideMe(a);hideMe("vreportreasonError");cp.call(baseurl+"/ajax/myajaxphp.php","video_report",video_report_response,videoreportremarks,videoreportreason,d,e)}}
function video_report_response(a){if(a.getElementsByTagName("vrepmsg").item(0).firstChild.data==0){showMe("vreportfailure");showMe("reportvideodiv")}else showMe("vreportsuccess")}
function fxSendMessage(a,b,c,d,e){sendmessagesubjectz=document.getElementById(b).value;sendmessagetextz=document.getElementById(c).value;if(d=="")showMe("sendmessagefailure");else if(e=="")showMe("sendmessagefailure");else if(sendmessagesubjectz==""){hideMe("mtextfailure");showMe("msubjectfailure")}else if(sendmessagetextz==""){hideMe("msubjectfailure");showMe("mtextfailure")}else{hideMe(a);hideMe("sendmessagefailure");hideMe("msubjectfailure");hideMe("mtextfailure");cp.call(baseurl+"/ajax/myajaxphp.php",
"send_message",send_message_response,sendmessagesubjectz,sendmessagetextz,d,e)}}function send_message_response(a){if(a.getElementsByTagName("sendmessagetomsg").item(0).firstChild.data==0){hideMe("msubjectfailure");hideMe("mtextfailure");showMe("sendmessagefailure");showMe("sendmessagediv")}else{hideMe("msubjectfailure");hideMe("mtextfailure");hideMe("sendmessagefailure");alert($("sendmessagesuccess").innerHTML)}}
function fxAddToFriends(a,b,c,d){addtofriendzmessage=document.getElementById(b).value;if(c=="")showMe("addtofriendsfailure");else if(d=="")showMe("addtofriendsfailure");else{hideMe(a);hideMe("addtofriendsfailure");cp.call(baseurl+"/ajax/myajaxphp.php","add_to_friends",add_to_friends_response,addtofriendzmessage,c,d)}}
function add_to_friends_response(a){if(a.getElementsByTagName("addtofriendsmsg").item(0).firstChild.data==0){hideMe("addtofriendsexists");showMe("addtofriendsfailure");showMe("addtofriendsdiv")}else if(a.getElementsByTagName("addtofriendsmsg").item(0).firstChild.data==2){hideMe("addtofriendsfailure");showMe("addtofriendsexists");showMe("addtofriendsdiv")}else{hideMe("addtofriendsfailure");hideMe("addtofriendsexists");showMe("addtofriendssuccess")}}
function fxAddVideoToChannel(a,b,c,d){b=document.getElementById(b).value;hideMe("vaddtochanexists");if(b=="")showMe("vaddtochanvideoError");else{hideMe(a);hideMe("vaddtochanvideoError");cp.call(baseurl+"/ajax/myajaxphp.php","add_video_to_channel",video_addtochan_response,b,c,d)}}
function video_addtochan_response(a){if(a.getElementsByTagName("vatchanmsg").item(0).firstChild.data==2){showMe("vaddtochanexists");showMe("addtochanneldiv")}else if(a.getElementsByTagName("vatchanmsg").item(0).firstChild.data==0){showMe("vaddtochanfailure");showMe("addtochanneldiv")}else showMe("vaddtochansuccess")}
function fxShareVideo(a,b,c,d,e){videosharemessage=document.getElementById(b).value;videoshareto=document.getElementById(c).value;if(videoshareto=="")alert($("vshareemptyError").innerHTML);else{hideMe(a);hideMe("vshareemptyError");cp.call(baseurl+"/ajax/myajaxphp.php","video_share",video_share_response,videosharemessage,videoshareto,d,e)}}
function video_share_response(a){if(a.getElementsByTagName("vshrmsg").item(0).firstChild.data==0){alert($("vsharefailure").innerHTML);showMe("sharevideodiv")}else if(a.getElementsByTagName("vshrmsg").item(0).firstChild.data==2){alert($("vsharehalffailure").innerHTML);showMe("sharevideodiv")}else alert($("vsharesuccess").innerHTML)}function fxSubscribe(a,b,c){hideMe(a);cp.call(baseurl+"/ajax/myajaxphp.php","member_subscribe",subscribe_response,b,c)}
function subscribe_response(a){a.getElementsByTagName("submessage").item(0).firstChild.data=="0"?showMe("subscribeFailure"):showMe("subscribeSuccess")}function fxSubscribeSeries(a,b,c){hideMe(a);cp.call(baseurl+"/ajax/myajaxphp.php","member_subscribe_series",subscribe_response_series,b,c)}function subscribe_response_series(a){a.getElementsByTagName("subseriesmessage").item(0).firstChild.data=="0"?showMe("subscribeFailure"):showMe("subscribeSuccess")}
function fxSubscribeChannel(a,b,c){hideMe(a);alert("hocico");cp.call(baseurl+"/ajax/myajaxphp.php","member_subscribe_channel",subscribe_response_channel,b,c)}function subscribe_response_channel(a){a.getElementsByTagName("jchanmessage").item(0).firstChild.data=="0"?showMe("subscribeFailure"):showMe("subscribeSuccess")}function fxFavVideo(a,b,c){hideMe(a);cp.call(baseurl+"/ajax/myajaxphp.php","fav_video",fav_video_response,b,c)}
function fav_video_response(a){a.getElementsByTagName("favvidmessage").item(0).firstChild.data=="0"?showMe("addtofavFailure"):showMe("addtofavSuccess")}function fxVideoRater(a,b){cp.call(baseurl+"/ajax/myajaxphp.php","rate_video",return_video_rating,a,b)}
function return_video_rating(a){a=a.getElementsByTagName("vstatus").item(0).firstChild.data;if(a=="0"){re=$("ratingExists").innerHTML;alert(re)}else if(a=="1"){rs=$("ratingSuccess").innerHTML;alert(rs)}else{rl=$("ratingLogin").innerHTML;alert(rl)}return false}function fxSeriesRater(a,b){cp.call(baseurl+"/ajax/myajaxphp.php","rate_series",return_series_rating,a,b)}
function return_series_rating(a){a=a.getElementsByTagName("vsstatus").item(0).firstChild.data;if(a=="0")showMe("ratingExists");else a=="1"?showMe("ratingSuccess"):showMe("ratingLogin");return false}function fxChannelsRater(a,b){cp.call(baseurl+"/ajax/myajaxphp.php","rate_channel",return_channel_rating,a,b)}
function return_channel_rating(a){a=a.getElementsByTagName("chanstatus").item(0).firstChild.data;if(a=="0")showMe("ratingExists");else a=="1"?showMe("ratingSuccess"):showMe("ratingLogin");return false}function showhidelists(a,b){showMe(a);hideMe(b)}function playvideohide(a){document.getElementById(a).style.display="none"}
function playvideoshow(a){if(document.getElementById("showShareVideo"))document.getElementById("showShareVideo").style.display="none";if(document.getElementById("showReportVideo"))document.getElementById("showReportVideo").style.display="none";if(document.getElementById("showAddToChannel"))document.getElementById("showAddToChannel").style.display="none";if(document.getElementById("showShareVideoNV"))document.getElementById("showShareVideoNV").style.display="none";if(document.getElementById("showReportVideoNV"))document.getElementById("showReportVideoNV").style.display=
"none";if(document.getElementById("showAddToChannelNV"))document.getElementById("showAddToChannelNV").style.display="none";if(document.getElementById("showAllThumbs"))document.getElementById("showAllThumbs").style.display="none";document.getElementById(a).style.display="block"};var swfobject=function(){function a(){if(!M){try{var f=q.getElementsByTagName("body")[0].appendChild(q.createElement("span"));f.parentNode.removeChild(f)}catch(g){return}M=true;f=Q.length;for(var k=0;k<f;k++)Q[k]()}}function b(f){if(M)f();else Q[Q.length]=f}function c(f){if(typeof D.addEventListener!=y)D.addEventListener("load",f,false);else if(typeof q.addEventListener!=y)q.addEventListener("load",f,false);else if(typeof D.attachEvent!=y)u(D,"onload",f);else if(typeof D.onload=="function"){var g=
D.onload;D.onload=function(){g();f()}}else D.onload=f}function d(){var f=q.getElementsByTagName("body")[0],g=q.createElement(E);g.setAttribute("type",R);var k=f.appendChild(g);if(k){var m=0;(function(){if(typeof k.GetVariable!=y){var n=k.GetVariable("$version");if(n){n=n.split(" ")[1].split(",");o.pv=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]}}else if(m<10){m++;setTimeout(arguments.callee,10);return}f.removeChild(g);k=null;e()})()}else e()}function e(){var f=I.length;if(f>0)for(var g=
0;g<f;g++){var k=I[g].id,m=I[g].callbackFn,n={success:false,id:k};if(o.pv[0]>0){var v=r(k);if(v)if(C(I[g].swfVersion)&&!(o.wk&&o.wk<312)){H(k,true);if(m){n.success=true;n.ref=l(k);m(n)}}else if(I[g].expressInstall&&t()){n={};n.data=I[g].expressInstall;n.width=v.getAttribute("width")||"0";n.height=v.getAttribute("height")||"0";if(v.getAttribute("class"))n.styleclass=v.getAttribute("class");if(v.getAttribute("align"))n.align=v.getAttribute("align");var s={};v=v.getElementsByTagName("param");for(var z=
v.length,A=0;A<z;A++)if(v[A].getAttribute("name").toLowerCase()!="movie")s[v[A].getAttribute("name")]=v[A].getAttribute("value");B(n,s,k,m)}else{x(v);m&&m(n)}}else{H(k,true);if(m){if((k=l(k))&&typeof k.SetVariable!=y){n.success=true;n.ref=k}m(n)}}}}function l(f){var g=null;if((f=r(f))&&f.nodeName=="OBJECT")if(typeof f.SetVariable!=y)g=f;else if(f=f.getElementsByTagName(E)[0])g=f;return g}function t(){return!S&&C("6.0.65")&&(o.win||o.mac)&&!(o.wk&&o.wk<312)}function B(f,g,k,m){S=true;Y=m||null;aa=
{success:false,id:k};var n=r(k);if(n){if(n.nodeName=="OBJECT"){O=h(n);T=null}else{O=n;T=k}f.id=ba;if(typeof f.width==y||!/%$/.test(f.width)&&parseInt(f.width,10)<310)f.width="310";if(typeof f.height==y||!/%$/.test(f.height)&&parseInt(f.height,10)<137)f.height="137";q.title=q.title.slice(0,47)+" - Flash Player Installation";m=o.ie&&o.win?"ActiveX":"PlugIn";m="MMredirectURL="+D.location.toString().replace(/&/g,"%26")+"&MMplayerType="+m+"&MMdoctitle="+q.title;if(typeof g.flashvars!=y)g.flashvars+="&"+
m;else g.flashvars=m;if(o.ie&&o.win&&n.readyState!=4){m=q.createElement("div");k+="SWFObjectNew";m.setAttribute("id",k);n.parentNode.insertBefore(m,n);n.style.display="none";(function(){n.readyState==4?n.parentNode.removeChild(n):setTimeout(arguments.callee,10)})()}p(f,g,k)}}function x(f){if(o.ie&&o.win&&f.readyState!=4){var g=q.createElement("div");f.parentNode.insertBefore(g,f);g.parentNode.replaceChild(h(f),g);f.style.display="none";(function(){f.readyState==4?f.parentNode.removeChild(f):setTimeout(arguments.callee,
10)})()}else f.parentNode.replaceChild(h(f),f)}function h(f){var g=q.createElement("div");if(o.win&&o.ie)g.innerHTML=f.innerHTML;else if(f=f.getElementsByTagName(E)[0])if(f=f.childNodes)for(var k=f.length,m=0;m<k;m++)!(f[m].nodeType==1&&f[m].nodeName=="PARAM")&&f[m].nodeType!=8&&g.appendChild(f[m].cloneNode(true));return g}function p(f,g,k){var m,n=r(k);if(o.wk&&o.wk<312)return m;if(n){if(typeof f.id==y)f.id=k;if(o.ie&&o.win){var v="",s;for(s in f)if(f[s]!=Object.prototype[s])if(s.toLowerCase()==
"data")g.movie=f[s];else if(s.toLowerCase()=="styleclass")v+=' class="'+f[s]+'"';else if(s.toLowerCase()!="classid")v+=" "+s+'="'+f[s]+'"';s="";for(var z in g)if(g[z]!=Object.prototype[z])s+='<param name="'+z+'" value="'+g[z]+'" />';n.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+v+">"+s+"</object>";U[U.length]=f.id;m=r(f.id)}else{z=q.createElement(E);z.setAttribute("type",R);for(var A in f)if(f[A]!=Object.prototype[A])if(A.toLowerCase()=="styleclass")z.setAttribute("class",
f[A]);else A.toLowerCase()!="classid"&&z.setAttribute(A,f[A]);for(v in g)if(g[v]!=Object.prototype[v]&&v.toLowerCase()!="movie"){f=z;s=v;A=g[v];k=q.createElement("param");k.setAttribute("name",s);k.setAttribute("value",A);f.appendChild(k)}n.parentNode.replaceChild(z,n);m=z}}return m}function w(f){var g=r(f);if(g&&g.nodeName=="OBJECT")if(o.ie&&o.win){g.style.display="none";(function(){if(g.readyState==4){var k=r(f);if(k){for(var m in k)if(typeof k[m]=="function")k[m]=null;k.parentNode.removeChild(k)}}else setTimeout(arguments.callee,
10)})()}else g.parentNode.removeChild(g)}function r(f){var g=null;try{g=q.getElementById(f)}catch(k){}return g}function u(f,g,k){f.attachEvent(g,k);N[N.length]=[f,g,k]}function C(f){var g=o.pv;f=f.split(".");f[0]=parseInt(f[0],10);f[1]=parseInt(f[1],10)||0;f[2]=parseInt(f[2],10)||0;return g[0]>f[0]||g[0]==f[0]&&g[1]>f[1]||g[0]==f[0]&&g[1]==f[1]&&g[2]>=f[2]?true:false}function L(f,g,k,m){if(!(o.ie&&o.mac)){var n=q.getElementsByTagName("head")[0];if(n){k=k&&typeof k=="string"?k:"screen";if(m)Z=F=null;
if(!F||Z!=k){m=q.createElement("style");m.setAttribute("type","text/css");m.setAttribute("media",k);F=n.appendChild(m);if(o.ie&&o.win&&typeof q.styleSheets!=y&&q.styleSheets.length>0)F=q.styleSheets[q.styleSheets.length-1];Z=k}if(o.ie&&o.win)F&&typeof F.addRule==E&&F.addRule(f,g);else F&&typeof q.createTextNode!=y&&F.appendChild(q.createTextNode(f+" {"+g+"}"))}}}function H(f,g){if(ca){var k=g?"visible":"hidden";if(M&&r(f))r(f).style.visibility=k;else L("#"+f,"visibility:"+k)}}function da(f){return/[\\\"<>\.;]/.exec(f)!=
null&&typeof encodeURIComponent!=y?encodeURIComponent(f):f}var y="undefined",E="object",R="application/x-shockwave-flash",ba="SWFObjectExprInst",D=window,q=document,J=navigator,ea=false,Q=[function(){ea?d():e()}],I=[],U=[],N=[],O,T,Y,aa,M=false,S=false,F,Z,ca=true,o=function(){var f=typeof q.getElementById!=y&&typeof q.getElementsByTagName!=y&&typeof q.createElement!=y,g=J.userAgent.toLowerCase(),k=J.platform.toLowerCase(),m=k?/win/.test(k):/win/.test(g);k=k?/mac/.test(k):/mac/.test(g);g=/webkit/.test(g)?
parseFloat(g.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false;var n=!+"\u000b1",v=[0,0,0],s=null;if(typeof J.plugins!=y&&typeof J.plugins["Shockwave Flash"]==E){if((s=J.plugins["Shockwave Flash"].description)&&!(typeof J.mimeTypes!=y&&J.mimeTypes[R]&&!J.mimeTypes[R].enabledPlugin)){ea=true;n=false;s=s.replace(/^.*\s+(\S+\s+\S+$)/,"$1");v[0]=parseInt(s.replace(/^(.*)\..*$/,"$1"),10);v[1]=parseInt(s.replace(/^.*\.(.*)\s.*$/,"$1"),10);v[2]=/[a-zA-Z]/.test(s)?parseInt(s.replace(/^.*[a-zA-Z]+(.*)$/,
"$1"),10):0}}else if(typeof D.ActiveXObject!=y)try{var z=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(z)if(s=z.GetVariable("$version")){n=true;s=s.split(" ")[1].split(",");v=[parseInt(s[0],10),parseInt(s[1],10),parseInt(s[2],10)]}}catch(A){}return{w3:f,pv:v,wk:g,ie:n,win:m,mac:k}}();(function(){if(o.w3){if(typeof q.readyState!=y&&q.readyState=="complete"||typeof q.readyState==y&&(q.getElementsByTagName("body")[0]||q.body))a();if(!M){typeof q.addEventListener!=y&&q.addEventListener("DOMContentLoaded",
a,false);if(o.ie&&o.win){q.attachEvent("onreadystatechange",function(){if(q.readyState=="complete"){q.detachEvent("onreadystatechange",arguments.callee);a()}});D==top&&function(){if(!M){try{q.documentElement.doScroll("left")}catch(f){setTimeout(arguments.callee,0);return}a()}}()}o.wk&&function(){M||(/loaded|complete/.test(q.readyState)?a():setTimeout(arguments.callee,0))}();c(a)}}})();(function(){o.ie&&o.win&&window.attachEvent("onunload",function(){for(var f=N.length,g=0;g<f;g++)N[g][0].detachEvent(N[g][1],
N[g][2]);f=U.length;for(g=0;g<f;g++)w(U[g]);for(var k in o)o[k]=null;o=null;for(var m in swfobject)swfobject[m]=null;swfobject=null})})();return{registerObject:function(f,g,k,m){if(o.w3&&f&&g){var n={};n.id=f;n.swfVersion=g;n.expressInstall=k;n.callbackFn=m;I[I.length]=n;H(f,false)}else m&&m({success:false,id:f})},getObjectById:function(f){if(o.w3)return l(f)},embedSWF:function(f,g,k,m,n,v,s,z,A,P){var V={success:false,id:g};if(o.w3&&!(o.wk&&o.wk<312)&&f&&g&&k&&m&&n){H(g,false);b(function(){k+="";
m+="";var K={};if(A&&typeof A===E)for(var G in A)K[G]=A[G];K.data=f;K.width=k;K.height=m;G={};if(z&&typeof z===E)for(var W in z)G[W]=z[W];if(s&&typeof s===E)for(var X in s)if(typeof G.flashvars!=y)G.flashvars+="&"+X+"="+s[X];else G.flashvars=X+"="+s[X];if(C(n)){W=p(K,G,g);K.id==g&&H(g,true);V.success=true;V.ref=W}else if(v&&t()){K.data=v;B(K,G,g,P);return}else H(g,true);P&&P(V)})}else P&&P(V)},switchOffAutoHideShow:function(){ca=false},ua:o,getFlashPlayerVersion:function(){return{major:o.pv[0],minor:o.pv[1],
release:o.pv[2]}},hasFlashPlayerVersion:C,createSWF:function(f,g,k){if(o.w3)return p(f,g,k)},showExpressInstall:function(f,g,k,m){o.w3&&t()&&B(f,g,k,m)},removeSWF:function(f){o.w3&&w(f)},createCSS:function(f,g,k,m){o.w3&&L(f,g,k,m)},addDomLoadEvent:b,addLoadEvent:c,getQueryParamValue:function(f){var g=q.location.search||q.location.hash;if(g){if(/\?/.test(g))g=g.split("?")[1];if(f==null)return da(g);g=g.split("&");for(var k=0;k<g.length;k++)if(g[k].substring(0,g[k].indexOf("="))==f)return da(g[k].substring(g[k].indexOf("=")+
1))}return""},expressInstallCallback:function(){if(S){var f=r(ba);if(f&&O){f.parentNode.replaceChild(O,f);if(T){H(T,true);if(o.ie&&o.win)O.style.display="block"}Y&&Y(aa)}S=false}}}}();var MooTools={version:"1.11"};function $defined(a){return a!=undefined}
function $type(a){if(!$defined(a))return false;if(a.htmlElement)return"element";var b=typeof a;if(b=="object"&&a.nodeName)switch(a.nodeType){case 1:return"element";case 3:return/\S/.test(a.nodeValue)?"textnode":"whitespace"}if(b=="object"||b=="function"){switch(a.constructor){case Array:return"array";case RegExp:return"regexp";case Class:return"class"}if(typeof a.length=="number"){if(a.item)return"collection";if(a.callee)return"arguments"}}return b}
function $merge(){for(var a={},b=0;b<arguments.length;b++)for(var c in arguments[b]){var d=arguments[b][c],e=a[c];a[c]=e&&$type(d)=="object"&&$type(e)=="object"?$merge(e,d):d}return a}var $extend=function(){var a=arguments;a[1]||(a=[this,a[0]]);for(var b in a[1])a[0][b]=a[1][b];return a[0]},$native=function(){for(var a=0,b=arguments.length;a<b;a++)arguments[a].extend=function(c){for(var d in c){this.prototype[d]||(this.prototype[d]=c[d]);this[d]||(this[d]=$native.generic(d))}}};
$native.generic=function(a){return function(b){return this.prototype[a].apply(b,Array.prototype.slice.call(arguments,1))}};$native(Function,Array,String,Number);function $chk(a){return!!(a||a===0)}function $pick(a,b){return $defined(a)?a:b}function $random(a,b){return Math.floor(Math.random()*(b-a+1)+a)}function $time(){return(new Date).getTime()}function $clear(a){clearTimeout(a);clearInterval(a);return null}var Abstract=function(a){a=a||{};a.extend=$extend;return a};Window=new Abstract(window);
Document=new Abstract(document);document.head=document.getElementsByTagName("head")[0];window.xpath=!!document.evaluate;if(window.ActiveXObject)window.ie=window[window.XMLHttpRequest?"ie7":"ie6"]=true;else if(document.childNodes&&!document.all&&!navigator.taintEnabled)window.webkit=window[window.xpath?"webkit420":"webkit419"]=true;else if(document.getBoxObjectFor!=null)window.gecko=true;window.khtml=window.webkit;Object.extend=$extend;
if(typeof HTMLElement=="undefined"){HTMLElement=function(){};window.webkit&&document.createElement("iframe");HTMLElement.prototype=window.webkit?window["[[DOMElement.prototype]]"]:{}}HTMLElement.prototype.htmlElement=function(){};if(window.ie6)try{document.execCommand("BackgroundImageCache",false,true)}catch(e$$10){}
var Class=function(a){var b=function(){return arguments[0]!==null&&this.initialize&&$type(this.initialize)=="function"?this.initialize.apply(this,arguments):this};$extend(b,this);b.prototype=a;b.constructor=Class;return b};Class.empty=function(){};Class.prototype={extend:function(a){var b=new this(null),c;for(c in a)b[c]=Class.Merge(b[c],a[c]);return new Class(b)},implement:function(){for(var a=0,b=arguments.length;a<b;a++)$extend(this.prototype,arguments[a])}};
Class.Merge=function(a,b){if(a&&a!=b){var c=$type(b);if(c!=$type(a))return b;switch(c){case "function":c=function(){this.parent=arguments.callee.parent;return b.apply(this,arguments)};c.parent=a;return c;case "object":return $merge(a,b)}}return b};
var Chain=new Class({chain:function(a){this.chains=this.chains||[];this.chains.push(a);return this},callChain:function(){this.chains&&this.chains.length&&this.chains.shift().delay(10,this)},clearChain:function(){this.chains=[]}}),Events=new Class({addEvent:function(a,b){if(b!=Class.empty){this.$events=this.$events||{};this.$events[a]=this.$events[a]||[];this.$events[a].include(b)}return this},fireEvent:function(a,b,c){this.$events&&this.$events[a]&&this.$events[a].each(function(d){d.create({bind:this,
delay:c,arguments:b})()},this);return this},removeEvent:function(a,b){this.$events&&this.$events[a]&&this.$events[a].remove(b);return this}}),Options=new Class({setOptions:function(){this.options=$merge.apply(null,[this.options].extend(arguments));if(this.addEvent)for(var a in this.options)$type(this.options[a]=="function")&&/^on[A-Z]/.test(a)&&this.addEvent(a,this.options[a]);return this}});
Array.extend({forEach:function(a,b){for(var c=0,d=this.length;c<d;c++)a.call(b,this[c],c,this)},filter:function(a,b){for(var c=[],d=0,e=this.length;d<e;d++)a.call(b,this[d],d,this)&&c.push(this[d]);return c},map:function(a,b){for(var c=[],d=0,e=this.length;d<e;d++)c[d]=a.call(b,this[d],d,this);return c},every:function(a,b){for(var c=0,d=this.length;c<d;c++)if(!a.call(b,this[c],c,this))return false;return true},some:function(a,b){for(var c=0,d=this.length;c<d;c++)if(a.call(b,this[c],c,this))return true;
return false},indexOf:function(a,b){for(var c=this.length,d=b<0?Math.max(0,c+b):b||0;d<c;d++)if(this[d]===a)return d;return-1},copy:function(a,b){a=a||0;if(a<0)a=this.length+a;b=b||this.length-a;for(var c=[],d=0;d<b;d++)c[d]=this[a++];return c},remove:function(a){for(var b=0,c=this.length;b<c;)if(this[b]===a){this.splice(b,1);c--}else b++;return this},contains:function(a,b){return this.indexOf(a,b)!=-1},associate:function(a){for(var b={},c=Math.min(this.length,a.length),d=0;d<c;d++)b[a[d]]=this[d];
return b},extend:function(a){for(var b=0,c=a.length;b<c;b++)this.push(a[b]);return this},merge:function(a){for(var b=0,c=a.length;b<c;b++)this.include(a[b]);return this},include:function(a){this.contains(a)||this.push(a);return this},getRandom:function(){return this[$random(0,this.length-1)]||null},getLast:function(){return this[this.length-1]||null}});Array.prototype.each=Array.prototype.forEach;Array.each=Array.forEach;function $A(a){return Array.copy(a)}
function $each(a,b,c){if(a&&typeof a.length=="number"&&$type(a)!="object")Array.forEach(a,b,c);else for(var d in a)b.call(c||a,a[d],d)}Array.prototype.test=Array.prototype.contains;
String.extend({test:function(a,b){return($type(a)=="string"?RegExp(a,b):a).test(this)},toInt:function(){return parseInt(this,10)},toFloat:function(){return parseFloat(this)},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/\w[A-Z]/g,function(a){return a.charAt(0)+"-"+a.charAt(1).toLowerCase()})},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase()})},trim:function(){return this.replace(/^\s+|\s+$/g,
"")},clean:function(){return this.replace(/\s{2,}/g," ").trim()},rgbToHex:function(a){var b=this.match(/\d{1,3}/g);return b?b.rgbToHex(a):false},hexToRgb:function(a){var b=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return b?b.slice(1).hexToRgb(a):false},contains:function(a,b){return b?(b+this+b).indexOf(b+a+b)>-1:this.indexOf(a)>-1},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")}});
Array.extend({rgbToHex:function(a){if(this.length<3)return false;if(this.length==4&&this[3]==0&&!a)return"transparent";for(var b=[],c=0;c<3;c++){var d=(this[c]-0).toString(16);b.push(d.length==1?"0"+d:d)}return a?b:"#"+b.join("")},hexToRgb:function(a){if(this.length!=3)return false;for(var b=[],c=0;c<3;c++)b.push(parseInt(this[c].length==1?this[c]+this[c]:this[c],16));return a?b:"rgb("+b.join(",")+")"}});
Function.extend({create:function(a){var b=this;a=$merge({bind:b,event:false,arguments:null,delay:false,periodical:false,attempt:false},a);if($chk(a.arguments)&&$type(a.arguments)!="array")a.arguments=[a.arguments];return function(c){var d;if(a.event){c=c||window.event;d=[a.event===true?c:new a.event(c)];a.arguments&&d.extend(a.arguments)}else d=a.arguments||arguments;var e=function(){return b.apply($pick(a.bind,b),d)};if(a.delay)return setTimeout(e,a.delay);if(a.periodical)return setInterval(e,a.periodical);
if(a.attempt)try{return e()}catch(l){return false}return e()}},pass:function(a,b){return this.create({arguments:a,bind:b})},attempt:function(a,b){return this.create({arguments:a,bind:b,attempt:true})()},bind:function(a,b){return this.create({bind:a,arguments:b})},bindAsEventListener:function(a,b){return this.create({bind:a,event:true,arguments:b})},delay:function(a,b,c){return this.create({delay:a,bind:b,arguments:c})()},periodical:function(a,b,c){return this.create({periodical:a,bind:b,arguments:c})()}});
Number.extend({toInt:function(){return parseInt(this)},toFloat:function(){return parseFloat(this)},limit:function(a,b){return Math.min(b,Math.max(a,this))},round:function(a){a=Math.pow(10,a||0);return Math.round(this*a)/a},times:function(a){for(var b=0;b<this;b++)a(b)}});
Element=new Class({initialize:function(a,b){if($type(a)=="string"){if(window.ie&&b&&(b.name||b.type)){var c=b.name?' name="'+b.name+'"':"",d=b.type?' type="'+b.type+'"':"";delete b.name;delete b.type;a="<"+a+c+d+">"}a=document.createElement(a)}a=$(a);return!b||!a?a:a.set(b)}});var Elements=new Class({initialize:function(a){return a?$extend(a,this):this}});Elements.extend=function(a){for(var b in a){this.prototype[b]=a[b];this[b]=$native.generic(b)}};
function $(a){if(!a)return null;if(a.htmlElement)return Garbage.collect(a);if([window,document].contains(a))return a;var b=$type(a);if(b=="string")b=(a=document.getElementById(a))?"element":false;if(b!="element")return null;if(a.htmlElement)return Garbage.collect(a);if(["object","embed"].contains(a.tagName.toLowerCase()))return a;$extend(a,Element.prototype);a.htmlElement=function(){};return Garbage.collect(a)}document.getElementsBySelector=document.getElementsByTagName;
function $$(){for(var a=[],b=0,c=arguments.length;b<c;b++){var d=arguments[b];switch($type(d)){case "element":a.push(d);case "boolean":break;case false:break;case "string":d=document.getElementsBySelector(d,true);default:a.extend(d)}}return $$.unique(a)}$$.unique=function(a){for(var b=[],c=0,d=a.length;c<d;c++)if(!a[c].$included){var e=$(a[c]);if(e&&!e.$included){e.$included=true;b.push(e)}}a=0;for(c=b.length;a<c;a++)b[a].$included=null;return new Elements(b)};
Elements.Multi=function(a){return function(){for(var b=arguments,c=[],d=true,e=0,l=this.length,t;e<l;e++){t=this[e][a].apply(this[e],b);if($type(t)!="element")d=false;c.push(t)}return d?$$.unique(c):c}};Element.extend=function(a){for(var b in a){HTMLElement.prototype[b]=a[b];Element.prototype[b]=a[b];Element[b]=$native.generic(b);Elements.prototype[Array.prototype[b]?b+"Elements":b]=Elements.Multi(b)}};
Element.extend({set:function(a){for(var b in a){var c=a[b];switch(b){case "styles":this.setStyles(c);break;case "events":this.addEvents&&this.addEvents(c);break;case "properties":this.setProperties(c);break;default:this.setProperty(b,c)}}return this},inject:function(a,b){a=$(a);switch(b){case "before":a.parentNode.insertBefore(this,a);break;case "after":var c=a.getNext();c?a.parentNode.insertBefore(this,c):a.parentNode.appendChild(this);break;case "top":if(c=a.firstChild){a.insertBefore(this,c);break}default:a.appendChild(this)}return this},
injectBefore:function(a){return this.inject(a,"before")},injectAfter:function(a){return this.inject(a,"after")},injectInside:function(a){return this.inject(a,"bottom")},injectTop:function(a){return this.inject(a,"top")},adopt:function(){var a=[];$each(arguments,function(b){a=a.concat(b)});$$(a).inject(this);return this},remove:function(){return this.parentNode.removeChild(this)},clone:function(a){a=$(this.cloneNode(a!==false));if(!a.$events)return a;a.$events={};for(var b in this.$events)a.$events[b]=
{keys:$A(this.$events[b].keys),values:$A(this.$events[b].values)};return a.removeEvents()},replaceWith:function(a){a=$(a);this.parentNode.replaceChild(a,this);return a},appendText:function(a){this.appendChild(document.createTextNode(a));return this},hasClass:function(a){return this.className.contains(a," ")},addClass:function(a){if(!this.hasClass(a))this.className=(this.className+" "+a).clean();return this},removeClass:function(a){this.className=this.className.replace(RegExp("(^|\\s)"+a+"(?:\\s|$)"),
"$1").clean();return this},toggleClass:function(a){return this.hasClass(a)?this.removeClass(a):this.addClass(a)},setStyle:function(a,b){switch(a){case "opacity":return this.setOpacity(parseFloat(b));case "float":a=window.ie?"styleFloat":"cssFloat"}a=a.camelCase();switch($type(b)){case "number":["zIndex","zoom"].contains(a)||(b+="px");break;case "array":b="rgb("+b.join(",")+")"}this.style[a]=b;return this},setStyles:function(a){switch($type(a)){case "object":Element.setMany(this,"setStyle",a);break;
case "string":this.style.cssText=a}return this},setOpacity:function(a){if(a==0){if(this.style.visibility!="hidden")this.style.visibility="hidden"}else if(this.style.visibility!="visible")this.style.visibility="visible";if(!this.currentStyle||!this.currentStyle.hasLayout)this.style.zoom=1;if(window.ie)this.style.filter=a==1?"":"alpha(opacity="+a*100+")";this.style.opacity=this.$tmp.opacity=a;return this},getStyle:function(a){a=a.camelCase();var b=this.style[a];if(!$chk(b)){if(a=="opacity")return this.$tmp.opacity;
b=[];for(var c in Element.Styles)if(a==c){Element.Styles[c].each(function(d){d=this.getStyle(d);b.push(parseInt(d)?d:"0px")},this);if(a=="border")return b.every(function(d){return d==b[0]})?b[0]:false;return b.join(" ")}if(a.contains("border"))if(Element.Styles.border.contains(a))return["Width","Style","Color"].map(function(d){return this.getStyle(a+d)},this).join(" ");else if(Element.borderShort.contains(a))return["Top","Right","Bottom","Left"].map(function(d){return this.getStyle("border"+d+a.replace("border",
""))},this).join(" ");if(document.defaultView)b=document.defaultView.getComputedStyle(this,null).getPropertyValue(a.hyphenate());else if(this.currentStyle)b=this.currentStyle[a]}if(window.ie)b=Element.fixStyle(a,b,this);if(b&&a.test(/color/i)&&b.contains("rgb"))return b.split("rgb").splice(1,4).map(function(d){return d.rgbToHex()}).join(" ");return b},getStyles:function(){return Element.getMany(this,"getStyle",arguments)},walk:function(a,b){a+="Sibling";for(var c=b?this[b]:this[a];c&&$type(c)!="element";)c=
c[a];return $(c)},getPrevious:function(){return this.walk("previous")},getNext:function(){return this.walk("next")},getFirst:function(){return this.walk("next","firstChild")},getLast:function(){return this.walk("previous","lastChild")},getParent:function(){return $(this.parentNode)},getChildren:function(){return $$(this.childNodes)},hasChild:function(a){return!!$A(this.getElementsByTagName("*")).contains(a)},getProperty:function(a){var b=Element.Properties[a];if(b)return this[b];b=Element.PropertiesIFlag[a]||
0;if(!window.ie||b)return this.getAttribute(a,b);return(a=this.attributes[a])?a.nodeValue:null},removeProperty:function(a){var b=Element.Properties[a];if(b)this[b]="";else this.removeAttribute(a);return this},getProperties:function(){return Element.getMany(this,"getProperty",arguments)},setProperty:function(a,b){var c=Element.Properties[a];if(c)this[c]=b;else this.setAttribute(a,b);return this},setProperties:function(a){return Element.setMany(this,"setProperty",a)},setHTML:function(){this.innerHTML=
$A(arguments).join("");return this},setText:function(a){var b=this.getTag();if(["style","script"].contains(b))if(window.ie){if(b=="style")this.styleSheet.cssText=a;else b=="script"&&this.setProperty("text",a);return this}else{this.removeChild(this.firstChild);return this.appendText(a)}this[$defined(this.innerText)?"innerText":"textContent"]=a;return this},getText:function(){var a=this.getTag();if(["style","script"].contains(a))if(window.ie)if(a=="style")return this.styleSheet.cssText;else{if(a=="script")return this.getProperty("text")}else return this.innerHTML;
return $pick(this.innerText,this.textContent)},getTag:function(){return this.tagName.toLowerCase()},empty:function(){Garbage.trash(this.getElementsByTagName("*"));return this.setHTML("")}});
Element.fixStyle=function(a,b,c){if($chk(parseInt(b)))return b;if(["height","width"].contains(a)){var d=0;(a=="width"?["left","right"]:["top","bottom"]).each(function(e){d+=c.getStyle("border-"+e+"-width").toInt()+c.getStyle("padding-"+e).toInt()});return c["offset"+a.capitalize()]-d+"px"}else if(a.test(/border(.+)Width|margin|padding/))return"0px";return b};Element.Styles={border:[],padding:[],margin:[]};
["Top","Right","Bottom","Left"].each(function(a){for(var b in Element.Styles)Element.Styles[b].push(b+a)});Element.borderShort=["borderWidth","borderStyle","borderColor"];Element.getMany=function(a,b,c){var d={};$each(c,function(e){d[e]=a[b](e)});return d};Element.setMany=function(a,b,c){for(var d in c)a[b](d,c[d]);return a};
Element.Properties=new Abstract({"class":"className","for":"htmlFor",colspan:"colSpan",rowspan:"rowSpan",accesskey:"accessKey",tabindex:"tabIndex",maxlength:"maxLength",readonly:"readOnly",frameborder:"frameBorder",value:"value",disabled:"disabled",checked:"checked",multiple:"multiple",selected:"selected"});Element.PropertiesIFlag={href:2,src:2};
Element.Methods={Listeners:{addListener:function(a,b){this.addEventListener?this.addEventListener(a,b,false):this.attachEvent("on"+a,b);return this},removeListener:function(a,b){this.removeEventListener?this.removeEventListener(a,b,false):this.detachEvent("on"+a,b);return this}}};window.extend(Element.Methods.Listeners);document.extend(Element.Methods.Listeners);Element.extend(Element.Methods.Listeners);
var Garbage={elements:[],collect:function(a){if(!a.$tmp){Garbage.elements.push(a);a.$tmp={opacity:1}}return a},trash:function(a){for(var b=0,c=a.length,d;b<c;b++)if((d=a[b])&&d.$tmp){d.$events&&d.fireEvent("trash").removeEvents();for(var e in d.$tmp)d.$tmp[e]=null;for(var l in Element.prototype)d[l]=null;Garbage.elements[Garbage.elements.indexOf(d)]=null;d.htmlElement=d.$tmp=d=null}Garbage.elements.remove(null)},empty:function(){Garbage.collect(window);Garbage.collect(document);Garbage.trash(Garbage.elements)}};
window.addListener("beforeunload",function(){window.addListener("unload",Garbage.empty);window.ie&&window.addListener("unload",CollectGarbage)});
Event=new Class({initialize:function(a){if(a&&a.$extended)return a;this.$extended=true;this.event=a=a||window.event;this.type=a.type;this.target=a.target||a.srcElement;if(this.target.nodeType==3)this.target=this.target.parentNode;this.shift=a.shiftKey;this.control=a.ctrlKey;this.alt=a.altKey;this.meta=a.metaKey;if(["DOMMouseScroll","mousewheel"].contains(this.type))this.wheel=a.wheelDelta?a.wheelDelta/120:-(a.detail||0)/3;else if(this.type.contains("key")){this.code=a.which||a.keyCode;for(var b in Event.keys)if(Event.keys[b]==
this.code){this.key=b;break}if(this.type=="keydown"){a=this.code-111;if(a>0&&a<13)this.key="f"+a}this.key=this.key||String.fromCharCode(this.code).toLowerCase()}else if(this.type.test(/(click|mouse|menu)/)){this.page={x:a.pageX||a.clientX+document.documentElement.scrollLeft,y:a.pageY||a.clientY+document.documentElement.scrollTop};this.client={x:a.pageX?a.pageX-window.pageXOffset:a.clientX,y:a.pageY?a.pageY-window.pageYOffset:a.clientY};this.rightClick=a.which==3||a.button==2;switch(this.type){case "mouseover":this.relatedTarget=
a.relatedTarget||a.fromElement;break;case "mouseout":this.relatedTarget=a.relatedTarget||a.toElement}this.fixRelatedTarget()}return this},stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation)this.event.stopPropagation();else this.event.cancelBubble=true;return this},preventDefault:function(){if(this.event.preventDefault)this.event.preventDefault();else this.event.returnValue=false;return this}});
Event.fix={relatedTarget:function(){if(this.relatedTarget&&this.relatedTarget.nodeType==3)this.relatedTarget=this.relatedTarget.parentNode},relatedTargetGecko:function(){try{Event.fix.relatedTarget.call(this)}catch(a){this.relatedTarget=this.target}}};Event.prototype.fixRelatedTarget=window.gecko?Event.fix.relatedTargetGecko:Event.fix.relatedTarget;Event.keys=new Abstract({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});
Element.Methods.Events={addEvent:function(a,b){this.$events=this.$events||{};this.$events[a]=this.$events[a]||{keys:[],values:[]};if(this.$events[a].keys.contains(b))return this;this.$events[a].keys.push(b);var c=a,d=Element.Events[a];if(d){d.add&&d.add.call(this,b);if(d.map)b=d.map;if(d.type)c=d.type}this.addEventListener||(b=b.create({bind:this,event:true}));this.$events[a].values.push(b);return Element.NativeEvents.contains(c)?this.addListener(c,b):this},removeEvent:function(a,b){if(!this.$events||
!this.$events[a])return this;var c=this.$events[a].keys.indexOf(b);if(c==-1)return this;this.$events[a].keys.splice(c,1);c=this.$events[a].values.splice(c,1)[0];var d=Element.Events[a];if(d){d.remove&&d.remove.call(this,b);if(d.type)a=d.type}return Element.NativeEvents.contains(a)?this.removeListener(a,c):this},addEvents:function(a){return Element.setMany(this,"addEvent",a)},removeEvents:function(a){if(!this.$events)return this;if(a){if(this.$events[a]){this.$events[a].keys.each(function(c){this.removeEvent(a,
c)},this);this.$events[a]=null}}else{for(var b in this.$events)this.removeEvents(b);this.$events=null}return this},fireEvent:function(a,b,c){this.$events&&this.$events[a]&&this.$events[a].keys.each(function(d){d.create({bind:this,delay:c,arguments:b})()},this);return this},cloneEvents:function(a,b){if(!a.$events)return this;if(b)a.$events[b]&&a.$events[b].keys.each(function(d){this.addEvent(b,d)},this);else for(var c in a.$events)this.cloneEvents(a,c);return this}};window.extend(Element.Methods.Events);
document.extend(Element.Methods.Events);Element.extend(Element.Methods.Events);Element.Events=new Abstract({mouseenter:{type:"mouseover",map:function(a){a=new Event(a);a.relatedTarget!=this&&!this.hasChild(a.relatedTarget)&&this.fireEvent("mouseenter",a)}},mouseleave:{type:"mouseout",map:function(a){a=new Event(a);a.relatedTarget!=this&&!this.hasChild(a.relatedTarget)&&this.fireEvent("mouseleave",a)}},mousewheel:{type:window.gecko?"DOMMouseScroll":"mousewheel"}});
Element.NativeEvents=["click","dblclick","mouseup","mousedown","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","keydown","keypress","keyup","load","unload","beforeunload","resize","move","focus","blur","change","submit","reset","select","error","abort","contextmenu","scroll"];Function.extend({bindWithEvent:function(a,b){return this.create({bind:a,arguments:b,event:Event})}});
Elements.extend({filterByTag:function(a){return new Elements(this.filter(function(b){return Element.getTag(b)==a}))},filterByClass:function(a,b){var c=this.filter(function(d){return d.className&&d.className.contains(a," ")});return b?c:new Elements(c)},filterById:function(a,b){var c=this.filter(function(d){return d.id==a});return b?c:new Elements(c)},filterByAttribute:function(a,b,c,d){var e=this.filter(function(l){l=Element.getProperty(l,a);if(!l)return false;if(!b)return true;switch(b){case "=":return l==
c;case "*=":return l.contains(c);case "^=":return l.substr(0,c.length)==c;case "$=":return l.substr(l.length-c.length)==c;case "!=":return l!=c;case "~=":return l.contains(c," ")}return false});return d?e:new Elements(e)}});function $E(a,b){return($(b)||document).getElement(a)}function $ES(a,b){return($(b)||document).getElementsBySelector(a)}
$$.shared={regexp:/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([!*^$]?=)["']?([^"'\]]*)["']?)?])?$/,xpath:{getParam:function(a,b,c){b=[b.namespaceURI?"xhtml:":"",c[1]];c[2]&&b.push('[@id="',c[2],'"]');c[3]&&b.push('[contains(concat(" ", @class, " "), " ',c[3],' ")]');if(c[4])if(c[5]&&c[6])switch(c[5]){case "*=":b.push("[contains(@",c[4],', "',c[6],'")]');break;case "^=":b.push("[starts-with(@",c[4],', "',c[6],'")]');break;case "$=":b.push("[substring(@",c[4],", string-length(@",c[4],") - ",c[6].length,
' + 1) = "',c[6],'"]');break;case "=":b.push("[@",c[4],'="',c[6],'"]');break;case "!=":b.push("[@",c[4],'!="',c[6],'"]')}else b.push("[@",c[4],"]");a.push(b.join(""));return a},getItems:function(a,b,c){var d=[];a=document.evaluate(".//"+a.join("//"),b,$$.shared.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);b=0;for(var e=a.snapshotLength;b<e;b++)d.push(a.snapshotItem(b));return c?d:new Elements(d.map($))}},normal:{getParam:function(a,b,c,d){if(d==0)if(c[2]){a=b.getElementById(c[2]);if(!a||
c[1]!="*"&&Element.getTag(a)!=c[1])return false;a=[a]}else a=$A(b.getElementsByTagName(c[1]));else{a=$$.shared.getElementsByTagName(a,c[1]);if(c[2])a=Elements.filterById(a,c[2],true)}if(c[3])a=Elements.filterByClass(a,c[3],true);if(c[4])a=Elements.filterByAttribute(a,c[4],c[5],c[6],true);return a},getItems:function(a,b,c){return c?a:$$.unique(a)}},resolver:function(a){return a=="xhtml"?"http://www.w3.org/1999/xhtml":false},getElementsByTagName:function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)c.extend(a[d].getElementsByTagName(b));
return c}};$$.shared.method=window.xpath?"xpath":"normal";
Element.Methods.Dom={getElements:function(a,b){var c=[];a=a.trim().split(" ");for(var d=0,e=a.length;d<e;d++){var l=a[d].match($$.shared.regexp);if(!l)break;l[1]=l[1]||"*";l=$$.shared[$$.shared.method].getParam(c,this,l,d);if(!l)break;c=l}return $$.shared[$$.shared.method].getItems(c,this,b)},getElement:function(a){return $(this.getElements(a,true)[0]||false)},getElementsBySelector:function(a,b){var c=[];a=a.split(",");for(var d=0,e=a.length;d<e;d++)c=c.concat(this.getElements(a[d],true));return b?
c:$$.unique(c)}};Element.extend({getElementById:function(a){a=document.getElementById(a);if(!a)return false;for(var b=a.parentNode;b!=this;b=b.parentNode)if(!b)return false;return a},getElementsByClassName:function(a){return this.getElements("."+a)}});document.extend(Element.Methods.Dom);Element.extend(Element.Methods.Dom);
Element.extend({getValue:function(){switch(this.getTag()){case "select":var a=[];$each(this.options,function(b){b.selected&&a.push($pick(b.value,b.text))});return this.multiple?a:a[0];case "input":if(!(this.checked&&["checkbox","radio"].contains(this.type))&&!["hidden","text","password"].contains(this.type))break;case "textarea":return this.value}return false},getFormElements:function(){return $$(this.getElementsByTagName("input"),this.getElementsByTagName("select"),this.getElementsByTagName("textarea"))},
toQueryString:function(){var a=[];this.getFormElements().each(function(b){var c=b.name,d=b.getValue();if(!(d===false||!c||b.disabled)){b=function(e){a.push(c+"="+encodeURIComponent(e))};$type(d)=="array"?d.each(b):b(d)}});return a.join("&")}});
Element.extend({scrollTo:function(a,b){this.scrollLeft=a;this.scrollTop=b},getSize:function(){return{scroll:{x:this.scrollLeft,y:this.scrollTop},size:{x:this.offsetWidth,y:this.offsetHeight},scrollSize:{x:this.scrollWidth,y:this.scrollHeight}}},getPosition:function(a){a=a||[];var b=this,c=0,d=0;do{c+=b.offsetLeft||0;d+=b.offsetTop||0;b=b.offsetParent}while(b);a.each(function(e){c-=e.scrollLeft||0;d-=e.scrollTop||0});return{x:c,y:d}},getTop:function(a){return this.getPosition(a).y},getLeft:function(a){return this.getPosition(a).x},
getCoordinates:function(a){a=this.getPosition(a);a={width:this.offsetWidth,height:this.offsetHeight,left:a.x,top:a.y};a.right=a.left+a.width;a.bottom=a.top+a.height;return a}});
Element.Events.domready={add:function(a){if(window.loaded)a.call(this);else{var b=function(){if(!window.loaded){window.loaded=true;window.timer=$clear(window.timer);this.fireEvent("domready")}}.bind(this);if(document.readyState&&window.webkit)window.timer=function(){["loaded","complete"].contains(document.readyState)&&b()}.periodical(50);else if(document.readyState&&window.ie){if(!$("ie_ready")){document.write('<script id="ie_ready" defer src="'+(window.location.protocol=="https:"?"://0":"javascript:void(0)")+
'"><\/script>');$("ie_ready").onreadystatechange=function(){this.readyState=="complete"&&b()}}}else{window.addListener("load",b);document.addListener("DOMContentLoaded",b)}}}};window.onDomReady=function(a){return this.addEvent("domready",a)};
window.extend({getWidth:function(){if(this.webkit419)return this.innerWidth;if(this.opera)return document.body.clientWidth;return document.documentElement.clientWidth},getHeight:function(){if(this.webkit419)return this.innerHeight;if(this.opera)return document.body.clientHeight;return document.documentElement.clientHeight},getScrollWidth:function(){if(this.ie)return Math.max(document.documentElement.offsetWidth,document.documentElement.scrollWidth);if(this.webkit)return document.body.scrollWidth;
return document.documentElement.scrollWidth},getScrollHeight:function(){if(this.ie)return Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight);if(this.webkit)return document.body.scrollHeight;return document.documentElement.scrollHeight},getScrollLeft:function(){return this.pageXOffset||document.documentElement.scrollLeft},getScrollTop:function(){return this.pageYOffset||document.documentElement.scrollTop},getSize:function(){return{size:{x:this.getWidth(),y:this.getHeight()},
scrollSize:{x:this.getScrollWidth(),y:this.getScrollHeight()},scroll:{x:this.getScrollLeft(),y:this.getScrollTop()}}},getPosition:function(){return{x:0,y:0}}});var Fx={};
Fx.Base=new Class({options:{onStart:Class.empty,onComplete:Class.empty,onCancel:Class.empty,transition:function(a){return-(Math.cos(Math.PI*a)-1)/2},duration:500,unit:"px",wait:true,fps:50},initialize:function(a){this.element=this.element||null;this.setOptions(a);this.options.initialize&&this.options.initialize.call(this)},step:function(){var a=$time();if(a<this.time+this.options.duration){this.delta=this.options.transition((a-this.time)/this.options.duration);this.setNow();this.increase()}else{this.stop(true);
this.set(this.to);this.fireEvent("onComplete",this.element,10);this.callChain()}},set:function(a){this.now=a;this.increase();return this},setNow:function(){this.now=this.compute(this.from,this.to)},compute:function(a,b){return(b-a)*this.delta+a},start:function(a,b){if(this.options.wait){if(this.timer)return this}else this.stop();this.from=a;this.to=b;this.change=this.to-this.from;this.time=$time();this.timer=this.step.periodical(Math.round(1E3/this.options.fps),this);this.fireEvent("onStart",this.element);
return this},stop:function(a){if(!this.timer)return this;this.timer=$clear(this.timer);a||this.fireEvent("onCancel",this.element);return this},custom:function(a,b){return this.start(a,b)},clearTimer:function(a){return this.stop(a)}});Fx.Base.implement(new Chain,new Events,new Options);
Fx.CSS={select:function(a,b){if(a.test(/color/i))return this.Color;var c=$type(b);if(c=="array"||c=="string"&&b.contains(" "))return this.Multi;return this.Single},parse:function(a,b,c){c.push||(c=[c]);var d=c[0];c=c[1];if(!$chk(c)){c=d;d=a.getStyle(b)}a=this.select(b,c);return{from:a.parse(d),to:a.parse(c),css:a}}};Fx.CSS.Single={parse:function(a){return parseFloat(a)},getNow:function(a,b,c){return c.compute(a,b)},getValue:function(a,b,c){if(b=="px"&&c!="opacity")a=Math.round(a);return a+b}};
Fx.CSS.Multi={parse:function(a){return a.push?a:a.split(" ").map(function(b){return parseFloat(b)})},getNow:function(a,b,c){for(var d=[],e=0;e<a.length;e++)d[e]=c.compute(a[e],b[e]);return d},getValue:function(a,b,c){if(b=="px"&&c!="opacity")a=a.map(Math.round);return a.join(b+" ")+b}};
Fx.CSS.Color={parse:function(a){return a.push?a:a.hexToRgb(true)},getNow:function(a,b,c){for(var d=[],e=0;e<a.length;e++)d[e]=Math.round(c.compute(a[e],b[e]));return d},getValue:function(a){return"rgb("+a.join(",")+")"}};
Fx.Style=Fx.Base.extend({initialize:function(a,b,c){this.element=$(a);this.property=b;this.parent(c)},hide:function(){return this.set(0)},setNow:function(){this.now=this.css.getNow(this.from,this.to,this)},set:function(a){this.css=Fx.CSS.select(this.property,a);return this.parent(this.css.parse(a))},start:function(a,b){if(this.timer&&this.options.wait)return this;var c=Fx.CSS.parse(this.element,this.property,[a,b]);this.css=c.css;return this.parent(c.from,c.to)},increase:function(){this.element.setStyle(this.property,
this.css.getValue(this.now,this.options.unit,this.property))}});Element.extend({effect:function(a,b){return new Fx.Style(this,a,b)}});
Fx.Styles=Fx.Base.extend({initialize:function(a,b){this.element=$(a);this.parent(b)},setNow:function(){for(var a in this.from)this.now[a]=this.css[a].getNow(this.from[a],this.to[a],this)},set:function(a){var b={};this.css={};for(var c in a){this.css[c]=Fx.CSS.select(c,a[c]);b[c]=this.css[c].parse(a[c])}return this.parent(b)},start:function(a){if(this.timer&&this.options.wait)return this;this.now={};this.css={};var b={},c={},d;for(d in a){var e=Fx.CSS.parse(this.element,d,a[d]);b[d]=e.from;c[d]=e.to;
this.css[d]=e.css}return this.parent(b,c)},increase:function(){for(var a in this.now)this.element.setStyle(a,this.css[a].getValue(this.now[a],this.options.unit,a))}});Element.extend({effects:function(a){return new Fx.Styles(this,a)}});
Fx.Elements=Fx.Base.extend({initialize:function(a,b){this.elements=$$(a);this.parent(b)},setNow:function(){for(var a in this.from){var b=this.from[a],c=this.to[a],d=this.css[a],e=this.now[a]={},l;for(l in b)e[l]=d[l].getNow(b[l],c[l],this)}},set:function(a){var b={};this.css={};for(var c in a){var d=a[c],e=this.css[c]={},l=b[c]={},t;for(t in d){e[t]=Fx.CSS.select(t,d[t]);l[t]=e[t].parse(d[t])}}return this.parent(b)},start:function(a){if(this.timer&&this.options.wait)return this;this.now={};this.css=
{};var b={},c={},d;for(d in a){var e=a[d],l=b[d]={},t=c[d]={},B=this.css[d]={},x;for(x in e){var h=Fx.CSS.parse(this.elements[d],x,e[x]);l[x]=h.from;t[x]=h.to;B[x]=h.css}}return this.parent(b,c)},increase:function(){for(var a in this.now){var b=this.now[a],c=this.css[a],d;for(d in b)this.elements[a].setStyle(d,c[d].getValue(b[d],this.options.unit,d))}}});
Fx.Scroll=Fx.Base.extend({options:{overflown:[],offset:{x:0,y:0},wheelStops:true},initialize:function(a,b){this.now=[];this.element=$(a);this.bound={stop:this.stop.bind(this,false)};this.parent(b);if(this.options.wheelStops){this.addEvent("onStart",function(){document.addEvent("mousewheel",this.bound.stop)}.bind(this));this.addEvent("onComplete",function(){document.removeEvent("mousewheel",this.bound.stop)}.bind(this))}},setNow:function(){for(var a=0;a<2;a++)this.now[a]=this.compute(this.from[a],
this.to[a])},scrollTo:function(a,b){if(this.timer&&this.options.wait)return this;var c=this.element.getSize(),d={x:a,y:b},e;for(e in c.size){var l=c.scrollSize[e]-c.size[e];d[e]=$chk(d[e])?$type(d[e])=="number"?d[e].limit(0,l):l:c.scroll[e];d[e]+=this.options.offset[e]}return this.start([c.scroll.x,c.scroll.y],[d.x,d.y])},toTop:function(){return this.scrollTo(false,0)},toBottom:function(){return this.scrollTo(false,"full")},toLeft:function(){return this.scrollTo(0,false)},toRight:function(){return this.scrollTo("full",
false)},toElement:function(a){var b=this.element.getPosition(this.options.overflown);a=$(a).getPosition(this.options.overflown);return this.scrollTo(a.x-b.x,a.y-b.y)},increase:function(){this.element.scrollTo(this.now[0],this.now[1])}});var Drag={};
Drag.Base=new Class({options:{handle:false,unit:"px",onStart:Class.empty,onBeforeStart:Class.empty,onComplete:Class.empty,onSnap:Class.empty,onDrag:Class.empty,limit:false,modifiers:{x:"left",y:"top"},grid:false,snap:6},initialize:function(a,b){this.setOptions(b);this.element=$(a);this.handle=$(this.options.handle)||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.bound={start:this.start.bindWithEvent(this),check:this.check.bindWithEvent(this),drag:this.drag.bindWithEvent(this),
stop:this.stop.bind(this)};this.attach();this.options.initialize&&this.options.initialize.call(this)},attach:function(){this.handle.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handle.removeEvent("mousedown",this.bound.start);return this},start:function(a){this.fireEvent("onBeforeStart",this.element);this.mouse.start=a.page;var b=this.options.limit;this.limit={x:[],y:[]};for(var c in this.options.modifiers)if(this.options.modifiers[c]){this.value.now[c]=this.element.getStyle(this.options.modifiers[c]).toInt();
this.mouse.pos[c]=a.page[c]-this.value.now[c];if(b&&b[c])for(var d=0;d<2;d++)if($chk(b[c][d]))this.limit[c][d]=$type(b[c][d])=="function"?b[c][d]():b[c][d]}if($type(this.options.grid)=="number")this.options.grid={x:this.options.grid,y:this.options.grid};document.addListener("mousemove",this.bound.check);document.addListener("mouseup",this.bound.stop);this.fireEvent("onStart",this.element);a.stop()},check:function(a){if(Math.round(Math.sqrt(Math.pow(a.page.x-this.mouse.start.x,2)+Math.pow(a.page.y-
this.mouse.start.y,2)))>this.options.snap){document.removeListener("mousemove",this.bound.check);document.addListener("mousemove",this.bound.drag);this.drag(a);this.fireEvent("onSnap",this.element)}a.stop()},drag:function(a){this.out=false;this.mouse.now=a.page;for(var b in this.options.modifiers)if(this.options.modifiers[b]){this.value.now[b]=this.mouse.now[b]-this.mouse.pos[b];if(this.limit[b])if($chk(this.limit[b][1])&&this.value.now[b]>this.limit[b][1]){this.value.now[b]=this.limit[b][1];this.out=
true}else if($chk(this.limit[b][0])&&this.value.now[b]<this.limit[b][0]){this.value.now[b]=this.limit[b][0];this.out=true}if(this.options.grid[b])this.value.now[b]-=this.value.now[b]%this.options.grid[b];this.element.setStyle(this.options.modifiers[b],this.value.now[b]+this.options.unit)}this.fireEvent("onDrag",this.element);a.stop()},stop:function(){document.removeListener("mousemove",this.bound.check);document.removeListener("mousemove",this.bound.drag);document.removeListener("mouseup",this.bound.stop);
this.fireEvent("onComplete",this.element)}});Drag.Base.implement(new Events,new Options);Element.extend({makeResizable:function(a){return new Drag.Base(this,$merge({modifiers:{x:"width",y:"height"}},a))}});
Drag.Move=Drag.Base.extend({options:{droppables:[],container:false,overflown:[]},initialize:function(a,b){this.setOptions(b);this.element=$(a);this.droppables=$$(this.options.droppables);this.container=$(this.options.container);this.position={element:this.element.getStyle("position"),container:false};if(this.container)this.position.container=this.container.getStyle("position");if(!["relative","absolute","fixed"].contains(this.position.element))this.position.element="absolute";var c=this.element.getStyle("top").toInt(),
d=this.element.getStyle("left").toInt();if(this.position.element=="absolute"&&!["relative","absolute","fixed"].contains(this.position.container)){c=$chk(c)?c:this.element.getTop(this.options.overflown);d=$chk(d)?d:this.element.getLeft(this.options.overflown)}else{c=$chk(c)?c:0;d=$chk(d)?d:0}this.element.setStyles({top:c,left:d,position:this.position.element});this.parent(this.element)},start:function(a){this.overed=null;if(this.container){var b=this.container.getCoordinates(),c=this.element.getCoordinates();
this.options.limit=this.position.element=="absolute"&&!["relative","absolute","fixed"].contains(this.position.container)?{x:[b.left,b.right-c.width],y:[b.top,b.bottom-c.height]}:{y:[0,b.height-c.height],x:[0,b.width-c.width]}}this.parent(a)},drag:function(a){this.parent(a);a=this.out?false:this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=a){this.overed&&this.overed.fireEvent("leave",[this.element,this]);this.overed=a?a.fireEvent("over",[this.element,this]):null}return this},
checkAgainst:function(a){a=a.getCoordinates(this.options.overflown);var b=this.mouse.now;return b.x>a.left&&b.x<a.right&&b.y<a.bottom&&b.y>a.top},stop:function(){this.overed&&!this.out?this.overed.fireEvent("drop",[this.element,this]):this.element.fireEvent("emptydrop",this);this.parent();return this}});Element.extend({makeDraggable:function(a){return new Drag.Move(this,a)}});
var XHR=new Class({options:{method:"post",async:true,onRequest:Class.empty,onSuccess:Class.empty,onFailure:Class.empty,urlEncoded:true,encoding:"utf-8",autoCancel:false,headers:{}},setTransport:function(){this.transport=window.XMLHttpRequest?new XMLHttpRequest:window.ie?new ActiveXObject("Microsoft.XMLHTTP"):false;return this},initialize:function(a){this.setTransport().setOptions(a);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers={};if(this.options.urlEncoded&&this.options.method==
"post")this.setHeader("Content-type","application/x-www-form-urlencoded"+(this.options.encoding?"; charset="+this.options.encoding:""));this.options.initialize&&this.options.initialize.call(this)},onStateChange:function(){if(!(this.transport.readyState!=4||!this.running)){this.running=false;var a=0;try{a=this.transport.status}catch(b){}this.options.isSuccess.call(this,a)?this.onSuccess():this.onFailure();this.transport.onreadystatechange=Class.empty}},isSuccess:function(a){return a>=200&&a<300},onSuccess:function(){this.response=
{text:this.transport.responseText,xml:this.transport.responseXML};this.fireEvent("onSuccess",[this.response.text,this.response.xml]);this.callChain()},onFailure:function(){this.fireEvent("onFailure",this.transport)},setHeader:function(a,b){this.headers[a]=b;return this},send:function(a,b){if(this.options.autoCancel)this.cancel();else if(this.running)return this;this.running=true;if(b&&this.options.method=="get"){a=a+(a.contains("?")?"&":"?")+b;b=null}this.transport.open(this.options.method.toUpperCase(),
a,this.options.async);this.transport.onreadystatechange=this.onStateChange.bind(this);this.options.method=="post"&&this.transport.overrideMimeType&&this.setHeader("Connection","close");$extend(this.headers,this.options.headers);for(var c in this.headers)try{this.transport.setRequestHeader(c,this.headers[c])}catch(d){}this.fireEvent("onRequest");this.transport.send($pick(b,null));return this},cancel:function(){if(!this.running)return this;this.running=false;this.transport.abort();this.transport.onreadystatechange=
Class.empty;this.setTransport();this.fireEvent("onCancel");return this}});XHR.implement(new Chain,new Events,new Options);
var Ajax=XHR.extend({options:{data:null,update:null,onComplete:Class.empty,evalScripts:false,evalResponse:false},initialize:function(a,b){this.addEvent("onSuccess",this.onComplete);this.setOptions(b);this.options.data=this.options.data||this.options.postBody;if(!["post","get"].contains(this.options.method)){this._method="_method="+this.options.method;this.options.method="post"}this.parent();this.setHeader("X-Requested-With","XMLHttpRequest");this.setHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");
this.url=a},onComplete:function(){this.options.update&&$(this.options.update).empty().setHTML(this.response.text);if(this.options.evalScripts||this.options.evalResponse)this.evalScripts();this.fireEvent("onComplete",[this.response.text,this.response.xml],20)},request:function(a){a=a||this.options.data;switch($type(a)){case "element":a=$(a).toQueryString();break;case "object":a=Object.toQueryString(a)}if(this._method)a=a?[this._method,a].join("&"):this._method;return this.send(this.url,a)},evalScripts:function(){var a,
b;if(this.options.evalResponse||/(ecma|java)script/.test(this.getHeader("Content-type")))b=this.response.text;else{b=[];for(var c=/<script[^>]*>([\s\S]*?)<\/script>/gi;a=c.exec(this.response.text);)b.push(a[1]);b=b.join("\n")}if(b)window.execScript?window.execScript(b):window.setTimeout(b,0)},getHeader:function(a){try{return this.transport.getResponseHeader(a)}catch(b){}return null}});
Object.toQueryString=function(a){var b=[],c;for(c in a)b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")};Element.extend({send:function(a){return(new Ajax(this.getProperty("action"),$merge({data:this.toQueryString()},a,{method:"post"}))).request()}});
var Slider=new Class({options:{onChange:Class.empty,onComplete:Class.empty,onTick:function(a){this.knob.setStyle(this.p,a)},mode:"horizontal",steps:100,offset:0},initialize:function(a,b,c){this.element=$(a);this.knob=$(b);this.setOptions(c);this.step=this.previousEnd=this.previousChange=-1;this.element.addEvent("mousedown",this.clickedElement.bindWithEvent(this));var d,e;switch(this.options.mode){case "horizontal":this.z="x";this.p="left";d={x:"left",y:false};e="offsetWidth";break;case "vertical":this.z=
"y";this.p="top";d={x:false,y:"top"};e="offsetHeight"}this.max=this.element[e]-this.knob[e]+this.options.offset*2;this.half=this.knob[e]/2;this.getPos=this.element["get"+this.p.capitalize()].bind(this.element);this.knob.setStyle("position","relative").setStyle(this.p,-this.options.offset);a={};a[this.z]=[-this.options.offset,this.max-this.options.offset];this.drag=new Drag.Base(this.knob,{limit:a,modifiers:d,snap:0,onStart:function(){this.draggedKnob()}.bind(this),onDrag:function(){this.draggedKnob()}.bind(this),
onComplete:function(){this.draggedKnob();this.end()}.bind(this)});this.options.initialize&&this.options.initialize.call(this)},set:function(a){this.step=a.limit(0,this.options.steps);this.checkStep();this.end();this.fireEvent("onTick",this.toPosition(this.step));return this},clickedElement:function(a){a=a.page[this.z]-this.getPos()-this.half;a=a.limit(-this.options.offset,this.max-this.options.offset);this.step=this.toStep(a);this.checkStep();this.end();this.fireEvent("onTick",a)},draggedKnob:function(){this.step=
this.toStep(this.drag.value.now[this.z]);this.checkStep()},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("onChange",this.step)}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("onComplete",this.step+"")}},toStep:function(a){return Math.round((a+this.options.offset)/this.max*this.options.steps)},toPosition:function(a){return this.max*a/this.options.steps}});Slider.implement(new Events);Slider.implement(new Options);function SimpleSwap(a,b){a.src=a.getAttribute(b||"origsrc")}function SimpleSwapSetup(){for(var a=$$(".mov img"),b=0;b<a.length;b++){a[b].oversrcimg=new Image;a[b].oversrcimg.src=a[b].src.replace("-1.","-3.");a[b].onmouseover=new Function("SimpleSwap(this,'oversrc');");a[b].onmouseout=new Function("SimpleSwap(this);");a[b].setAttribute("origsrc",a[b].src);a[b].setAttribute("oversrc",a[b].oversrcimg.src)}}var PreSimpleSwapOnload=window.onload?window.onload:function(){};
window.onload=function(){PreSimpleSwapOnload();SimpleSwapSetup()};var clickFunction=function(){if($("searchterm").value=="H\u013eadan\u00fd re\u0165azec"||$("searchterm").value=="Searched string"||$("searchterm").value=="Keresett l\u00e1nc")$("searchterm").value=""},subSearch=function(a){if($("searchterm").value=="H\u013eadan\u00fd re\u0165azec"||$("searchterm").value=="Searched string"||$("searchterm").value=="Keresett l\u00e1nc"||$("searchterm").value=="")(new Event(a)).stop()};
window.addEvent("domready",function(){$("searchterm").addEvent("click",clickFunction);$("searchform").addEvent("submit",subSearch)});var urlAddress="http://www.videotube.sk",pageName="Videotube.sk - Z\u00e1bavn\u00e9 Vide\u00e1";function addToFavorites(){window.external?window.external.AddFavorite(urlAddress,pageName):alert("Sorry! Your browser doesn't support this function.")};
