var $j = jQuery.noConflict();

function showEmbed(id)
{
	if($j.browser.msie)	window.location = 'video.php?id=' + id;
	else
	{
		var el = $j("#embedElem");
		el.load("ajax.php?x=embed&id="+id);
		window.location.hash=id;
	}
};

//$j(function() {
//	var embH = $j("div#embedThumbs").height();
//	var embTh = $j("div#scrollDiv").height() - embH;
//	
//	$j("div#slider-vertical").css("height", embH-10);
//
//	$j("#slider-vertical").slider({
//		animate: true,
//		orientation: "vertical",
//		range: "max",
//		min: 0,
//		max: 100,
//		value: 100,
//		slide: function(event, ui) {
//			$j("div#scrollDiv").css("top",(ui.value-100)*embTh/100+"px");
//		}
//	});
//});

window.onload=function()
{
	if($j.browser.msie)
	{
		$j("#embedThumbs").css('margin-top','20px');
		var el = $j("#scrollbar1");
		var off = el.offset();
		off.top = off.top+20;
		el.offset(off);
	}
	var elA = $j('a.embRel').each(function()
	{
		this.href='#'+this.rel;
		this.onclick = function(){showEmbed(this.rel);return false;};
	});
	(window.location.hash ? showEmbed(window.location.hash.substr(1,3)) : '');
}
