function extract_channel_id(fullstring) { var idpos = fullstring.indexOf('xml_channel='); idpos += 12; var return_string = fullstring.substring(idpos); return return_string; } function clean_long_desc(fullstring) { var idpos = fullstring.indexOf('xml_channel='); var return_string = fullstring.substring(0,idpos); return return_string; } var player; //Fired when player is loaded into the DOM and ready to rock. function playerReady(obj) { var id = obj['id']; player = document.getElementsByName(obj.id)[0]; player.addControllerListener('ITEM', 'itemMonitor'); }; function getPlayer(gid) { //standard function for the JWplayer if(navigator.appName.indexOf("Microsoft") != -1) { return window[gid]; } else { return document[gid]; } }; //Handles the loading of a new playlist, based on the channel selection. function channel_hop(channelid) { //Needs an accurate readout of the playlist system. var url ="http://www.mendiptv.co.uk/wp-content/plugins/mendip_tv/xml/wp_generator.php?vid_cat=" + channelid; player.sendEvent("LOAD",url); } //Handles the loading of a single video - used for advertising function video_load(channelid) { //Needs an accurate readout of the playlist system. var url ="http://www.mendiptv.co.uk/wp-content/plugins/mendip_tv/xml/wp_generator.php?vid_single=" + channelid; player.sendEvent("LOAD",url); } function itemMonitor(obj) { //This event is fired when the video changes to the next in show, or previous. //Loading the data is done in a controlled fashion, a few milliseconds after the video load in order to allow duration to be pulled out. currentItem = obj['index']; var itemtitle = player.getPlaylist()[currentItem].title; var longdesc = player.getPlaylist()[currentItem].author; var itemlink = player.getPlaylist()[currentItem].link; var duration = player.getPlaylist()[currentItem].duration; var channel_id = extract_channel_id(longdesc); longdesc = clean_long_desc(longdesc); elem = document.getElementById("videoinfo"); var do_more_base = "