function checkAll(){ var x = false; if (document.frm.elements.check_all.checked) { x = true; } var y = document.frm.elements['box[]']; var i = 0; for (i = 0; i < y.length; i++) { y[i].checked = x; } } function atleastone2(){ var y = false; for (var x = 0; x < document.frm.length; x++) { if ((document.frm.elements[x].name === 'xmlbox[]') && (document.frm.elements[x].checked === true)) { y = true; } } if (y !== true) { Dialog.alert(' Please select at least one playlist!', { width: 250, className: 'alphacube', okLabel: 'OK' }); return false; } } function atleastone(){ var y = false; for (var x = 0; x < document.frm.length; x++) { if (document.frm.elements[x].checked === true) { y = true; } } if (y !== true) { Dialog.alert(' Please select at least one file!', { width: 250, className: 'alphacube', okLabel: 'OK' }); return false; } } function KeepCount(){ var i = 0; var len = document.getElementById('xmlname').options.length; var xml = document.frm.elements['xmlbox[]']; document.frm.elements.playlist_input.value = document.frm.elements['xmlbox[]'].value; for (i = 0; i < len; i++) { if (document.getElementById('xmlname').options[i].value === document.frm.elements.playlist_input.value) { document.getElementById('xmlname').options[i].selected = true; } } for (i = 0; i < xml.length; i++) { if (xml[i].checked === true) { document.frm.elements.playlist_input.value = xml[i].value; var x = document.frm.elements.playlist_input.value; for (i = 0; i < len; i++) { if (document.getElementById('xmlname').options[i].value === x) { document.getElementById('xmlname').options[i].selected = true; } } } } } function clearsel(){ var xml = document.frm.elements['xmlbox[]']; var x = document.getElementById('xmlname'); xml.checked = false; if (x.options[x.selectedIndex].value != document.frm.elements.playlist_input.value) { document.frm.elements.playlist_input.value = x.options[x.selectedIndex].value; for (var i = 0; i < xml.length; i++) { if (xml[i].value == x.options[x.selectedIndex].value) { xml[i].checked = true; } else { xml[i].checked = false; } } } } function createchk(){ var w = document.getElementById('xmltype'); var y = document.frm.elements.playlist_input.value; var x = document.frm.elements['box[]']; var z = document.frm.elements.url_file.value; var xS = false; var wS = false; if (w.options[w.selectedIndex].value === 'subtitle') { wS = true; } if (y === '') { Dialog.alert(' insert or select a name for your playlist', { width: 250, className: 'alphacube', okLabel: 'OK' }); return false; } else if ((!x) && (z === '') && (!wS)) { Dialog.alert(' no file to add! upload some file, OR add a Remote Media!', { width: 250, className: 'alphacube', okLabel: 'OK' }); return false; } if (x != null) { if (x.checked) { xS = true; } var i = 0; for (i = 0; i < x.length; i++) { if (x[i].checked) { xS = true; } } } if ((z === '') && (!xS) && (!wS)) { Dialog.alert(' You must select a least one file OR add a Remote Media!', { width: 250, className: 'alphacube', okLabel: 'OK' }); return false; } } function checkinp(){ var z = document.getElementById('xmlname'); var y = document.frm.elements.playlist_input.value; var x = document.frm.elements['xmlbox[]']; if ((y === '') && (x != null)) { x.checked = false; z.value = ''; var i = 0; for (i = 0; i < x.length; i++) { if (x[i].checked) { x[i].checked = false; } } } } function nomatch(){ Dialog.alert(' Playlist formats doesn\' t match!', { width: 250, className: 'alphacube', okLabel: 'OK' }); return false; } function success(){ Dialog.alert(' playlist has been created!', { width: 250, className: 'alphacube', okLabel: 'OK' }); return false; } function err_msg1(){ new Effect.Pulsate('err1', { pulses: 5, duration: 1.5 }); } function err_msg2(){ new Effect.Pulsate('err2', { pulses: 5, duration: 1.5 }); } var tooltip = function(){ var id = 'tt'; var top = 3; var left = 3; var maxw = 300; var speed = 10; var timer = 20; var endalpha = 95; var alpha = 0; var tt, t, c, b, h; var ie = document.all ? true : false; return { show: function(v, w){ if (tt == null) { tt = document.createElement('div'); tt.setAttribute('id', id); t = document.createElement('div'); t.setAttribute('id', id + 'top'); c = document.createElement('div'); c.setAttribute('id', id + 'cont'); b = document.createElement('div'); b.setAttribute('id', id + 'bot'); tt.appendChild(t); tt.appendChild(c); tt.appendChild(b); document.body.appendChild(tt); tt.style.opacity = 0; tt.style.filter = 'alpha(opacity=0)'; document.onmousemove = this.pos; } tt.style.display = 'block'; c.innerHTML = v; tt.style.width = w ? w + 'px' : 'auto'; if (!w && ie) { t.style.display = 'none'; b.style.display = 'none'; tt.style.width = tt.offsetWidth; t.style.display = 'block'; b.style.display = 'block'; } if (tt.offsetWidth > maxw) { tt.style.width = maxw + 'px' } h = parseInt(tt.offsetHeight) + top; clearInterval(tt.timer); tt.timer = setInterval(function(){ tooltip.fade(1) }, timer); }, pos: function(e){ var u = ie ? event.clientY + document.documentElement.scrollTop : e.pageY; var l = ie ? event.clientX + document.documentElement.scrollLeft : e.pageX; tt.style.top = (u - h) + 'px'; tt.style.left = (l + left) + 'px'; }, fade: function(d){ var a = alpha; if ((a != endalpha && d == 1) || (a != 0 && d == -1)) { var i = speed; if (endalpha - a < speed && d == 1) { i = endalpha - a; } else if (alpha < speed && d == -1) { i = a; } alpha = a + (i * d); tt.style.opacity = alpha * .01; tt.style.filter = 'alpha(opacity=' + alpha + ')'; } else { clearInterval(tt.timer); if (d == -1) { tt.style.display = 'none' } } }, hide: function(){ clearInterval(tt.timer); tt.timer = setInterval(function(){ tooltip.fade(-1) }, timer); } }; }(); function addtips(e){ t = e.getAttribute('title'); tooltip.show(t); e.removeAttribute('title'); } function deltips(e){ e.writeAttribute('title', t); tooltip.hide(); } /** * Toggle Function - aseptik@gmail.com (c) '09 * */ function tog(e){ var myArray = ['properties', 'colors', 'layout', 'playback', 'communication', 'accessibility', 'embedparams']; t = e.className; myArray.splice(myArray.indexOf(t),1); for( var i=0; i < myArray.length; i++ ) { Effect.Fade(myArray[i], { duration: 0.2 }); } Effect.Appear(t, { duration: 0.2 }); return false; } function gid(name){ return document.getElementById(name); } var perline = 9; var divSet = false; var curId; var colorLevels = Array('0', '3', '6', '9', 'C', 'F'); var colorArray = Array(); var ie = false; var nocolor = 'none'; if (document.all) { ie = true; nocolor = ''; } function addColor(r, g, b){ var red = colorLevels[r]; var green = colorLevels[g]; var blue = colorLevels[b]; addColorValue(red, green, blue); } function addColorValue(r, g, b){ colorArray[colorArray.length] = r + r + g + g + b + b; } function setColor(color){ var link = gid(curId); var field = gid(curId); var prev = gid(curId + 'pick'); var picker = gid('colorpicker'); field.value = color; prev.style.backgroundColor = '#' + color; if (color == '') { color = nocolor; } picker.style.display = 'none'; eval(gid(curId).title); } function setDiv(){ if (!document.createElement) { return; } var elemDiv = document.createElement('div'); if (typeof(elemDiv.innerHTML) != 'string') { return; } genColors(); elemDiv.id = 'colorpicker'; elemDiv.innerHTML = getColorTable(); document.body.appendChild(elemDiv); divSet = true; } function pickColor(id){ if (!divSet) { setDiv(); } var picker = gid('colorpicker'); if (id == curId && picker.style.display == 'block') { picker.style.display = 'none'; return; } curId = id; var thelink = gid(id); picker.style.top = getAbsoluteOffsetTop(thelink) + "px"; picker.style.left = getAbsoluteOffsetLeft(thelink) + "px"; picker.style.display = 'block'; } function genColors(){ addColorValue('0', '0', '0'); addColorValue('3', '3', '3'); addColorValue('6', '6', '6'); addColorValue('8', '8', '8'); addColorValue('9', '9', '9'); addColorValue('A', 'A', 'A'); addColorValue('C', 'C', 'C'); addColorValue('E', 'E', 'E'); addColorValue('F', 'F', 'F'); for (a = 1; a < colorLevels.length; a++) addColor(0, 0, a); for (a = 1; a < colorLevels.length - 1; a++) addColor(a, a, 5); for (a = 1; a < colorLevels.length; a++) addColor(0, a, 0); for (a = 1; a < colorLevels.length - 1; a++) addColor(a, 5, a); for (a = 1; a < colorLevels.length; a++) addColor(a, 0, 0); for (a = 1; a < colorLevels.length - 1; a++) addColor(5, a, a); for (a = 1; a < colorLevels.length; a++) addColor(a, a, 0); for (a = 1; a < colorLevels.length - 1; a++) addColor(5, 5, a); for (a = 1; a < colorLevels.length; a++) addColor(0, a, a); for (a = 1; a < colorLevels.length - 1; a++) addColor(a, 5, 5); for (a = 1; a < colorLevels.length; a++) addColor(a, 0, a); for (a = 1; a < colorLevels.length - 1; a++) addColor(5, a, 5); return colorArray; } function getColorTable(){ var colors = colorArray; var tableCode = ''; tableCode += '