$(document).ready( function () {	
Shadowbox.init();


////////// INTRO //////////////////////

$("#footer").show(500,function (){
$("#newsletter").show(500,function (){
$("#infos").show(500,function (){
$("#news").show(500,function (){
$("#logo_footer").show(500,function (){
$("#bt_photography").fadeIn(500,function (){
$("#bt_drawings").fadeIn(700,function (){
});});
});
});
});
});
});



////////// NEWS //////////////////////

$("#news_ticker").newsticker();
		$(".readmore").click(function () {
		$('#news2').load('include/get_news.php?id='+ this.id,function(){
		$('#news').hide(500,function(){
		$('#news2').show(500);
		//$("#footer").animate({bottom: "10%"}, 500)
		;});
		}); 
		return false
		}); 

		
	 $("#close").livequery('click', function(event) {
	$("#news2").hide(500,function () {
	$('#news').show(500);
			//$("#footer").animate({bottom: "48%"}, 500)

}); 
	return false;
}); 


 $("#close_about").livequery('click', function(event) {
	$("#hidden_content").hide(500,function () {
	$('#news').show(500);
			//$("#footer").animate({bottom: "48%"}, 500)

}); 
	return false;
}); 

 $("#close_links").livequery('click', function(event) {
	$("#hidden_content").hide(500,function () {
	$('#news').show(500);
			//$("#footer").animate({bottom: "48%"}, 500)

}); 
	return false;
}); 

////////// ENTRANCE //////////////////////

		$("#bt_photography").livequery('click', function(event) {
				$("#footer").animate({marginTop: "-400px"},"slow","easeInOutQuad").hide(50,function () {
			//	if ($("body").hasClass("bodybg"))
			//	$("body").removeClass("bodybg");
				//$("body").addClass("nobg");
						$("#container").fadeOut("fast",function(){
		$("#container").css({backgroundImage: 'none'});
		$("#container").fadeIn("fast",function(){

	    $("#bgimage").fadeOut("fast");
	    $("body").animate({backgroundColor: '#000000'},"slow",function(){
		$("#menu_photography").load('include/menu_photography.php',function(){
		$(this).slideDown("slow");
		$("#navigation_works1").fadeIn(500,"easeInOutQuad");
		$('#main_content_black').load('include/thumbnail_photography.php?category=7',function(){
		$('#main_content_black').fadeIn(500);


		});});});});});}); return false
		}); 


      

$("#bt_drawings").livequery('click', function(event) {
				$("#footer").animate({marginTop: '500px'},"slow","easeInOutQuad").hide(50,function () {

		//$("#container").css({ width:"960px"});
		//$("#content").css({ width:"960px"});

			//	if ($("body").hasClass("nobg"))
			//	$("body").removeClass("nobg");
			//	$("body").addClass("bodybg");
		$("#container").fadeOut("fast",function(){
		$("#container").css({backgroundImage: 'none'});
		$("#container").fadeIn("fast",function(){
		$("#bgimage").fadeIn("slow");
	    $("body").animate({backgroundColor: '#ffffff'},"slow",function(){
		$("#menu_drawings").load('include/menu_drawings.php',function(){
		$("#shoppingcart2").slideDown(500,"easeInOutQuad");
		$(this).fadeIn("slow",function(){

		$("#navigation_works2").fadeIn(500,function(){
        $('#main_content').load('include/thumbnail_drawings.php?category=8');
		$('#main_content').fadeIn(500);
// First Parameter: number of items
	// Second Parameter: options object
	

		});});});});});});}); return false
		}); 



//-------------------------------------------//
$('a.pages')
    .livequery(function(){ 
    // use the helper function hover to bind a mouseover and mouseout event 
        $(this) 
            .hover(function() { 
				 $(this).animate({opacity: 0.01},"slow");
            }, 
			
			function() {
				if (!$(this).hasClass('selected'))
				 $(this).animate({opacity: 1},"slow");
            }); 
    }, function() { 
        // unbind the mouseover and mouseout events 
        $(this) 
            .unbind('mouseover') 
            .unbind('mouseout'); 
    }); 


$('a.menu1')
    .livequery(function(){ 
    // use the helper function hover to bind a mouseover and mouseout event 
        $(this) 
            .hover(function() { 
				 $(this).animate({opacity: 0.01},"slow");
            }, 
			
			function() {
				if (!$(this).hasClass('selected'))
				 $(this).animate({opacity: 1},"slow");
            }); 
    }, function() { 
        // unbind the mouseover and mouseout events 
        $(this) 
            .unbind('mouseover') 
            .unbind('mouseout'); 
    }); 
	
	$('a.menu1').livequery('click', function(event) { 
				 $('a.menu1').removeClass('selected');
				 $('a.menu1').animate({opacity: 1},"fast")
				$(this).animate({opacity: 0.01},100);
				$(this).addClass('selected');

				 		return false

    }); 




$('a.menu2')
    .livequery(function(){ 
    // use the helper function hover to bind a mouseover and mouseout event 
        $(this) 
            .hover(function() { 
			 $(this).animate({opacity: 0.01},"slow");
            }, 
			
			function() {
				if (!$(this).hasClass('selected'))
				 $(this).animate({opacity: 1},"slow");
            }); 
    }, function() { 
        // unbind the mouseover and mouseout events 
        $(this) 
            .unbind('mouseover') 
            .unbind('mouseout'); 
    }); 
	
	$('a.menu2').livequery('click', function(event) { 
				 $('a.menu2').removeClass('selected');
				  $('a.menu2').animate({opacity: 1},"fast")
				$(this).animate({opacity: 0.01},100);
				 $(this).addClass('selected');

				 		return false

    }); 


		$("#bt_about").livequery('click', function(event) {
		$("#main_content").fadeOut(500,function () {
		 $('#contactdiv').fadeOut("fast");
		$("#main_content_black").fadeOut(500,function () {
		$('#main_content').load('include/about.php?page_title=About',function(){
		$('#main_content').fadeIn(500);});});});
		return false
		});
		$("#bt_about2").livequery('click', function(event) {
		$("#main_content_black").fadeOut(500,function () {
		$('#contactdiv').fadeOut("fast");
		$("#main_content").fadeOut();
		$('#main_content_black').load('include/about.php?page_title=About',function(){
		//$("#menu_drawings").css({position:"relative"})
		$('#main_content_black').fadeIn(500);});});
		return false
		}); 
		
		$("#bt_about_photography").livequery('click', function(event) {
		$("#main_content_black").fadeOut(500,function () {
		$("#main_content").fadeOut();
		$('#main_content_black').load('include/about.php?page_title=About',function(){
		//$("#menu_drawings").css({position:"relative"})
		$('#main_content_black').fadeIn(500);});});
		return false
		}); 
		
		
		$("#bt_links").livequery('click', function(event) {
		$("#main_content").fadeOut(500,function () {
		$('#contactdiv').fadeOut("fast");
		$("#main_content_black").fadeOut();
		$('#main_content').load('include/links.php',function(){
		$('#main_content').fadeIn(500);});});
		return false
		}); 
		
		
		
		$("#bt_contact").livequery('click', function(event) {
		$("#main_content").fadeOut(500,function () {
		$("#main_content_black").fadeOut();
				if ($("#contactdiv").hasClass("contactdivblack"))
		$("#contactdiv").removeClass("contactdivblack");
		$('#contactdiv').fadeIn("slow");});
		return false
		}); 
		
		$("#bt_links2").livequery('click', function(event) {
		$("#main_content_black").fadeOut(500,function () {
		 $('#contactdiv').fadeOut("fast");
		$("#main_content").fadeOut();
		$('#main_content_black').load('include/links.php',function(){
		$('#main_content_black').fadeIn(500);});});
		return false
		}); 
		
		
		
		$("#bt_contact2").livequery('click', function(event) {
		$("#main_content_black").fadeOut(500,function () {
		$('#contactdiv').addClass('contactdivblack');											   
		$("#main_content").fadeOut();
		$('#contactdiv').fadeIn("slow");});
		return false
		}); 
		
		$("#bt_shop_white").livequery('click', function(event) {
		$("#main_content").fadeOut(500,function () {
		$('#contactdiv').fadeOut("fast");
		$("#main_content_black").fadeOut(500,function () {
		$('#main_content').load('include/shop.php',function(){
		$('#main_content').fadeIn(500);});});});
		return false
		}); 
		
		$("#bt_shop_black").livequery('click', function(event) {
		$("#main_content_black").fadeOut(500,function () {
		$('#contactdiv').fadeOut("fast");
		$("#main_content").fadeOut(500,function () {
		$('#main_content_black').load('include/shop_black.php',function(){
		$('#main_content_black').fadeIn(500);});});});
		return false
		}); 
		
		




		//	$(".pages").click(function () {
		//$(".pages").removeClass("current");
		//	$(this).addClass("current");
		//$('#hidden_content').hide(200);
		//$('#hidden_content').load('include/about.php?page_id='+ this.id,function(){
		//$("#news").hide("fast",function(){
		//$('#hidden_content').hide(200,function(){ $(this).show(500);
		//});});});
		//return false
		//}); 
		
		


}); 

