function printPage()
{
	this.focus();
	this.print();
}

function showDiv(p_intId)
{
    if (document.getElementById(''+p_intId+'') != null){ 
        document.getElementById(''+p_intId+'').style.display = "block";
    }
}

function hideDivs(p_intIdPart)
{
    var l_intCount = 0;
    while (document.getElementById(''+p_intIdPart+''+l_intCount+'')){
        document.getElementById(''+p_intIdPart+''+l_intCount+'').style.display = "none";
        l_intCount = l_intCount + 1;
    }
}

function StartFadeImg(p_strId, p_intOpac)
{
    var l_objImg = document.getElementById('Img_' + p_strId + '_0');
    
    document.getElementById('BannerLink').href=document.getElementById('Img_' + p_strId + '_0').getAttribute('imglink');
    document.getElementById('BannerLink').target=document.getElementById('Img_' + p_strId + '_0').getAttribute('imglinktarget');
    
    l_objImg.style.filter = 'alpha(opacity=' + p_intOpac + ')';
    l_objImg.style.opacity = p_intOpac/100;
    p_intOpac = p_intOpac + 5;
    
    if(p_intOpac < 101)
    {
        setTimeout("StartFadeImg('" + p_strId + "'," +p_intOpac+ ")",70);
    }
    else if(document.getElementById('Img_' + p_strId + '_1'))
    {
        var l_intStart = 0;
        var l_intNext = 0;
        if(document.getElementById('Img_' + p_strId + '_1'))
        {         
            l_intNext = 1;
            setTimeout("FadeImg('" + p_strId + "'," + l_intStart + "," + l_intNext + ",0)", 5000);
        } 
    }
}

function FadeImg(p_strId, p_intStart, p_intNext, p_intOpac)
{
    var l_objCurrentImg = document.getElementById('Img_' + p_strId + '_' + p_intStart);
    var l_objNextImg = document.getElementById('Img_' + p_strId + '_' + p_intNext);
    var l_intCurrentOpac = 100 - p_intOpac;
    
    l_objCurrentImg.style.filter = 'alpha(opacity=' + l_intCurrentOpac + ')';
    l_objCurrentImg.style.opacity = l_intCurrentOpac/100;
    l_objNextImg.style.filter = 'alpha(opacity=' + p_intOpac + ')';
    l_objNextImg.style.opacity = p_intOpac/100;

    p_intOpac = p_intOpac + 5;

    if(p_intOpac < 101)
    {
        setTimeout("FadeImg('" + p_strId + "'," + p_intStart + "," + p_intNext + "," + p_intOpac + ")", 70);
    }
    else
    {
        p_intStart = p_intNext;
        
        document.getElementById('BannerLink').href=document.getElementById('Img_' + p_strId + '_' + p_intNext).getAttribute('imglink');
        document.getElementById('BannerLink').target=document.getElementById('Img_' + p_strId + '_' + p_intNext).getAttribute('imglinktarget');
        
        if(document.getElementById('Img_' + p_strId + '_' + (p_intNext + 1)))
            p_intNext = p_intNext +1;
        else
            p_intNext = 0;
        setTimeout("FadeImg('" + p_strId + "'," + p_intStart + "," + p_intNext + ",0)", 5000);
    }
}

function checkMailFriend()
{
    if(document.getElementById('Email').value=='')
    {
        window.alert('Email is verplicht.');
        document.getElementById('Email').focus();
        return false;
    }
}

 function Next(g_strJSPointer,fotoboek,mId,rId)
{

    if(PhotoArray[Pointer+1] != null)
    {
        top.location=fotoboek+'.aspx?mId='+mId+'&rId='+rId+'&fId=' + PhotoArray[Pointer+1] + '#f'+ PhotoArray[Pointer+1];
        Pointer++;
    }
}
function Previous(g_strJSPointer,fotoboek,mId,rId)
{
    if(PhotoArray[Pointer-1] != null)
    {
        top.location=fotoboek+'.aspx?mId='+mId+'&rId='+rId+'&fId=' + PhotoArray[Pointer-1] + '#f'+ PhotoArray[Pointer-1];
        Pointer--;
    }
}