function SetURL()
{
	var path = window.location.pathname;
	
	path = path.substring(0, path.lastIndexOf('/')+1)
	
	return(window.location.protocol+'//'+window.location.host+'/');
}


function RateIt(evt, video, video_type)
{
	var req = new Request.HTML({
		url: SetURL()+'includes/ajax/rate_it.php',
		method: 'post',
		data: {'video' : video, 'video_type' : video_type, 'rate' : GetNr(GetPos(evt).x)},
		update: $('rating_img')
	}).send();
	
	return false;
}


function SetOnline(vid)
{
	var effect = new Fx.Morph('online_'+vid, {duration: 'long', transition: Fx.Transitions.Sine.easeOut});
	
	var req = new Request.HTML({
		url: SetURL()+'includes/ajax/set_online.php',
		method: 'post',
		data: {'vid': vid},
		update: $('online_'+vid),
		onComplete: function() {
			effect.start('a.show_online_over');
		}
	}).send();

	
	//$('online_'+vid).stop();
	
	
	return false;
}

function Tracking()
{
	var req = new Request.HTML({
		url: SetURL()+'includes/ajax/tracking.php',
		method: 'post',
		data : {
			platform: Browser.Platform.name,
			browser_name: Browser.Engine.name,
			browser_version: Browser.Engine.version,
			flash_major: Browser.Plugins.Flash.version,
			flash_minor: Browser.Plugins.Flash.build
		}
	}).send();
}
