$(document).ready(function(){
	$("a").hover(
		function(){
			$(this).children("img").addClass('hover');
		},
		function(){
			$(this).children("img").removeClass('hover');
		}
	);
        $('#btn_reel_talk').click(function(){
             $('#reel_talk').slideDown("fast");
             $('#btn_reel_talk').hide();
             $('#reel_warning').hide();
             return false; 
        });
	$("a").hover(
		function(){
			$(this).children("img").fadeTo(150, 0.7);
		},
		function(){
			$(this).children("img").fadeTo(150, 1);
		}
	);

        $('.trailer').click(function(){
            h = $(window).height();
            w = $(window).width();
            id = $(this).attr('href');
            id = id.replace('http://','');
            embed_code = '<object width="515" height="254"><param name="movie" value="http://www.traileraddict.com/emb/'+id+'"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="transparent"></param><embed src="http://www.traileraddict.com/emb/'+id+'" type="application/x-shockwave-flash" allowscriptaccess="always" wmode="transparent" width="515" height="254"></embed></object>';
            $('#dimmer').css('height',h).css('width',w).show();
            $('#trailer').css('top', '100px');
            $('#trailer').css('left', w/2-$('#trailer').width()/2);
            $('#trailer_movie').html(embed_code);
            $('#trailer').show();
            return false;
        });

        $('#btn_close_viewer').click(function(){
            $('#trailer').hide();
            $('#dimmer').hide();
            return false;
        });

        $('#dimmer').click(function(){
            $('#trailer').hide();
            $(this).hide();
            return false;
        });


});