var openingWindow; //holds the opener of popup window

/*	start mobile FlashDemo */
function gotoAndPlay() {
    var o = document.getElementById("mobileDemo")
    if (o != null && o != "undefined") {
        o.TGotoLabel("_level0/_root", "startdemo");
        o.TPlay("_level0/_root");
    }
}

/* check wether on PreWin or not */
function IsPreWin() {
    try {
        if (top.frames[0] != null && top.frames[0].name == "PRD_BAW_header")
            return true
    }
    catch (err) {
    }
    return false;
}

// monnt fake function!!
function checkForm() {
    return true;
}

// this function opens a popup !!!
function redirect(url) {
    window.open(url, 'popup', 'hotkeys=no, resizable=no, toolbar=no, status=yes, dependent=no, scrollbars=0, width=550, height=370');
}

function open_popup(url, params) {
    window.open(url, 'popup', params);
}

function open_parent(url) {
    window.opener.location = url;
    window.close();
}

function open_mobiledemo() {
    window.open('epage.aspx?view=showmovie', 'demo', 'hotkeys=no, resizable=no, toolbar=no, status=no, dependent=yes, scrollbars=0, width=980, height=527');
}

function openVeriSign() {
    window.open('https://seal.verisign.com/splash?form_file=fdf/splash.fdf&type=GOLD&sealid=2&dn=' + location.host, '', 'scrollbars=1,width=700,height=550');
}

function DoBehenLiveV2 (a, obj)
{
    document.getElementById("A"+obj).style.height = a + "px";
}

function NdeshjeKryesoreV2 (a)
{
    document.getElementById("pollcenter").style.height = a + "px";
}


function PollHeightV2 (a)
{
    document.getElementById("flashid").style.height = a + "px";
}

function DoBehenLiveNdryshoNdeshje (a)
{
    parent.location="LiveNow.aspx?EventID="+a
}

function LiveHeightV2 (a)
{
    //alert(a)
    //document.getElementById("dobehenlivetrue2").style.height = a + "px";
    document.getElementById("dobehenlivetrue").style.height = a + "px";
    //document.getElementById("juli_width").style.height = a + "px";

}

function LiveAllHeightV2(a)
{
    //alert(a)
    //alert(document.getElementById("dobehenlivetrue33").style.height)
    document.getElementById("dobehenlivetrue33").style.height = a + "px";
    //document.getElementById("LiveAnash").style.height =  a  + "px";
    //alert(document.getElementById("LiveAnash").style.height)

}

function WebTop10Java(a) {
    //alert(a)
    document.getElementById("WebTop10").style.height = a + "px";
}

function NdryshoNdeshje(NdeshjeID)
{
    location="LiveNow.aspx?EventID="+NdeshjeID
}

function submitBetFinder(BetFinderSearchString) {
    var isEmpty = true;
    regex = /^\s*$/;
    isEmpty = regex.test(BetFinderSearchString);
    if (!isEmpty && BetFinderSearchString.length > 1) {
        frm = document.getElementById('_betfinder');
        frm.betfinder.value = BetFinderSearchString;
        frm.submit();
    }
}

function GetUserSettings() {
    //detect persistant cookies
    document.cookie = "cookieName=cookiealue";
    var cookiesenable = document.cookie.indexOf("cookieName");
    var cookies = cookiesenable != -1;

    var useragent = navigator.userAgent;
    var bName = (useragent.indexOf('Opera') > -1) ? 'Opera' : navigator.appName;
    var bVer = "-1";
    var pos = useragent.indexOf('MSIE');
    if (pos > -1) {
        bVer = useragent.substring(pos + 5);
        pos = bVer.indexOf(';');
        bVer = bVer.substring(0, pos);
    }
    pos = useragent.indexOf('Opera');
    if (pos > -1) {
        bVer = useragent.substring(pos + 6);
        pos = bVer.indexOf(' ');
        bVer = bVer.substring(0, pos);
    }
    if (bName == "Netscape") {
        bVer = useragent.substring(8);
        pos = bVer.indexOf(' ');
        bVer = bVer.substring(0, pos);
    }
    if (bName == "Netscape" && parseInt(navigator.appVersion) >= 5) {
        pos = useragent.lastIndexOf('/');
        bVer = useragent.substring(pos + 1);
    }

    if (useragent.indexOf('Firefox') > -1)
        bName = 'Firefox';

    var browser = bName;
    var ver = bVer;

    var data = "<UserAgent><![CDATA[" + navigator.userAgent + "]]></UserAgent>";
    data += "<Browser><![CDATA[" + browser + "]]></Browser>";
    data += "<Browserversion><![CDATA[" + ver + "]]></Browserversion>";
    data += "<ScreenWidth><![CDATA[" + window.screen.width + "]]></ScreenWidth>";
    data += "<ScreenHeigth><![CDATA[" + window.screen.height + "]]></ScreenHeigth>";
    data += "<ColorDepth><![CDATA[" + window.screen.colorDepth + "]]></ColorDepth>";
    data += "<Cookies><![CDATA[" + cookies + "]]></Cookies>";

    return data;
}

function ShowHelp(strPage) {
    var target = location.host.toLowerCase();
    if (target.indexOf("dev.") == 0 && (target.indexOf("poker") > 0 || target.indexOf("casino") > 0 || target.indexOf("games") > 0))
        target = target.substr(4);
    if (target.indexOf("test.") == 0 && (target.indexOf("poker") > 0 || target.indexOf("casino") > 0 || target.indexOf("games") > 0))
        target = target.substr(5);
    if (target.indexOf("beta.") == 0 && (target.indexOf("poker") > 0 || target.indexOf("casino") > 0 || target.indexOf("games") > 0))
        target = target.substr(5);
    var doti = target.indexOf('.');
    target = "help" + target.substr(doti);

    target = location.protocol + "//" + target + "/" + strPage;
    if (typeof LanguageTLC != "undefined" && LanguageTLC != "" && target.indexOf("sc_lang") == -1)
        target += (target.indexOf("?") == -1 ? '?' : '&') + 'sc_lang=' + LanguageTLC;

    window.open(target, 'help', 'hotkeys=no, resizable=yes, toolbar=yes, status=yes, dependent=yes, scrollbars=1, width=720, height=550');
}

function open_help(strPage) {
    window.open('help.aspx?mode=content&page=' + strPage, 'help', 'hotkeys=no, resizable=yes, toolbar=yes, status=yes, dependent=yes, scrollbars=1, width=720, height=550');
}

function open_livescore(strPage) {
    window.open(strPage, 'livescore', 'hotkeys=no, resizable=no, toolbar=yes, status=yes, dependent=yes, scrollbars=1, width=1024, height=768');
}

function open_epage(aID) {
    window.open('epage.aspx?aid=' + aID, 'help', 'hotkeys=no, resizable=yes, toolbar=yes, status=yes, dependent=yes, scrollbars=1, width=720, height=550');
}


function open_statistics(strPage) {
    window.open(strPage, 'help', 'hotkeys=no, resizable=yes, toolbar=yes, status=yes, dependent=yes, scrollbars=1, width=720, height=550');
}

function open_glossary(strPage, oWin) {
    if (oWin) this.openingWindow = oWin;
    window.open('help.aspx?mode=glossary&page=' + strPage, 'help', 'hotkeys=no, resizable=yes, toolbar=yes, status=yes, dependent=yes, scrollbars=1, width=720, height=550');
}

function open_glossaryinternal(strPage) {
    window.open('help.aspx?mode=glossaryinternal&page=' + strPage, 'help', 'hotkeys=no, resizable=yes, toolbar=yes, status=yes, dependent=yes, scrollbars=1, width=720, height=550');
}

function open_stats(betradarMatchID, LanguageID, url) {
    if (url != '') {
        var strLanguageString = 'en';
        if (LanguageID == 2) { strLanguageString = 'de' };
        window.open('http://www.stats.betradar.com/' + url + '/?matchid=' + betradarMatchID + '&language=' + strLanguageString, 'statistics', 'toolbar=yes, resizable=yes, scrollbars=1, width=720, height=550');
    }
}

function open_listofodds() {
    window.open('ListOfOdds.aspx?view=print', 'listofodds', 'hotkeys=no, resizable=yes, toolbar=yes, status=yes, dependent=yes, scrollbars=1, width=720, height=550');
}

// this func is used for simulates the focus to the login-button if the user clicks on one input field
// used in login control
function setBtnBorder(strElementName, strClassName) {

    if (navigator.appVersion.indexOf("MSIE") != -1 && document.getElementById) {
        var obj = findObj(strElementName)
        if (obj != null) {
            obj.className = strClassName
        }
    }
}

function findObj(n, d) { //v4.0
    var p, i, x;
    if (!d) d = document;
    if ((p = n.indexOf('?')) > 0 && parent.frames.length) {
        d = parent.frames[n.substring(p + 1)].document;
        n = n.substring(0, p);
    }
    if (!(x = d[n]) && d.all)
        x = d.all[n];
    for (i = 0; !x && i < d.forms.length; i++)
        x = d.forms[i][n];
    for (i = 0; !x && d.layers && i < d.layers.length; i++)
        x = findObj(n, d.layers[i].document);
    if (!x && document.getElementById)
        x = document.getElementById(n);
    return x;
}

function swapImgRestore() { //v3.0
    var i, x, a = document.sr;
    for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++)
        x.src = x.oSrc;
}

function preloadImages() { //v3.0
    var d = document;
    if (d.images) {
        if (!d.p)
            d.p = new Array();
        var i, j = d.p.length, a = preloadImages.arguments;
        for (i = 0; i < a.length; i++)
            if (a[i].indexOf('#') != 0) {
            d.p[j] = new Image;
            d.p[j++].src = a[i];
        }
    }
}

function swapImage() { //v3.0
    var i, j = 0, x, a = swapImage.arguments;
    document.sr = new Array;
    for (i = 0; i < (a.length - 2); i += 3)
        if ((x = findObj(a[i])) != null) {
        document.sr[j++] = x;
        if (!x.oSrc)
            x.oSrc = x.src;
        x.src = a[i + 2];
    }
}

function changetextParent(fieldname, whichcontent) {
    var e = document.getElementById(fieldname);
    if (e == null) e = parent.document.getElementById(fieldname);

    if (e != null) e.innerHTML = whichcontent;
}

/*clock*/
var my12_hour = 0;
var dn = ""; var old = "";
function show_clock() {
    //show clock in NS 4
    if (document.layers)
        document.ClockPosNS.visibility = "show"
    if (old == "die") { return; }

    seconds++;

    if (seconds >= 60) {
        seconds = "0";
        minutes++;
        if (minutes <= 9) { minutes = "0" + minutes; }
    }
    if (minutes >= 60) {
        minutes = "0";
        hours++;
        if (hours <= 9) { hours = "0" + hours; }
    }
    if (hours >= 24) {
        hours = "00";
    }

    if (my12_hour) {
        dn = "AM";
        if (hours > 12) { dn = "PM"; hours = hours - 12; }
        if (hours == 0) { hours = 12; }
    } else {
        dn = "";
    }

    if (seconds <= 9) { seconds = "0" + seconds; }
    if (minutes == "0") { minutes = "00"; }

    myclock = '';
    myclock += hours + ':' + minutes + ':' + seconds + ' ' + dn + ' ' + gmtDisplay;

    if (old == "true") {
        document.write(myclock);
        old = "die"; return;
    }

    if (document.layers) {
        clockpos = document.ClockPosNS;
        liveclock = clockpos.document.LiveClockNS;
        liveclock.document.write(myclock);
        liveclock.document.close();
    } else if (document.getElementById) {
        if (document.getElementById("LiveClockIE") != null)
            document.getElementById("LiveClockIE").innerHTML = myclock;
    } else if (document.all) {
        LiveClockIE.innerHTML = myclock;
    }
    setTimeout("show_clock()", 1000);
}

// helper funktion returns MultiDimensionalArray
function MultiDimensionalArray(iRows, iCols) {
    var i;
    var j;
    var a = new Array(iRows);
    for (i = 0; i < iRows; i++) {
        a[i] = new Array(iCols);
        for (j = 0; j < iCols; j++)
            a[i][j] = "";
    }
    return (a);
}

/* 
returns difference of leftPos of to objects 
used to get width
*/
function GetPosXDiff(leftElemID, rightElemID) {
    var e1, e2;
    var retVal = null;
    e1 = document.getElementById(leftElemID);
    e2 = document.getElementById(rightElemID);
    if (e1 != null && e2 != null) {
        retVal = DL_GetElementLeft(e2) - DL_GetElementLeft(e1);
    }
    return retVal;
}

/* 
returns difference of topPos of to objects 
used to get height
*/
function GetPosYDiff(topElemID, bottomElemID) {
    var e1, e2;
    var retVal = null;
    e1 = document.getElementById(topElemID);
    e2 = document.getElementById(bottomElemID);
    if (e1 != null && e2 != null) {
        retVal = DL_GetElementTop(e2) - DL_GetElementTop(e1);
    }
    return retVal;
}

/* returns true leftPos */
function DL_GetElementLeft(eElement) {
    if (!eElement && this) eElement = this;

    var DL_bIE = document.all ? true : false;
    var nLeftPos = eElement.offsetLeft;
    var eParElement = eElement.offsetParent;

    while (eParElement != null) {
        if (DL_bIE) {
            if ((eParElement.tagName != "TABLE") && (eParElement.tagName != "BODY")) {
                nLeftPos += eParElement.clientLeft;
            }
        }
        else {
            if (eParElement.tagName == "TABLE") {
                var nParBorder = parseInt(eParElement.border);
                if (isNaN(nParBorder)) {
                    var nParFrame = eParElement.getAttribute('frame');
                    if (nParFrame != null) {
                        nLeftPos += 1;
                    }
                }
                else if (nParBorder > 0) {
                    nLeftPos += nParBorder;
                }
            }
        }
        nLeftPos += eParElement.offsetLeft;
        eParElement = eParElement.offsetParent;
    }
    return nLeftPos;
}

/* returns true topPos */
function DL_GetElementTop(eElement) {
    if (!eElement && this) eElement = this;

    var DL_bIE = document.all ? true : false;
    var nTopPos = eElement.offsetTop;
    var eParElement = eElement.offsetParent;

    while (eParElement != null) {
        if (DL_bIE) {
            if ((eParElement.tagName != "TABLE") && (eParElement.tagName != "BODY")) {
                nTopPos += eParElement.clientTop;
            }
        }
        else {
            if (eParElement.tagName == "TABLE") {
                var nParBorder = parseInt(eParElement.border);
                if (isNaN(nParBorder)) {
                    var nParFrame = eParElement.getAttribute('frame');
                    if (nParFrame != null) {
                        nTopPos += 1;
                    }
                }
                else if (nParBorder > 0) {
                    nTopPos += nParBorder;
                }
            }
        }

        nTopPos += eParElement.offsetTop;
        eParElement = eParElement.offsetParent;
    }
    return nTopPos;
}

/* COOKIE Helper Functions */
function GetCookie(name) {
    var sCookieData = null;
    var aCookie = document.cookie.split("; ");

    for (var i = 0; i < aCookie.length; i++) {
        var aCrumb = aCookie[i].split("=");
        if (aCrumb[0].replace(/^\s*/, '').replace(/\s*$/, '') == name) {
            sCookieData = unescape(aCrumb[1]);
        }
    }
    return sCookieData;
}

function DeleteCookie(name, path, domain) {
    if (GetCookie(name)) {
        document.cookie = name + "=" + ((path) ? ";path=" + path : "") + ((domain) ? ";domain=" + domain : "") + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
    }
}

function SetCookie(name, value, expires, path, domain, secure) {
    document.cookie = name + '=' + escape(value) + ((expires) ? ';expires=' + expires.toGMTString() : '') + ((path) ? ';path=' + path : '') + ((domain) ? ';domain=' + domain : '') + ((secure) ? ';secure' : '');
}

function Flash(movie, id, width, height, ver, bg, fv) {
    this.movie = movie;
    this.id = id;
    this.width = width;
    this.height = height;
    this.ver = ver ? ver : "8,0,0,0";

    this.align = "middle";

    this.attributes = new Array();
    this.params = new Object();

    if (bg)
        this.setParam("bgcolor", bg);
    if (fv)
        this.setParam("FlashVars", fv);

    this.setParam("menu", "false");

    this.setParam("allowScriptAccess", "sameDomain");
    this.setParam("quality", "high");
    this.setParam("wmode", "transparent");
}

function FlashWithMenu(movie, id, width, height, ver, bg, fv) {
    this.movie = movie;
    this.id = id;
    this.width = width;
    this.height = height;
    this.ver = ver ? ver : "8,0,0,0";

    this.align = "middle";

    this.attributes = new Array();
    this.params = new Object();

    if (bg)
        this.setParam("bgcolor", bg);
    if (fv)
        this.setParam("FlashVars", fv);


    this.setParam("allowScriptAccess", "sameDomain");
    this.setParam("quality", "high");

}


Flash.prototype.addAttribute = function(n, v) {
    if (v)
        this.attributes[this.attributes.length] = n + '="' + v + '"';
    else
        this.attributes[this.attributes.length] = n;
}

FlashWithMenu.prototype.addAttribute = function(n, v) {
    if (v)
        this.attributes[this.attributes.length] = n + '="' + v + '"';
    else
        this.attributes[this.attributes.length] = n;
}

Flash.prototype.setParam = function(n, v) {
    this.params[n] = v;
}

FlashWithMenu.prototype.setParam = function(n, v) {
    this.params[n] = v;
}

Flash.prototype.toString = function() {
    if (this.ver.length < 2)
        this.ver += ",0,0,0";

    var s = '<object id="' + this.id + '" width="' + this.width + '" height="' + this.height + '" align="' + this.align + '" ';
    s += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + this.ver + '" ';
    for (var i = 0; i < this.attributes.length; i++)
        s += this.attributes[i] + " ";
    s += '>';

    s += '<param name="movie" value="' + this.movie + '" />';
    var k;
    for (k in this.params)
        s += '<param name="' + k + '" value="' + this.params[k] + '" />';

    s += '<embed menu="false" src="' + this.movie + '" ';
    s += 'width="' + this.width + '" height="' + this.height + '" name="' + this.id + '" align="' + this.align + '" ';
    for (k in this.params)
        s += k + '="' + this.params[k] + '" ';

    s += 'swLiveConnect="true" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />';

    s += '</object>';
    return s;
}

FlashWithMenu.prototype.toString = function() {
    if (this.ver.length < 2)
        this.ver += ",0,0,0";

    var s = '<object id="' + this.id + '" width="' + this.width + '" height="' + this.height + '" align="' + this.align + '" ';
    s += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + this.ver + '" ';
    for (var i = 0; i < this.attributes.length; i++)
        s += this.attributes[i] + " ";
    s += '>';

    s += '<param name="movie" value="' + this.movie + '" />';
    for (var k in this.params)
        s += '<param name="' + k + '" value="' + this.params[k] + '" />';

    s += '<embed src="' + this.movie + '" ';
    s += 'width="' + this.width + '" height="' + this.height + '" name="' + this.id + '" align="' + this.align + '" ';
    for (var k in this.params)
        s += k + '="' + this.params[k] + '" ';

    s += 'swLiveConnect="true" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />';

    s += '</object>';
    return s;
}

Flash.prototype.render = function() {
    document.write(this.toString());

    // fix for flashplayer 9.0.16 bug with ExternalInterface
    if (!Flash.unloadSet) {
        if (window.attachEvent)	// only in IE
            window.attachEvent("onbeforeunload", function() { __flash_unloadHandler = function() { }; __flash_savedUnloadHandler = function() { }; });
        Flash.unloadSet = true;
    }

    // fix for flashplayer 9.0.16 bug with ExternalInterface
    if (!Flash.unloadSet) {
        if (window.attachEvent)	// only in IE
            window.attachEvent("onbeforeunload", function() { __flash_unloadHandler = function() { }; __flash_savedUnloadHandler = function() { }; });
        Flash.unloadSet = true;
    }
}

Flash.prototype.renderToString = function() {
    // fix for flashplayer 9.0.16 bug with ExternalInterface
    if (!Flash.unloadSet) {
        if (window.attachEvent)	// only in IE
            window.attachEvent("onbeforeunload", function() { __flash_unloadHandler = function() { }; __flash_savedUnloadHandler = function() { }; });
        Flash.unloadSet = true;
    }

    // fix for flashplayer 9.0.16 bug with ExternalInterface
    if (!Flash.unloadSet) {
        if (window.attachEvent)	// only in IE
            window.attachEvent("onbeforeunload", function() { __flash_unloadHandler = function() { }; __flash_savedUnloadHandler = function() { }; });
        Flash.unloadSet = true;
    }

    return this.toString();
}

FlashWithMenu.prototype.render = function() {
    document.write(this.toString());

    // fix for flashplayer 9.0.16 bug with ExternalInterface
    if (!Flash.unloadSet) {
        if (window.attachEvent)	// only in IE
            window.attachEvent("onbeforeunload", function() { __flash_unloadHandler = function() { }; __flash_savedUnloadHandler = function() { }; });
        Flash.unloadSet = true;
    }

    // fix for flashplayer 9.0.16 bug with ExternalInterface
    if (!Flash.unloadSet) {
        if (window.attachEvent)	// only in IE
            window.attachEvent("onbeforeunload", function() { __flash_unloadHandler = function() { }; __flash_savedUnloadHandler = function() { }; });
        Flash.unloadSet = true;
    }
}

FlashWithMenu.prototype.renderToString = function() {
    // fix for flashplayer 9.0.16 bug with ExternalInterface
    if (!Flash.unloadSet) {
        if (window.attachEvent)	// only in IE
            window.attachEvent("onbeforeunload", function() { __flash_unloadHandler = function() { }; __flash_savedUnloadHandler = function() { }; });
        Flash.unloadSet = true;
    }

    // fix for flashplayer 9.0.16 bug with ExternalInterface
    if (!Flash.unloadSet) {
        if (window.attachEvent)	// only in IE
            window.attachEvent("onbeforeunload", function() { __flash_unloadHandler = function() { }; __flash_savedUnloadHandler = function() { }; });
        Flash.unloadSet = true;
    }

    return this.toString();
}


function Toggle(id, display) {
    if (typeof display == "undefined")
        display = "block";

    var o = document.getElementById(id);
    if (o) {
        if (o.style.display == "none") {
            o.style.display = display;
        }
        else {
            o.style.display = "none";
        }
    }
}

function SwitchImageAndDiv(idDiv, idImage, image1, image2) {
    // Togle div tag
    Toggle(idDiv);

    // Swap image src
    var oImage = document.getElementById(idImage);
    if (oImage) {
        var oImage_fileName = extractFileName(new String(oImage.src));

        if (oImage_fileName == extractFileName(new String(image1))) {
            oImage.src = image2;
        }
        else {
            oImage.src = image1;
        }
    }
}

function EnableElement(idElem, enable) {
    var oElement = document.getElementById(idElem);
    if (oElement) {
        if (enable) {
            oElement.style.visibility = "visible";
            oElement.style.lineHeight = "normal";
            oElement.style.display = "block";
        }
        else {
            oElement.style.visibility = "hidden";
            oElement.style.display = "none";
        }
    }
}

function extractFileName(url) {
    if (url.lastIndexOf("/") != 0) {
        return url.substring(url.lastIndexOf("/") + 1);
    }
    else
        return url;
}
function addLoadEvent(func) {
    if (typeof window.onload != 'function') {
        window.onload = func;
    }
    else {
        var oldonload = window.onload;
        window.onload = function() {
            oldonload();
            func();
        }
    }
}

//Inserts an additional omniture tag to the page, if pagename/channel/server are left null,
//the already set values are used
function InsertOmnitureTag(pagename, channel, defaultPageName) {
    if (typeof cat != "undefined") {
        if (channel != null)
            cat.v1 = channel;

        if (pagename != null)
            cat.v2 = pagename;

        if (defaultPageName != null)
            cat.v22 = defaultPageName;

        cat.SetVars();
        var s_code = s_ocatalyst.t();
        if (s_code)
            document.write(s_code);
    }
}

function onBalanceChange(fieldname, whichcontent) {
    if (typeof whichcontent == "undefined")	// fieldname is not used anymore, so in the future this should work with only one parameter
        whichcontent = fieldname; 		// make it work with both one and two parameters.

    CurrencyBalanceSubject.SetState(whichcontent);
}

// returns the flash version.
// major version before comma
// minor version as first digit after comma
// revision as the next three digits.
// i.e. "9.0 r28"	--> 9.0028
// i.e. "9.0 r103" --> 9.0103
function FlashVersion() {
    if (navigator.plugins && navigator.plugins.length)		// Navigator-based browsers
    {
        for (var i = 0; i < navigator.plugins.length; i++) {
            if (navigator.plugins[i].name.indexOf('Shockwave Flash') != -1) {
                var d, darr, revarr, version;
                d = navigator.plugins[i].description; 	// d = "Shockwave Flash 9.0 r103"
                darr = d.split(" ");

                version = darr[2];
                if (darr[3] != "") {
                    revarr = darr[3].split("r");
                } else {
                    revarr = darr[4].split("r");
                }
                version += revarr[1] > 0 ? ("000" + revarr[1]).substr(revarr[1].length) : "000";
                return parseFloat(version);
            }
        }
    }
    else if (window.ActiveXObject)		// IE
    {
        for (var i = 15; i >= 2; i--) {
            try {
                var f = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
                if (f) {
                    var v = f.GetVariable("$version"); 	// v = "WIN 9,0,47,0"
                    v = v.substr(4);
                    var varr = v.split(",");
                    var version = varr[0] + '.' + (varr[1].length == 1 ? varr[1] : '9');
                    version += ("000" + varr[2]).substr(varr[2].length);
                    return parseFloat(version);
                }
            }
            catch (e)
			{ }
        }
    }
    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1)
        return 4; // WebTV 2.6 supports Flash 4
    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1)
        return 3; // WebTV 2.5 supports Flash 3
    else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1)
        return 2; // older WebTV supports Flash 2

    return -1.0; // can't detect
}

// PIB

// BUTTON STYLE BETBROWSER
function highlight(obj, isHover) {
    var cssClass = obj.className;
    if (cssClass == "" || cssClass == "MouseOver") {	// RotatingTeaser
        obj.className = isHover ? "MouseOver" : "";
        return;
    }

    var color = "#000000";
    var oddColor = "#000000";

    if (typeof (BetListHighlightColorOverride) != "undefined") {
        color = BetListHighlightColorOverride
    }

    if (isHover) {
        obj.style.backgroundColor = "#FFCC00";
        obj.style.borderColor = "#ffe066 #907608 #907608 #ffe066";
    }
    else {
        color = "";
        oddColor = "";
        obj.style.backgroundColor = "";
        obj.style.borderColor = "";
    }

    if ((typeof (BetListBackgroundColorOverrid) != "undefined") &&
        (typeof (BetListHighlightBackgroundColorOverrid) != "undefined")) {
        if (isHover) {
            obj.style.backgroundImage = BetListHighlightBackgroundColorOverrid;
        }
        else {
            obj.style.backgroundImage = BetListBackgroundColorOverrid;
        }
    }

    obj.style.color = color; 				// set color of this element
    var tds = obj.getElementsByTagName("TD"); // and all child TDs
    for (var i = 0; i < tds.length; i++) {
        if (tds[i].className == "odd") {
            tds[i].style.color = oddColor;
        } else {
            tds[i].style.color = color;
        }
    }
}


// CREATE DROPSHADOW AND STRETCHED BACKGROUND AND TRANSPARENCY
document.getElementsByClassName = function(clsName) {
    var retVal = new Array();
    var elements = document.getElementsByTagName("*");
    for (var i = 0; i < elements.length; i++) {
        if (elements[i].className.indexOf(" ") >= 0) {
            var classes = elements[i].className.split(" ");
            for (var j = 0; j < classes.length; j++) {
                if (classes[j] == clsName)
                    retVal.push(elements[i]);
            }
        }
        else if (elements[i].className == clsName)
            retVal.push(elements[i]);
    }
    return retVal;
}

function ShadowBoxFactory(className) {
    this.targetClassName = className;
    this.boxes = new Array();
    this.backgroundimage = null;
    this.tag = 0x000001;
    this.getBoxes = function() {
        var elements = document.getElementsByClassName(this.targetClassName);
        for (var n = 0; n < elements.length; n++)
            this.boxes.push(elements[n]);
    }

    this.render = function(content) {
        var x = new Array();
        x['dsBodyLeft'] = this.cr('div', 'dsBodyLeft');
        x['dsTop'] = this.cr('div', 'dsTop');
        x['dsTopLeft'] = this.cr('div', 'dsTopLeft');
        x['dsBodyRight'] = this.cr('div', 'dsBodyRight');
        x['dsBody'] = this.cr('div', 'dsBody');
        x['dsBodyBg'] = this.cr('div', 'dsBodyBg');
        if (this.backgroundimage != null)
            x['bgimg'] = this.cr('img', this.backgroundimage.className);
        x['dsBodyContent'] = this.cr('div', 'dsBodyContent');

        x['dsBottom'] = this.cr('div', 'dsBottom');
        x['dsBottomLeft'] = this.cr('div', 'dsBottomLeft');
        if (this.backgroundimage != null)
            x['bgimg'].src = this.backgroundimage.src;
        x['dsBodyLeft'].appendChild(x['dsTop']);
        x['dsTop'].appendChild(x['dsTopLeft']);
        x['dsBodyLeft'].appendChild(x['dsBodyRight']);

        x['dsBodyRight'].appendChild(x['dsBody']);
        x['dsBodyRight'].appendChild(x['dsBottom']);
        x['dsBody'].appendChild(x['dsBodyBg']);
        x['dsBottom'].appendChild(x['dsBottomLeft']);
        if (this.backgroundimage != null) {
            x['dsBodyBg'].appendChild(x['bgimg']);
            x['dsBodyBg'].appendChild(x['dsBodyContent']).innerHTML = content;
        }
        else
            x['dsBodyBg'].innerHTML = content;
        this.backgroundimage = null;
        return x['dsBodyLeft'];
    }
    this.getBoxes();

    this.cr = function(name, classname, innerHTML) {
        var e = document.createElement(name);
        if (classname)
            e.className = classname;
        if (innerHTML)
            e.innerHTML = innerHTML;
        return e;
    }

    this.tagthis = function(obj) {
        obj.tag = this.tag;
    }
    this.tagged = function(obj) {
        return obj.tag == this.tag;
    }
}

ShadowBoxFactory.prototype.CreateShadow = function(targetid, backgroundimage) {
    if (backgroundimage)
        this.backgroundimage = backgroundimage;
    if (!targetid) {
        for (n = 0; n < this.boxes.length; n++) {
            if (!this.tagged(this.boxes[n])) {
                var ofcourse = this.render(this.boxes[n].innerHTML);
                this.boxes[n].innerHTML = '';
                this.boxes[n].appendChild(ofcourse);
                if (this.boxes[n].parentNode.offsetWidth && this.boxes[n].parentNode.offsetWidth != 'undefined')
                    this.boxes[n].style.width = (this.boxes[n].parentNode.offsetWidth + 'px');
                this.tagthis(this.boxes[n]);
            }
        }
    }
    else {
        var target = document.getElementById(targetid);
        if (!target || this.tagged(target))
            return;
        var ofcourse = this.render(target.innerHTML);
        target.innerHTML = '';
        target.appendChild(ofcourse);
        if (target.parentNode.offsetWidth && target.parentNode.offsetWidth != 'undefined')
            target.style.width = (target.parentNode.offsetWidth + 'px');
        this.tagthis(target);
    }
}
ShadowBoxFactory.prototype.CreateBgImage = function(src, classname) {
    var img = new Image();
    img.src = src;
    img.className = classname;
    return img;
}


// Utilities for the bet view:
var betSlipLoaded = true;
var i = 0;
// this file is used from the betview to add a bet to our slip
function AddBetSlipInfo(resultOdd, gameID, resultID, isvisible, eventID, cameFromLiveBet) {
    if (typeof eventID == "undefined") {
        eventID = 0;
    }
    if (typeof cameFromLiveBet == "undefined") {
        cameFromLiveBet = "0";
    }

    //don't add if bet is invisible (param isvisible == 'False')
    //for Labels BDE & BAW only
    if (isvisible != null && typeof isvisible == 'string') {
        if (isvisible == 'False') {
            return;
        }
    }

    if (this.betSlipLoaded) {

        //frames["BetSlipIframe1"].location.href="betslip.aspx?mode=add&GameID=" + gameID + "&resultID=" + resultID + "&ResultOdd=" + resultOdd;

        var frm = frames["BetSlipIframe1"];
        frm.document.getElementById(frm.mode_CID).value = 'add';
        frm.document.getElementById(frm.resultOdd_CID).value = resultOdd;
        frm.document.getElementById(frm.gameID_CID).value = gameID;
        frm.document.getElementById(frm.resultID_CID).value = resultID;
        frm.document.getElementById(frm.cameFromLiveBet_CID).value = cameFromLiveBet;
        frm.document.getElementById(frm.eventID_CID).value = eventID;
        frm.document.getElementById(frm.hiddenButton_CID).click();

    }
    else {
        frames["BetSlipIframe1"].location.replace("betslip.aspx");
    }
    this.betSlipLoaded = false;
}

function switchMultipleStates(leagueIDs) {
    var x = leagueIDs.split(',');
    for (var i = 0; i < x.length; i++) {
        switchState(x[i]);
    }
}

function changeValue() {
    alert(document.getElementbyID("searchField").value);
}



function ChangeButtonColor() {
    document.getElementById("Go").className = "btnSelected";
}

// called by betview			
function resizeIFrame(iframeWindow) {
    if (iframeWindow.document.height) // ns6
    {
        var iframeElement = document.getElementById(iframeWindow.name);
        if (iframeElement.style != null)
            iframeElement.style.height = iframeWindow.document.height + 'px';
    }
    else if (document.all) //ie
    {
        var iframeElement = document.all[iframeWindow.name];


        if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat') //Back ckompliant
        {
            if (iframeElement)
                if (iframeElement.style)
                    if (iframeElement.style != null) {
                        iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight + 'px';
                        if (parent.document.getElementById("BetSlipBorders") && iframeElement.name == "BetSlipIframe1") {
                            parent.document.getElementById("BetSlipBorders").style.height = iframeWindow.document.documentElement.scrollHeight + 30+'px';
                        }
                        if (parent.document.getElementById("TopTenBorders") && iframeElement.name == "Ndeshje10Iframe1") {
                            parent.document.getElementById("TopTenBorders").style.height = iframeWindow.document.documentElement.scrollHeight + 'px';
                        }
                        if (parent.document.getElementById("SondazhDiteIframeBorders") && iframeElement.name == "SondazhDiteIframe1") {
                            parent.document.getElementById("SondazhDiteIframeBorders").style.height = iframeWindow.document.documentElement.scrollHeight + 30 + 'px';
                        }
                        if (iframeWindow.name == 'DjathtasLive') {
                            var Livet = parent.document.getElementById("LiveAnash")
                            if (Livet) {
                                Livet.style.height = iframeWindow.document.documentElement.scrollHeight + 'px';
                            }
                        }
                    }
        }
        else //CSS1compliant
        {
            if (String(iframeElement) != "undefined") {
                if (iframeElement.style != null)
                    iframeElement.style.height = iframeWindow.document.body.scrollHeight + 'px';
            }
        }
    }
}

// called by betslip
function resizeIFrameBS(iframeWindow) {
    resizeIFrame(iframeWindow);
    this.betSlipLoaded = true;
}

function resizeIFrame2(iframeWindow) {
    if (iframeWindow.document.height) // ns6
    {
        var iframeElement = document.getElementById(iframeWindow.name);
        if (iframeElement.style != null)
            iframeElement.style.height = iframeWindow.document.height + 'px';
    }
    else if (document.all) //ie
    {
        var iframeElement = document.all[iframeWindow.name];


        if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat') //Back ckompliant
        {
            if (iframeElement.style != null) {
                iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight + 'px';
                if (parent.document.getElementById("BetSlipBorders") && iframeElement.name == "BetSlipIframe1") {
                    parent.document.getElementById("BetSlipBorders").style.height = iframeWindow.document.documentElement.scrollHeight + 'px';
                }
                if (parent.document.getElementById("TopTenBorders") && iframeElement.name == "Ndeshje10Iframe1") {
                    parent.document.getElementById("TopTenBorders").style.height = iframeWindow.document.documentElement.scrollHeight + 'px';
                }
                if (parent.document.getElementById("SondazhDiteIframeBorders") && iframeElement.name == "SondazhDiteIframe1") {
                    parent.document.getElementById("SondazhDiteIframeBorders").style.height = iframeWindow.document.documentElement.scrollHeight + 'px';
                }
                if (iframeWindow.name == 'DjathtasLive') {
                    var Livet = parent.document.getElementById("LiveAnash")
                    if (Livet) {
                        Livet.style.height = iframeWindow.document.documentElement.scrollHeight + 'px';
                    }
                }
            }
        }
        else //CSS1compliant
        {
            if (String(iframeElement) != "undefined") {
                if (iframeElement.style != null)
                    iframeElement.style.height = iframeWindow.document.body.scrollHeight + 'px';
            }
        }
    }
}


function resizeIFrameBS2(iframeWindow) {
    resizeIFrame2(iframeWindow);
    this.betSlipLoaded = true;
}
//----------------------------------------------------------
//  Shto ne Betslip
//----------------------------------------------------------
function PanelUpdateCupon(OddID) {

    if (document.getElementById('txtShuma'))
        sumof = document.getElementById('txtShuma').value
    //                    if (document.getElementById('CuponTBL'))
    //                        document.getElementById('CuponTBL').innerHTML = "<table width=100% height='" + document.getElementById('CuponTBL').scrollHeight + "' cellpadding=0 cellspacing=0><tr><td align=center><img src='Image/1.gif'></td></tr></table>"
    //alert(OddID)
    document.getElementById("BetSlipIframe1").src = "betslip.aspx?id=" + OddID;
    //ob_post.AddParam('OddID', OddID);
    //ob_post.post(null, "PanelUpdateCupon", function() {
    //    alert("ddd");

    //});

}

//----------------------------------------------------------
//  Shto ne Betslip
//----------------------------------------------------------
var sumof
function keyaa() {
    try {
        if (sumof) {
            document.getElementById('txtShuma').value = sumof;
            keya()
        }
    } catch (e) {

    }

   
    return;
}

function noenter() {
    return !(window.event && window.event.keyCode == 13);
}
var OLDValue = '0';
function keya(event) {
    if (event.keyCode == 13) return false;
    if (!IsNumeric(document.getElementById("txtShuma").value)) {
        //document.getElementById("txtShuma").value = OLDValue
    }
    shumat = document.getElementById("txtShuma").value;
    shumat = shumat.replace(",", "");
    t = document.getElementById("HFMin").innerHTML;
    t = t.replace(",", ".");
    if (document.getElementById("HFMax")) {
        t2 = document.getElementById("HFMax").innerHTML;
        t2 = t2.replace(",", ".");
    }
    if (shumat != '') document.getElementById("txtShuma").value = formatFloat(shumat, 0);
    c = document.getElementById("txtMinimal");
    c.innerHTML = formatFloat((t * shumat) / document.getElementById("lblKomb").innerHTML, 2);
    if (document.getElementById("txtMaksimal")) {
        c = document.getElementById("txtMaksimal");
        c.innerHTML = formatFloat((t2 * shumat) / document.getElementById("lblKomb").innerHTML, 2);
    }
    sumof = shumat
    document.getElementById('txtShuma').focus()
    OLDValue = document.getElementById("txtShuma").value
}

function IsNumeric(sText) {
    var ValidChars = "0123456789.";
    var IsNumber = true;
    var Char;


    for (i = 0; i < sText.length && IsNumber == true; i++) {
        Char = sText.charAt(i);
        if (ValidChars.indexOf(Char) == -1) {
            IsNumber = false;
        }
    }
    return IsNumber;

}

var thousand_sep = "";
var decimal_point = ".";
var default_precision = 2;

function formatFloat(aFloat, aPrecision) {
    try {
        precision = default_precision;
        if (!isNaN(aPrecision))
            if (Math.abs(aPrecision) <= 10)
            precision = aPrecision;
    } catch (e) {
        precision = default_precision;
    }
    try {
        number = parseFloat(aFloat + '');
        if (isNaN(number))
            return "NaN";
    } catch (e) {
        return "NaN";
    }

    number = Math.round(number * Math.pow(10, precision)) / Math.pow(10, precision);
    integerpart = '' + ((number < 0) ? Math.ceil(number) : Math.floor(number));
    decimalpart = Math.abs(Math.round((number - integerpart) * (Math.pow(10, precision))));
    if (decimalpart < 10)
        decimalpart = "0" + decimalpart;
    if (decimalpart == 0)
        decimalpart = "00";
    var buff = "";
    for (j = -1, i = integerpart.length; i >= 0; i--, j++) {
        if ((j % 3) == 0 && j > 1)
            buff = thousand_sep + buff;
        buff = integerpart.charAt(i) + buff;
    }
    if (precision > 0)
        return buff + decimal_point + decimalpart;
    return buff;
}

    function LinkONOFF(obj) {
    //alert('sss')
        if (obj.className == "InfoOn")
            obj.className = "InfoOff"
        else
            obj.className = "InfoOn"
    }
   
function DoBehenLiveSetHeight(divid, newH){

    if (newH > '0') {
        var n = Math.round(newH)
        if (n < newH)
            newH = n + 1
        document.getElementById(divid).style.height = newH + "px";
        if (isIE) {
            if (document.getElementById(divid + 'Tab'))
                document.getElementById(divid + 'Tab').style.height = newH  + "px";
            if (document.getElementById(divid + 'Main'))
                document.getElementById(divid + 'Main').style.display = 'block'
        }
    }
    else {
        document.getElementById(divid).style.height = 30 + "px";
        if (isIE) {
            if (document.getElementById(divid + 'Main'))
                document.getElementById(divid + 'Main').style.display = 'none'
        }
    }
}

var BrowserDetect = {
    init: function() {
        this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
        this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
        this.OS = this.searchString(this.dataOS) || "an unknown OS";
    },
    searchString: function(data) {
        for (var i = 0; i < data.length; i++) {
            var dataString = data[i].string;
            var dataProp = data[i].prop;
            this.versionSearchString = data[i].versionSearch || data[i].identity;
            if (dataString) {
                if (dataString.indexOf(data[i].subString) != -1)
                    return data[i].identity;
            }
            else if (dataProp)
                return data[i].identity;
        }
    },
    searchVersion: function(dataString) {
        var index = dataString.indexOf(this.versionSearchString);
        if (index == -1) return;
        return parseFloat(dataString.substring(index + this.versionSearchString.length + 1));
    },
    dataBrowser: [
		{
		    string: navigator.userAgent,
		    subString: "Chrome",
		    identity: "Chrome"
		},
		{ string: navigator.userAgent,
		    subString: "OmniWeb",
		    versionSearch: "OmniWeb/",
		    identity: "OmniWeb"
		},
		{
		    string: navigator.vendor,
		    subString: "Apple",
		    identity: "Safari",
		    versionSearch: "Version"
		},
		{
		    prop: window.opera,
		    identity: "Opera"
		},
		{
		    string: navigator.vendor,
		    subString: "iCab",
		    identity: "iCab"
		},
		{
		    string: navigator.vendor,
		    subString: "KDE",
		    identity: "Konqueror"
		},
		{
		    string: navigator.userAgent,
		    subString: "Firefox",
		    identity: "Firefox"
		},
		{
		    string: navigator.vendor,
		    subString: "Camino",
		    identity: "Camino"
		},
		{		// for newer Netscapes (6+)
		    string: navigator.userAgent,
		    subString: "Netscape",
		    identity: "Netscape"
		},
		{
		    string: navigator.userAgent,
		    subString: "MSIE",
		    identity: "Explorer",
		    versionSearch: "MSIE"
		},
		{
		    string: navigator.userAgent,
		    subString: "Gecko",
		    identity: "Mozilla",
		    versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
		    string: navigator.userAgent,
		    subString: "Mozilla",
		    identity: "Netscape",
		    versionSearch: "Mozilla"
		}
	],
    dataOS: [
		{
		    string: navigator.platform,
		    subString: "Win",
		    identity: "Windows"
		},
		{
		    string: navigator.platform,
		    subString: "Mac",
		    identity: "Mac"
		},
		{
		    string: navigator.platform,
		    subString: "Linux",
		    identity: "Linux"
		}
	]

};
BrowserDetect.init();

function lojra() {
    window.open('blackjack.aspx', '', 'height=345,width=420');
}

/***********************************************
* Local Time script- © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var weekdaystxt = ["", "", "", "", "", "", ""]

function showLocalTime(container, servermode, offsetMinutes, displayversion, oratanisrv) {
    if (!document.getElementById || !document.getElementById(container)) return
    this.container = document.getElementById(container)
    this.displayversion = displayversion



    var stringu = oratanisrv


//    stringu = stringu.replace(/shkurt/, "February")
//    stringu = stringu.replace(/mars/, "March")
//    stringu = stringu.replace(/prill/, "April")
//    stringu = stringu.replace(/maj/, "May")
//    stringu = stringu.replace(/qershor/, "June")
//    stringu = stringu.replace(/korrik/, "July")
//    stringu = stringu.replace(/gusht/, "August")
//    stringu = stringu.replace(/shtator/, "September")
//    stringu = stringu.replace(/tetor/, "October")
//    stringu = stringu.replace(/nėntor/, "November")
//    stringu = stringu.replace(/dhjetor/, "December")
    //alert(stringu)
    var servertimestring = stringu
    this.localtime = this.serverdate = new Date(servertimestring)
    this.localtime.setTime(this.serverdate.getTime() + offsetMinutes * 60 * 1000) //add user offset to server time
    this.updateTime()
    this.updateContainer()
}

showLocalTime.prototype.updateTime = function() {
    var thisobj = this
    this.localtime.setSeconds(this.localtime.getSeconds() + 1)
    setTimeout(function() { thisobj.updateTime() }, 1000) //update time every second
}

showLocalTime.prototype.updateContainer = function() {
    var thisobj = this
    if (this.displayversion == "long")
        this.container.innerHTML = this.localtime.toLocaleString()
    else {
        var hour = this.localtime.getHours()
        var minutes = this.localtime.getMinutes()
        var seconds = this.localtime.getSeconds()
        var ampm = (hour >= 12) ? "PM" : "AM"
        var dayofweek = weekdaystxt[this.localtime.getDay()]
        this.container.innerHTML = formatField(hour) + ":" + formatField(minutes) + ":" + formatField(seconds)
    }
    setTimeout(function() { thisobj.updateContainer() }, 1000) //update container every second
}

function formatField(num, isHour) {
    if (typeof isHour != "undefined") { //if this is the hour field
        var hour = (num > 12) ? num - 12 : num
        return (hour == 0) ? 12 : hour
    }
    return (num <= 9) ? "0" + num : num//if this is minute or sec field
}

function PollIDitesHeight(divid, newH) {

    if (newH > '0') {
        document.getElementById(divid + "IMG").style.height = newH + 82 + "px";
        document.getElementById(divid + "Outer").style.height = newH + 60 + "px";
        document.getElementById(divid + "Outer2").style.height = newH + 82 + "px";
        document.getElementById(divid).style.height = newH + "px";
        //alert(document.getElementById(divid + "Outer").style.height )
    }
}

function golatlive(lart) {

       parent.document.getElementById("golatliveiframe").style.height =lart + 'px';

   }

   window.onerror = errorMSG
   function errorMSG() { return true; }


   function nba() {
       document.getElementById("Qendra").src = "game.aspx?ndeshjeid=365256"
   //parent.top.location = "game.aspx?ndeshjeid=365256"
   }


   function callidsot(ddddd) {
       document.getElementById("Qendra").src = "game.aspx?ndeshjeid=" + ddddd
       //parent.top.location = "game.aspx?ndeshjeid=365256"
   }

   function videolive(inf) {
       if (inf == "on") {
           document.getElementById("livestreamid").style.display = "block"
       } else {
           document.getElementById("livestreamid").style.display = "block"
        }

   }

   function hapndeshje(ID) {
        //alert(ID)
        window.location='game.aspx?ndeshjeid='+ID
   }
