Shadowbox.init({
    // skip the automatic setup, we'll do this later manually
    skipSetup: true,
    players: ["img", "html"],
    displayNav: true,
	/*overlayColor:'#fff',*/
	initialHeight: 202,
	initialWidth: 124,
	handleOversize: 'resize',
	overlayColor: '#fff'
});

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

	$("a.playtrailer").click(openHQPics);
	$("a.readmore").click(openSceneInfo);
	$("a.colapsemore").click(colapseSceneInfo);

	playTrailer();
});

//Shadowbox.loadSkin('mofos', '../cdn/tour/js/shadowbox.old/skin/');




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()
{
	if (typeof launchTrailer == 'function')
		return launchTrailer();

			//var thesrc = $("#scene_id").val();
			//options:	'http://mofos.com/tour/videooptions/go_' + thesrc + '/'
	var thesrc = $("#scene_id").val();
	var thumbnail = '';
	var player = $("#videoPlayer");
	 $("#videoPlayer").html("");

	$.get("?action=viewtrailers&guimode=ajax");
	player.flash(
		{
			src: "http://static.brazzers.com/player/wide_tour_player.swf",
			width: 768,
			height: 480,
            wmode: "transparent",
            align: "middle",
			allowfullscreen:true,
			allowscriptaccess: "always",
			allownetworkaccess: "always",
			flashvars: {
					options: "get_scenes2/" + thesrc + "/autoplay-0/show-info-0"
			}
		},
		{version:"10.0.22"}
	);
}
