function twoTabChange(object,tab)
{
    var h3 = object.parentNode;
    var div = h3.parentNode;
    var step = (navigator.userAgent.indexOf("Firefox") != -1 ? 2 : 1);
    if(tab == "left-tab")
    {            
        div.childNodes[step * 1 - 1].className = "forums-tab current";        
        div.childNodes[step * 2 - 1].className = "iframe-content current";
        div.childNodes[step * 3 - 1].className = "blogs-tab";
        div.childNodes[step * 4 - 1].className = "iframe-content notcurrent";
    }
    else if(tab == "right-tab")
    {
        div.childNodes[step * 1 - 1].className = "forums-tab";    
        div.childNodes[step * 2 - 1].className = "iframe-content notcurrent";
        div.childNodes[step * 3 - 1].className = "blogs-tab current";
        div.childNodes[step * 4 - 1].className = "iframe-content current";
    }
}
function over(object)
{
    object.style.textDecoration = "underline";
}
function out(object)
{
    object.style.textDecoration = "none";
}
function threeTabChange(object, tab)
{
    var h3 = object.parentNode;
    var div = h3.parentNode;
    var step = (navigator.userAgent.indexOf("Firefox") != -1 ? 2 : 1);
    if (tab == "tab1")
    {
        div.childNodes[step * 1 - 1].className = "tab1-tab current";        
        div.childNodes[step * 2 - 1].className = "iframe-content current";
        div.childNodes[step * 3 - 1].className = "tab2-tab";
        div.childNodes[step * 4 - 1].className = "iframe-content notcurrent";
        div.childNodes[step * 5 - 1].className = "tab3-tab";
        div.childNodes[step * 6 - 1].className = "iframe-content notcurrent";
    }
    else if (tab == "tab2")
    {
        div.childNodes[step * 1 - 1].className = "tab1-tab";        
        div.childNodes[step * 2 - 1].className = "iframe-content notcurrent";
        div.childNodes[step * 3 - 1].className = "tab2-tab current";
        div.childNodes[step * 4 - 1].className = "iframe-content current";
        div.childNodes[step * 5 - 1].className = "tab3-tab";
        div.childNodes[step * 6 - 1].className = "iframe-content notcurrent";
    }
    else if (tab == "tab3")
    {
        div.childNodes[step * 1 - 1].className = "tab1-tab";        
        div.childNodes[step * 2 - 1].className = "iframe-content notcurrent";
        div.childNodes[step * 3 - 1].className = "tab2-tab";
        div.childNodes[step * 4 - 1].className = "iframe-content notcurrent";
        div.childNodes[step * 5 - 1].className = "tab3-tab current";
        div.childNodes[step * 6 - 1].className = "iframe-content current";
    }
}
/* Used for switching between large tabs e.g. on the Tab - List Overview page */
function fourTabChange(object, tab, contentId)
{
    var h3 = object.parentNode;
    var div = h3.parentNode;
    var contentdiv;
    var currentContentViewId;
    var step = (navigator.userAgent.indexOf("Firefox") != -1 ? 2 : 1);
    /* Clean up */
    div.childNodes[step * 1 - 1].className = "notcurrent";        
    if (div.childNodes[step * 2 - 1].className.indexOf("no-tab") == -1) {
        div.childNodes[step * 2 - 1].className = "notcurrent";
    }
    if (div.childNodes[step * 3 - 1].className.indexOf("no-tab") == -1) {
        div.childNodes[step * 3 - 1].className = "notcurrent";
    }
    if (div.childNodes[step * 4 - 1].className.indexOf("no-tab") == -1) {
        div.childNodes[step * 4 - 1].className = "no-border notcurrent";
    }
    contentdiv = div.childNodes[step * 5 - 1];
    for (i = 1; i < 5; i++) contentdiv.childNodes[step * i - 1].className = "notcurrent";
    /* Display selected content */
    if (tab == "tab1") div.childNodes[step * 1 - 1].className = "current";
    else if (tab == "tab2") div.childNodes[step * 2 - 1].className = "current";
    else if (tab == "tab3") div.childNodes[step * 3 - 1].className = "current";
    else if (tab == "tab4") div.childNodes[step * 4 - 1].className = "no-border current";
    contentdiv.childNodes[step * contentId - 1].className = "current";
}
/* used for formatting rows in the auto completer */
function formatItem(row) {
    if (row.length == 1)
        return "<a class=\"close\" href=\"#\">Close</a>" + row[0];
    else
        return "<a href=" + row[1] + ">" + row[0] + "</a>";
}
/* the function called when the autocomplete item is chosen */
function selectItem(li) {
    if (li.extra) {
        document.location.href = li.extra[0];
    }
}
function clearTextField(elem)
{
   if (elem != null && elem.value != null && elem.value == 'Keyword Search')
   {
     elem.value = '';
    }
}
function validatePostcode(e)
{
    var keynum = (window.event ? e.keyCode : (e.which ? e.which : 0));
    var keychar = String.fromCharCode(keynum);
    var numcheck = /\d/;
    return keynum < 32 || numcheck.test(keychar);
}
    
function quickSearch(url)
{
    var $results = $("#keyword-results");
    $results.load(url, {}, formatQuickSearch);
    $results.css("visibility","visible");
    var obj = $("#search-text")[0];
    curLeft = 0;
    curTop = 0;
    if (obj.offsetParent) {
        curLeft = obj.offsetLeft;
        curTop = obj.offsetTop + obj.offsetHeight;
        while (obj = obj.offsetParent) {
            curLeft += obj.offsetLeft;
            curTop += obj.offsetTop;
        }
    }
    var $div = $("div.select-free");
    $div[0].style.left = curLeft + "px";
    $div[0].style.top = curTop + "px";
}
function formatQuickSearch(text)
{
 if (navigator.userAgent.indexOf("Safari") > 0)
 {
  $("#keyword-results").html("<ul><li><span style=\"color:#FF9900;\">Choose a suggestion...</span><a href=\"javascript:closeSearch()\" class=\"close\">Close</a></li>" + 
        text.replace(/\s*(.+)\s+\|\s+(.+)\s+NEWLINE/g, "<li><a href=\"$2\">$1</a></li>") + "</ul>");
 }
 else{
  $("#keyword-results").html("<ul><li><span style=\"color:#FF9900;\">Choose a suggestion...</span><a href=\"javascript:closeSearch()\" class=\"close\" style=\"position:relative; margin-top:-15px\">Close</a></li>" + 
        text.replace(/\s*(.+)\s+\|\s+(.+)\s+NEWLINE/g, "<li><a href=\"$2\">$1</a></li>") + "</ul>");
 }
}
    
function closeSearch()
{
    var $results = $("#keyword-results");
    $results.css("visibility","hidden");
    $results.html("");
    $("#search-text")[0].focus();
}
var ID;
    
$(document).ready(function()
{
    $("#search-text").keyup(function()
    {
        var params = this.value.replace(" ","+");
        if (params == ""){
            window.clearTimeout(ID);
            closeSearch();
        }
        else{
            var url = "/search-results-text.html?q=" + params;
            window.clearTimeout(ID);
            ID = window.setTimeout("quickSearch(\"" + url + "\");", 750);
        }
    });
});
///////////////////////////////////////////////////////////////////////
//AJAX Call of "NEXT"
///////////////////////////////////////////////////////////////////////
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;
}
var nextguide = "";
//For Header Animated Logo
function getTVG_LOC(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 "sydney";
}
function setTVG_LOC(c_name,value,expiredays)
{
            var exdate=new Date();
            exdate.setDate(exdate.getDate()+expiredays);
            document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
var TVG_LOC = getTVG_LOC("TVG_LOC") ;
//var yourLocation = google.loader.ClientLocation.address.region;
//if (yourLocation = "NSW"){ yourlocation1 = "sydney";} 
//else if (yourLocation = "QLD"){ yourlocation1 = "brisbane";} 
//else if (yourLocation = "VIC"){ yourlocation1 = "melbourne";} 
//else if (yourLocation = "SA"){ yourlocation1 = "adelaide";} 
//else if(yourLocation = "WA"){ yourlocation1 = "perth";} 
//else (yourLocation == null){ yourlocation1 = "sydney";}
if(TVG_LOC == null){    
    TVG_LOC = "sydney";
    setTVG_LOC("TVG_LOC",TVG_LOC,1);    
}
function setSelectedLocation(){
    
    var locale = document.getElementById("location-dropdown");
    for(i = 0; i < locale.length ; i++){        
        if(locale.options[i].value == TVG_LOC ){            
            locale.options[i].selected = true;
        }
    }
    
}
function readTitle(){
    var title = document.title;        
    var rt = /(\s*\-.+$)|(\s+$)/;
    title  = title.replace(rt, "");        
    var lt = /\s*((\S+\s*)*)/;
    title =  title.replace(lt, "$1");
       
    return title;
}
var http_request = false;
function makeRequest(url, parameters) {
  http_request = false;
  if (window.XMLHttpRequest) { // Mozilla, Safari,...
     http_request = new XMLHttpRequest();
     if (http_request.overrideMimeType) {
        http_request.overrideMimeType('text/xml');
     }
  } else if (window.ActiveXObject) { // IE
     try {
        http_request = new ActiveXObject("Msxml2.XMLHTTP");
     } catch (e) {
        try {
           http_request = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {}
     }
  }
  if (!http_request) {     
     return false;
  }
  http_request.onreadystatechange = alertContents;
  http_request.open('GET', url + parameters, true);
  http_request.send(null);
 
}
function alertContents() {
  if (http_request.readyState == 4) {
     if (http_request.status == 200) {
        var xmldoc = http_request.responseXML;          
        buildHtml(xmldoc);            
     } else {
        //alert('There was a problem with the request.');
     }
  }
}
function    buildHtml(xmldoc)
{
    var today = getToday();
    var program = xmldoc.getElementsByTagName('program').item(0);            
    var program_name    = program.getAttribute("program_name");
    var startDayText    = program.getAttribute("startDayText");             
    var startTimeText    = program.getAttribute("startTimeText"); 
    var TimeOD                    = getTimeod(program);
    var ThisMonth                = getThisMonth(program);    
    var link    = program.getAttribute("link");
    if(program_name == null){
        nextguide ='<div class=\"date\">' + today + '</div>'+
                '<div class=\"schedule\">' +
                '    <a href=\"/tvguide_search.html\">Schedule <img alt=\"\" src=\"/images_css/orange-minor-link-arrow-right.gif\"></a>' +
                '</div>' +
                '<div class=\"schedule-details\">' +
                '    <div class=\"schedule-not-showing\">Not currently showing</div>' +
                '</div>' ;
    }else{
        nextguide ='    <div class=\"item\">' +
                '        <div class=\"time\">'+startTimeText+'</div>' +
                '        <div class=\"day\">'+startDayText+'&nbsp;'+TimeOD+'</div>' +
                '        <div class=\"date\">'+ThisMonth+'</div>' +
                '    </div>' +
                '    <div class=\"links\">' +
                '        <ul>' +
                '            <li><a href=\"/tvguide_search.html\">full guide</a></li>' +
                '            <li><a href=\"'+link+'\">set reminder</a></li>' +
                '        </ul></div>';
    }
    //document.write(nextguide);    
}
function getTimeod(program) 
{
    var    tofd    = program.getAttribute("startTime");
    oDate = new Date();
    oDate.setTime(tofd);
    tofd_hour = oDate.getHours();
    if (tofd_hour > 17) daytime = "Night";
    else if (tofd_hour > 11) daytime = "Afternoon";
    else daytime = "Morning";
    return daytime;
}
function getThisMonth(program)
{
    var DateString = program.getAttribute("startDateText");
    var DateStrin = (DateString.replace(/-/g,"/"));
    var myDate = new Date(DateStrin);
//    showday =    program.getAttribute("startDateText");
    var weekday        = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");    
    var months        = new Array("January","February","March","April","May","June","July","August","September","October","November","December");    
    var time        = new Date();
    var lmonth        = months[myDate.getMonth()];    
    var dow         = weekday[time.getDay()];
    var suffix        = "th";
    day = myDate.getDate();
    
    if (day==1){
        suffix="st";
    }
    if (day==2){
        suffix="nd";
    }
    if (day==3){
        suffix="rd";
    }
    if (day==21){
        suffix="st";
    }
    if (day==22){
        suffix="nd";
    }    
    if (day==23){
        suffix="rd";
    }
    if (day==31){
        suffix="st";
    }    
    var thismonth = lmonth + " " + day + suffix;
    return thismonth ;
}function getToday(){
    var weekday        = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")    
    var months        = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");    
    var time        = new Date();
    var lmonth        = months[time.getMonth()];    
    var dow         = weekday[time.getDay()];
    var suffix        = "th";
    var day            = time.getDate();
    if (day==1){
        suffix="st";
    }
    if (day==2){
        suffix="nd";
    }
    if (day==3){
        suffix="rd";
    }
    if (day==21){
        suffix="st";
    }
    if (day==22){
        suffix="nd";
    }    
    if (day==23){
        suffix="rd";
    }
    if (day==31){
        suffix="st";
    }    
    var today = dow + " " + lmonth + " " + day + suffix;
    return today ;
}
function do_xml(name) {         
    var url            = document.URL;        
    var locale = (TVG_LOC.length != 0) ? TVG_LOC : "sydney";    
    if(url.indexOf("tv_") > 0 ){    
        var title  = readTitle();            
       // var url = document.location.protocol+'//'+document.location.host+'/tv-schedule/next?location='+locale+'&hd=1&search_title='+title;        --remarked for Staging
        var url = document.location.protocol+'//ten.com.au/tv-schedule/next?location='+locale+'&hd=1&search_title='+title;
        makeRequest(url, '');        
    }else{
                    
        //var url = document.location.protocol+'//'+document.location.host+'/tv-schedule/next?location='+locale+'&hd=1&search_title='+name;        --remarked for Staging
        var url = 'http://ten.com.au/tv-schedule/next?location='+locale+'&search_title='+name;        
        makeRequest(url, '');
    }
}
//do_xml("Toasted TV");
///////////////////////////////////////////////////////////////////////
//END OF AJAX Call of "NEXT"
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
//TV Synopsis AJAX Call
///////////////////////////////////////////////////////////////////////
var synopsis = "";
function makeSynopsisRequest(url, parameters) {
  http_request = false;
  if (window.XMLHttpRequest) { // Mozilla, Safari,...
     http_request = new XMLHttpRequest();
     if (http_request.overrideMimeType) {
        http_request.overrideMimeType('text/xml');
     }
  } else if (window.ActiveXObject) { // IE
     try {
        http_request = new ActiveXObject("Msxml2.XMLHTTP");
     } catch (e) {
        try {
           http_request = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {}
     }
  }
  if (!http_request) {
     //alert('Cannot create XMLHTTP instance');
     return false;
  }
  http_request.onreadystatechange = alertSynopsisContents;
  http_request.open('GET', url + parameters, true);
  http_request.send(null);
 
}
function alertSynopsisContents() {
  if (http_request.readyState == 4) {
     if (http_request.status == 200) {
        var xmldoc = http_request.responseXML;          
        buildSynopsisHtml(xmldoc);            
     } else {
        //alert('There was a problem with the request.');
     }
  }
}

function    buildSynopsisHtml(xmldoc)
{
    
    var root = xmldoc.getElementsByTagName('program').item(0);
    var showUrl    = '';
    if(root.getElementsByTagName("showUrl")[0] != null){
        showUrl            = root.getElementsByTagName("showUrl")[0].firstChild.nodeValue;    
    }
    var program_name    = root.getElementsByTagName("program_name")[0].firstChild.nodeValue;                
    
    program_name = program_name.replace("#38;"," ");
    var startDay = root.getElementsByTagName("startDay")[0].firstChild.nodeValue;    
    var startDateFormat = root.getElementsByTagName("startDateFormat")[0].firstChild.nodeValue;    
    
    var program_type = root.getElementsByTagName("program_type")[0].firstChild.nodeValue;            
    var startTimeText = root.getElementsByTagName("startTimeText")[0].firstChild.nodeValue;    
    
    actualstrt = root.getElementsByTagName("actual")[0].firstChild.nodeValue;
    actualstart = (actualstrt.substring(11,16));
    aDate = new Date();
    aDate.setTime(actualstart);
    ampm_hour = parseInt(actualstart.substring(0,2));
    ampm_min =  actualstart.substring(3,5);
    var sep = '';
    if (ampm_hour > 12){sep = "PM"}
    else {sep = "AM"}
    if (sep=="PM"){ampm_hour = ampm_hour - 12}
    act_time = ampm_hour +':'+ ampm_min +' '+ sep;

    var endTimeText = root.getElementsByTagName("endTimeText")[0].firstChild.nodeValue;    
    var image = '';
    if(root.getElementsByTagName("image")[0] != null){
        image = root.getElementsByTagName("image")[0].firstChild.nodeValue;    
    }
    var micrositeUrl = '';
    if(root.getElementsByTagName("micrositeUrl")[0] != null){
        micrositeUrl = root.getElementsByTagName("micrositeUrl")[0].firstChild.nodeValue;    
    }
    var locale =  root.getElementsByTagName("location")[0].firstChild.nodeValue;
    if (locale=="Sydney"){locale ="nsw"}else if(locale=="Brisbane"){locale="qld"}else if(locale=="Melbourne"){locale="vic"}else if(locale=="Adelaide"){locale="sa"}else{locale="wa"}
    
    var schedule_id = root.getElementsByTagName("schedule_id")[0].firstChild.nodeValue;    
    
    var series_id = '';
    if(root.getElementsByTagName("series_id")[0].firstChild != null){            
        series_id = root.getElementsByTagName("series_id")[0].firstChild.nodeValue;    
    }
    var startTimeMillis = root.getElementsByTagName("startTimeMillis")[0].firstChild.nodeValue;    
    var closecaptioned = root.getAttribute("close-captioned");    
    var highdefinition = root.getAttribute("high-definition");
    var repeat = root.getAttribute("repeat");
    var widescreen = root.getAttribute("widescreen");
    
    var classification = '';
    if(root.getElementsByTagName("classification")[0].firstChild != null){
        classification = root.getElementsByTagName("classification")[0].firstChild.nodeValue;    
    }
    var episodename = '';
    if(root.getElementsByTagName("episode_name")[0].firstChild != null){
        episodename = root.getElementsByTagName("episode_name")[0].firstChild.nodeValue;
    }
    var seasonnum = '';
    if(root.getElementsByTagName("series_number")[0].firstChild != null){
        seasonnum = root.getElementsByTagName("series_number")[0].firstChild.nodeValue;
    }
    var episodenum = '';
    if(root.getElementsByTagName("episode_number")[0].firstChild != null){
        episodenum = root.getElementsByTagName("episode_number")[0].firstChild.nodeValue;
    }
    var consumadv = ''; 
    if(root.getElementsByTagName("consumer_advice")[0].firstChild != null){
        consumadv = root.getElementsByTagName("consumer_advice")[0].firstChild.nodeValue;
    }
    var actors = '';
    if(root.getElementsByTagName("actors")[0].firstChild != null){
        actors = root.getElementsByTagName("actors")[0].firstChild.nodeValue;
    }
    var director = '';
    if(root.getElementsByTagName("director")[0].firstChild != null){
        director = root.getElementsByTagName("director")[0].firstChild.nodeValue;
    }
    var prodyear = '';
    if(root.getElementsByTagName("prod_year")[0].firstChild != null){
        prodyear = root.getElementsByTagName("prod_year")[0].firstChild.nodeValue;
    }
    var fta_genre = '';
    if(root.getElementsByTagName("fta_genre")[0].firstChild != null){
        fta_genre = root.getElementsByTagName("fta_genre")[0].firstChild.nodeValue;
    }
    var duration = '';
    if(root.getElementsByTagName("duration")[0].firstChild != null){
        duration = root.getElementsByTagName("duration")[0].firstChild.nodeValue;    
    }
    var country = '';
    if(root.getElementsByTagName("country")[0].firstChild != null){
        country = root.getElementsByTagName("country")[0].firstChild.nodeValue;        
    }    
    var synopsisVal = '' ;
    if(root.getElementsByTagName("synopsis")[0].firstChild != null){
        synopsisVal = root.getElementsByTagName("synopsis")[0].firstChild.nodeValue;    
    }
    synopsis =        '              <div class="article">' +
                    '                <div class="article-head article-head2">' +
                    '                <div class="details"><div class="title">';
    if(showUrl !=''){
        synopsis = synopsis +     '                          <h2 class="heading treated"><a href="' + showUrl + '"><span class="highlight header">' + program_name + '</span></a></h2>' ;
    }else{
        synopsis = synopsis +     '                          <h1><font color="#000000">' + program_name +'</font></h1>' ;
    }
    synopsis = synopsis +   '                      <div class="date">' +
                            '                      ' + act_time + '&nbsp;' + startDay + '&nbsp;' + startDateFormat + '                    </div></div>';
    if(episodename !=''){
        synopsis = synopsis +     '<h2><font color="#FF9900";>' + episodename + '</font></h2>';
    }else{
        synopsis = synopsis;
    }
    if(seasonnum !=''){
        synopsis = synopsis +     '<p><font color="#ADADAD">Season ' + seasonnum + ',';
    }else{
        synopsis = synopsis + '<p><font color="#ADADAD">';
    }    
    if(episodenum !=''){
        synopsis = synopsis +     'Episode ' + episodenum + '</font></p><br>';
    }else{
        synopsis = synopsis + '</font></p><br>';
    }
    
    synopsis =  synopsis +  '                    <div class="note">' +
                            '                      ' + synopsisVal +
                            '                    <br><br></div>';
    if(actors !=''){
        synopsis = synopsis +     '<p><font color="#ADADAD">Starring: </font><font color="#FF9900">' + actors + '</font></p>';
    }else{
        synopsis = synopsis;
    }
    if(director !=''){
        synopsis = synopsis +     '<p><font color="#ADADAD">Director: </font><font color="#FF9900">' + director + '</font></p>';
    }else{
        synopsis = synopsis;
    }
    synopsis = synopsis +   '                    <div class="reminder-row">' +
                            '                      <form name="reminder_form" method="post" action="tvguide_reminder.html">' +
                            '                        <div><font color="#808080"><strong>SET EMAIL REMINDER FOR:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></font>' +
                            '                          <label><input class="episode" type="radio" value="false" name="mark_for_series" /> This Episode&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>';
    if(program_type == 'Series'){
        synopsis    = synopsis +'                        <label><input class="series" type="radio" value="true" name="mark_for_series" /> Whole Series&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>';
    } 
    synopsis    = synopsis +'                          <input type="hidden" name="location" value="'+ locale +'"/>' +
                            '                          <input type="hidden" name="delivery_method" value="email"/>' +
                            '                          <input type="hidden" name="program_id" value="' + schedule_id + '"/>' +
                            '                          <input type="hidden" name="series_id" value="' + series_id + '"/>' +
                            '                          <input type="hidden" name="time" value="' + startTimeMillis + '"/>' +
                            '                          <input type="hidden" name="channel" value="Ten"/>' +
                            '                          <input type="hidden" name="program" value="' + program_name + '"/>' +
                            '                          <input type="hidden" name="remove" value="false"/>' +
                            '                          <input type="hidden" name="post" value="true"/>' +
                            '                           <input type="image" class="reminder" value="submit" src="/images/setreminder.gif" width="107px" height="18px"></input>                    ' +
                            '                        </div>' +
                            '                        <div class="clear"/>' +
                            '                      </form>' +
                            '                    </div>';
                            
                            
    synopsis = synopsis + '<div class="date"><p><font color="#ADADAD">Classification: </font>';
    if(classification.length >= 1){
        synopsis    = synopsis + '<font color="#000000">'  + classification + ' </font>';
    }
    if(consumadv !=''){
        synopsis = synopsis +     '<font color="#000000">[' + consumadv + ']</font>' ;
    }else{
        synopsis = synopsis;
    }
    if(closecaptioned == 'true'){
        synopsis    = synopsis +'<font color="#000000">(CC) </font>' ;
    }else{
        synopsis    = synopsis;
    }
    if(repeat=='true'){
        synopsis    = synopsis + '<font color="#000000">(Rpt) </font>';
    }else{
        synopsis    = synopsis;
    }
    if(widescreen=='true'){
        synopsis    = synopsis + '<font color="#000000">(WS) </font>';
    }else{
        synopsis    = synopsis;
    }
    if(highdefinition=='true'){
        synopsis    = synopsis + '<font color="#000000">(HD) </font></p>';
    }else{
        synopsis    = synopsis + '</p>';
    }
    
    if(duration !=''){
        synopsis = synopsis +     '    <p><font color="#ADADAD">Duration: </font><font color="#000000">' + duration + ' minutes</font></p>' ;
    }else{
        synopsis = synopsis;
    }
    if(fta_genre !=''){
        synopsis = synopsis +     '<p><font color="#ADADAD">Genre: </font><font color="#000000">' + fta_genre + '</font></p>';
    }else{
        synopsis = synopsis;
    }
    if(prodyear !=''){
        synopsis = synopsis +     '<p><font color="#ADADAD">Year: </font><font color="#000000">' + prodyear + '</font></p>';
    }else{
        synopsis = synopsis;
    }
    if(country !=''){
        synopsis = synopsis +     '<p><font color="#ADADAD">Country: </font><font color="#000000">' + country + '</font></p>';
    }else{
        synopsis = synopsis;
    }
    synopsis = synopsis;
    synopsis = synopsis +    '                  </div>' +
                            '                </div>' +
                            '              </div><br><br>';
    
}
function do_synopsis() {        
    var dir = 'feeds' ;
    var loc = 'nsw';
    if(TVG_LOC == 'melbourne'){
        loc = 'vic';
    }else if(TVG_LOC == 'brisbane'){
        loc = 'qld';
    }else if(TVG_LOC == 'adelaide'){
        loc = 'sa';
    }else if(TVG_LOC == 'perth'){
        loc = 'wa';
    }else{
        loc = 'nsw';
    }
    var url            = document.URL;        
    if(url.indexOf("tvguide_synopsis.htm") > 0 ){
        var afterId     = url.split("?id");    
        var file        = afterId[1].replace('=','');        
        var xml  = document.location.protocol+'//'+document.location.host+'/'+dir+'/'+loc+'/'+file;                
        makeSynopsisRequest(xml, '');    
    }    
}
do_synopsis();
///////////////////////////////////////////////////////////////////////
//END OF TV Synopsis AJAX Call
///////////////////////////////////////////////////////////////////////