
function rate(uid,rating,onCompleteFunction) {

	new Ajax.Request('/php/api/Movie.rate.php', {method:'get',parameters:'auth='+auth+'&uid='+uid+'&rating='+rating,asynchronous:true,onSuccess:onCompleteFunction});
	

}

 

function fave(uid,onCompleteFunction) {
	new Ajax.Request('/php/api/Movie.fave.php', {method:'get',parameters:'auth='+auth+'&uid='+curruid,asynchronous:true,onSuccess:onCompleteFunction});
}
function unfave(uid,onCompleteFunction) {
	new Ajax.Request('/php/api/Movie.unfave.php', {method:'get',parameters:'auth='+auth+'&uid='+curruid,asynchronous:true,onSuccess:onCompleteFunction});
}

 
function return_dir(uid) {
	return(uid.substr(0,3)+"/"+uid.substr(3,3)+"/"+uid);
}

function deleteMovie(uid) {
	
	new Ajax.Request('/php/api/Media.delete.php', {method:'get',parameters:'uid='+uid,asynchronous:true,onSuccess:deleteComplete});
	
	 
}

function deleteComplete(response) {

}

function openPopup(url,name,width,height,opt_show_scrollbars) {
	var scrollbar_param=opt_show_scrollbars?",scrollbars=1":"";
	var newwindow=window.open(url,name,'height='+height+',width='+width+scrollbar_param);
	if(newwindow&&!newwindow.opener){newwindow.opener=window;}
	if(window.focus){newwindow.focus()}
	return false;
}

function postToFacebook(url,title) {
	openPopup('http://www.facebook.com/sharer.php?u='+url, title, 440, 620, true);
}
