﻿function refreshIFrame(iFrameID) {
    var divResult = $(iFrameID);
    var checkID = $(getCheckID()).value;
    divResult.src = divResult.src;
}

function showPage(ps_url) {
    var divInvoer = $('iframeMain');
    // var checkID = $(getCheckID()).value ;
    // var src = format('invoerForm.aspx?checkid={0}&startpath={1}&keyid=0', checkID, path);
    var src = ps_url ;
    divInvoer.src = src;
    // openWindow(src);
}

function changeMain() {
    // var tdInvoer = $('divlev');
    // document.getElementById('divlev').innerHTML = "test123" ;
    $('divlev').innerHTML = "test123";
   
}

function format(text) {
    //check if there are two arguments in the arguments list
    if (arguments.length <= 1) {
        //if there are not 2 or more arguments there’s nothing to replace
        //just return the original text
        return text;
    }
    //decrement to move to the second argument in the array
    var tokenCount = arguments.length - 2;
    for (var token = 0; token <= tokenCount; token++) {
        //iterate through the tokens and replace their placeholders from the original text in order
        text = text.replace(new RegExp('\\{' + token + '\\}', 'gi'),
                                                arguments[token + 1]);
    }
    return text;
}

function openWindow(ps_docname) {
    lo_window = window.open("", "", "resizable=yes,toolbar=yes,scrollbars=yes,fullscreen=no,height=600,width=800,top=50,left=25,screenX=10,screenY=50");
    // lo_window = window.open ("","","resizable=yes,toolbar=yes,scrollbars=yes,fullscreen=yes");
    lo_window.location.href = ps_docname;
    if (!lo_window.opener) lo_window.opener = self;
}

function toggleDiv(divid) {
    if (document.getElementById(divid).style.display == 'none') {
        document.getElementById(divid).style.display = 'block';
    } else {
        document.getElementById(divid).style.display = 'none';
    }
}

function Togglextra(i) {
    oText = document.getElementById('span' + i);
    oLinka = document.getElementById('linka' + i);
    oLinkb = document.getElementById('linkb' + i);

    /*	
    alert(oText.id) ;
    alert(oLinka.id) ;
    alert(oLinkb.id) ;
    */

    if (oText.style.display == 'block') {
        oText.style.display = 'none';
        oLinka.style.display = 'block';
        oLinkb.style.display = 'none';
    } else {
        oText.style.display = 'block';
        oLinka.style.display = 'none';
        oLinkb.style.display = 'block';
    }
}