function video_content(video_tab) {		// clear divs + loading message	$("#scrolling").html('<p class="very_centered"><img src="/media/loader/load_scrolling.gif" alt="Loading..." /></p>');	$("#video_box").html('<p class="very_centered"><img src="/media/loader/load_video.gif" alt="Loading..." /></p>');	$("#video_details").html('<p class="very_centered"><img src="/media/loader/load_details.gif" alt="Loading..." /></p>');		// hide up arrow	$("#scroll_up").css("visibility", "hidden");		// deactivate tabs	$(".tab").removeClass("active");		// pick a tab	// if not passed, get from a cookie	if (video_tab == undefined) { video_tab = $.cookie('video_tab'); }	// if not in the cookie, default to TGL	if (video_tab == null) { video_tab = 'tomgreen_live'; }		/**	 *	 * Video tab cookie	 *	**/	// set video tab cookie	var date = new Date();	date.setTime(date.getTime()+(60 * 1000)); // 1 minute	$.cookie('video_tab', video_tab, { expires: date });		// if live stream	if (video_tab == 'tomgreen_live') {		$("#video_details").css("height", "189px");	} else if (video_tab == 'deputv') {		$("#video_details").css("height", "189px");		} else if (video_tab == 'faq') {		$("#video_details").css("height", "500px");		} else {		$("#video_details").css("height", "auto");	}		// show video details	show_details(video_tab, '');		show_thumbs($.cookie('pg'), video_tab);			// get video		// for "tomgreen_live" just do this:	if (video_tab == 'tomgreen_live') {		showFlvStream ();		} else {		$.ajax({			type: "POST",			url: "/ajax/content_video.php",			data: "tab="+video_tab,			success: function(response) { populate_video(video_tab, response, ''); }		});	}		$("#"+video_tab).addClass("active");}function showFlvStream() {		/*	// alert ("this is flash stream, but I can't test it, since it crashes my firefox");	// makeVideo("http://bglive-a.bitgravity.com/tomgreen/testing", "http://bitcast-a.bitgravity.com/tomgreen/live/FlowPlayer.swf", "video_box", "664", "400", "native");		var base = "http://bitcast-a.bitgravity.com/tomgreen";		// video stream	var video_stream_url = 'http://bglive-a.bitgravity.com' + video_stream;		var so = new SWFObject (base+"/bitgravity_player.swf", "BitGravityVideoPlayer", "664", "400", "9", "#78B33B");	//so.addVariable ("File", "http://bglive-a.bitgravity.com/tomgreen/testing/native");	so.addVariable ("File", video_stream_url);	so.addVariable ("ScrubMode", "normal");	so.addVariable("AutoSize", "off");	so.addVariable ("DefaultRatio", "0.5625");	so.addVariable ("AutoPlay", "on");	so.addVariable ("LiveMode", "on");	so.addParam("base", base+"/");	so.addParam ("allowFullScreen", "true");	so.addParam ("scale", "noscale");	so.addParam ("salign", "lt");		$("#video_box").html ('<div id="flashcontent"></div>');	so.write ("flashcontent");	*/		// victor/native		if (video_stream == 'unauthorized') {		$("#video_box").html ('<div id="flashcontent"><div id="flashcontent-inner"><a href="/estore/login.php"><img src="/media/player_replacement.jpg" alt="" /></a></div></div>');		return;	}		switch (video_stream) {		case "/tomgreen/victor/native": bgliveKbps = "300"; break;		case "/tomgreen/mobile/native": bgliveKbps = "450"; break;		default: 						bgliveKbps = "600"; break;	}		var flashvars = {};	flashvars.File = "http://bglive-a.bitgravity.com" + video_stream;	flashvars.Mode = "live";	flashvars.ScrubMode = "advanced";	flashvars.StreamGuard = "true";	flashvars.AutoPlay = "true";	flashvars.DefaultRatio = "1.777778";	flashvars.ForceRatio = "false";	flashvars.VideoFit = "stretch";	flashvars.BufferTime = "1.5";	flashvars.AutoBitrate = "disabled";	flashvars.MaxFallBack = "5";	flashvars.LogoPosition = "topleft";	flashvars.ColorBase = "#000000";	flashvars.ColorControl = "#666666";	flashvars.ColorHighlight = "#99FF00";	flashvars.ColorFeature = "#99FF00";		var params = {};	params.base = "http://bitcast-b.bitgravity.com/player/";	params.allowFullScreen = "true";	params.salign = "lt";	params.scale = "noscale"		var attributes = {};	attributes.id = "flash_player_6";		$("#video_box").html ('<div id="flashcontent"><div id="flashcontent-inner"></div></div>');		swfobject.embedSWF(stablerelease, "flashcontent-inner", "640", "380", "9.0.0", "http://bitcast-b.bitgravity.com/player/expressInstall.swf", flashvars, params, attributes);		/*	bgliveAspect = "0.5625"; 	bgliveNode = "bglive-a.bitgravity.com"; 		var bglivePlayer = "bitgravity_player_v4.swf";	var bglivePlayerVersion = "4.87";	var bgliveBase = "http://www.bitgravity.com/players/" + bglivePlayerVersion + "/";	var bglivePlayerBackground = "#78B33B";	var gBitGravityPlayerDefaultOptions =	{		"file"							: "http://" + bgliveNode + video_stream,		"DefaultRatio"					: bgliveAspect,	// "0.56" = 9x16, "0.75" = 3x4 aspect ratio		"TopLevelBitRate"				: bgliveKbps,	// target stream bitrate		"LiveMode"						: "on",		// use live player controls		"ScrubMode"						: "normal",	// standard scrub mode		"LiveButton"					: "try",	// "try" = fast-forward to live in the same stream; "force" = reload the stream		"Thumb"							: "",		// show a JPEG iamge while the live stream is starting		"AutoPlay"						: "on",		// automatically connect and start playing		"FullScreenControlFade"			: "on",		// fade full screen controls away after inactivity		"Buffer"						: "1.5",	// number of seconds to buffer before playing		"InfoOverlay"					: "off",	// debugging info overlay		"DSChecking"					: "on",		// dead stream checking enable/disable		"DSminChecks"					: "5",		// minimum dead stream checks at stream start		"DSbufferingFailsAllowed"		: "5",		// allowed failures while downloading proceeding		"DSnonBufferingFailsAllowed"	: "3",		// allowed failures while downloading stopped		"QL_AutoQuality"				: "off",	// default to single bitrate stream		"StreamResetInterval"			: "3600000",	// milliseconds before reconnect		"StreamResetBufferWait"			: "4000",	// milliseconds before fade from current playing video to new video		"StreamResetFadeDuration"		: "750",	// fade transition duration between current and new video		"StreamResetFadeSteps"			: "15"		// opacity steps within fade duration	};	var so = new SWFObject(bgliveBase + "/" + bglivePlayer, "BitGravityVideoPlayer", 664, 400, "9", bglivePlayerBackground);	for(var key in gBitGravityPlayerDefaultOptions)	{		if(typeof gBitGravityPlayerDefaultOptions[key] != 'function')		{			so.addVariable(key, gBitGravityPlayerDefaultOptions[key]);		}	}	so.addParam("base", bgliveBase);	so.addParam("allowFullScreen", "true");	so.addParam("scale", "noscale");	so.addParam("salign", "lt");	$("#video_box").html ('<div id="flashcontent"></div>');	so.write ("flashcontent");	*/}function show_details (video_tab, vid) {		// if live stream	if (video_tab == 'tomgreen_live') {		$("#video_details").css("height", "189px");	} else if (video_tab == 'deputv') {		$("#video_details").css("height", "189px");		} else if (video_tab == 'faq') {		$("#video_details").css("height", "500px");		} else {		$("#video_details").css("height", "auto");	}		// get video details	$.ajax({		type: "POST",		url: "/ajax/content_details.php",		data: "tab="+video_tab+"&video="+vid,		success: function(response) { populate_details(video_tab, response); }	});}function show_thumbs (page) {		$("#scrolling").html('<p class="very_centered"><img src="/media/loader/load_scrolling.gif" alt="Loading..." /></p>');	video_tab = $.cookie('video_tab');		// get left content	$.ajax({		type: "POST",		url: "/ajax/content_scroller.php",		data: "tab="+video_tab,		success: function(response) { populate_scroller(video_tab, response); }	});		// get total	$.ajax({		type: "POST",		data: "tab="+video_tab,		url: "/ajax/content_total.php",		success: function(response) { 			total = parseInt(response);			show_arrows (total);		}	});	}// show video, if a thumbnail was clicked onfunction show_video (vid, video_tab_requested) {		// show "loading"	$("#video_box").html('<p class="very_centered"><img src="/media/loader/load_video.gif" alt="Loading..." /></p>');		// get video tab	video_tab = $.cookie('video_tab');		// if we are in the live stream section, "redirect" to show archives section	if (video_tab == 'tomgreen_live') {		if (video_tab_requested == undefined) {			video_tab = 'previous_shows';		} else {			video_tab = video_tab_requested;		}				// deactivate "tgl"		$("#tomgreen_live").removeClass("active");		// activate "archive"		$("#" + video_tab).addClass("active");				$("#scrolling").html('<p class="very_centered"><img src="/media/loader/load_scrolling.gif" alt="Loading..." /></p>');		$("#video_details").html('<p class="very_centered"><img src="/media/loader/load_details.gif" alt="Loading..." /></p>');				/**		 *		 * Video tab cookie		 *		**/		var date = new Date();		date.setTime(date.getTime()+(60 * 1000)); // 1 minute		$.cookie('video_tab', video_tab, { expires: date });				show_thumbs(1);	}		// get video	$.ajax({		type: "POST",		url: "/ajax/content_video.php",		data: "tab="+video_tab+"&video="+vid,		success: function(response) { populate_video(video_tab, response, vid); }	});		show_details (video_tab, vid);}function populate_details(video_tab, response) {	$("#video_details").html(response);}function populate_scroller(video_tab, response) {	$("#scrolling").html(response);}function show_arrows (total) {		video_tab = $.cookie('video_tab');			if (video_tab == 'deputv') {		$("#scroll_down").css("visibility", "hidden");	} else {		if (total > 1) {			$("#scroll_down").css("visibility", "visible");		} else {			$("#scroll_down").css("visibility", "hidden");		}	}}function populate_video (video_tab, response, vid) {		$("#video_box").html(response);		if (video_tab == 'tomgreen_live') {		$.ajax({			type: "POST",			url: "/ajax/content_swfobject.php",			data: "tab="+video_tab+"&video="+vid,			success: function(response) { populate_qt (video_tab, response); }		});	}		if (video_tab != 'tomgreen_live' && video_tab != 'deputv') {				$.ajax({			type: "POST",			url: "/ajax/content_swfobject.php",			data: "tab="+video_tab+"&video="+vid,			success: function(response) { populate_swfobject (video_tab, response); }		});	}}function populate_swfobject (video_tab, response) {		if ($("#flashcontent") != undefined) {				// if not passed, get from a cookie		if (video_tab == undefined) { video_tab = $.cookie('video_tab'); }				var video = eval('(' + response + ')');				/*				var so = new SWFObject (video.base+"/bitgravity_player.swf", "BitGravityVideoPlayer", video.width, video.height, "9", video.bgcolor);		so.addVariable ("File", video.file);		so.addVariable ("ScrubMode", "advanced");		so.addVariable ("AutoSize", "on");		so.addVariable ("DefaultRatio", video.ratio);		so.addVariable ("AutoPlay", video.autoplay);		so.addVariable ("FullScreenControlFade", "on");		so.addVariable ("LiveMode", "off");				so.addVariable ("title", video.title);		so.addVariable ("description", video.description);		so.addVariable ("keywords", video.keywords);		so.addVariable ("id", video.id);						so.addParam ("base", video.base+"/");		so.addParam ("allowFullScreen", "true");		so.addParam ("scale", "noscale");		so.addParam ("salign", "lt");		so.useExpressInstall ("/media/expressinstall.swf");				*/				if ($("#flashcontent").attr("id") != undefined) {						$("#flashcontent").html('<div id="flashcontent-inner"><div>');						var flashvars = {};			flashvars.File = video.file;			//flashvars.e = video.expire;			//flashvars.h = video.bghash;			flashvars.Mode = "ondemand";			flashvars.ScrubMode = "advanced";			flashvars.StreamGuard = "true";			flashvars.AutoPlay = video.autoplay;			flashvars.DefaultRatio = video.ratio;			flashvars.ForceRatio = "false";			flashvars.VideoFit = "stretch";			flashvars.BufferTime = "1.5";			flashvars.AutoBitrate = "disabled";			flashvars.Thumbnail = "";			flashvars.PreRoll = "";			flashvars.LogoPNG = "";			flashvars.LogoPosition = "topleft";			flashvars.ColorBase = "#000000";			flashvars.ColorControl = "#666666";			flashvars.ColorHighlight = "#99FF00";			flashvars.ColorFeature = "#99FF00";						var params = {};			params.base = "http://bitcast-a.bitgravity.com/player/";			params.allowFullScreen = "true";			params.salign = "lt";			params.scale = "noscale"			var attributes = {};			attributes.id = "flash_player_6";			swfobject.embedSWF(stablerelease, "flashcontent-inner", "640", "380", "9.0.0", "http://bitcast-b.bitgravity.com/player/expressInstall.swf", flashvars, params, attributes);						// so.write("flashcontent");		}	}}