/* 
 *  This file contains all the javascript functions
 */
var SMGObj = new jQuery.noConflict();
var smgPlayer;

 function postMediaAjax(response, status, xhr)
 {
	if (status == "error")
	{
		alert("Sorry but there was an error: "+xhr.status + " " + xhr.statusText);
	}
	else
	{
		//alert(__nextVideoID);
		//smgPlayer.loadVideo(__nextVideoID);
		// FIXME: The player is loading due to the DOMReady event in the returned ajax. I don't know how reliable this is..'
	}
 }

/**
 * Loads another page of media,
 * @param int page Page number to load
 */
function loadList(page) {
    if(page>0)
        SMGObj(".previews").load('mediaList.php','page='+page,postMediaAjax);
}
 
