function ShowOverlay(OverlayTitle, OverlayContentArray, RenderContentOnly) {
    var renderContentOnlyFlag = (RenderContentOnly == undefined ? false : RenderContentOnly);
    infohtml = []
    if (renderContentOnlyFlag == false) {
        infohtml.push('<div id="infodiv" unselectable="on">')
        infohtml.push(' <div id="infodivabout" style="float:left;width:525px;padding-left:19px;" unselectable="on">')
        infohtml.push('  <div style="font-size:16px;"><strong unselectable="on">' + OverlayTitle + '</strong></div>')
        infohtml.push('  <br style="line-height:5px;"/><hr/><br style="line-height:5px;"/>')
        infohtml.push('<div unselectable="on" style="color:#000000">')
    }
    for (var i = 0; i < OverlayContentArray.length; i++) {
        infohtml.push(OverlayContentArray[i]);
    }
    if (renderContentOnlyFlag == false) {
        infohtml.push('</div>')
        infohtml.push('</div>')
        infohtml.push('<br style="clear:both;"/>')
    }

    //showScreenBlock();
    dg("titledetcontent").innerHTML = infohtml.join("")
    setopacity("titledetDiv", 0)
    dg("titledetDiv").style.display = "block"
    dg("titledetbgDiv").style.display = "block"

    newmidh = (dg("titledetcontent").offsetHeight + 40)
    newdeth = (dg("titledetcontent").offsetHeight + 80)
    if (newmidh < 350) { newmidh = 350 }
    if (newdeth < 350 + 60) { newdeth = 350 + 40 }
    dg("titledetbgmid").style.height = newmidh + "px"
    dg("titledetDiv").style.height = newdeth + "px"

    try {
        var ScrollTop = window.pageYOffset || document.documentElement.scrollTop || 0;
        if (ScrollTop == 0) {
            if (window.pageYOffset) {
                ScrollTop = window.pageYOffset;
            }
            else {
                ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
            }
        }
        if (ScrollTop > 0) {
            ScrollTop += 30;
            dg("titledetDiv").style.top = ScrollTop + "px";
            dg("titledetbgDiv").style.top = ScrollTop + "px";
        }
    }
    catch (e)
    { }

    fx("titledetDiv", 4, false, 'setTimeout("fixinfosize()",50)', "opacity,0,100")
}

function moreinfoover(thisinfo) {
    fx("moreinfoimg_" + thisinfo, 3, fx_slidein, null, "backgroundColor,58595b,4a85c8")
    fx("moreinfo_" + thisinfo, 3, fx_slidein, null, "color,4a85c8,58595b")
    dg("moreinfotext_" + thisinfo).style.textDecoration = "underline"
}

function moreinfoout(thisinfo) {
    fx("moreinfoimg_" + thisinfo, 3, fx_slidein, null, "backgroundColor,4a85c8,58595b")
    fx("moreinfo_" + thisinfo, 3, fx_slidein, null, "color,58595b,4a85c8")
    dg("moreinfotext_" + thisinfo).style.textDecoration = "none"
}

titleinfo_array = []
lastclicked = -1
var lastMoreInfoPassIdClicked = -1;
function moreinfoclick(thisinfo) {
    lastclicked = thisinfo
    lastMoreInfoPassIdClicked = currentlist[thisinfo + listoffset].PassID;
    if (currentlist[thisinfo + listoffset].BurnLicCount && currentlist[thisinfo + listoffset].BurnLicAvailable > 0) {
        //return;
    }
    var thistitleid = currentlist[thisinfo + listoffset].TitleID
    if (titleinfo_array[thistitleid] == undefined) {
        ajl(webservices + "Titles.asmx/GetTitle", titlescallback, 'TitleID=' + thistitleid, ajaxerror, true);
    } else {
        drawmoreinfo(titleinfo_array[thistitleid], lastMoreInfoPassIdClicked)
    }
}

var showDebug = null;
function drawmoreinfo(thistitleobj, inPassId) {
    var selectedTitle = null;

    libraryarray.forEach(function(title) {
        if (title.PassID == inPassId) {
            selectedTitle = title;
        }
    });

    // When the resulting title object does not have the name property defined, then it is
    // an empty result.  If we don't have the passId, we must abort processing.
    if (!thistitleobj.Name && selectedTitle == null) {
        return;
    }

    if (showDebug == null) {
        if (String(window.location).toLowerCase().indexOf("debug=1") != -1) {
            showDebug = true;
        }
        else {
            showDebug = false;
        }
    }

    infohtml = []
    infohtml.push('<div id="infodiv">')
    infohtml.push(' <img id="titleinfoboxart" onload="try{dg(\'titleinfoboxartv\').style.top=this.offsetHeight+\'px\'}catch(e){}" src="' + protocol + '://'+IMAGE_CACHE_SERV+'/images/boxart/175/' + selectedTitle.BoxArt + '175.jpg" border="0" width="175" style="float:left;margin-bottom:20px;border:1px solid #dedede;"/>')
    infohtml.push(' <div id="infodivabout" style="float:left;width:370px;margin-left:19px;">')
    infohtml.push('  <div style="font-size:16px;color:#5c83b0"><strong>' + selectedTitle.Name + '</strong></div>')
    infohtml.push('  <div style="float:left"><strong>Download Locations:</strong> ')
    infohtml.push('  </div>')
    if (selectedTitle.DDIDS != null) {
        infohtml.push('<table style="color:inherit">');
        infohtml.push('<thead />');
        infohtml.push('<tbody>');
        //Need to parse out the download destinations.
        var downloadInstances = String(selectedTitle.DDIDS).split(',');
        var ddToTranslate = [];
        for (var i = 0; i < downloadInstances.length; i++) {
            var instanceData = [];
            instanceData = downloadInstances[i].split('|');
            //Confirmed we have the DQID, SKUID, DDID
            if (instanceData.length == 3) {
                ddToTranslate.push(instanceData[instanceData.length - 1]);
            }
        }
        // Keep track of valid download locations.
        var validDownloads = 0;
        for (var i = 0; i < ddToTranslate.length; i++) {
            for (var ddIndex = 0; ddIndex < destinationarray.length; ddIndex++) {
                if (destinationarray[ddIndex].DDID == ddToTranslate[i]) {
                    infohtml.push('<tr>');
                    infohtml.push('<td>');
                    infohtml.push('<span style="color:#60676c">');
                    infohtml.push(destinationarray[ddIndex].Loc);
                    infohtml.push('</span>');
                    infohtml.push('</td>');
                    infohtml.push('</tr>');
                    validDownloads++;
                    break;
                }
            }
        }
        // No valid downloads found, enter empty area in it's place.
        if (validDownloads == 0) {
            infohtml.push('<tr><td><span> </span><br/></td></tr>');
        }
        infohtml.push('</tbody>');
        infohtml.push('</table>');
        downloadInstances = null;
        ddToTranslate = null;
    }

    infohtml.push('  <div><strong>Download Licenses:</strong> ')
    if (selectedTitle.LicCount != null) {
        infohtml.push(parseInt(selectedTitle.LicAvailable - selectedTitle.LicCount) + ' left ');
    }
    infohtml.push('  </div>')
    if (showDebug == true) {
        infohtml.push('  <div><strong>Download Count:</strong> ')
        if (selectedTitle.DLCount != null) {
            infohtml.push(parseInt(selectedTitle.DLCount));
        }
        infohtml.push('  </div>')
        infohtml.push('  <div><strong>Max License Available:</strong> ')
        if (selectedTitle.LicAvailable != null) {
            infohtml.push(parseInt(selectedTitle.LicAvailable));
        }
        infohtml.push('  </div>')
    }


    if (thistitleobj.Description != undefined && thistitleobj.Description != '') {
        infohtml.push('  <br style="line-height:5px;"/><hr/><br style="line-height:5px;"/>')
        infohtml.push('  <div style="color:#777a7d"><strong style="width:60px;display:block;float:left;">Synopsis:&nbsp;</strong>')
        infohtml.push(thistitleobj.Description)
        infohtml.push('  </div>')
    }
    else {
        infohtml.push('  <br style="line-height:5px;"/><hr/><br style="line-height:5px;"/>')
        infohtml.push('  <div style="color:#777a7d">')
        infohtml.push('Additional Information Unavailable.')
        infohtml.push('  </div>')
    }

    if (thistitleobj.Rating != undefined && thistitleobj.Rating != null) {
        infohtml.push('  <div><strong style="width:90px;display:block;float:left;">Rating:</strong>' + thistitleobj.Rating + '</div>')
    }
    if (thistitleobj.ReleaseYear != null) {
        infohtml.push('  <div><strong style="width:90px;display:block;float:left;">Release Year:</strong>' + thistitleobj.ReleaseYear + '</div>')
    }
    if (thistitleobj.Starring != null) {
        if (thistitleobj.Starring.length > 1) { plural = "s" } else { plural = "" }
        for (var i = 0; i < thistitleobj.Starring.length; i++) {
            if (i == 0) { thishead = 'Actor' + plural + ':' } else { thishead = '&nbsp;' }
            infohtml.push('  <div><strong style="width:90px;display:block;float:left;">' + thishead + '</strong><a href="http://www.cinemanow.com/SearchResults.aspx?q=' + escape(thistitleobj.Starring[i]) + '">' + thistitleobj.Starring[i] + '</a></div>')
        }
    }
    if (thistitleobj.Directors != null) {
        if (thistitleobj.Directors.length > 1) { plural = "s" } else { plural = "" }
        for (var i = 0; i < thistitleobj.Directors.length; i++) {
            if (i == 0) { thishead = 'Director' + plural + ':' } else { thishead = '&nbsp;' }
            infohtml.push('  <div><strong style="width:90px;display:block;float:left;">' + thishead + '</strong><a href="http://www.cinemanow.com/SearchResults.aspx?q=' + escape(thistitleobj.Directors[i]) + '">' + thistitleobj.Directors[i] + '</a></div>')
        }
    }
    if (thistitleobj.Producers != null) {
        if (thistitleobj.Producers.length > 1) { plural = "s" } else { plural = "" }
        for (var i = 0; i < thistitleobj.Producers.length; i++) {
            if (i == 0) { thishead = 'Producer' + plural + ':' } else { thishead = '&nbsp;' }
            infohtml.push('  <div><strong style="width:90px;display:block;float:left;">' + thishead + '</strong><a href="http://www.cinemanow.com/SearchResults.aspx?q=' + escape(thistitleobj.Producers[i]) + '">' + thistitleobj.Producers[i] + '</a></div>')
        }
    }
    if (thistitleobj.Writers != null) {
        if (thistitleobj.Writers.length > 1) { plural = "s" } else { plural = "" }
        for (var i = 0; i < thistitleobj.Writers.length; i++) {
            if (i == 0) { thishead = 'Writer' + plural + ':' } else { thishead = '&nbsp;' }
            infohtml.push('  <div><strong style="width:90px;display:block;float:left;">' + thishead + '</strong><a href="http://www.cinemanow.com/SearchResults.aspx?q=' + escape(thistitleobj.Writers[i]) + '">' + thistitleobj.Writers[i] + '</a></div>')
        }
    }
    if (thistitleobj.RunningTimeSeconds != null) {
        if (thistitleobj.RunningTimeSeconds > 0) {
            infohtml.push('  <div><strong style="width:90px;display:block;float:left;">Run Time:</strong>' + Math.round(thistitleobj.RunningTimeSeconds / 60) + ' Minutes</div>')
        }
    }
    if (thistitleobj.Copyright != null) {
        infohtml.push('  <div><strong style="width:90px;display:block;float:left;">Copyright:</strong>' + thistitleobj.Copyright + '</div>')
    }

    infohtml.push('<br/> ')
    infohtml.push('</div>')
    infohtml.push('<br style="clear:both;"/>')
    infohtml.push('<div id="werecommendDiv" style="background-color:transparent;position:relative;clear:both;width:566px;z-index:200;">')
    infohtml.push(' <strong style="color:#5c83b0;background-color:white;">We Recommend:</strong><br/>')
    infohtml.push(' <div id="werecommendcontentDiv" style="background-color:transparent;"></div>')
    infohtml.push('</div>')
    infohtml.push('<img src="img/mmgr2/vboxfade.png" id="titleinfoboxartv" onload="fixpng();try{this.style.top=dg(\'titleinfoboxart\').offsetHeight+\'px\'}catch(e){};" width="175" height="60" border="0" style="position:absolute;top:0px;left:1px;z-index:150;height:60px;background-color:white;background-image:url(images/boxart/175v/' + selectedTitle.BoxArt + '175.jpg);"/>')

    similarSKUID = currentlist[lastclicked + listoffset].FileType.split(",")[0].split(":")[1]

    if (similarSKUID != 0) {
        //if (similars[similarSKUID]==undefined) {
        ajl(webservices + "remoteq.asmx/GetRelatedPurchases", drawsimilar_callback, 'SKUID=' + similarSKUID, ajaxerror, true);
        //} else {
        //	drawsimilar(similarSKUID)
        //}
    }

    if (dg("titledetDiv").style.display == "block") {

        setopacity("titledetDiv", 0)

        var lasttitledetcontentheight = (dg("titledetbgmid").offsetHeight)
        var lasttitledetDivheight = (dg("titledetDiv").offsetHeight)

        dg("titledetcontent").innerHTML = infohtml.join("")

    } else {
        dg("titledetcontent").innerHTML = infohtml.join("")
        setopacity("titledetDiv", 0)
        dg("titledetDiv").style.display = "block"
        dg("titledetbgDiv").style.display = "block"

        newmidh = (dg("titledetcontent").offsetHeight + 40)
        newdeth = (dg("titledetcontent").offsetHeight + 80)
        if (newmidh < 350) { newmidh = 350 }
        if (newdeth < 350 + 60) { newdeth = 350 + 40 }
        dg("titledetbgmid").style.height = newmidh + "px"
        dg("titledetDiv").style.height = newdeth + "px"

        fx("titledetDiv", 4, false, 'setTimeout("fixinfosize()",50)', "opacity,0,100")
    }
}

function fixinfosize() {
    newmidh = (dg("titledetcontent").offsetHeight + 40)
    newdeth = (dg("titledetcontent").offsetHeight + 80)
    if (newmidh < 350) { newmidh = 350 }
    if (newdeth < 350 + 40) { newdeth = 350 + 40 }
    fx("titledetbgmid", 5, fx_slideout, null, "height," + dg("titledetbgmid").offsetHeight + "," + newmidh)
    fx("titledetDiv", 5, fx_slideout, null, "height," + dg("titledetDiv").offsetHeight + "," + newdeth)
}

function closetitledet() {
    fx("titledetDiv", 4, false, "dg('titledetDiv').style.display='none';dg('titledetbgDiv').style.display='none'", "opacity,100,0");
    if (dg("screenblockDiv") && dg("screenblockDiv").style.display.toLowerCase() == "block") {
        setTimeout('dg("screenblockDiv").style.display="none"', 50);
    }
}

function getElementPosition(theElement, rootElement) {
    var posX = 0;
    var posY = 0;
    var breakOutAfterElement = (rootElement != undefined ? true : false);
    while (theElement != null) {
        posX += theElement.offsetLeft;
        posY += theElement.offsetTop;
        theElement = theElement.offsetParent;
        if (breakOutAfterElement == true) {
            if (theElement.offsetParent != null) {
                if (theElement.id == rootElement.id) {
                    break;
                }
            }
        }

    }
    return { X: posX, Y: posY };
}
function ShowFaqItem(FaqItemTarget) {
    if (browser == "ie") {
        dg(helpDivId).scrollTop = getElementPosition(dg(FaqItemTarget), dg(helpDivId)).Y;
    }
    else {
        dg(FaqItemTarget).scrollIntoView();
    }
}
var helpDivId = 'helpOverLayDiv';

function fixpng(scaling) { if ((browser == "ie") && (bver < 7)) { if (event.srcElement.src.indexOf("spacer.gif") != -1) { return }; event.srcElement.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + event.srcElement.src + "', sizingMethod='" + ((scaling == undefined || scaling == false) ? "image" : "scale") + "')"; event.srcElement.src = "img/spacer.gif" } }
function fixpng_background(thisid) { if ((browser == "ie") && (bver < 7)) { if (dg(thisid).background.indexOf("spacer.gif") != -1) { return }; dg(thisid).style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + dg(thisid).background + "', sizingMethod='scale')"; dg(thisid).background = "" } }
function fixpng_bg_style(thisid) { if ((browser == "ie") && (bver < 7)) { if (dg(thisid).style.backgroundImage.indexOf("spacer.gif") != -1) { return }; dg(thisid).style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + dg(thisid).style.backgroundImage.replace(/url\(/g, "").replace(/\)/g, "") + "', sizingMethod='scale')"; dg(thisid).style.backgroundImage = "url(img/spacer.gif)" } }
function fixpng_cssbg(cssselector) { if ((browser == "ie") && (bver < 7)) { thiscss = getstyle(cssselector); if (thiscss.style.backgroundImage.indexOf("spacer.gif") != -1) { return }; thiscss.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + thiscss.style.backgroundImage.replace(/url\(/g, "").replace(/\)/g, "") + "', sizingMethod='scale')"; thiscss.style.backgroundImage = "url(img/spacer.gif)" } }


function WatchCinemaNowWhereYouWant() {
    var content = [];
    content.push('<div style="color:#000000;padding-right:15px; ">');
    content.push('<div style="float:left;padding-top:5px;padding-bottom:18px;"><a href="http://www.cinemanow.com/devices.aspx" target="_blank"><img src="/theme/std2/img/icon_3devices_wportable.gif" border="0"></a></div>');
    content.push('<br />');
    content.push('<br />');
    content.push('<div style="float:left;width:250px"><span style="font-size:15px;font-weight:bold">Computers</span>');
    content.push('<br />');
    content.push('<a href="https://selfserve.roxio.com/cinemanow/default.aspx?id=000002CN" target="_blank">System Requirements</a>');
    content.push('<br />');
    content.push('<br /></div>');
    content.push('<div style="float:left;width:250px"><span style="font-size:15px;font-weight:bold">TVs</span>');
    content.push('<br />');
    content.push('<a href="http://www.cinemanow.com/Devices.aspx" target="_blank">TV-Connected devices</a>');
    content.push('<br />');
    content.push('<a href="http://www.cinemanow.com/tivo/info" target="_blank">Watch on your TiVo DVR</a>');
    content.push('<br />');
    content.push('<a href="http://www.cinemanow.com/pclaptop1.aspx" target="_blank">How to connect your computer to your TV </a>');
    content.push('<br />');
    content.push('<br /></div>');
    content.push('<div style="float:left; width:250px"><span style="font-size:15px;font-weight:bold">Portable Players</span>&nbsp;&nbsp;<span style="font-size:11px;">(play on up to 2 players)</span>');
    content.push('<br />');
    content.push('<a href="http://www.cinemanow.com/Devices.aspx" target="_blank">Compatible Portable players </a>');
    content.push('<br />');
    content.push('<br /></div>');
    //content.push('<br />this is a test7');
    content.push('</div>');

    ShowOverlay("Watch CinemaNow Where You Want ", content);
}

function WatchCinemaNowWhereYouWant_noPortables() {
    var content = [];
    content.push('<div style="color:#000000;padding-right:15px; ">');
    content.push('<div style="float:left;padding-top:5px;padding-bottom:18px;"><a href="http://www.cinemanow.com/devices.aspx" target="_blank"><img src="/theme/std2/img/icon_pcDevicesOnly.gif" border="0"></a></div>');
    content.push('<br />');
    content.push('<br />');
    content.push('<div style="float:left;width:250px"><span style="font-size:15px;font-weight:bold">Computers</span>');
    content.push('<br />');
    content.push('<a href="https://selfserve.roxio.com/cinemanow/default.aspx?id=000002CN" target="_blank">System Requirements</a>');
    content.push('<br />');
    content.push('<br /></div>');
    content.push('<div style="float:left;width:250px"><span style="font-size:15px;font-weight:bold">TVs</span>');
    content.push('<br />');
    content.push('<a href="http://www.cinemanow.com/Devices.aspx" target="_blank">TV-Connected devices</a>');
    content.push('<br />');
    content.push('<a href="http://www.cinemanow.com/tivo/info" target="_blank">Watch on your TiVo DVR</a>');
    content.push('<br />');
    content.push('<a href="http://www.cinemanow.com/pclaptop1.aspx" target="_blank">How to connect your computer to your TV </a>');
    content.push('<br />');
    content.push('<br /></div>');
    content.push('</div>');

    ShowOverlay("Watch CinemaNow Where You Want ", content);
}

/* uncomment after flash streaming is live
function WindowsComputer() {
    var content = [];
    content.push('<div style="color:#000000;padding-right:15px; ">');
    content.push('<br />');
    content.push('<div style="float:left;width:450px;margin-left:14px;"><span style="font-size:15px;font-weight:bold"></span>');
    content.push('<ul>');
    content.push('<li>Computer</li>');
    content.push('<ul>');
    content.push('<li>Apple Mac</li>');
    content.push('<ul>');
    content.push('<li>PowerPC G5 1.8 GHz or faster or Intel Core Duo 1.33 GHz or faster</li>');
    content.push('</ul>');
    content.push('<li>PC</li>');
    content.push('<ul>');
    content.push('<li>Desktop - laptop</li>');
    content.push('<ul>');
    content.push('<li>Intel Pentium 4 2.33GHz, AMD Athlon 64 2800+ processor (or faster)</li>');
    content.push('<li>28MB of RAM</li>');
    content.push('<li>64MB of graphics memory</li>');
    content.push('</ul>');
    content.push('<li>Netbook</li>');
    content.push('<ul>');
    content.push('<li>Intel Atom 1.6GHz or faster processor</li>');
    content.push('<li>1GB of RAM</li>');
    content.push('<li>GPU / media accelerator (NVIDIA ION, Broadcom Crystal HD Media Accelerator, Intel GMA 500)</li>');
    content.push('</ul>');
    content.push('</ul>');
    content.push('</ul>');
    content.push('<li>OS</li>');
    content.push('<ul>');
    content.push('<li>Windows XP and higher</li>');
    content.push('<li>Apple Mac OS X</li>');
    content.push('</ul>');
    content.push('<li>Software</li>');
    content.push('<ul>');
    content.push('');
    content.push('<li>Internet Explorer 7.0 and higher</li>');
    content.push('<li>Firefox 3.6 and higher</li> ');
    content.push('<li>Safari 4 and higher (Apple Mac only)</li> ');
    content.push('<li>Google Chrome</li>');
    content.push('<li>Download</li>');
    content.push('<ul>');
    content.push('<li>Windows Media Player 10</li>');
    content.push('</ul>');
    content.push('<li>Streaming</li>');
    content.push('<ul>');
    content.push('<li>Adobe Flash Player 10.1 or higher</li>');
    content.push('</ul>');
    content.push('</ul>');
    content.push('<li>Internet connection</li>');
    content.push('<ul>');
    content.push('<li>Streaming</li>');
    content.push('<ul>');
    content.push('<li>Broadband connection with a minimum connection speed of 1500 kb per second</li>');
    content.push('</ul>');
    content.push('<li>Download</li>');
    content.push('<ul>');
    content.push('<li>Broadband connection with a minimum connection speed of 750 kb per second</li>');
    content.push('</ul>');
    content.push('</ul>');
    content.push('</ul>');
    content.push('<br /></div>');
    content.push('</div>');

    ShowOverlayPlayOn("System Requirements", content);
}
*/

function WindowsComputer() {
    var content = [];
    content.push('<div style="color:#000000;padding-right:15px; ">');
    content.push('<div style="float:left;width:500px;margin-left:14px;"><span style="font-size:15px;font-weight:bold"></span>');    
    if (hasStreamingAsset){
        if (hasStreamingAsset.toLowerCase()=="true") {
            content.push('<h3>Streaming</h3>');
            content.push('<p>');
            content.push('OS: Windows XP, Vista or Windows 7 / Mac OS X <br/>');
            content.push('Browser: IE 7 and higher / Firefox 3.6 and higher/ Safari 4 and higher / Google Chrome <br/>');
            content.push('Adobe Flash player (10.3 or higher)<br/>');
            content.push('Broadband Internet connection such as DSL or Cable Modem');
            content.push('</p>');
        }
    }
    content.push('<h3>Download</h3>');
    content.push('<p>');
    content.push('OS: Windows XP, Vista or Windows 7<br/> ');
    content.push('Windows Media Player 10 or higher <br/>');
    content.push('Browser: IE 7 and higher / Firefox 3.6 and higher<br/>');
    content.push('Broadband Internet connection such as DSL or Cable Modem ');
    content.push('</p>');
    content.push('</div>');
    content.push('</div>');

    ShowOverlayPlayOn("System Requirements", content);
}

function MacComputer() {
    var content = [];
    content.push('<div style="color:#000000;padding-right:15px; ">');
    content.push('<br />');
    content.push('<div style="float:left;width:250px;margin-left:14px;"><span style="font-size:15px;font-weight:bold"></span>');
    content.push('<li>Mac computer with an Intel processor</li>');
    content.push('<li>Mac OS X v10.4 or later</li>');
    content.push('<li>1GHz processor; 1.5GHz or faster recommended</li>');
    content.push('<li>512MB RAM; 1GB or more recommended</li>');
    content.push('<li>We currently only offer instant streaming as an option for playback on Mac computers. Titles you purchase on your Mac will remain in your CinemaNow library and can be played back on any other CinemaNow compatible device or PC.</li>');
    content.push('<br /></div>');
    content.push('</div>');

    ShowOverlayPlayOn("Macintosh System Requirements", content);
}


function TVDirectConnection() {
    var content = [];
    content.push('Watch CinemaNow videos on your TV by connecting your PC directly to your TV.');
    content.push('<br />');
    content.push('<br />');
    content.push('<a href="/pclaptop1.aspx">Learn how to connect your computer to your TV</a>');
    content.push('<br /></div>');
    content.push('</div>');

    ShowOverlayPlayOn("TV Direct Connection", content);
}

function TVDirectConnectionRN() {
    var content = [];
    content.push('Watch RoxioNow videos on your TV by connecting your PC directly to your TV.');
    content.push('<br />');
    content.push('<br />');
    content.push('<a href="/pclaptop1.aspx">Learn how to connect your computer to your TV</a>');
    content.push('<br /></div>');
    content.push('</div>');

    ShowOverlayPlayOn("TV Direct Connection", content);
}


function TVXbox360() {
    var content = [];
    content.push('Your Xbox 360 will play CinemaNow videos which you have downloaded to your PC.');
    content.push('<br />');
    content.push('<br />');
    content.push('<a href="/pc-to-tv_on_xbox1.aspx">Learn how to connect your Xbox 360 to CinemaNow</a>');
    content.push('<br /></div>');
    content.push('</div>');

    ShowOverlayPlayOn("Xbox 360", content);
}

function TVXbox360RN() {
    var content = [];
    content.push('Your Xbox 360 will play RoxioNow videos which you have downloaded to your PC.');
    content.push('<br />');
    content.push('<br />');
    content.push('<a href="/pc-to-tv_on_xbox1.aspx">Learn how to connect your Xbox 360 to RoxioNow</a>');
    content.push('<br /></div>');
    content.push('</div>');

    ShowOverlayPlayOn("Xbox 360", content);
}


function TVPlayStation() {
    var content = [];
    content.push('Watch purchased movies directly from your TV with a Sony PlayStation&reg; 3.');
    content.push('<br />');
    content.push('<br />');
    content.push('<a href="http://www.CinemaNow.com/Devices.aspx">Find out how to setup your PlayStation&reg; 3 to watch CinemaNow movies.</a>');
    content.push('<br /></div>');
    content.push('</div>');

    ShowOverlayPlayOn("Sony PlayStation&reg; 3", content);
}

function TVHasDivxFile() {
    var content = [];
    content.push('Watch purchased movies directly from your TV with a DivX certified DVD player or Blu-Ray player.');
    content.push('<br />');
    content.push('<br />');
    content.push('<a href="http://www.CinemaNow.com/Devices.aspx">Find out more about DivX certified DVD players and Blu-Ray players.</a>');
    content.push('<br /></div>');
    content.push('</div>');

    ShowOverlayPlayOn("DivX Video", content);
}

function TVWithPS3() {
    var content = [];
    content.push('Watch purchased movies directly from your TV with a Sony PlayStation 3.');
    content.push('<br />');
    content.push('<br />');
    content.push('<a href="http://www.CinemaNow.com/DevicesPS3.aspx">Find out how to setup your Playstation 3 to watch CinemaNow movies.</a>');
    content.push('<br /></div>');
    content.push('</div>');

    ShowOverlay("Playstation 3", content);
}

function TVWithBluRay() {
    var content = [];
    content.push('Purchase or rent movies and TV shows directly from your TV with a CinemaNow ready Blu-Ray player.');
    content.push('<br />');
    content.push('<br />');
    content.push('<a href="/Devices.aspx">Find out more about CinemaNow ready Blu-Ray players and set-top boxes</a>');
    content.push('<br /></div>');
    content.push('</div>');

    ShowOverlayPlayOn("CinemaNow Ready Devices", content);
}

function TVWithBluRayRN() {
    var content = [];
    content.push('Purchase or rent movies and TV shows directly from your TV with a RoxioNow ready Blu-Ray player.');
    content.push('<br /></div>');
    content.push('</div>');

    ShowOverlayPlayOn("RoxioNow Ready Devices", content);
}

function CinemanowWithTivo() {
    var content = [];
    content.push('Watch purchased CinemaNow movies directly from your TiVo.');
    content.push('<br />');
    content.push('<br />');
    content.push('<a href="http://www.CinemaNow.com/tivo/info">Find out more</a>');
    content.push('<br /></div>');
    content.push('</div>');

    ShowOverlayPlayOn("Tivo", content);
}


function CinemanowWithPortable() {
    var content = [];
    content.push('Take CinemaNow movies with you and watch them where and when you want.');
    content.push('<br />');
    content.push('<br />');
    content.push('<a href="http://www.CinemaNow.com/Devices.aspx">Find out more about CinemaNow ready portable devices</a>');
    content.push('<br /></div>');
    content.push('</div>');

    ShowOverlayPlayOn("CinemaNow Ready Portable Device", content);
}

function DivxPhones() {
    var content = [];
    content.push('Watch CinemaNow movies on the go with a wide variety of DivX certified mobile phones and portable devices.');
    content.push('<br />');
    content.push('<br />');
    content.push('<a href="http://www.CinemaNow.com/Devices.aspx">Find out more about DivX certified mobile phones and portable devices</a>');
    content.push('<br /></div>');
    content.push('</div>');

    ShowOverlayPlayOn("DivX certified phones and portable players", content);
}

function RentalViewPeriod(viewingPeriod) {
    var content = [];
    content.push('<div style="float:left;width:345x"><span style="font-size:15px;font-weight:bold"></span>');
    content.push('<p>When you rent a movie, you have 30 days after downloading it to begin viewing. Once you begin viewing, you have ' + viewingPeriod + ' to view the movie. You may view the movie an unlimited number of times during this viewing period. Movies are not viewable after the 30 day period. Stopping, pausing or restarting a movie does not extend the available time for viewing.</p>');
    content.push('<p>Please note: For HD titles, protected by Intel Insider, you have 24 hours at the point when download begins to view the title.</p>');

    content.push('</div>');
    content.push('</div>');

    ShowOverlay("Viewing Period: " + viewingPeriod, content);
}

function BuyViewPeriod(deviceCount) {
    var content = [];
    content.push('<div style="float:left;width:345x"><span style="font-size:15px;font-weight:bold"></span>');
    content.push('<p>When you buy a video, you can watch your video as many times as you like and play it back on up to ' + deviceCount + ' PCs or transfer to as many as ' + (parseInt(deviceCount) - 1) + ' CinemaNow ready portable devices.</p>');
    content.push('<p>With a video you own, your viewing period does not expire. However, some new release movies become unavailable for streaming or downloading due to content licensing restrictions.  Videos that you have already downloaded to your PC or portable device will not be affected by this unavailability and you can continue to enjoy them on your PC or CinemaNow ready devices.</p>');

    content.push('</div>');
    content.push('</div>');

    ShowOverlay("Viewing Period: Unlimited", content);
}

function BuyRoxioNowViewPeriod(deviceCount) {
    var content = [];
    content.push('<div style="float:left;width:345x"><span style="font-size:15px;font-weight:bold"></span>');
    content.push('<p>When you buy a video, you can watch your video as many times as you like and play it back on up to ' + deviceCount + ' PCs or transfer to as many as ' + (parseInt(deviceCount) - 1) + ' RoxioNow ready portable devices.</p>');
    content.push('<p>With a video you own, your viewing period does not expire. However, some new release movies become unavailable for streaming or downloading due to content licensing restrictions.  Videos that you have already downloaded to your PC or portable device will not be affected by this unavailability and you can continue to enjoy them on your PC or RoxioNow ready devices.</p>');

    content.push('</div>');
    content.push('</div>');

    ShowOverlay("Viewing Period: Unlimited", content);
}

function BuyDivxViewPeriod(deviceCount) {
    var content = [];
    content.push('<div style="float:left;width:345x"><span style="font-size:15px;font-weight:bold"></span>');
    content.push('<p>When you buy a video, you can watch your video as many times as you like and play it back on up to ' + deviceCount + ' PCs or transfer to as many as ' + (parseInt(deviceCount) - 1) + ' CinemaNow ready portable devices.</p>');
    content.push('<p>With a video you own, your viewing period does not expire. However, some new release movies become unavailable for streaming or downloading due to content licensing restrictions.  Videos that you have already downloaded to your PC or portable device will not be affected by this unavailability and you can continue to enjoy them on your PC, Mac or portable devices.</p>');

    content.push('</div>');
    content.push('</div>');

    ShowOverlay("Viewing Period: Unlimited", content);
}

function ShowWhatIsHD() {
    var content = [];
    content.push('<div style="float:left;width:345x"><span style="font-size:15px;font-weight:bold"></span>');
    content.push('<p>HD stands for high definition video. High definition video is presented at a certain resolution allowing for the display of the highest form of digital video. It renders clarity and detail in the video presentation with a minimum of a 16:9 aspect ratio - similar to a movie theater screen.</p>');
    content.push('<p>Compared to the SD format, HD video has 4-5 times more resolution and pixels than SD video.</p>');
    content.push('<p>To get the best of HD, you have a display device that has a native resolution of either 1280 x 720 pixels (720p) or 1920 x 1080 (1080i). In this instance, HD titles are presented in the 1080p format. This is the highest commercially available format of digital video and is the equivalent of the Blu-ray format.</p>');
    content.push('<p>A RoxioNow video offered in HD has the following characteristics:</p>');
    content.push('<p>Average video bitrate = 8000Kbps<br />Framerate = 24 or 29.97/30<br />Interlacing = Progressive</p>');

    content.push('</div>');
    content.push('</div>');

    ShowOverlay("What is HD?", content);
}

function ShowWhatIsSD() {
    var content = [];
    content.push('<div style="float:left;width:345x"><span style="font-size:15px;font-weight:bold"></span>');
    content.push('<p>SD stands for standard definition video. Standard definition video meets a certain resolution which is not considered as high as high definition (HD).</p>');
    content.push('<p>The most significant characteristic of SD video is that it is the equivalent of DVD video.</p>');
    content.push('<p>Standard definition is equivalent to a resolution of 720 horizontal and 480 vertical lines stacked from the top to the botton of the screen.</p>');
    content.push('<p>A RoxioNow video offered in SD has the following characteristics:</p>');
    content.push('<p>Average video bitrate = 2000Kbps<br />Framerate = 24 or 29.97/30<br />Interlacing = Progressive</p>');

    content.push('</div>');
    content.push('</div>');

    ShowOverlay("What is SD?", content);
}

function ShowMostDevices() {
    var content = [];
    content.push('<div style="float:left;width:345x"><span style="font-size:15px;font-weight:bold"></span>');
    content.push('<p>CinemaNow HD is available from most devices. However, the following devices only play back SD content. If your device is not in this list you should be able to view HD content</p>');
    content.push('<table border="1"><tr><th width="100px">Manufacturer</th><th width="100px">Device Type</th><th width="145px">Device Model</th></tr></table>');
    content.push('</div>');
    ShowOverlay("HD capable devices", content);
}
function ShowLogin(url) {
    var content = [];
    content.push('<div style="float:left;width:345x"><span style="font-size:15px;font-weight:bold"></span>');
    content.push('<p>Sign in now to determine whether this title is available for HD playback on your device(s)</p>');
    content.push('<form method="post" action="' + url + '"><input id="bSubmit" type="image" style="border-width:0px;" src="theme/std2/img/Login/button-signin.jpg" name="bSubmit"/></form>');

    content.push('</div>');
    ShowOverlay("Please Sign In", content);
}
// shows overlay for each of the device the movie plays on in the title details page
function ShowOverlayPlayOn(OverlayTitle, OverlayContentArray, RenderContentOnly) {
    var renderContentOnlyFlag = (RenderContentOnly == undefined ? false : RenderContentOnly);
    infohtml = [];
    if (renderContentOnlyFlag == false) {
        infohtml.push('<div id="infodiv" unselectable="on">')
        infohtml.push(' <div id="infodivabout" style="float:left;width:725px;margin-left:19px;" unselectable="on">')
        infohtml.push('  <div style="font-size:16px;color:#5c83b0"><strong unselectable="on">' + OverlayTitle + '</strong></div>')
        infohtml.push('  <br style="line-height:5px;"/><br style="line-height:5px;"/>')
        infohtml.push('<div unselectable="on" style="color:#000000">')
    }

    for (var i = 0; i < OverlayContentArray.length; i++) {
        infohtml.push(OverlayContentArray[i]);
    }

    if (renderContentOnlyFlag == false) {
        infohtml.push('</div>')
        infohtml.push('</div>')
        infohtml.push('<br style="clear:both;"/>')
    }

    dg("PlaysOnContent").innerHTML = infohtml.join("")
    setopacity("PlaysOnDiv", 0)

    dg("PlaysOnDiv").style.display = "block" 
    dg("PlaysOnBGDiv").style.display = "block"

    newmidh = (dg("PlaysOnContent").offsetHeight + 40)
    newdeth = (dg("PlaysOnContent").offsetHeight + 80)
    dg("PlaysOnBGMid").style.height = newmidh + "px"
    dg("PlaysOnDiv").style.height = newdeth + "px"

    try {
        var ScrollTop = window.pageYOffset || document.documentElement.scrollTop || 0;
        if (ScrollTop == 0) {
            if (window.pageYOffset) {
                ScrollTop = window.pageYOffset;
            }
            else {
                ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
            }
        }
        if (ScrollTop > 0) {
            ScrollTop += 30;
            dg("PlaysOnDiv").style.top = ScrollTop + "px";
            dg("PlaysOnBGDiv").style.top = ScrollTop + "px";
            dg("PlaysOnDiv").style.height = newdeth + ScrollTop + "px";
        }
    }
    catch (e)
    { }

    fx("PlaysOnDiv", 4, false, 'setTimeout("fixinfosize()",50)', "opacity,0,100");

    // greys the background while showing the popup
    // if browser is ie6
    if (String(navigator.userAgent).toLowerCase().indexOf('msie 6.0') >= 0) {
        ShowOverlayVeil('6');
    }
    else {
        ShowOverlayVeil();
    }
}

// closes the plays on device overlay
function closePlaysOnDiv() {
    fx("PlaysOnDiv", 4, false, "dg('PlaysOnDiv').style.display='none';dg('PlaysOnBGDiv').style.display='none'", "opacity,100,0");
}

