function openNewWindow(URLtoOpen, windowName, windowFeatures) 
{ 
	newWindow=window.open(URLtoOpen, windowName, windowFeatures); 
}

function donothing()
{

}

function showrateform()
{
	var url='/drivercast/driverrate.php';
	var pars='command=canrate&videoid=' + videoid;
	var CanRateAjax = new Ajax.Updater('ratethis',url, {method:'post',parameters: pars, evalScripts: true});

}

function rateit(e)
{
	
	whichstar = Event.element(e);
	var url = '/drivercast/driverrate.php';
	var pars = 'command=addrating&videoid=' + videoid + '&rating=' + whichstar.name;
	var NewRateAjax = new Ajax.Updater('ratethis', url, {method:'post',parameters: pars, onComplete:bodyLoad});

}

function showratedescription(e)
{
	var descrip = "";
	var whichstar = Event.element(e);
	switch(whichstar.name)
	   {
					case "1":
							descrip	= "Not good at all";
							break;

					case "2":
							descrip ="So So";
							break;

					case "3":
							descrip = "Average";
							break;

					case "4":
							descrip = "Really Good";
							break;

					case "5":
							descrip = "Amazing";
							break;

					default:
						  "Click on a start to rate this video";
							break;
		}
	$('ratinginstruct').innerHTML = descrip;		
}

function bodyLoad()
{
	
	var imagename;
	var someimage;
	

	//load the rating of this video
	var url = '/drivercast/driverrate.php';
	var pars = 'command=getrating&videoid=' + videoid;	
	var currentRateAjax = new Ajax.Updater( 'videorating', url, { method: 'post', parameters: pars }); 
	showrateform();
}

window.onload = bodyLoad;