// Jquery Ideal-Home Script

$(document).ready(function() {
						   
/*  var test = self.document.location.hash.substring(1);
						   
if (test == 'wildcard') {
   $.ajax({
   type: "POST",
   url: "/_ideal-home-splash.php",
   data: test,
   success: function(data){
     $('#ideal-home-splash').html(data);
	 $('#ideal-home-splash').fadeIn('slow');
   }
 });
} */

$('#front_render').animate({
	opacity: 'show',
    marginTop: "100px"
	}, 1000, function() {
	$('#logo_main').fadeIn(800);	
    $('#logo_ideal_home').fadeIn(800, function() {
			$('#inside_render').fadeIn(800);		
		});
	});
$('#inside_render').live('click', function() {
var setAnimation = $('#inside_render').attr('title');

	if(setAnimation == 'clicked') {
			$('.entry').slideUp("slow", function() { 
				$('#photos').slideDown('slow');
				});
			$('.view_more_photos').fadeOut('fast');
			$('.view_story').fadeIn('slow');
	$('#inside_render').attr('title', 'notClicked');
	}else {
		$('#photos').slideUp("slow", function() { 
		$('.entry').slideDown('slow');
		});
		$('.view_story').fadeOut('fast');
		$('.view_more_photos').fadeIn('slow');
		$('#inside_render').attr('title', 'clicked');
		}
	});
$('.gallery_img').click(function () {
	var image = $(this).attr('src');							  
		 $.ajax({
   			type: "POST",
   			url: "/_Ideal_Home_image.php",
   			data: 'image=' + image + '',
   			success: function(data){
				$('#ideal-home-image').fadeOut('slow', function () {
     			$('#ideal-home-image').html(data);
	 			$('#ideal-home-image').fadeIn('slow');
				});
   			}
 		});
	});
$(".button").live("click", function() {
	var image_num = $(this).attr('id');
	var image_link = '/Ideal-Home/2010/images/update/' + image_num + '.jpg';
		$.ajax({
   			type: "POST",
   			url: "/_Ideal_Home_image.php",
   			data: 'image=' + image_link + '',
   			success: function(data){
				$('#ideal-home-image').fadeOut('slow', function () {
     			$('#ideal-home-image').html(data);
	 			$('#ideal-home-image').fadeIn('slow');
				});
   			}
 		});						  
	});
});
