window.onload = function()
{
    blankTarget();

    var replaces = 0;
    while(document.body.innerHTML.indexOf('##'+'kukac##') != -1 && replaces < 10000)
    {
        document.body.innerHTML = document.body.innerHTML.replace('##'+'kukac##', String.fromCharCode(64));
        replaces++;
    }
}

function blankTarget()
{
    if(!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName("a");
    for(var i=0; i<anchors.length; i++)
    {
        var anchor = anchors[i];
        anchor.tabindex = i;
        if(anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
        {
            anchor.target = "_blank";
        }
    }
}

function showarfolyam(a)
{
    xmlhttp = createXMLHTTPObject();
    xmlhttp.open("GET", 'include/_setarfolyam.php?arfolyam='+a, false);
    xmlhttp.send(null);
    
    document.getElementById('valuta_arfolyam').style.display = 'none';
    document.getElementById('deviza_arfolyam').style.display = 'none';
	document.getElementById('hitel_arfolyam').style.display = 'none';
    
    if(a == 'd')
    {
        document.getElementById('deviza_arfolyam').style.display = 'block';
    }
	else if(a == 'v')
    {
        document.getElementById('valuta_arfolyam').style.display = 'block';
    }
    else
    {
        document.getElementById('hitel_arfolyam').style.display = 'block';
    }
}

function showtable(t)
{
    var tables = document.getElementsByTagName('table');
    
    for (i = 0; i < tables.length; i++)
    {
        if(tables[i].id.search('valuta') != -1)
        {
            tables[i].style.display = 'none';
        }
    }
    
    document.getElementById(t).style.display = 'block';   
}

function webbankPopup()
{
    newwindow = window.open('https://www.net-banking.hu/mecsek/loginpage.hu.html', '_blank', 'width=1020, height=768, scrollbars');

    if (window.focus)
    {
        newwindow.focus();
    }

    return false;
}
