var normalplayer = false; var currentid = 0; function resizePlayer(){ document.getElementById('ytapiplayer').style.height = "300px"; document.getElementById('ytapiplayer').style.width = "400px"; } function addslashes(str) { str=str.replace(/\'/g,'\\\''); str=str.replace(/\"/g,''); return str; } function stripslashes(str) { str=str.replace(/\\'/g,'\''); return str; } function setCookie(name, value, expires, path, domain, secure) { document.cookie= name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else { begin += 2; } var end = document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } return unescape(dc.substring(begin + prefix.length, end)); } function deleteCookie(name, path, domain) { if (getCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } /* //slider (function() { var Event = YAHOO.util.Event, Dom = YAHOO.util.Dom, lang = YAHOO.lang, slider, bg="slider-bg", thumb="slider-thumb", valuearea="slider-value", textfield="slider-converted-value" // The slider can move 0 pixels up var topConstraint = 0; // The slider can move 200 pixels down var bottomConstraint = 200; // Custom scale factor for converting the pixel offset into a real value var scaleFactor = 1; // The amount the slider moves when the value is changed with the arrow // keys var keyIncrement = 5; var tickSize = 20; Event.onDOMReady(function() { slider = YAHOO.widget.Slider.getHorizSlider(bg, thumb, topConstraint, bottomConstraint, 20); slider.getRealValue = function() { return Math.round(this.getValue() * scaleFactor); } slider.subscribe("change", function(offsetFromStart) { //var valnode = Dom.get(valuearea); //var fld = Dom.get(textfield); // Display the pixel value of the control //valnode.innerHTML = offsetFromStart; // use the scale factor to convert the pixel offset into a real // value var actualValue = slider.getRealValue(); // update the text box with the actual value seekTo(actualValue); // Update the title attribute on the background. This helps assistive // technology to communicate the state change Dom.get(bg).title = "slider value = " + actualValue; }); slider.subscribe("slideStart", function() { YAHOO.log("slideStart fired", "warn"); }); slider.subscribe("slideEnd", function() { YAHOO.log("slideEnd fired", "warn"); }); }); })(); //drag and drop (function() { var Dom = YAHOO.util.Dom; var Event = YAHOO.util.Event; var DDM = YAHOO.util.DragDropMgr; YAHOO.example.DDApp = { init: function() { var rows=1,cols=3,i,j; for (i=1;i this.lastY) { this.goingUp = false; } this.lastY = y; }, onDragOver: function(e, id) { var srcEl = this.getEl(); var destEl = Dom.get(id); // We are only concerned with list items, we ignore the dragover // notifications for the list. if (destEl.nodeName.toLowerCase() == "li") { var orig_p = srcEl.parentNode; var p = destEl.parentNode; if (this.goingUp) { p.insertBefore(srcEl, destEl); // insert above } else { p.insertBefore(srcEl, destEl.nextSibling); // insert below } DDM.refreshCache(); } } }); Event.onDOMReady(YAHOO.example.DDApp.init, YAHOO.example.DDApp, true); })(); */ function hideLightbox(){ //doen we nie meer aan } function onYouTubePlayerReady(playerId) { normalplayer = document.getElementById("playerid"); //leuk! //cueNewVideo('yUbt98X_8Xo'); setInterval(updateNormalPlayerInfo, 100); } function updateNormalPlayerInfo() { time = getCurrentTime(); dur = getDuration(); //a hack is needed due to difference in dur and time value dur = dur - 2; if((time > dur) && dur> 1 && time > 1){ stop(); getNextPlaylist(); if(document.title) document.title = "Next in playlist..."; } } function cueNewVideo(id) { if (normalplayer) { normalplayer.cueVideoById(id); } } function loadNewVideo(id) { if (normalplayer) { currentid = id; normalplayer.loadVideoById(id); } } function getNextPlaylist(){ var playlistplay = 0; var ul = document.getElementById("ul3"); var items = ul.getElementsByTagName("li"); for (i=0;i 0) loadNewVideo(items[0].id); } function play() { if (normalplayer) { normalplayer.playVideo(); } } function pause() { if (normalplayer) { normalplayer.pauseVideo(); } } function stop() { if (normalplayer) { normalplayer.stopVideo(); } } function getDuration() { if (normalplayer) { return normalplayer.getDuration(); } } function getCurrentTime() { if (normalplayer) { return normalplayer.getCurrentTime(); } } function seekTo(seconds) { if (normalplayer) { normalplayer.seekTo(seconds, true); } } function appendOptionLast(text,id,ul){ if(text && id && ul){ var list = document.getElementById(ul); var newNode = document.createElement("li"); newNode.setAttribute('id',id); newNode.innerHTML = text; list.appendChild(newNode); } } function clearList(ul){ var list = document.getElementById(ul); while (list.firstChild) { list.removeChild(list.firstChild); } } /* function mostViewed(){ clearList('ul1'); insertVideos('ul1','mostviewed','','20','0'); } function mostLinked(){ clearList('ul1'); insertVideos('ul1','linked','','20','0'); } function getHot(){ clearList('ul1'); insertVideos('ul1','hot','','15','0'); } */ function makeRequest(page){ clearList('ul1'); var tags = encodeURI(document.getElementById('searchinput').value); insertVideos('ul1','search',tags,'10','0','',''); } function getSearch(tags){ clearList('ul1'); insertVideos('ul1','search',encodeURI(tags),'10','0','',''); } var imname; var timer; function mousOverImage(name,id,nr){ if(name) imname = name; imname.src = "http://img.youtube.com/vi/"+id+"/"+nr+".jpg"; imname.style.border = '3px solid #ff0066'; nr++; if(nr > 3) nr = 1; timer = setTimeout("mousOverImage(false,'"+id+"',"+nr+");",500); } function mouseOutImage(name){ if(name) imname = name; //make border back to greyish imname.style.border = '3px double #99ccff'; if(timer) clearTimeout(timer); } var firsttime = true; /*accounts for directory structure */ function playVideo(id,loader,title,clearer){ loadNewVideo(id); }