function createCookie(name,value) { document.cookie = name+"="+value+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') { c = c.substring(1,c.length); } if (c.indexOf(nameEQ) == 0) { return c.substring(nameEQ.length,c.length); } } return null; } if(null == readCookie('SiSTeR-uniqid')) { var cookiedate = new Date(); var uniqid = [cookiedate.getFullYear(), cookiedate.getMonth(), cookiedate.getDate(), cookiedate.getHours(), cookiedate.getMinutes(), Math.random()].join(''); createCookie('SiSTeR-uniqid',uniqid); } String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); }; if ( SiSTeR == undefined ) { var SiSTeR = {}; } SiSTeR.Version = '2.2'; SiSTeR.Copyright = 'Patent-pending, Copyright © 2003-2010, SiSTeR Technologies'; SiSTeR.Config = SiSTeR.Config != undefined ? SiSTeR.Config : {}; SiSTeR.Config.set = function(v,d) { this[v] = this[v] != undefined ? this[v] : d; } SiSTeR.Config.set("bufferlength",5); SiSTeR.Config.set("enablefullscreen",false); SiSTeR.Config.set("enablelogging",true); SiSTeR.Config.set("autoplay",true); SiSTeR.Config.set("height",300); SiSTeR.Config.set("width",480); SiSTeR.Config.set("containerid","SiSTeR"); SiSTeR.Config.set("pubid","3DF"); SiSTeR.Config.set("aspect",""); SiSTeR.Config.set("publisher_profile",SiSTeR.Config.pubid); SiSTeR.Config.set("title","vcl-title.jpg"); SiSTeR.Config.set("logo",null); SiSTeR.uniqid = readCookie('SiSTeR-uniqid'); SiSTeR.mediaid = null; SiSTeR.Path = ''; SiSTeR.Init = function() {}; SiSTeR.Require = function(s) { document.write(''); } SiSTeR.Players = { _p:{}, load: function(s) { if ( this._p[s] != undefined && typeof this._p[s] == 'function' ) { this._p[s](); } }, register: function(s,f) { this._p[s] = f; } } SiSTeR.getElementById = function () { var elements = new Array(); var element = null; for (var i = 0; i < arguments.length; i++) { element = arguments[i]; if (typeof element == 'string') element = document.getElementById(element); if (arguments.length == 1) return element; elements.push(element); } return elements; } SiSTeR.Event = { observers: false, _observeAndCache: function(element, name, observer, useCapture) { if (!this.observers) this.observers = []; if (element) { if (element.addEventListener) { this.observers.push([element, name, observer, useCapture]); element.addEventListener(name, observer, useCapture); } else if (element.attachEvent) { this.observers.push([element, name, observer, useCapture]); element.attachEvent('on' + name, observer); } } }, unloadCache: function() { if (!SiSTeR.Event.observers) return; for (var i = 0, length = Event.observers.length; i < length; i++) { SiSTeR.Event.stopObserving.apply(this, Event.observers[i]); SiSTeR.Event.observers[i][0] = null; } SiSTeR.Event.observers = false; }, observe: function(element, name, observer, useCapture) { element = SiSTeR.getElementById(element); useCapture = useCapture || false; if (name == 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.attachEvent)) name = 'keydown'; SiSTeR.Event._observeAndCache(element, name, observer, useCapture); }, stopObserving: function(element, name, observer, useCapture) { element = SiSTeR.getElementById(element); useCapture = useCapture || false; if (name == 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.detachEvent)) name = 'keydown'; if (element.removeEventListener) { element.removeEventListener(name, observer, useCapture); } else if (element.detachEvent) { try { element.detachEvent('on' + name, observer); } catch (e) {} } } } SiSTeR.ParsedURL = { 'url':null, 'basename':null, 'domain':null, 'dirname':null, 'querystring':null, 'query':null, 'parse': function(u) { this.url = u; this.basename = u.substring(u.lastIndexOf('/') + 1,u.indexOf('?')); this.domain = u.substring(u.indexOf('http://') + 7).substring(0,u.substring(u.indexOf('http://') + 7).indexOf('/')); this.dirname = u.substring(u.indexOf('http://') + 7 + this.domain.length,u.lastIndexOf('/')+1); this.querystring= u.substring((u.indexOf('?')) + 1); this.query = new Object(); var separator = ','; var query = this.querystring; if ( query.length < 1 ) { return false; } var keypairs = new Object(); var n = 1; while (query.indexOf('&') > -1) { keypairs[n] = query.substring(0,query.indexOf('&')); query = query.substring((query.indexOf('&')) + 1); n++; } keypairs[n] = query; for (i in keypairs) { var keyName = keypairs[i].substring(0,keypairs[i].indexOf('=')); var keyValue = keypairs[i].substring((keypairs[i].indexOf('=')) + 1); while (keyValue.indexOf('+') > -1) { keyValue = keyValue.substring(0,keyValue.indexOf('+')) + ' ' + keyValue.substring(keyValue.indexOf('+') + 1); } keyValue = unescape(keyValue); if (this.query[keyName]) { this.query[keyName] = this.query[keyName] + separator + keyValue; } else { this.query[keyName] = keyValue; } } return this; } } SiSTeR.Log = function(o) { if ( !SiSTeR.Config.enablelogging ) return true; if (o == undefined) o = {}; var t = new Image(); var d = new Date(); var a = []; a.push([SiSTeR.Path,'tracker.png?ts=',d.getTime()].join('')); if ( o.e != undefined ) a.push(['e=',o.e].join('')); if ( o.i != undefined ) { a.push(['i=',o.i].join('')); } else if (SiSTeR.mediaid) { a.push(['i=',SiSTeR.mediaid].join('')); } if ( o.m != undefined ) { a.push(['m=',o.m].join('')); } else { a.push(['m=',SiSTeR.uniqid].join('')); } a.push(['p=',o.p == undefined ? (SiSTeR.Config.publisher_profile != undefined ? SiSTeR.Config.publisher_profile : SiSTeR.Config.pubid) : o.p].join('')); t.src = a.join('&'); return true; } function SiSTeR_Log(o) { var foo = o.split(','); var bar = {i:foo[0],p:foo[1],e:foo[2]}; return SiSTeR.Log(bar); } SiSTeR.Load = function() { var s = document.getElementsByTagName("scr" + "ipt"); for(var i=0;i 0) { uniqid = SiSTeR.uniqid; } } s2.addVariable("file",SiSTeR.Path + "pl.php?" + escape("c=playlist:" + this.mediaid + "&p=" + (SiSTeR.Config.publisher_profile != undefined ? SiSTeR.Config.publisher_profile : SiSTeR.Config.pubid) + (SiSTeR.Config.aspect.length > 0 ? "&a=" + SiSTeR.Config.aspect : "") + (uniqid.length > 0 ? "&m=" + uniqid : ""))); var file = SiSTeR.Path + "pl.php?"; var querystring = "c=playlist:" + this.mediaid + "&p="; if (SiSTeR.Config.publisher_profile != undefined) { querystring = querystring + SiSTeR.Config.publisher_profile; } else { querystring = querystring + SiSTeR.Config.pubid; } if (SiSTeR.Config.aspect != undefined && SiSTeR.Config.aspect.length != undefined) { if (SiSTeR.Config.aspect.length > 0) { querystring = querystring + "&a=" + SiSTeR.Config.aspect; } } if (uniqid.length > 0) { querystring = querystring + "&m=" + uniqid; } file = file + escape(querystring); s2.addVariable("file",file); if(this.img != null) { s2.addVariable("image",escape(this.img)); } else if (SiSTeR.Config.title.indexOf('http://') == 0 || SiSTeR.Config.title.indexOf('https://') == 0) { s2.addVariable("image",escape(SiSTeR.Config.title)); } else { s2.addVariable("image",escape(SiSTeR.Path+SiSTeR.Config.title)); } if (SiSTeR.Config.logo != null) { s2.addVariable("logo",SiSTeR.Config.logo); } s2.addVariable("stretching","uniform"); s2.addVariable("resizing","true"); s2.addVariable("autostart",(SiSTeR.Config.autoplay ? "true" : "false")); s2.addVariable("javascriptid","SiSTeR_3DF"); if ( this.obj == undefined ) { if ( SiSTeR.getElementById("auto_container") == undefined ) { document.write('
'); } this.obj = SiSTeR.getElementById("auto_container"); } SiSTeR.mediaid = this.mediaid; SiSTeR.Log({e:'Draw3DFPlayer',i:this.mediaid}); s2.write(this.obj.id); } SiSTeR.Players.register('auto',function() { if (SiSTeR.getElementById(SiSTeR.Config.containerid)) { if (SiSTeR.getElementById(SiSTeR.Config.containerid).getAttribute('rel').indexOf('SiSTeR.vid[') != -1 ) { mediaid = SiSTeR.getElementById(SiSTeR.Config.containerid).getAttribute('rel').match(/SiSTeR\.vid\[(.*)\]/); var params = mediaid[1].split(','); params[0] = params[0] ? params[0] : null; params[1] = params[1] ? params[1] : null; var initParams = {}; var protocol = params[0].match(/^(.+)\:\/\//i); if ( protocol != null && protocol[1] != undefined ) { switch(protocol[1]) { case 'rtsp': case 'mms': case 'http': if (params[0].indexOf('.flv') != -1) { initParams = {obj:SiSTeR.getElementById(SiSTeR.Config.containerid),img:params[1],flv:params[0]}; } else if (params[0].indexOf('.mp4') != -1 || params[0].indexOf('.m4v') != -1) { initParams = {obj:SiSTeR.getElementById(SiSTeR.Config.containerid),img:params[1],flv:params[0]}; } break; case 'mediaid': var picurl = SiSTeR.getElementById(SiSTeR.Config.containerid).getAttribute('rel').match(/SiSTeR\.pic\[(.+?)\]/); if (picurl) { params[1] = picurl[1] ? picurl[1] : null; } initParams = {obj:SiSTeR.getElementById(SiSTeR.Config.containerid),img:params[1],mediaid:params[0].replace(/mediaid\:\/\//i,"")}; break; } } else { initParams = {obj:SiSTeR.getElementById(SiSTeR.Config.containerid),img:params[1],flv:params[0]}; } SiSTeR.Init = Draw3DFPlayer; SiSTeR.Init.apply(initParams); } } }); SiSTeR.Players.register('3DF',function() { if (SiSTeR.getElementById(SiSTeR.Config.containerid)) { if (SiSTeR.getElementById(SiSTeR.Config.containerid).getAttribute('rel').indexOf('SiSTeR.vid[') != -1 ) { mediaid = SiSTeR.getElementById(SiSTeR.Config.containerid).getAttribute('rel').match(/SiSTeR\.vid\[(.+?)\]/); var params = [mediaid[1]]; params[0] = params[0] ? params[0] : null; var picurl = SiSTeR.getElementById(SiSTeR.Config.containerid).getAttribute('rel').match(/SiSTeR\.pic\[(.+?)\]/); if (picurl) { params[1] = picurl[1] ? picurl[1] : null; } SiSTeR.Init = Draw3DFPlayer; SiSTeR.Init.apply({obj:SiSTeR.getElementById(SiSTeR.Config.containerid),img:params[1],mediaid:params[0].replace(/mediaid\:\/\//i,"")}); } } }); SiSTeR.Event.observe(window,"load",function() { SiSTeR.Players.load(SiSTeR.Config.pubid); }); SiSTeR.Load();