$(document).ready(function(){
	
	$('a.content_l').click(function(){
		$('#content_l').hide().load(''+ this.href +'').show();
		return false;
	});

	$('a.content_r').click(function(){
		$('#content_r').hide().load(''+ this.href +'').show();
		return false;
	});
	
	$('a.content_test').click(function(){
		$('#content_test').hide().load(''+ this.href +'').show();
		return false;
	});

	/* NAV */
	
	$('.nav a.news').click(function(){
		$('.nav a.photos').css("width","40px").css("height","30px").css("border","1px solid #444444");
		$('.nav a.news').css("color","#999999");
		$(this).css("color","#666666");
	});
	
	$('.nav a.photos').click(function(){
		$('.nav a.photos').css("width","40px").css("height","30px").css("border","1px solid #444444");
		$(this).css("width","36px").css("height","26px").css("border","3px solid #222222");
		$('.nav a.news').css("color","#999999");
	});
	
	$('.nav a.photos:first').css("width","36px").css("height","26px").css("border","3px solid #222222");
	
	$('.nav a.tv').click(function(){
		$('.nav a.tv').css("color","#999999");
		$(this).css("color","#666666");
	});
	
	$('.nav a.tv').click(function(){
		$('.nav a.tv').css("color","#999999");
		$(this).css("color","#666666");
	});
	
	$('.nav a.tv:first').css("color","#666666");
	
	/* ZOEK FOCUS */

	$(".zoeken").focus(function(){
		if(this.value=='SEARCH FOR'){
			this.value='';
			this.style.color='#666666';
		} else {
			this.style.color='#666666';
		}
	});
	$(".zoeken").blur(function(){
		if(this.value==''){
			this.value='SEARCH FOR';
			this.style.color='#999999';
		} else if(this.value=='SEARCH FOR'){
		this.style.color='#999999';
		} else {
			this.style.color='#666666';
		}
	});
	
	/* SOCIAL INACTIVE */
	
	$('a.inactive span').hide();
	
	$('a.inactive span').hide();
	$('a.inactive').hover(function(){
		$('span', this).show().animate({ top:'+=5',opacity:1}, 100);
	}, function(){
		$('span', this).show().animate({ top:'-=5',opacity:0}, 100);
	});

	
	/* CAROUSEL */
	
	$('#news').cycle({
		fx:     'scrollUp',
		speed:   400,
		timeout: 0,
		random:  0,
		next:   '#news_next', 
  prev:   '#news_prev'
	});
	
	$('#photos').cycle({
		fx:     'scrollUp',
		speed:   400,
		timeout: 0,
		random:  0,
		next:   '#photos_next', 
  prev:   '#photos_prev'
	});
	
	$('#tv').cycle({
		fx:     'scrollUp',
		speed:   400,
		timeout: 0,
		random:  0,
		next:   '#tv_next', 
  prev:   '#tv_prev'
	});

	/* SCROLL TO */

	$(".vlak").click(function (e) {
	  var offset = $(".scrollto").offset();
	  var test = offset.top - 15;
	 	$('html,body').animate({scrollTop: test}, 500);
	});
	
	/* POPUP */

	$("a[rel='popup']").colorbox();
	
	$('a.popup').fadeTo(100,0.8);
	$('a.popup').hover(function() {
		$(this).stop().fadeTo(200,1);
	}, function() {
		$(this).stop().fadeTo(200,0.8);
	});

 /* EQUAL HEIGHTS */
	
	$.fn.setAllToMaxHeight = function(){
		return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) );
	}

 $('.footer_blok').setAllToMaxHeight()

 /* RADIO */
 
 $("#radio li").click(function(event){
	event.preventDefault();
	$('#radio > li').removeClass("active");
	var id = this.id;
	var newselect = id.replace('-li-', '-');
	$('#'+newselect).attr('checked', true);
	$(this).addClass("active");
	$(this).parent().addClass("active");
	return false;
 });
 
});
