$(document).ready(function(){
			
	$("a.playtrailer").click(openTrailer);
	$("a.readmore").click(openSceneInfo);
	$("a.colapsemore").click(colapseSceneInfo);
	
	Shadowbox.init({	
		overlayColor:'#fff',
		initialHeight: 202,
		initialWidth: 124
	});   

});

Shadowbox.loadSkin('mofos', '../cdn/tour/js/shadowbox/skin/');
Shadowbox.loadLanguage('en', '../cdn/tour/js/shadowbox/lang/'); // use the English language
Shadowbox.loadPlayer(['img', 'html'], '../cdn/tour/js/shadowbox/player/'); // use img and qt players




function openSceneInfo()
{
	$(".show_more, .rating_box").fadeOut("fast");	
	$(".more_info").slideDown("fast", function(){$(this).css("display", "inline");});
	$(".colapsemore").fadeIn("fast");
}


function colapseSceneInfo()
{
	$(".more_info").slideUp("fast");
	$(".show_more, .rating_box").fadeIn("fast");		
	$(".colapsemore").fadeOut("fast");	
}

function openTrailer()
{
	$(this).unbind('click');
		$(".hqpics").fadeOut("fast");
        $(".player").show();
		/*$(".player").fadeIn("fast", function(){
			$(this).find("img").click(playTrailer);	*/
			playTrailer();
		/*});*/
				
		
		$(this).unbind("click").html("See HQPics").click(openHQPics);
		return false;
}


function openHQPics()
{	
	$("#videoPlayer").html("");
	$(".hqpics").fadeIn("fast");
    $(".player").fadeOut("fast");           
	$(this).unbind("click").html("View Trailer").click(openTrailer);
	return false;
}



function playTrailer()
{
	var thesrc = $("#scene_id").val();
	var thumbnail = '';	
	var player = $("#videoPlayer");
	 $("#videoPlayer").html("");
	
	$.get("?action=viewtrailers&guimode=ajax");
	player.flash(
		{
			src: "player/player.swf",
			width: 630, 
			height: 480,
            wmode: "transparent",
            align: "middlel",
			allowfullscreen:true,			
			allowscriptaccess: "always",
			allownetworkaccess: "always",			
			flashvars: {
				options:	'http://mofos.com/tour/videooptions/go_' + thesrc + '/'
			}			
		},
		{version:"9.0.115.0"}	
	);
}
