function PlayFLV(div_id, flv_path, img_path, width, height, auto) {
    var so = new SWFObject('/Data/flash/mediaplayer.swf', 'MediaPlayer', width, height, '8');
    so.addParam('allowscriptaccess', 'always');
    so.addParam('allowfullscreen', 'true');
    so.addParam('wmode', 'transparent');
    so.addVariable('width', width);
    so.addVariable('height', height);
    so.addVariable('file', flv_path);

    so.addVariable('autostart', auto);

    if (img_path != '') {
        so.addVariable('image', img_path);
    }
    so.write(div_id);
}

function getNodeValue(o) {
    try {
        return o.item(0).firstChild.nodeValue;
    }
    catch (err) {
        return '';
    }
}

function PopupCenter(pageURL, title,w,h) {
    var left = (screen.width/2)-(w/2);
    var top = (screen.height/2)-(h/2);
    var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}

function numberFormat(number, label_id) {
    number += '';
    x = number.split('.');
    x1 = x[0];
    x2 = x.length > 1 ? '.' + x[1] : '';
    var rgx = /(\d+)(\d{3})/;
    while (rgx.test(x1))
        x1 = x1.replace(rgx, '$1' + ',' + '$2');

    var cost = document.getElementById(label_id);
    cost.innerHTML = x1 + x2;
}
