﻿var mouseoverUitleg = false;



$(document).ready(function(){


    // uitleg onmouseover
    $('.uitleg span').each(function(){
   
        $(this).bind("mouseenter", function(e){
            $(this).parent().siblings('.uitleg-popup').addClass("over");
            
        });
        
        $(this).bind("mouseleave", function(e){
            if(!mouseoverUitleg)
            {
                $(this).parent().siblings('.uitleg-popup').removeClass("over");
            }
        });

        
        $(this).parent().siblings('.uitleg-popup').bind("mouseenter", function(e){
            mouseoverUitleg = true;
            $(this).addClass("over");
        });
        
        $(this).parent().siblings('.uitleg-popup').bind("mouseleave", function(e){
            mouseoverUitleg = false;
            $(this).removeClass("over");
        });
        
    });
    
    
    
    
    
    // videoclick
    
    
    
    
    
    
    //video hover
    
    $('.kleine-video-collectie .video-klein').each(function(){
        
        $(this).bind("click", function(e){
       
            $('.kleine-video-collectie').addClass('hidden');
            $('.kleine-video-indepth').addClass('show');
            $(this).find('.extrainfo').clone().prependTo('.kleine-video-indepth');
            $(this).find('.eersteinhoud').clone().prependTo('.imagecontainer');  
           

        });
    });
    
    
    $('.kleine-video-collectieNed2 .video-klein').each(function(){
        
        $(this).bind("click", function(e){
       
            $('.kleine-video-collectieNed2').addClass('hidden');
            $('.kleine-video-indepthNed2').addClass('show');
            $(this).find('.extrainfoNed2').clone().prependTo('.kleine-video-indepthNed2');
            $(this).find('.eersteinhoudNed2').clone().prependTo('.imagecontainerNed2');  

        });
    });

  

});

function sluitVenster(target)
{
    $('#' +  target + '.activeplayer').css('display', 'none');
    $('#' +  target + '.activeplayer').prev('.summary').css('display', 'block');
    
    $('.kleine-video-collectie').removeClass('hidden');
    $('.kleine-video-indepth').removeClass('show');
    //$('#' + target + '.activeplayer').prev('.summary').css('display', 'none');
    $('.kleine-video-indepth').empty();
    $('.imagecontainer').empty();
    $('.kleine-video-indepth-extraSpirit').css('display', 'none');
document.getElementById(target).innerHTML="";
}

function sluitVensterNed2(target)
{
    $('#' +  target + '.activeplayer').css('display', 'none');
    $('#' +  target + '.activeplayer').prev('.summary').css('display', 'block');
    
    $('.kleine-video-collectieNed2').removeClass('hidden');
    $('.kleine-video-indepthNed2').removeClass('show');
    //$('#' + target + '.activeplayer').prev('.summary').css('display', 'none');
    $('.kleine-video-indepthNed2').empty();
    $('.imagecontainerNed2').empty();
    $('.kleine-video-indepth-extraNed2').css('display', 'none');
	document.getElementById(target).innerHTML="";

    
}



function startVideo(target, mediafile, preview)
{
    $('#' +  target + '.activeplayer').css('display', 'block');
    $('#' +  target + '.activeplayer').prev('.summary').css('display', 'none');


	var s1 = new SWFObject('/mediaplayer/player-viral.swf', 'player', '391', '281', '9');
	s1.addParam('allowfullscreen', 'true');
	s1.addParam('allowscriptaccess', 'always');
	s1.addParam('image', preview );
	s1.addParam('flashvars', 'file=' + mediafile + '&autostart=true' );

	s1.write(target);
	
	
}

function restoreFromVideo()
{
    $('.video-groot.activeplayer').css('display', 'none');
    
    $('.video-groot.summary').css('display', 'block');
}

function VulExtra(container, supportimage)
{
    
    $('.kleine-video-indepth-extra').css('display', 'block');
    $('.kleine-video-indepth-extra .textuals').empty();
    $('.kleine-video-indepth-extra .textuals').html($('#' + container).html());
    $('.kleine-video-indepth-extra .supportimage').css('background-image', 'url(' + supportimage + ')');
    

}

function VulExtraSpirit(container, supportimage) {
    
    $('.kleine-video-indepth-extraSpirit').css('display', 'block');
    $('.kleine-video-indepth-extraSpirit .textuals').empty();

    $('.kleine-video-indepth-extraSpirit .textuals').html($('#' + container).html());
    $('.kleine-video-indepth-extraSpirit .supportimage').css('background-image', 'url(' + supportimage + ')');


}

function VulExtraNed2(container, supportimage)
{

    $('.kleine-video-indepth-extraNed2').css('display', 'block');
    $('.kleine-video-indepth-extraNed2 .textuals').empty();

    $('.kleine-video-indepth-extraNed2 .textuals').html($('#' + container).html());
    $('.kleine-video-indepth-extraNed2 .supportimage').css('background-image', 'url(' + supportimage + ')');
    

}