﻿    function getArgs() { 
        var args = new Object(); 
        var query = location.search.substring(1); 
        var pairs = query.split("&"); 
        for(var i = 0; i < pairs.length; i++) { 
            var pos = pairs[i].indexOf('='); 
            if (pos == -1) continue; 
            var argname = pairs[i].substring(0,pos); 
            var value = pairs[i].substring(pos+1); 
            args[argname] = unescape(value); 
        } 
        return args; 
    } 
    //Pagina schalen
    function paginaSchalen() {
        var moz = document.getElementById && !document.all; 
        var lDiv = document.getElementById('lmDiv');
        var tDiv=document.getElementById('topDiv');
        var mDiv=document.getElementById('mainDiv');
        var bDiv=document.getElementById('bannerDiv');
        var pDiv=document.getElementById('popupDiv');
        var cnDiv=document.getElementById('cnDiv');
        if (moz) {
            var myHeight = window.innerHeight;
            var myWidth = window.innerWidth;
        }  else {
            var myHeight = document.documentElement.clientHeight;
            var myWidth = document.documentElement.clientWidth;
        } 
        bDiv.style.left=myWidth;
        if (parseInt(myHeight)>120) {
            var nh=parseInt(myHeight)-134;
            mDiv.style.height=nh+'px'; 
            pDiv.style.height=nh+'px'; 
            lDiv.style.height=nh+'px'; 
            var ct=parseInt(myHeight)-62;
            bDiv.style.top=ct+'px';
            nh=parseInt(myHeight)-300;
            if (cnDiv && nh>0) cnDiv.style.height=nh+'px'; 
        } 
        if (parseInt(myWidth)>1002) {
            var nl=parseInt((parseInt(myWidth)-1000)/2);
            var nml=nl+162;
            bDiv.style.left='0px';
            tDiv.style.left=nl+'px';
            lDiv.style.left=nl+'px';
            mDiv.style.left=nml+'px';
            pDiv.style.left=nml+'px';
            nml=nl+167;
            if (cnDiv && nml>0) cnDiv.style.left=nml+'px';
        } else {
            bDiv.style.left='0px';
            tDiv.style.left='2px';
            lDiv.style.left='2px';
            mDiv.style.left='164px';
            pDiv.style.left='164px';
            if (cnDiv) cnDiv.style.left='169px';
        }
    }
    function selectComp(afdid) {
        deselectButtons();
        var selcell =$get('CompCell');
	    if (selcell) selcell.className='TabSel';
        switch (afdid)
        {
        case 1:
          cmp_stand(200901001);
          break;
        case 2:
          cmp_stand(200903101);
          break;
        case 3:
          cmp_stand(200904101);
          break;
        case 4:
          cmp_stand(200905101);
          break;
        default:
        }    
    }
    function selectHome() {
        deselectButtons();
        var selcell =$get('HomeCell');
	    if (selcell) selcell.className='TabSel';        
    }
    function selectBeker() {
        deselectButtons();
        var selcell =$get('BekerCell');
	    if (selcell) selcell.className='TabSel';        
    }
    function selectOefen() {
        deselectButtons();
        var selcell =$get('OefenCell');
	    if (selcell) selcell.className='TabSel';        
    }
    function selectNacomp() {
        deselectButtons();
        var selcell =$get('NacompCell');
	    if (selcell) selcell.className='TabSel';        
    }
    function selectClub() {
        deselectButtons();
        var selcell =$get('ClubCell');
	    if (selcell) selcell.className='TabSel';        
    }
    function selectSpeler() {
        deselectButtons();
        var selcell =$get('SpelerCell');
	    if (selcell) selcell.className='TabSel';        
    }
    function selectTrainer() {
        deselectButtons();
        var selcell =$get('TrainerCell');
	    if (selcell) selcell.className='TabSel';        
    }
    function selectScheids() {
        deselectButtons();
        var selcell =$get('ScheidsCell');
	    if (selcell) selcell.className='TabSel';        
    }
    function selectVacature() {
        deselectButtons();
        var selcell =$get('VacatureCell');
	    if (selcell) selcell.className='TabSel';        
    }
    function selectArchief() {
        deselectButtons();
        var selcell =$get('ArchiefCell');
	    if (selcell) selcell.className='TabSel';        
    }
    function deselectButtons()
    {
	    var homecell =$get('HomeCell');
	    homecell.className='TabOff';
	    var compcell =$get('CompCell');
	    compcell.className='TabOff';
	    var bekercell =$get('BekerCell');
	    bekercell.className='TabOff';
	    var oefencell =$get('OefenCell');
	    oefencell.className='TabOff';
	    var nacompcell =$get('NacompCell');
	    nacompcell.className='TabOff';
	    var clubcell =$get('ClubCell');
	    clubcell.className='TabOff';
	    var spelercell =$get('SpelerCell');
	    spelercell.className='TabOff';
	    var trainercell =$get('TrainerCell');
	    trainercell.className='TabOff';
	    var scheidscell =$get('ScheidsCell');
	    scheidscell.className='TabOff';
	    var scheidscell =$get('VacatureCell');
	    scheidscell.className='TabOff';
	    var archiefcell =$get('ArchiefCell');
	    archiefcell.className='TabOff';
    }
function contact () {
    sT();
    sP();
    SVC_Home.homeContact(onPUGot);
}
function WVcomp (wnr,clubid) {
    sT();
    sP();
    SVC_Comp.compVerslag(wnr, clubid, onPUGot);
}
function cV (wnr,clubid) {
    sT();
    sP();
    SVC_Comp.compVerslag(wnr, clubid, onPUGot);
}
function oV (wnr,clubid) {
    sT();
    sP();
    SVC_Oefen.oefenVerslag(wnr, clubid, onPUGot);
}
function oS (wnr) {
    sT();
    sP();
    SVC_Oefen.oefenStat(wnr, onPUGot);
}
function bV (wnr,clubid) {
    sT();
    sP();
    SVC_Beker.bekerVerslag(wnr, clubid, onPUGot);
}
function WVnacomp (wnr,clubid) {
    sT();
    sP();
    SVC_Nacomp.nacompVerslag(wnr, clubid, onPUGot);
}
function nV (wnr,clubid) {
    sT();
    sP();
    SVC_Nacomp.nacompVerslag(wnr, clubid, onPUGot);
}
function WSbeker (wnr) {
    var urlstr="beker/WS.aspx?W=" + wnr;
    window.open(urlstr ,"wedstrijdstatistieken","width=600,height=500,toolbar=0,menubar=0,location=0,status=0,directories=0,scrollbars=1,resizable=1");
}
function CN (recid) {
    sT();
    sP();
    SVC_Club.nieuwsBericht(recid, onPUGot);
}
function cN (recid) {
    sT();
    sP();
    SVC_Club.nieuwsBericht(recid, onPUGot);
}
function oA (recid) {
    sT();
    sP();
    SVC_Oefen.oefenAanvraag(recid, onPUGot);
}
function Aanvraag (recid) {
    sT();
    sP();
    SVC_Oefen.oefenAanvraag(recid, onPUGot);
}
function sA (recid) {
    sT();
    sP();
    SVC_Scheids.scheidsAanvraag(recid, onPUGot);
}
function sp_cl(pid) {
    sT();
    sP();
    SVC_Speler.spelerClubs(pid, onPUGot);
}
function cS (wnr) {
    sT();
    sP();
    SVC_Comp.compStat(wnr, onPUGot);
}
function bS (wnr) {
    sT();
    sP();
    SVC_Beker.bekerStat(wnr, onPUGot);
}
function nS (wnr) {
    sT();
    sP();
    SVC_Nacomp.nacompStat(wnr, onPUGot);
}
function rN (recid) {
    sT();
    sP();
    SVC_Home.redactieNieuws(recid, onPUGot);
}
function onPUGot(result) {
    var cd=$get('popupDiv');
    if (cd) {
        cd.style.overflow='visible';
        cd.innerHTML=result;
        var cnDiv=document.getElementById('cnDiv');
        var mDiv=document.getElementById('popupDiv');
        if (cnDiv && mDiv) {
            var l=mDiv.style.left;
            var t=mDiv.style.top;
            var h=mDiv.style.height;
            l=parseInt(l)+5;
            h=parseInt(h)-170;
            t=parseInt(t)+130;
            cnDiv.style.height=h+'px'; 
            cnDiv.style.left=l+'px'; 
            cnDiv.style.top=t+'px'; 
        }
    }
}
function onPUscrollGot(result) {
    var cd=$get('popupDiv');
    if (cd) {
        cd.style.overflow='scroll';
        cd.innerHTML=result;
    }
}

function RN (recid) {
    var urlstr="Home/RN.aspx?R=" + recid;
    window.open(urlstr ,"redactienieuws","width=600,height=500,toolbar=0,menubar=0,location=0,status=0,directories=0,scrollbars=1,resizable=1");
}
function Vac (vid) {
    sT();
    sP();
    SVC_Vacatures.vacatureDetails(vid, onPUGot);
}
function SWP (recid) {
    var urlstr="Speler/SWP.aspx?r=" + recid;
    window.open(urlstr ,"Weekprestaties","width=600,height=500,toolbar=0,menubar=0,location=0,status=0,directories=0,scrollbars=1,resizable=1");
}
var pauzeTimeout;

function startPauze() {
    clearTimeout(pauzeTimeout);
    var pauze=$get('pauzeDiv');
    pauze.style.visibility='visible';
    var pauze1=$get('pauzeDiv1');
    pauze1.style.visibility='visible';
    var opdracht='setBal(1)';
    pauzeTimeout=setTimeout(opdracht,300);
}
function stopPauze() {
    var pauze=$get('pauzeDiv');
    pauze.style.visibility='hidden';
    var pauze1=$get('pauzeDiv1');
    pauze1.style.visibility='hidden';
    clearTimeout(pauzeTimeout);
    var balsrc='images/bal/bal01.gif';
    var bal=$get('pauzeimg');
    bal.src=balsrc;
    hT();
}
function setBal(teller) {
    var nieuweteller;
    if (teller<10) { var balsrc='images/bal/bal0' + teller + '.gif'; } else { var balsrc='images/bal/bal' + teller + '.gif'; }
    var bal=$get('pauzeimg');
    bal.src=balsrc;
    if (teller>30) {nieuweteller=0;} else { nieuweteller=teller+1; }
    var opdracht='setBal('+nieuweteller+')';
    pauzeTimeout=setTimeout(opdracht,300);
}    
function sT() {
    var tr=$get('transDiv');
    if (tr) tr.style.visibility = 'visible';
}
function hT() {
    var tr=$get('transDiv');
    if (tr) tr.style.visibility='hidden';
    hP();
}
function sP() {
    var pd=$get('popupDiv');
    if (pd) {
        pd.innerHTML='';
        pd.style.visibility='visible';
    }
    hA();
}
function hP() {
    var pd=$get('popupDiv');
    if (pd) pd.style.visibility='hidden';
}
function hA() {
    f = $get("embed");
    if (f) f.innerHTML = '';
}
