﻿function onSourceDownloadProgressChanged(sender, eventArgs) {
    sender.findName("uxStatus").Text =
        "Загрузка плеера: " + Math.round((eventArgs.progress * 1000)) / 10 + "%";
    sender.findName("uxProgressBar").ScaleY = eventArgs.progress * 360;
}

function li(arg) {
    if (document.images) {
        rslt = new Image();
        rslt.src = 'http://www.amtv.ru/images/pix/' + arg;
        return rslt;
    }
}
function hi(imgDocID, imgObjName) {
    if (document.images) {
        document.images[imgDocID].src = eval(imgObjName + ".src");
    }
    return false;
}

function searchfrmvalid(frm) {
    if (!frm) return false;
    if (frm && frm.q.value.length < 2) { alert('Введите строку поиска'); return false; }
    return true;
}

function submit_search() {
    var frm = document.forms['search'];
    if (searchfrmvalid(frm)) {
        if (frm) return chif(frm.action + '&q=' + frm.q.value);
    }
    return false;
}

function chl(location) {
    var pos = location.indexOf('?');
    if (pos > 0) {
        location += '&';
    } else
        location += '?';
    location += 'lite';

    window.location = location;

    return false;
}

function header_focus()
{
var he;
if (window.parent) 
	he = window.parent.document.getElementById('top');
else
	he = window.document.getElementById('top');
if (he) he.focus();
}

function chif(location) {
    var fr;
    if (window.parent) 
        fr = window.parent.document.getElementById('cntnt');
    else
        fr = window.document.getElementById('cntnt');
    if (fr) {
        var pos = location.indexOf('?');
        if (pos > 0) {
            location += '&';
        } else
            location += '?';
        location += 'lite';

        fr.src = location;

        header_focus();
        
        return false;
    }  else {
        var pos = location.indexOf('&lite');
        if (pos == -1) {
            pos = location.indexOf('?lite');
        }
        if (pos > 0) {
            location = location.substring(0, pos);
        }

	header_focus();

        if (window.parent)
            window.parent.document.location = location;
          
        return false;
    }

    return true;
}

function loadMain() {
    if (self.parent.frames.length == 0 && self.location.href.indexOf('&lite') > 0) self.location.href = self.location.href.replace('&lite', '');
}

