$(document).ready(function () {

    $("#username").focus(function() {

        if(this.value=='Gebruikersnaam') {this.value=''}

    });

    $("#username").blur(function() {

        if(this.value=='') {this.value='Gebruikersnaam'}

    });

	$("#password").focus(function() {

        if(this.value=='Wachtwoord') {this.value=''}

    });

    $("#password").blur(function() {

        if(this.value=='') {this.value='Wachtwoord'}

    });

	$(".image_thumb ul li:first").addClass('active');

	$(".image_thumb ul li").click(function(){
		//Set Variables
		var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
		var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL
		var imgDesc = $(this).find('.block').html();  //Get HTML of the "block" container
		var imgDescHeight = $(".main_image").find('.block').height(); //Find the height of the "block"

		if ($(this).is(".active")) {  //If the list item is active/selected, then...
			return false; // Don't click through - Prevents repetitive animations on active/selected list-item
		} else { //If not active then...
			//Animate the Description
			$(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() { //Pull the block down (negative bottom margin of its own height)
				$(".main_image .block").html(imgDesc).animate({ opacity: 0.85,	marginBottom: "0" }, 250 ); //swap the html of the block, then pull the block container back up and set opacity
				$(".main_image img").attr({ src: imgTitle , alt: imgAlt}); //Switch the main image (URL + alt tag)
			});
		}
		//Show active list-item
		$(".image_thumb ul li").removeClass('active'); //Remove class of 'active' on all list-items
		$(this).addClass('active');  //Add class of 'active' on the selected list
		return false; 

	}) .hover(function(){ //Hover effects on list-item 
		$(this).addClass('hover'); //Add class "hover" on hover 
		}, function() {
		$(this).removeClass('hover'); //Remove class "hover" on hover out
	});
	
	$("#reviews").easySlider({ prevText: '&laquo;', nextText: '&raquo;', continuous: true});
	$("#bands").easySlider({ prevId: 'prevBtn2', nextId: 'nextBtn2', prevText: '&laquo;', nextText: '&raquo;', continuous: true});
});
$(window).load(function() {
	var mainOuterHeight = $('#main').eq(0).outerHeight();
	var sidebarOuterHeight = $('#sidebar').eq(0).outerHeight();
	var sidebarHeight = $('#sidebar').eq(0).height(); 
	var mainHeight = $('#main').eq(0).height();
	
	if (mainOuterHeight > sidebarOuterHeight) { 
		var padding = sidebarOuterHeight - sidebarHeight; 
		var height = mainOuterHeight - padding;
		$('#sidebar').css('height',  height ); 
		}
		
	if (mainOuterHeight < sidebarOuterHeight) {
		var padding = mainOuterHeight - mainHeight;
		var height = sidebarOuterHeight - padding;
		$('#main').css('height', height );
	}
		
});