// JavaScript Document
$(document).ready(function() {
	//scrollpane for video thumbnails
	$('#episodeScroll').jScrollPane({showArrows:true, scrollbarWidth:14, scrollbarMargin:1});
	$('input[@type=radio].star').rating();
	//load the flash video
	$('#videocontainer').flash({
		src: 'video/v3/fplayerIn.swf?theVideo='+fromURLItem,
		width: 700,
		height: 520
	},
	{ version: '9.0.115.0' },
	//{ expressInstall: true },
	function(htmlOptions) {
		//$this = $(this);
		htmlOptions.flashvars.theVideo = fromURLItem; //get the episode
		htmlOptions.flashvars.varDomain = fromURLDomain; //get the episode
		this.innerHTML = '<div>'+this.innerHTML+'</div>';
        var $alt = $(this.firstChild);
        $alt.addClass('alt');
        $(this)
            .addClass('flash-replaced')
            .prepend($.fn.flash.transform(htmlOptions));		
	}
	);
	$('#videocontainerhd').flash({
		src: 'video/v3/fplayerHD.swf?theVideo='+fromURLItem,
		width: 700,
		height: 520
	},
	{ version: '9.0.115.0' },
	//{ expressInstall: true },
	function(htmlOptions) {
		//$this = $(this);
		htmlOptions.flashvars.theVideo = fromURLItem; //get the episode
		htmlOptions.flashvars.varDomain = fromURLDomain; //get the episode
		this.innerHTML = '<div>'+this.innerHTML+'</div>';
        var $alt = $(this.firstChild);
        $alt.addClass('alt');
        $(this)
            .addClass('flash-replaced')
            .prepend($.fn.flash.transform(htmlOptions));		
	}
	);
});

function handlevote(voteValue) {
	//alert(videoID);
	$.ajax({
		type: "POST",
		url: "ajax/submitvote.asp",
		data: "vote="+voteValue+"&videoID="+videoID,
		success: function() {
			$('#voting').empty();
			$('#voting').append("Thanks for voting!");
		}
	});
}