$(document).ready(function(){
	
	
	$('input').focus(function(){
		
		if($(this).attr('value') == 'name' || $(this).attr('value') == 'bericht' || $(this).attr('value') == 'email' || $(this).attr('value') == 'search'){ $(this).attr('value','');}
	});
	$('textarea').focus(function(){
		
		if($(this).attr('value') == 'message'){ $(this).attr('value','');}
	});
	
	var inputField = $('input[rel=headerImg]').attr('value');
	if(inputField != 'null' && inputField != ''){
		var newImage = "<img src='" + inputField + "' />";
		$('#imageHolder').html(newImage);
	};
	
	$('#t_shirt_box select').change(function(){
		currentT = $(this).val();
		$('#t_shirt_preview').css('background-position', "0px " + -((currentT - 1) * 436) + "px");
	});
	
	
	var gallery1Height = $('#gallery1').height();
	var gallery2Height = $('#gallery2').height();
	var gallery3Height = $('#gallery3').height();
	var gallery4Height = $('#gallery4').height();
	var gallery5Height = $('#gallery5').height();
	var gallery6Height = $('#gallery6').height();
	var gallery7Height = $('#gallery7').height();
	var gallery8Height = $('#gallery8').height();
	var gallery9Height = $('#gallery9').height();
	var gallery10Height = $('#gallery10').height();
	var gallery11Height = $('#gallery11').height();
	var gallery12Height = $('#gallery12').height();
	var gallery13Height = $('#gallery13').height();
	var gallery14Height = $('#gallery14').height();
	var gallery15Height = $('#gallery15').height();
	
	
	function reduceToNothing(galleryID){
		if(galleryID != 1){$('#gallery1').animate({height:0, margin:0});}
		if(galleryID != 2){$('#gallery2').animate({height:0, margin:0});}
		if(galleryID != 3){$('#gallery3').animate({height:0, margin:0});}
		if(galleryID != 4){$('#gallery4').animate({height:0, margin:0});}
		if(galleryID != 5){$('#gallery5').animate({height:0, margin:0});}
		if(galleryID != 6){$('#gallery6').animate({height:0, margin:0});}
		if(galleryID != 7){$('#gallery7').animate({height:0, margin:0});}
		if(galleryID != 8){$('#gallery8').animate({height:0, margin:0});}
		if(galleryID != 9){$('#gallery9').animate({height:0, margin:0});}
		if(galleryID != 10){$('#gallery10').animate({height:0, margin:0});}
		if(galleryID != 11){$('#gallery11').animate({height:0, margin:0});}
		if(galleryID != 12){$('#gallery12').animate({height:0, margin:0});}
		if(galleryID != 13){$('#gallery13').animate({height:0, margin:0});}
		if(galleryID != 14){$('#gallery14').animate({height:0, margin:0});}
		if(galleryID != 15){$('#gallery15').animate({height:0, margin:0});}
		
	}
	$('#sidebar.portfolioBar a[href=#show1]').click(function(){

	reduceToNothing(1);
	$('#gallery1').animate({height:gallery1Height, marginBottom:20});
		return false;
		
	});
	
	$('#sidebar.portfolioBar a[href=#show2]').click(function(){

	reduceToNothing(2);
	$('#gallery2').animate({height:gallery2Height, marginBottom:20});
		return false;
		
	});
	$('#sidebar.portfolioBar a[href=#show3]').click(function(){

	reduceToNothing(3);
	$('#gallery3').animate({height:gallery3Height, marginBottom:20});
		return false;
		
	});
	$('#sidebar.portfolioBar a[href=#show4]').click(function(){

	reduceToNothing(4);
	$('#gallery4').animate({height:gallery4Height, marginBottom:20});
		return false;
		
	});
	$('#sidebar.portfolioBar a[href=#show5]').click(function(){
	
	reduceToNothing(5);
	$('#gallery5').animate({height:gallery5Height, marginBottom:20});
		return false;
		
	});
	$('#sidebar.portfolioBar a[href=#show6]').click(function(){
	
	reduceToNothing(6);
	$('#gallery6').animate({height:gallery6Height, marginBottom:20});
		return false;
		
	});
	$('#sidebar.portfolioBar a[href=#show7]').click(function(){
	
	reduceToNothing(7);
	$('#gallery7').animate({height:gallery7Height, marginBottom:20});
		return false;
		
	});
	$('#sidebar.portfolioBar a[href=#show8]').click(function(){
	
	reduceToNothing(8);
	$('#gallery8').animate({height:gallery8Height, marginBottom:20});
		return false;
		
	});
	$('#sidebar.portfolioBar a[href=#show9]').click(function(){
	
	reduceToNothing(9);
	$('#gallery9').animate({height:gallery9Height, marginBottom:20});
		return false;
		
	});
	$('#sidebar.portfolioBar a[href=#show10]').click(function(){
	
	reduceToNothing(10);
	$('#gallery10').animate({height:gallery10Height, marginBottom:20});
		return false;
		
	});
	$('#sidebar.portfolioBar a[href=#show11]').click(function(){
	
	reduceToNothing(11);
	$('#gallery11').animate({height:gallery11Height, marginBottom:20});
		return false;
		
	});
	$('#sidebar.portfolioBar a[href=#show12]').click(function(){
	
	reduceToNothing(12);
	$('#gallery12').animate({height:gallery12Height, marginBottom:20});
		return false;
		
	});
	$('#sidebar.portfolioBar a[href=#show13]').click(function(){
	
	reduceToNothing(13);
	$('#gallery13').animate({height:gallery13Height, marginBottom:20});
		return false;
		
	});
	$('#sidebar.portfolioBar a[href=#show14]').click(function(){
	
	reduceToNothing(14);
	$('#gallery14').animate({height:gallery14Height, marginBottom:20});
		return false;
		
	});
	$('#sidebar.portfolioBar a[href=#show15]').click(function(){
	
	reduceToNothing(15);
	$('#gallery15').animate({height:gallery15Height, marginBottom:20});
		return false;
		
	});
	
	$('#sidebar.portfolioBar a[href=#refresh]').click(function(){
	$('#gallery1').animate({height:gallery1Height, marginBottom:20});
	$('#gallery2').animate({height:gallery2Height, marginBottom:20});
	$('#gallery3').animate({height:gallery3Height, marginBottom:20});
	$('#gallery4').animate({height:gallery4Height, marginBottom:20});
	$('#gallery5').animate({height:gallery5Height, marginBottom:20});
	$('#gallery6').animate({height:gallery6Height, marginBottom:20});
	$('#gallery7').animate({height:gallery7Height, marginBottom:20});
	$('#gallery8').animate({height:gallery8Height, marginBottom:20});
	$('#gallery9').animate({height:gallery9Height, marginBottom:20});
	$('#gallery10').animate({height:gallery10Height, marginBottom:20});
	$('#gallery11').animate({height:gallery11Height, marginBottom:20});
	$('#gallery12').animate({height:gallery12Height, marginBottom:20});
	$('#gallery13').animate({height:gallery13Height, marginBottom:20});
	$('#gallery14').animate({height:gallery14Height, marginBottom:20});
	$('#gallery15').animate({height:gallery15Height, marginBottom:20});
	return false;
		
	});
	
	
	
	$('#sidebar.portfolioBar a').click(function(){
		return false;
		
	});
	
	
	
	
});
