Shadowbox.init({
    skipSetup: true,
    players: ["html","swf"]
});

jQuery(document).ready(function(){
	
	$('.leesmeer2_verenigingen').click(function () 
	{
		var obj = $(this).parents('.vereniging').find('.vervolgtekst_verenigingen');
		
		if (obj.css('display')=='none')
		{
			obj.slideDown();
			$(this).find('a').addClass('active'); 	
		}
		else
		{
			obj.slideUp();
			$(this).find('a').removeClass('active');
		}
		
	});
	
	selectboxForms();
	
	$(".slide_followup").each(function(){
		$(this).show();
	});
	
	$(".outbound_link").attr('target','_blank');
	
	function formatText(index, panel) {
		  return index + "";
	    }
    
	$('.watch_intro').click(function(){
		var url = $(this).attr("rel");
		Shadowbox.open({
           content:    url+'&autoplay=1',
           player:     "swf",
           title:      "Get.Noticed - Nederweert",
           height:     385,
           width:      640
      });
	});    
	    
	$(function () {
	        
	            $('.anythingSlider').anythingSlider({
	                easing: "easeInQuart",        // Anything other than "linear" or "swing" requires the easing plugin
	                autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
	                delay: 3000,                    // How long between slide transitions in AutoPlay mode
	                startStopped: false,            // If autoPlay is on, this can force it to start stopped
	                animationTime: 800,             // How long the slide transition takes
	                hashTags: true,                 // Should links change the hashtag in the URL?
	                buildNavigation: false,          // If true, builds and list of anchor links to link to each slide
	        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
	        		startText: "Go",             // Start text
			        stopText: "Stop",               // Stop text
			        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
	            });
	            
	            $("#slide-jump").click(function(){
	                $('.anythingSlider').anythingSlider(1);
	            });
	            
	});
	
	$(function () {
	        
	            $('.new_slider').anythingSlider({
	                easing: "easeInBack",        // Anything other than "linear" or "swing" requires the easing plugin
	                autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
	                delay: 7000,                    // How long between slide transitions in AutoPlay mode
	                startStopped: false,            // If autoPlay is on, this can force it to start stopped
	                animationTime: 1200,             // How long the slide transition takes
	                hashTags: true,                 // Should links change the hashtag in the URL?
	                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
	        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
	        		startText: "Go",             // Start text
			        stopText: "Stop",               // Stop text
			        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
	            });
	            
	            $("#slide-jump").click(function(){
	                $('.anythingSlider').anythingSlider(1);
	            });
	            
	});
	
	$(".single_img").fancybox({'titlePosition':'inside'});
	
	$('.foto_holder').cycle({
 		fx: 'fade',
 		speed: 750,
 		timeout: 750,
 		autostop: 1 
 	}); 
 	
	
	
 	$('.click_for_more').click(function () {
		
		//var obj = $(this).parents('.branche_block').find('.branche_block_more');
		var cfm_id = $(this).attr('id');
		var arr_cfm_id = cfm_id.split('_');
		
		loadBrancheKlanten(arr_cfm_id[1]);
		
	});

	
 	if($('#main_cont').length)
	{
		var element_max = document.getElementById('wrapper_vervolg');	
		$('.rechts').height(element_max.clientHeight);
		//$('#main_cont').find('.wrapper').height(element_max.clientHeight);
	}
	
	$("#carousel").jCarouselLite({
    auto: 800,
    speed: 1000
	});
	
	$('.slide_image a').click(function(){
		Shadowbox.open({
           content:    'http://www.youtube.com/v/Vf3jHeuLGnU&hl=nl_NL&fs=1&autoplay=1',
           player:     "swf",
           title:      "Get.Noticed - Nederweert",
           height:     385,
           width:      640
      });
		
	});
	
	
});

function selectboxForms(){
	$('div.form div.select select').selectbox();
	var zIndex = 9999;
	$('div.form div.entry').each(function(){
		$(this).css('z-index',zIndex);
		zIndex--;
	});
}

$(function() {
	    $('.groep_icon').tipsy();
	});
	


function loadBrancheKlanten(bid)
{
	$.ajax({
		type: "POST",
		url: "/getnoticed.nl/ajax/ajax_helper.php",
		data: 'b_id='+bid+'&action=load_branche_klanten',
		dataType: "html",
		success: function(result)
		{
			if(result != '')
			{
				//alert(result);
				
				$('#branche_more_klanten').html(result);
			 
   			}
		}

    });
}
