
function getScreen(url,size){if(url===null){return"";}
size=(size===null)?"big":size;var vid;var results;results=url.match("[\\?&]v=([^&#]*)");vid=(results===null)?url:results[1];if(size=="small"){return"http://img.youtube.com/vi/"+vid+"/2.jpg";}else{return"http://img.youtube.com/vi/"+vid+"/0.jpg";}}
var player=null;var playlist=null;var plState=getCookie('plyr_state');var plItem=getCookie('plyr_item');var trElapsed=getCookie('plyr_time');var plVol=getCookie('plyr_vol');var playah;var vplayer;var currentState=null;var previousState=null;var pcurrentState=null;var ppreviousState=null;function setCookie(c_name,value,expiredays){var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+"="+escape(value)+((expiredays==null)?"":";expires="+exdate.toGMTString());}
function getCookie(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}return"0";}
function timeSet(obj){setCookie('plyr_time',obj['position'],2);};function volumeSet(obj){setCookie('plyr_vol',obj['percentage'],2);};function itemSet(obj){currentItem=obj.index;setCookie('plyr_time','0');};function stateSet(obj){setCookie('plyr_state',obj['newstate'],2);pcurrentState=obj.newstate;if(pcurrentState!=ppreviousState){switch(pcurrentState)
{case'PLAYING':vplayer.sendEvent('PLAY','false');gid('playah_title').innerHTML=playah.getPlaylist()[currentItem]['title'];break;};}
ppreviousState=pcurrentState;};function stateMonitor(obj){currentState=obj.newstate;if(currentState!=previousState){switch(currentState)
{case'PLAYING':playah.sendEvent('PLAY','false');gid('playah_title').innerHTML='Video is playing';break;};}
previousState=currentState;};function playvideo(url){if(currentState!="PLAYING"){vplayer.sendEvent('LOAD',url);vplayer.sendEvent('PLAY','true');}else{vplayer.sendEvent('STOP');vplayer.sendEvent('LOAD',url);vplayer.sendEvent('PLAY','true');}}
function playerReady(obj){if(obj.id=='playah'){playah=gid(obj.id);var id=playah;var version=playah['version'];var client=playah['client'];playah.addControllerListener('ITEM','itemSet');playah.addControllerListener('VOLUME','volumeSet');playah.addModelListener('TIME','timeSet');playah.addModelListener('STATE','stateSet');}
if(obj.id=='vplayer'){vplayer=gid(obj.id);vplayer.addModelListener('STATE','stateMonitor');}};function gid(name){return document.getElementById(name);};function loadPlayer(){timeVal=Math.round(trElapsed);plState=plState;if(plVol==0){plVol="30";setCookie('plyr_vol','30',2);}
if(plState==0){plState="PLAYING";setCookie('plyr_state','PLAYING',2);}
yoplaythis=encodeURIComponent('http://www.jtsaund.com/wp-content/plugins/wp42o/trak_pl.php?tr='+plItem+'&t='+timeVal);if(plState=="playing"){plState="PLAYING";}
if(plState=="BUFFERING"){plState="PLAYING";}
if(plState=="PLAYING"){var flashvars={'file':yoplaythis,'id':'playah','displaytitle':'false','start':timeVal,'item':plItem,'autostart':'true','repeat':'always'};var params={'wmode':'transparent','allowfullscreen':'false','displaytitle':'true','volume':plVol,'allowscriptaccess':'always'};}
else if(plState=="IDLE"){var flashvars={'file':yoplaythis,'id':'playah','displaytitle':'false','autostart':'false','repeat':'always'};var params={'wmode':'transparent','allowfullscreen':'false','displaytitle':'false','volume':plVol,'allowscriptaccess':'always'};}
var attributes={'id':'playah','name':'playah'};swfobject.embedSWF('http://www.jtsaund.com/wp-content/plugins/wp42o/player.swf','playah','205','45','9',false,flashvars,params,attributes);}
function loadvPlayer(){var flashvars={'image':'http://www.jtsaund.com/music/media/jttv.jpg','skin':'http://www.jtsaund.com/music/media/overlay.swf','file':'http://www.youtube.com/watch?v=zM7ucWa69fI','id':'vplayer','autostart':'false','repeat':'always'};var params={'wmode':'transparent','allowfullscreen':'true','allowscriptaccess':'always'};var attributes={'id':'vplayer','name':'vplayer'};swfobject.embedSWF('http://www.jtsaund.com/music/media/player.swf','vplayer','350','250','9',false,flashvars,params,attributes);}
