var COOKIE_DOMAIN, SITE_URL, SITE_ID;

$(document).ready(function() {
	$(".bookmark").jFav();

	if (!$.cookie('nats_sess') && !$.cookie('nats')) {
		try {
			var currentNats = document.location.href.match(/(?:\?|&)nats=([^&]+)/);
			if (currentNats && currentNats[1]) {
				currentNats = currentNats[1];
				$('a').each(function() {
					try {
						var natsTest = /(\?|&)nats=/;
						if (!natsTest.test(this.href) && this.href.indexOf('http') == 0 && this.href.indexOf('#') == -1) {
							this.href = this.href + (this.href.indexOf('?') > -1 ? '&' : '?') + 'nats=' + currentNats;
						}
					} catch(e) {}
				});
			}
		} catch(e) {}
	}
});

function playTrailer() {

	// If Flash has not been installed, provide the official flash plugin download link
	if (!swfobject.hasFlashPlayerVersion("10")){
		return false;
	}
	
	$("#porn").css({marginLeft:'100px'});
	$("a.play_480p").addClass("selected");
	$("a.play_720p").removeClass("selected");

	$("a.play_480p").html("Now Watching...  480p");
	$("a.play_720p").html("Watch the HD 720p");

	var id = $("#scene_id").val();
	//var vidfile = $("#video_file").val();
	//var vidinfo =  vidfile.split(".");
	var thumbnail = '';
	var height = 432;

	var player = $("#player");
	player.html("");

	player.flash(
		{
			src: "http://static.brazzers.com/player/wide_tour_player_minBW.swf",
			width: 768,
			height: height + 6,
			wmode: "transparent",
			align: "middlel",
			allowfullscreen:true,
			allowscriptaccess: "always",
			allownetworkaccess: "always",
			flashvars: {
				options: SITE_URL + "/get_scene/" + id + "/autoplay-0/show-info-0"
			}
		},
		{version:"10.0.22"}
	);

	return false;
}

