﻿var NEWSTICKER = null; 

function updateIssue(el)
{
    var url = el.options[el.selectedIndex].value;

    window.location.href = url;
}

function playVideo(video)
{
    var html = '';

    // write the object tag to the video window
    html += '<object type="application/x-shockwave-flash" width="320" height="240"';
    html += 'wmode="transparent" data="tml/video/player320x240.swf?file=../upload/video/flv/' + video + '&autoStart=true">';
    html += '<param name="movie" value="tml/video/player320x240.swf?file=../upload/video/flv/' + video + '&autoStart=true" />';
    html += '<param name="wmode" value="transparent" />';
    html += '</object>';

    wH('video-window', html);
}

function additionalInfo(item) {
    var rdm = Math.random();

    gE('ifrAdditionalInfo').src = 'tml/frames/additional-info.aspx?item=' + item + '&rdm=' + rdm;
    eE(gE('additional-info'));
}

function expdMoreInfo(productID) {
    var rdm = Math.random();

    gE('ifrMoreInfo').src = 'tml/frames/more-info.aspx?pid=' + productID + '&rdm=' + rdm;
    eE(gE('more-info'));
}

function expdComments(webformID) {
    var rdm = Math.random();

    gE('ifrComments').src = 'tml/frames/comments.aspx?wid=' + webformID + '&rdm=' + rdm;
    eE(gE('comments'));
}

function getLinks(pubID, pubKey, compID) {
    var el = $('links');

    var req = new Request.HTML({ url: 'tml/ajax/GetLinks.aspx?pubid=' + pubID + '&pubkey=' + pubKey + '&compid=' + compID,
        onSuccess: function(html) {
            el.set('text', '');
            el.adopt(html);

            initMenus();
        }
    });

    req.send();
}

function cM(type, comp, prod, web, ismobile) {
    if (CAPTURE_METRICS) {
        var req = new Request.HTML({ url: 'tml/ajax/CaptureMetrics.ashx?type=' + type + '&comp=' + comp + '&prod=' + prod + '&web=' + web + '&pid=' + pID + '&ismobile=0',
            onSuccess: function(html) {
            }
        });

        req.send();
    }
}

function showEmail(cID)
{
    var rdm = Math.random();

    gE('ifrDCEmail').src = 'tml/frames/direct-contact-email.aspx?cid=' + cID + '&rdm=' + rdm;
    eE(gE('direct-contact-email'));
}

//function getTeasers(pubID, pubKey, type) {
//    var el;

//    switch (type)
//    {
//        case 1:
//            el = $('column2');
//            break;
//    }

//    var req = new Request.HTML({ url: 'tml/ajax/GetTeasers.aspx?pubid=' + pubID + '&pubkey=' + pubKey + '&type=' + type,
//        onSuccess: function(html) {
//            el.set('text', '');
//            el.adopt(html);

//            initMenus();
//        }
//    });

//    req.send();
//}