function getValueByID(a){if(parent.document.getElementById(a)!=null){return parent.document.getElementById(a).value}}function play(a,c,b){parent.document.location="index.php?view="+a+"[y]"+c}function showNames(a){document.getElementById("cyetube_names").src="cyetube_names.php?cattype="+a}function searchFor(){searchterm=document.getElementById("search_term").value;searchcat="all";if(searchterm.length>0){document.getElementById("cyetube_names").src="media_search.php?search_term="+searchterm+"&search_cat="+searchcat}}function searchForOnYouTube(){searchterm=document.getElementById("search_term").value;popupWin=window.open("http://www.youtube.com/results?search_query="+searchterm+"&search_type=&aq=f","open_window","menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width="+screen.width+", height="+screen.height+", left=0, top=0")}function searchForOnDailymotion(){searchterm=document.getElementById("search_term").value;popupWin=window.open("http://www.dailymotion.com/relevance/search/"+searchterm,"open_window","menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width="+screen.width+", height="+screen.height+", left=0, top=0")}function searchForWithEnter(b){if(window.event){b=window.event}var a=(b.keyCode)?b.keyCode:b.which;if(a==13){searchFor()}}function lastMoviesAdded(a){try{xmlhttp_lma=new XMLHttpRequest()}catch(b){try{xmlhttp_lma=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{xmlhttp_lma=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){alert("Your browser broke!");return false}}}xmlhttp_lma.open("GET","inc_last_movies_added.php?noe_mla="+a,true);xmlhttp_lma.onreadystatechange=function(){if(xmlhttp_lma.readyState==4){document.getElementById("movies_added").innerHTML=xmlhttp_lma.responseText}};xmlhttp_lma.send(null);return false}function writeToFile(b){try{xmlhttp_wtf=new XMLHttpRequest()}catch(a){try{xmlhttp_wtf=new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{xmlhttp_wtf=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){alert("Your browser broke!");return false}}}xmlhttp_wtf.open("GET","inc_ajax_write_to_file.php?text="+b,true);xmlhttp_wtf.onreadystatechange=function(){if(xmlhttp_wtf.readyState==4){if(parent.document.getElementById("viewed_links")!=null){parent.document.getElementById("viewed_links").innerHTML=xmlhttp_wtf.responseText}}};xmlhttp_wtf.send(null);return false}function reportUnavailableClip(a){try{xmlhttp_ruc=new XMLHttpRequest()}catch(b){try{xmlhttp_ruc=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{xmlhttp_ruc=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){alert("Your browser broke!");return false}}}xmlhttp_ruc.open("GET","inc_ajax_repo_clip_unav.php?item="+a,true);xmlhttp_ruc.onreadystatechange=function(){if(xmlhttp_ruc.readyState==4){if(parent.document.getElementById("unav_clip")!=null){parent.document.getElementById("unav_clip").innerHTML=xmlhttp_ruc.responseText}}};xmlhttp_ruc.send(null);return false}function getClipStatus(a,c,b){try{xmlhttp_CS=new XMLHttpRequest()}catch(d){try{xmlhttp_CS=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){try{xmlhttp_CS=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){alert("Your browser broke!");return false}}}xmlhttp_CS.open("GET","inc_ajax_clip_status.php?m="+a+"&c="+c+"&n="+b,true);xmlhttp_CS.onreadystatechange=function(){if(xmlhttp_CS.readyState==4){if(parent.document.getElementById("unav_clip")!=null){parent.document.getElementById("unav_clip").innerHTML=xmlhttp_CS.responseText}}};xmlhttp_CS.send(null);return false}function setLinkYM(a,c,b){try{xmlhttp_YM=new XMLHttpRequest()}catch(d){try{xmlhttp_YM=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){try{xmlhttp_YM=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){alert("Your browser broke!");return false}}}xmlhttp_YM.open("GET","inc_ajax_clip_linkym.php?m="+a+"&c="+c+"&n="+b,true);xmlhttp_YM.onreadystatechange=function(){if(xmlhttp_YM.readyState==4){parent.document.getElementById("link_ym").innerHTML=xmlhttp_YM.responseText}};xmlhttp_YM.send(null);return false}function expandDiv(b,a){if(document.getElementById(b).style.display=="none"){document.getElementById(b).style.display="";document.getElementById(a).src="img/down.png"}else{document.getElementById(b).style.display="none";document.getElementById(a).src="img/right.png"}}function expandDiv2(b,e,a){div="ct_vafed";var d=new Array("most_viewed","viewed","latest_added","featured");var c=d.length;for(i=0;i<c;i++){if(parent.document.getElementById(d[i]+"_img")!=null){document.getElementById(d[i]+"_img").src="img/right.png"}}document.getElementById("scroll").innerHTML="Loading...";document.getElementById("container").style.cursor="wait";document.getElementById("scroll").style.background="url(img/loading.gif) no-repeat center center";if(document.getElementById(div).style.display=="none"){document.getElementById(div).style.display="";document.getElementById(e).src="img/down.png"}else{document.getElementById(div).style.display="";document.getElementById(e).src="img/down.png"}getVAFED(b,a)}function getVAFED(a,c){try{xmlhttp_vafed=new XMLHttpRequest()}catch(b){try{xmlhttp_vafed=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{xmlhttp_vafed=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){alert("Your browser broke!");return false}}}xmlhttp_vafed.open("GET","inc_ajax_vafed.php?opt="+a+"&date="+c,true);xmlhttp_vafed.onreadystatechange=function(){if(xmlhttp_vafed.readyState==4){parent.document.getElementById("scroll").innerHTML=xmlhttp_vafed.responseText;document.getElementById("scroll").style.background="";document.getElementById("container").style.cursor="default"}};xmlhttp_vafed.send(null);return false}function showSpan(d,a){var c=new Array("span_mv","span_v","span_la","span_ft");var b=c.length;for(i=0;i<b;i++){if(parent.document.getElementById(c[i])!=null){parent.document.getElementById(c[i]).style.display="none"}}if(parent.document.getElementById(d)!=null){if(a){document.getElementById(d).style.display=""}else{document.getElementById(d).style.display="none"}}}function addClip(){try{xmlhttp=new XMLHttpRequest()}catch(a){try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){alert("Your browser broke !");return false}}}name=document.getElementById("clip_name").value;code=document.getElementById("clip_code").value;cat=document.getElementById("clip_category").value;link=document.getElementById("clip_link").value;username=document.getElementById("user_logged").value;if(can_go_fwd(name,code,cat,link)){name=name.replace("&","_and_");xmlhttp.open("GET","inc_ajax_add_clip.php?clip_name="+name+"&clip_code="+code+"&clip_cat="+cat+"&clip_link="+link+"&visible="+showHyperlink()+"&username="+username,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){if(parent.document.getElementById("add_clip_result")!=null){document.getElementById("add_clip_result").innerHTML=xmlhttp.responseText}}};xmlhttp.send(null)}clearValues();return false}function showHyperlink(){visible=false;if(document.getElementById("clip_category")!=null){cat=document.getElementById("clip_category").value;visible=false;if((cat=="movie")||(cat=="trailer")){document.getElementById("p_clip_link").style.display="";visible=true;movie_name=document.getElementById("clip_name").value;if(movie_name.length!=0){document.getElementById("find_site").style.display="";document.getElementById("find_site").innerHTML='<A HREF="http://www.google.com/search?q='+movie_name+' movie" target="_blank">Find '+movie_name+" Web Site &gt;&gt;</A>";document.getElementById("find_code").style.display="";document.getElementById("find_code").innerHTML='<A HREF="http://www.youtube.com/results?search_query='+movie_name+' trailer" target="_blank">Find '+movie_name+" Trailer Code &gt;&gt;</A>"}else{document.getElementById("find_site").style.display="none";document.getElementById("find_code").style.display="none"}}else{document.getElementById("p_clip_link").style.display="none";visible=false;document.getElementById("find_site").style.display="none";document.getElementById("find_code").style.display="none"}}return visible}function can_go_fwd(b,e,a,d){len_name=b.length;len_code=e.length;len_cat=a.length;len_link=d.lenght;var c=true;if((len_name==0)&&(len_code==0)&&(len_cat==0)&&(len_link==0)){alert("Please fill in all the fields !");document.form_add_clip.clip_name.focus();c=false}else{if(len_name==0){alert("Please fill in the CLIP NAME field !");document.form_add_clip.clip_name.focus();c=false}else{if(len_code==0){alert("Please fill in the CLIP CODE field !");document.form_add_clip.clip_code.focus();c=false}else{if(len_cat==0){alert("Please select a CATEGORY !");document.form_add_clip.clip_category.focus();c=false}else{c=true}}}}return c}function refreshLink(){movie_name=document.getElementById("clip_name").value;cat=document.getElementById("clip_category").value;if(cat=="movie"||cat=="trailer"){if(movie_name.length!=0){document.getElementById("find_site").style.display="";document.getElementById("find_site").innerHTML='<A HREF="http://www.google.com/search?q='+movie_name+' movie" target="_blank">Find '+movie_name+" Web Site &gt;&gt;</A>";document.getElementById("find_code").style.display="";document.getElementById("find_code").innerHTML='<A HREF="http://www.youtube.com/results?search_query='+movie_name+' trailer" target="_blank">Find '+movie_name+" Trailer Code &gt;&gt;</A>"}}}function clearValues(){document.getElementById("clip_name").value="";document.getElementById("clip_code").value="";document.getElementById("clip_category").value="9x";showHyperlink();document.getElementById("clip_link").value=""}function checkUserAvailability(){try{xmlhttp_checkav=new XMLHttpRequest()}catch(a){try{xmlhttp_checkav=new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{xmlhttp_checkav=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){alert("Your browser broke!");return false}}}cyetube_id=document.getElementById("cyeTubeID").value;xmlhttp_checkav.open("GET","inc_ajax_check_availability.php?ctid="+cyetube_id,true);xmlhttp_checkav.onreadystatechange=function(){if(xmlhttp_checkav.readyState==4){if(cyetube_id.length>0){parent.document.getElementById("cyetube_id").innerHTML=xmlhttp_checkav.responseText;response=xmlhttp_checkav.responseText;if(response.indexOf("taken")>0){parent.document.getElementById("button_register").disabled=true}if(response.indexOf("available")>0){parent.document.getElementById("button_register").disabled=false}}else{parent.document.getElementById("cyetube_id").innerHTML='<FONT COLOR="#ff3399"><B>nothing to check</B></FONT>'}}};xmlhttp_checkav.send(null);return false}function validateEmail(){cyetube_email=document.getElementById("email").value;if(!isEmail(cyetube_email)){parent.document.getElementById("cyetube_email_validate").innerHTML=', <FONT COLOR="#ff3399"><B>email is not valid</B></FONT>'}else{parent.document.getElementById("cyetube_email_validate").innerHTML=', <FONT COLOR="#75C5F0"><B>email is valid</B></FONT>'}}function checkEmailAvailability(){try{xmlhttp_checkavemail=new XMLHttpRequest()}catch(a){try{xmlhttp_checkavemail=new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{xmlhttp_checkavemail=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){alert("Your browser broke!");return false}}}cyetube_email=document.getElementById("email").value;xmlhttp_checkavemail.open("GET","inc_ajax_check_availability.php?ctemail="+cyetube_email,true);xmlhttp_checkavemail.onreadystatechange=function(){if(xmlhttp_checkavemail.readyState==4){if(cyetube_email.length>0){response=xmlhttp_checkavemail.responseText;if(!isEmail(cyetube_email)){parent.document.getElementById("cyetube_email").innerHTML='<FONT COLOR="#ff3399"><B>email is not valid</B></FONT>';parent.document.getElementById("button_register").disabled=true}else{parent.document.getElementById("cyetube_email").innerHTML='<FONT COLOR="#75C5F0"><B>email is valid</B></FONT>';if(response.indexOf("taken")>0){parent.document.getElementById("button_register").disabled=true}if(response.indexOf("ok")>0){parent.document.getElementById("button_register").disabled=false}parent.document.getElementById("cyetube_email").innerHTML=response}}else{parent.document.getElementById("cyetube_email").innerHTML='<FONT COLOR="#ff3399"><B>nothing to check</B></FONT>'}}};xmlhttp_checkavemail.send(null);return false}function register(){try{xmlhttp_register=new XMLHttpRequest()}catch(a){try{xmlhttp_register=new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{xmlhttp_register=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){alert("Your browser broke!");return false}}}cyetube_id=document.getElementById("cyeTubeID").value;cyetube_pass_01=document.getElementById("password_01").value;cyetube_pass_02=document.getElementById("password_02").value;cyetube_name=document.getElementById("name").value;cyetube_email=document.getElementById("email").value;if(RU_can_go_fwd(cyetube_id,cyetube_pass_01,cyetube_pass_02,cyetube_name,cyetube_email)){xmlhttp_register.open("GET","inc_ajax_register_user.php?ctid="+cyetube_id+"&ctpass01="+cyetube_pass_01+"&ctpass02="+cyetube_pass_02+"&n="+cyetube_name+"&e="+cyetube_email,true);xmlhttp_register.onreadystatechange=function(){if(xmlhttp_register.readyState==4){if(cyetube_pass_01!=cyetube_pass_02){parent.document.getElementById("cyetube_password_01").innerHTML='<FONT COLOR="#ff3399"><B>passwords do NOT match</B></FONT>';parent.document.getElementById("cyetube_password_02").innerHTML='<FONT COLOR="#ff3399"><B>passwords do NOT match</B></FONT>'}else{parent.document.getElementById("cyetube_password_01").innerHTML='<FONT COLOR="#75C5F0"><B>passwords do match</B></FONT>';parent.document.getElementById("cyetube_password_02").innerHTML='<FONT COLOR="#75C5F0"><B>passwords do match</B></FONT>';parent.document.getElementById("form_register").innerHTML=xmlhttp_register.responseText}}};xmlhttp_register.send(null)}return false}function RU_can_go_fwd(d,f,e,a,b){len_ctid=d.length;len_pass01=f.length;len_pass02=e.length;len_name=a.length;len_email=b.length;var c=true;if((len_ctid==0)&&(len_pass01==0)&&(len_pass02==0)&&(len_name==0)&&(len_email==0)){document.form_register.cyeTubeID.focus();document.getElementById("cyetube_id").innerHTML='<FONT COLOR="#ff3399"><B> <-- Please fill in the cyeTube ID field !</B></FONT>';document.getElementById("cyetube_password_01").innerHTML='<FONT COLOR="#ff3399"><B> <-- Please fill in the PASSWORD field !</B></FONT>';document.getElementById("cyetube_password_02").innerHTML='<FONT COLOR="#ff3399"><B> <-- Please fill in the CONFIRM PASSWORD field !</B></FONT>';document.getElementById("cyetube_name").innerHTML='<FONT COLOR="#ff3399"><B> <-- Please fill in the FULL NAME field !</B></FONT>';document.getElementById("cyetube_email").innerHTML='<FONT COLOR="#ff3399"><B> <-- Please fill in the EMAIL field !</B></FONT>';c=false}else{if(len_ctid==0){document.form_register.cyeTubeID.focus();document.getElementById("cyetube_id").innerHTML='<FONT COLOR="#ff3399"><B> <-- Please fill in the cyeTube ID field !</B></FONT>';c=false}else{if(len_pass01==0){document.form_register.password_01.focus();parent.document.getElementById("cyeTubeID").innerHTML="";parent.document.getElementById("cyetube_password_01").innerHTML='<FONT COLOR="#ff3399"><B> <-- Please fill in the PASSWORD field !</B></FONT>';c=false}else{if(len_pass02==0){document.form_register.password_02.focus();parent.document.getElementById("cyetube_password_01").innerHTML="";parent.document.getElementById("cyetube_password_02").innerHTML='<FONT COLOR="#ff3399"><B> <-- Please fill in the CONFIRM PASSWORD field !</B></FONT>';c=false}else{if(len_name==0){document.form_register.name.focus();parent.document.getElementById("cyetube_password_01").innerHTML="";parent.document.getElementById("cyetube_password_02").innerHTML="";parent.document.getElementById("cyetube_name").innerHTML='<FONT COLOR="#ff3399"><B> <-- Please fill in the FULL NAME field !</B></FONT>';c=false}else{if(len_email==0){document.form_register.email.focus();parent.document.getElementById("cyetube_password_01").innerHTML="";parent.document.getElementById("cyetube_password_02").innerHTML="";parent.document.getElementById("cyetube_name").innerHTML="";parent.document.getElementById("cyetube_email").innerHTML='<FONT COLOR="#ff3399"><B> <-- Please fill in the EMAIL field !</B></FONT>';c=false}else{c=true}}}}}}return c}function isEmail(e){function d(l){var n=l.split("");if(n.length==0){return true}var k=0;for(var m=0;m<n.length;m++){if(n[m]==" "){k=1;break}}if(k){return true}return false}function h(k){var o=new Array("~","!","@","#","$","%","^","&","*","(",")","+","=","[","]",":",";",",",'"',"'","|","{","}","\\","/","<",">","?");var n=k.split("");for(var m=0;m<n.length;m++){for(var l=0;l<o.length;l++){if(n[m]==o[l]){return false}}}return true}function f(k){var o=new Array("-","_",".");var n=k.split("");which=0;for(var m=0;m<2;m++){for(var l=0;l<o.length;l++){if(n[which]==o[l]){return false}}which=n.length-1}return true}function j(k){var o=new Array("-","_",".");var n=k.split("");if(n.length<2||n.length>4){return false}for(var m=0;m<n.length;m++){for(var l=0;l<o.length;l++){if(n[m]==o[l]){return false}}}return true}var b=e.split("@");if(b.length<=1||b.length>2){return false}else{if(h(b[0])&&f(b[0])&&h(b[1])){if(!d(b[b.length-1])&&!d(b[0])){var a=b[b.length-1].split(".");if(a.length>=2){var g=1;for(var c=0;c<a.length;c++){if(d(a[c])||!f(a[c])){g=0;break}}if(g&&j(a[a.length-1])){return true}return false}return false}}}}function createPlaylist(a){try{xmlhttp_register=new XMLHttpRequest()}catch(b){try{xmlhttp_register=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{xmlhttp_register=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){alert("Your browser broke!");return false}}}cyetube_pl_name=document.getElementById("playlist_name").value;cyetube_pl_description=document.getElementById("playlist_description").value;cyetube_pl_type=document.getElementById("playlist_type").value;cyetube_pl_username=document.getElementById("playlist_username").value;if(cyetube_pl_name.length>=3){xmlhttp_register.open("GET","inc_ajax_create_playlist.php?ct_pl_name="+cyetube_pl_name+"&ct_pl_desc="+cyetube_pl_description+"&ct_pl_type="+cyetube_pl_type+"&ct_username="+cyetube_pl_username,true);xmlhttp_register.onreadystatechange=function(){if(xmlhttp_register.readyState==4){alert(xmlhttp_register.responseText);parent.window.location=a}};xmlhttp_register.send(null)}else{parent.document.getElementById("span_playlist_name").innerHTML='<FONT COLOR="#ff3399"><B>min 3 characters</B></FONT>'}return false}function updatePlaylist(b,a){try{xmlhttp_update=new XMLHttpRequest()}catch(c){try{xmlhttp_update=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{xmlhttp_update=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){alert("Your browser broke!");return false}}}cyetube_pl_name=document.getElementById("playlist_name").value;cyetube_pl_description=document.getElementById("playlist_description").value;cyetube_pl_type=document.getElementById("playlist_type").value;cyetube_pl_username=document.getElementById("playlist_username").value;if(cyetube_pl_name.length>=3){xmlhttp_update.open("GET","inc_ajax_update_playlist.php?ct_pl_code="+b+"&ct_pl_name="+cyetube_pl_name+"&ct_pl_desc="+cyetube_pl_description+"&ct_pl_type="+cyetube_pl_type+"&ct_username="+cyetube_pl_username,true);xmlhttp_update.onreadystatechange=function(){if(xmlhttp_update.readyState==4){alert(xmlhttp_update.responseText);parent.window.location=a}};xmlhttp_update.send(null)}else{parent.document.getElementById("span_playlist_name").innerHTML='<FONT COLOR="#ff3399"><B>min 3 characters</B></FONT>'}return false}function playList(a){try{xmlhttp_plid=new XMLHttpRequest()}catch(b){try{xmlhttp_plid=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{xmlhttp_plid=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){alert("Your browser broke!");return false}}}xmlhttp_plid.open("GET","inc_ajax_create_playlist.php?ct_pl_name="+cyetube_pl_name+"&ct_pl_desc="+cyetube_pl_description+"&ct_pl_type="+cyetube_pl_type+"&ct_username="+cyetube_pl_username,true);xmlhttp_plid.onreadystatechange=function(){if(xmlhttp_plid.readyState==4){parent.document.getElementById("form_create_playlist").innerHTML=xmlhttp_register.responseText}};xmlhttp_plid.send(null);return false}function deletePlaylist(a,b){try{xmlhttp_plid_del=new XMLHttpRequest()}catch(c){try{xmlhttp_plid_del=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{xmlhttp_plid_del=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){alert("Your browser broke!");return false}}}xmlhttp_plid_del.open("GET","inc_ajax_delete_playlist.php?ct_pl_id="+a+"&ct_pl_code="+b,true);xmlhttp_plid_del.onreadystatechange=function(){if(xmlhttp_plid_del.readyState==4){alert(xmlhttp_plid_del.responseText);parent.window.location="playlists.php"}};xmlhttp_plid_del.send(null);return false}function showAdd2Playlist(a,c,b){try{xmlhttp_a2p=new XMLHttpRequest()}catch(d){try{xmlhttp_a2p=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){try{xmlhttp_a2p=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){alert("Your browser broke!");return false}}}username=getValueByID("user_logged");xmlhttp_a2p.open("GET","inc_ajax_add2playlist_status.php?m="+a+"&c="+c+"&n="+b+"&u="+username,true);xmlhttp_a2p.onreadystatechange=function(){if(xmlhttp_a2p.readyState==4){if(document.getElementById("add_clip")!=null){document.getElementById("add_clip").innerHTML=xmlhttp_a2p.responseText}}};xmlhttp_a2p.send(null);return false}function add2Playlist(a,b){try{xmlhttp_a2pl=new XMLHttpRequest()}catch(c){try{xmlhttp_a2pl=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{xmlhttp_a2pl=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){alert("Your browser broke!");return false}}}xmlhttp_a2pl.open("GET","inc_ajax_add_clip_2playlist.php?ct_pl_id="+a+"&ct_clip_code="+b,true);xmlhttp_a2pl.onreadystatechange=function(){if(xmlhttp_a2pl.readyState==4){parent.document.getElementById("add_clip_2playlist_"+b+"_status").innerHTML=xmlhttp_a2pl.responseText}};xmlhttp_a2pl.send(null);return false}function addAll2Playlist(a){try{xmlhttp_a2pl=new XMLHttpRequest()}catch(b){try{xmlhttp_a2pl=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{xmlhttp_a2pl=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){alert("Your browser broke!");return false}}}xmlhttp_a2pl.open("GET","inc_ajax_add_clip_2playlist.php?ct_pl_id="+a+"&ct_clip_code=qlist",true);xmlhttp_a2pl.onreadystatechange=function(){if(xmlhttp_a2pl.readyState==4){if(parent.document.getElementById("add_clips_2playlist_status")!=null){parent.document.getElementById("add_clips_2playlist_status").innerHTML=xmlhttp_a2pl.responseText}parent.window.location="quick_list.php"}};xmlhttp_a2pl.send(null);return false}function removeClipFromPlaylist(d,a,b){try{xmlhttp_remove=new XMLHttpRequest()}catch(c){try{xmlhttp_remove=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{xmlhttp_remove=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){alert("Your browser broke!");return false}}}xmlhttp_remove.open("GET","inc_ajax_remove_clip_from_playlist.php?ct_pl_id="+a+"&ct_clip_rank="+d+"&ct_pl_code="+b,true);xmlhttp_remove.onreadystatechange=function(){if(xmlhttp_remove.readyState==4){alert(xmlhttp_remove.responseText);parent.window.location="playlists.php?pl_code="+b}};xmlhttp_remove.send(null);return false}function addToQuickList(a){if(parent.document.getElementById("user_logged")!=null){user_logged=parent.document.getElementById("user_logged").value}ql_writeToFile(a,"ct_quicklist_"+user_logged);document.getElementById(a).innerHTML='<span id="span_qlist_add_result" title="This item ws added to the qList !">added</span>';document.getElementById(a).disabled=true;document.getElementById(a).style.cursor="default"}function ql_writeToFile(c,a){try{xmlhttp_wtfilename=new XMLHttpRequest()}catch(b){try{xmlhttp_wtfilename=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{xmlhttp_wtfilename=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){alert("Your browser broke!");return false}}}xmlhttp_wtfilename.open("GET","inc_ajax_write_to_file.php?text="+c+"&filename="+a,true);xmlhttp_wtfilename.onreadystatechange=function(){if(xmlhttp_wtfilename.readyState==4){noe_qlist_clips=xmlhttp_wtfilename.responseText;if(parent.document.getElementById("quicklist")!=null){parent.document.getElementById("quicklist").innerHTML='<A HREF="quick_list.php" title="qList: View Clips">qList ['+noe_qlist_clips+"]</A>"}}};xmlhttp_wtfilename.send(null);return false}function refreshPlaylists(a){try{xmlhttp_rpl=new XMLHttpRequest()}catch(b){try{xmlhttp_rpl=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{xmlhttp_rpl=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){alert("Your browser broke!");return false}}}id_select="span_select_"+a;if(document.getElementById("user_logged")!==null){username=document.getElementById("user_logged").value}xmlhttp_rpl.open("GET","inc_ajax_refresh_playlists.php?&ct_clip_code="+a+"&username="+username,true);xmlhttp_rpl.onreadystatechange=function(){if(xmlhttp_rpl.readyState==4){document.getElementById(id_select).innerHTML=xmlhttp_rpl.responseText}};xmlhttp_rpl.send(null);return false};