$(function() {

	// for the homepage port gallery

	
	$('ul#work_samples li a').hover(
		function() {
			$(this).children('img').css ({ 'z-index' : '3000' });
			$(this).parent().css({ 'z-index' : '2999' });
			$(this).children('img').stop().animate({ width : '114px', height : '114px', top : '-50%', left : '-50%' }, 200);
		},
		function() {
			$(this).children('img').css ({ 'z-index' : '0' });
			$(this).parent().css({ 'z-index' : '0' });
			$(this).children('img').stop().animate({ width : '50px', height : '50px', top : '0px', left : '0px' }, 200);
	});

	$('ul#work_samples li a').click(function() { 
			var id = $(this).attr("id");
		    $('div#right_header_home').load('includes/homepage_work.php?id='+id);
			return false;
	});
       
    // for the Newsletter 
    $('p#news').click(function() {
		$('div#news_content').slideToggle();	
    	return false;
    });
	
	var get_issue = $('body').attr("id");
	if (get_issue !== '') {
		
		$('body').append('<div class="overlay"></div>');
		$('.overlay').animate({ opacity : .70 }).fadeIn();
		
		$('body').append('<div class="container"><img src="/images/email1_2010.jpg" /></div>');
		$('.container').fadeIn();
		
		$('body').click(function() {
			$('.overlay').fadeOut();
			$('.container').remove();
		});
	}
    
	$('a.issue').click(function() {
	
		var issue = $(this).attr('href');
	
		$('body').append('<div class="overlay"></div>');
		$('.overlay').animate({ opacity : .70 }).fadeIn();
		
		$('body').append('<div class="container"><img src="'+issue+'" /></div>');
		$('.container').fadeIn();
		
		$('body').click(function() {
			$('.overlay').fadeOut();
			$('.container').remove();
			
		});
		
		return false;
	});
    
});
