function wbl_pr( strName, dtProgStart, nDuration, strChannel, nChannelID, nProgID, tStartUTC, strDesc, strEpisode, strCategory, strKeywords ) { this.strName = strName; this.dtProgStart = dtProgStart; this.nDuration = nDuration; this.strChannel = strChannel; this.nChannelID = nChannelID; this.nProgID = nProgID; this.tStartUTC = Number( "0x" + tStartUTC ) * 1000; this.strCategory = strCategory; this.arrKeywords = strKeywords.split( ", " ); this.genreURLList = "genre=" + strCategory; for( var n = 0; n < this.arrKeywords.length; n++ ) { if( this.genreURLList.length ) { this.genreURLList += "&"; } var keyword = this.arrKeywords[ n ]; this.genreURLList += "genre=" + keyword.replace( / /g, "-" ); } }; var mydg_search_arrProgrammes = new Array( new wbl_pr( "Blackadder The Third", "14:40 Monday 23rd November", 40, "G.O.L.D.", 18, 101421, "4B0A9EC0", "Duel and Duality. Series 3, episode 6. <br>The Prince is challenged to a duel by the fearsome Duke of Wellington, played by the genius that is Stephen Fry. Edmund volunteers to take his place - the fool!<br>Director: Mandie Fletcher<br>Starring: Tony Robinson, Hugh Laurie, Helen Atkinson-Wood, Rowan Atkinson, Stephen Fry, Gertan Klauber<br> (Subtitles, Audio Described, 1987, 4 Star)", "Duel and Duality", "Sitcom", "Comedy, Sitcom, Subtitles, Audio Described, 4 Star" )
,new wbl_pr( "Blackadder The Third", "20:20 Monday 23rd November", 40, "G.O.L.D.", 18, 101429, "4B0AEE70", "Duel and Duality. Series 3, episode 6. <br>The Prince is challenged to a duel by the fearsome Duke of Wellington, played by the genius that is Stephen Fry. Edmund volunteers to take his place - the fool!<br>Director: Mandie Fletcher<br>Starring: Tony Robinson, Hugh Laurie, Helen Atkinson-Wood, Rowan Atkinson, Stephen Fry, Gertan Klauber<br> (Subtitles, Audio Described, 1987, 4 Star)", "Duel and Duality", "Sitcom", "Comedy, Sitcom, Subtitles, Audio Described, 4 Star" )
,new wbl_pr( "Blackadder The Third", "20:20 Monday 23rd November", 40, "G.O.L.D. (TopUpTV)", 50947, 102189, "4B0AEE70", "Duel and Duality. Series 3, episode 6. <br>The Prince is challenged to a duel by the fearsome Duke of Wellington, played by the genius that is Stephen Fry. Edmund volunteers to take his place - the fool!<br>Director: Mandie Fletcher<br>Starring: Tony Robinson, Hugh Laurie, Helen Atkinson-Wood, Rowan Atkinson, Stephen Fry, Gertan Klauber<br> (Subtitles, Audio Described, 1987, 4 Star)", "Duel and Duality", "Sitcom", "Comedy, Sitcom, Subtitles, Audio Described, 4 Star" )
 ); function mydg_search_load() { var searchKeywords = "(napoleon AND bonaparte) OR (duke AND wellington) OR napoleonic "; var searchURL = "%28napoleon%20AND%20bonaparte%29%20OR%20%28duke%20AND%20wellington%29%20OR%20napoleonic%20"; w = function (c){document.writeln(c); }; getCookie = function( name ) { getCookVal = function( offset ) { var endstr = document.cookie.indexOf (";", offset); if( endstr == -1 ) endstr = document.cookie.length; return unescape( document.cookie.substring( offset, endstr ) ); }; var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while( i < clen ) { var j = i + alen; if( document.cookie.substring( i, j ) == arg ) return getCookVal( j ); i = document.cookie.indexOf( " ", i ) + 1; if( i == 0 ) break; } return null; }; df = function( strPID, strName, strChannel, strCat, genreURLList ) { popUp = function(strURL) { var defTop = 50; var defLeft = 50; var defWidth = 640; var defHeight = 640; var popupWin = window.open(strURL,'desc_win','resizable,scrollbars,top=' + defTop + ',left='+ defLeft +',width='+ defWidth +',height='+ defHeight); }; popUp( "http://www.mydigiguide.com/tv-guide/tv.dll?" + genreURLList + "&title=" + escape(strName) + "&channel=" + escape(strChannel) + "&a=19&h=68&f=1&PID=" + strPID ); }; var mydg_search_dateToday = new Date(); var mydg_search_dateTomorrow = new Date( mydg_search_dateToday.getTime() + 86400000 ); getNiceDateTime = function( dt ) { isSameDay = function( dt1, dt2 ) { var n1 = Math.ceil( dt1.getTime() / 86400000 ); var n2 = Math.ceil( dt2.getTime() / 86400000 ); if( n1 == n2 ) return true; return false; }; getNiceTime = function( dt ) { var mins = dt.getMinutes(); if( dt.getHours() > 12 ) return dt.getHours() - 12 + ":" + (mins < 10 ? "0" + mins : mins ) + "pm"; else return dt.getHours() + ":" + (mins < 10 ? "0" + mins : mins ) + "am"; }; var niceTimeSummary = ""; if( isSameDay( mydg_search_dateToday, dateProgStart ) ) { if( dateProgStart.getHours() >= 18 ) niceTimeSummary = "Tonight at " + getNiceTime( dateProgStart ); else niceTimeSummary = getNiceTime( dateProgStart ); } else if( isSameDay( mydg_search_dateTomorrow, dateProgStart ) ) { niceTimeSummary = "Tomorrow at " + getNiceTime( dateProgStart ); } else { var dayPostFix = "th"; switch( dt.getDate() ) { case 1: case 21: case 31: dayPostFix = "st"; break; case 2: case 22: dayPostFix = "nd"; break; case 3: case 23: dayPostFix = "rd"; break; } var monthName = ""; switch( dt.getMonth() ) { case 0: monthName = "January"; break; case 1: monthName = "February"; break; case 2: monthName = "March"; break; case 3: monthName = "April"; break; case 4: monthName = "May"; break; case 5: monthName = "June"; break; case 6: monthName = "July"; break; case 7: monthName = "August"; break; case 8: monthName = "September"; break; case 9: monthName = "October"; break; case 10: monthName = "November"; break; case 11: monthName = "December"; break; } niceTimeSummary = monthName + " " + dt.getDate() + dayPostFix + " at " + getNiceTime( dateProgStart );; } return niceTimeSummary; }; includeStyle = function( styleVar ) { if( styleVar != undefined && styleVar.length ) { return " style='" + styleVar + "'"; } return ""; }; if( typeof( mydg_search_version ) != "undefined" && mydg_search_version == 2 ) { var style_programme_list_none = "margin:10px;"; var style_programme_list = ""; var style_programme_list_item = ""; var style_programme_details = ""; var style_programme_name = ""; var style_programme_name_link = ""; var style_programme_time = ""; var style_programme_channel = ""; if( typeof( mydg_search_inline_styles ) != "undefined" ) { if( typeof( mydg_search_inline_styles.programme_list_none ) != "undefined" ) { style_programme_list_none = mydg_search_inline_styles.programme_list_none; } if( typeof( mydg_search_inline_styles.programme_list ) != "undefined" ) { style_programme_list = mydg_search_inline_styles.programme_list; } if( typeof( mydg_search_inline_styles.programme_list_item ) != "undefined" ) { style_programme_list_item = mydg_search_inline_styles.programme_list_item; } if( typeof( mydg_search_inline_styles.programme_details ) != "undefined" ) { style_programme_details = mydg_search_inline_styles.programme_details; } if( typeof( mydg_search_inline_styles.programme_name ) != "undefined" ) { style_programme_name = mydg_search_inline_styles.programme_name; } if( typeof( mydg_search_inline_styles.programme_name_link ) != "undefined" ) { style_programme_name_link = mydg_search_inline_styles.programme_name_link; } if( typeof( mydg_search_inline_styles.programme_time ) != "undefined" ) { style_programme_time = mydg_search_inline_styles.programme_time; } if( typeof( mydg_search_inline_styles.programme_channel ) != "undefined" ) { style_programme_channel = mydg_search_inline_styles.programme_channel; } } var content = ""; if ( mydg_search_arrProgrammes.length <= 0 ) { content +=( "<p class='programme-list-none'" + includeStyle( style_programme_list_none ) + ">Sorry, no programmes are currently showing.</p>" ); } else { content +=( "<ul class='programme_list'" + includeStyle( style_programme_list ) + ">" ); for( var i = 0; i < mydg_search_arrProgrammes.length; i++ ) { var dateProgStart = new Date( mydg_search_arrProgrammes[i].tStartUTC ); var popupLink = "JavaScript:df(" + mydg_search_arrProgrammes[i].nProgID + ",\"" + mydg_search_arrProgrammes[i].strName + "\",\"" + mydg_search_arrProgrammes[i].strChannel + "\",\"" + mydg_search_arrProgrammes[i].strCategory + "\",\"" + mydg_search_arrProgrammes[i].genreURLList + "\");"; content +=( "<li class='programme_list_item'" + includeStyle( style_programme_list_item ) + "><span class='programme_name'" + includeStyle( style_programme_name ) + "><a href='" + popupLink + "' title=\"View the programme description for " + mydg_search_arrProgrammes[i].strName + "\" class='programme_name_link'" + includeStyle( style_programme_name_link ) + ">" + mydg_search_arrProgrammes[i].strName + "</a></span><span class='programme_details'" + includeStyle( style_programme_details ) + "><span class='programme_time'" + includeStyle( style_programme_time ) + ">" + getNiceDateTime( dateProgStart ) + "</span> on <span class='programme_channel'" + includeStyle( style_programme_channel ) + ">" + mydg_search_arrProgrammes[i].strChannel + "</span></span></li>" ); } content +=( "</ul>" ); } var id = document.getElementById("mydg_search"); if( id ) { id.innerHTML = content; } else { w( content ); } } else { w( "<table width=" + tblWIDTH + " bgcolor=\"" + tblBGCOL + "\" cellpadding=2 cellspacing=0 border=1 bordercolorlight=\"#FFFFFF\" bordercolordark=\"#FFFFFF\">" ); w( "<tr bgcolor=\"" + pfindHEADCOL + "\"><td bordercolordark=\"" + tblBORDCOL + "\" bordercolorlight=\"" + tblBORDCOL + "\"><font size=" + pfindHEADFSIZE + " color=\"" + pfindHEADFCOLOR + "\" face=\"" + pfindFFACE + "\"><b>INSTANT SEARCH</b> for '" + searchKeywords + "'</font></td></tr><tr><td bordercolordark=\"" + tblBORDCOL + "\" bordercolorlight=\"" + tblBORDCOL + "\"><font size=" + pfindFSIZE + " color=\"" + pfindFCOLOR + "\" face=\"" + pfindFFACE + "\">" ); if ( mydg_search_arrProgrammes.length <= 0 ) { w( "<center><br><a href=\"http://www.mydigiguide.com/tv-guide/tv.dll\" target=\"_blank\"><img src=\"http://www.mydigiguide.com/i/wbllogo.gif\" width=89 height=56 border=0 alt=\"Get your UK and Ireland TV and Radio listings from myDigiGuide\"></a><p><b>Sorry, no programmes that match the keywords: '" + searchKeywords + "' are currently showing.</b></center>" ); } else { w( "<b><font size=" + pfindFSIZE + " color=\"" + pfindFCOLOR + "\" face=\"" + pfindFFACE + "\">Click the programme name for a full description or click the channel name for a complete listing.</font></b><br><br>"); for ( i = 0; i < mydg_search_arrProgrammes.length; i++) { var tmpStart = mydg_search_arrProgrammes[i].dtProgStart; var tTime = tmpStart.substring(0, 5); var tDate = tmpStart.substring(6, tmpStart.length); var popupLink = "JavaScript:df(" + mydg_search_arrProgrammes[i].nProgID + ",\"" + mydg_search_arrProgrammes[i].strName + "\",\"" + mydg_search_arrProgrammes[i].strChannel + "\",\"" + mydg_search_arrProgrammes[i].strCategory + "\",\"" + mydg_search_arrProgrammes[i].genreURLList + "\");"; w( "<a href='" + popupLink + "' title=\"View the programme description for " + mydg_search_arrProgrammes[i].strName + "\"><b><font size=" + pfindFSIZE + " color=\"" + pfindFCOLOR + "\" face=\"" + pfindFFACE + "\"><u>" + mydg_search_arrProgrammes[i].strName + "</u></font></b></a> showing on <a href=\"http://www.mydigiguide.com/tv-guide/tv.dll?a=2&amp;ch=" + mydg_search_arrProgrammes[i].nChannelID + "&amp;dt=" + mydg_search_arrProgrammes[i].strProgDate + "&amp;lz=0\" title=\"View full listings for " + mydg_search_arrProgrammes[i].strChannel + "\" target=\"_blank\"><font size=" + pfindFSIZE + " color=\"" + pfindFCOLOR + "\" face=\"" + pfindFFACE + "\"><u>" + mydg_search_arrProgrammes[i].strChannel + "</u></font></a>, " ); if ( bTimeNewLine == 1 ) { w( "<br>&nbsp;&nbsp;&nbsp;" ); } w( "<i>" + tDate + " at " + tTime + "</i><br>" ); } w( "<br><a href=\"http://www.digiguide.com/p/wbl/freecontent.shtml\" target=\"_blank\"><font color=\"" + pfindFCOLOR + "\" face=\"" + pfindFFACE + "\"><b><u>UK TV Guide, 14+ days listings for 600+ channels, all major providers, searching, reminders</u></b></a>" ); } w( "</font></td></tr></table>" ); } }; mydg_search_load();