
function showTrailer(id, width, height, location, flv_flag, image_name )
{	 
	if (flv_flag == undefined) //default .. using scene id 
	{
		document.getElementById('trailer_pic_' + id).style.visibility = "hidden";	
		document.getElementById('trailer_' + id).innerHTML = "";	
		document.getElementById('trailer_' + id).innerHTML = "<div class=\"main_trailer\" id=\"main_trailer_" + id +"\"><div id=\"porn_" + id + "\"></div></div>";	
		document.getElementById('main_trailer_' + id).style.backgroundColor = "#000000";
		var s1 = new SWFObject(
			"http://static.brazzers.com/embed/flvplayer_test.swf",
			"pornplayer",
			width,
			height,
			"9"
		);		
		s1.addParam("allowfullscreen","true");
		s1.addParam("allowscriptaccess","always");
		s1.addParam("scalemode","showall");
		s1.addVariable("width",width);
		s1.addVariable("height",height);
		s1.addVariable("file", "http://static.brazzers.com/scenes/" + id + "/trailer.flv");
		s1.addVariable("image","http://static.brazzers.com/player/wait.jpg");
		s1.addVariable("captionsScale", 0.3);
		s1.addVariable("backcolor","0xCDCDCD");
		s1.addVariable("autostart", true);
		s1.addVariable("trailer",true);
		s1.write("porn_" + id);
	}
	else	//specified flv 
	{
		document.getElementById('trailer_' + id).innerHTML = "";	
		document.getElementById('trailer_' + id).innerHTML = "<div class=\"main_trailer\" id=\"main_trailer_" + id +"\"><div id=\"porn_" + id + "\"></div></div>";	
		document.getElementById('main_trailer_' + id).style.backgroundColor = "#000000";
		var s1 = new SWFObject(
			"http://static.brazzers.com/embed/flvplayer_test.swf",
			"pornplayer",
			width,
			height,
			"9"
		);		
		s1.addParam("allowfullscreen","true");
		s1.addParam("allowscriptaccess","always");
		s1.addParam("scalemode","showall");
		s1.addVariable("width",width);
		s1.addVariable("height",height);
		s1.addVariable("file", "http://static.brazzers.com/" + location + flv_flag);
		s1.addVariable("image", "http://static.brazzers.com" + location + image_name);
		s1.addVariable("captionsScale", 0.3);
		s1.addVariable("backcolor","0xCDCDCD");
		s1.addVariable("autostart", false);
		s1.addVariable("trailer",true);
		s1.addVariable("overstretch", "fit");
		s1.write("porn_" + id);
	
	}
}

function showTrailer3Mins(id, width, height)
{
	document.getElementById('trailer_pic_' + id).style.visibility = "hidden";	
	document.getElementById('trailer_' + id).innerHTML = "";	
	document.getElementById('trailer_' + id).innerHTML = "<div class=\"main_trailer\" id=\"main_trailer_" + id +"\"><div id=\"porn_" + id + "\"></div></div>";	
	document.getElementById('main_trailer_' + id).style.backgroundColor = "#000000";
	
			var s1 = new SWFObject(
				"http://static.brazzers.com/embed/flvplayer_test.swf",
				"pornplayer",
				width,
				height,
				//parseInt(height) + 20 + "",
				"9"
			);
			
		s1.addParam("allowfullscreen","true");
		s1.addParam("allowscriptaccess","always");
		s1.addParam("scalemode","showall");
		s1.addVariable("width",width);
		s1.addVariable("height",height);
		//s1.addVariable("file", site_url + "/updates/" + folder + "/trailer.flv");
		s1.addVariable("file", "http://static.brazzers.com/scenes/" + id + "/180sec.flv");
		s1.addVariable("image","http://static.brazzers.com/player/wait.jpg");
		//s1.addVariable("image", "img/area/scene/flv_has_preview_bg.jpg")
		s1.addVariable("captionsScale", 0.3);
		//s1.addVariable("usecaptions","false");
		s1.addVariable("backcolor","0xCDCDCD");
		s1.addVariable("autostart", true);
		s1.addVariable("trailer",true);
		//s1.addVariable("overstretch", "fit");
		s1.write("porn_" + id);
}

function showTrailerHover(id, value)
{
	var element = document.getElementById('trailer_hover_' + id);
	element.style.visibility = value;
	/*if(element.style.visibility == "hidden" || element.style.visibility == "")
		element.style.visibility = "visible";
	else
		element.style.visibility = "hidden";*/
}

