var ajax = new sack();

function startLoadVideoCat(vcatId,catTitle){
	ajax.requestFile = 'ajax/video.ajax.php';	// Specifying which file to get
	ajax.setVar("cat",vcatId);
	ajax.setVar("title",catTitle);
	ajax.setVar("year",'');
	ajax.setVar("month",'');
	
		
	ajax.onLoading = printVideoLoading;
	ajax.onInteractive = printVideoLoading;
	ajax.onCompletion = printVideoCategoryList;	// Specify function that will be executed after file has been found
	ajax.runAJAX();		
}

function startLoadVideoYear(year){
	ajax.requestFile = 'ajax/video.ajax.php';	// Specifying which file to get
	ajax.setVar("year",year);
	ajax.setVar("month",'');
	ajax.setVar("cat",'');
		
	ajax.onLoading = printVideoLoading;
	ajax.onInteractive = printVideoLoading;
	ajax.onCompletion = printVideoCategoryList;	// Specify function that will be executed after file has been found
	ajax.runAJAX();		
}

function startLoadVideoMonth(month, year){
	ajax.requestFile = 'ajax/video.ajax.php';	// Specifying which file to get
	ajax.setVar("cat",'');
	ajax.setVar("month",month);
	ajax.setVar("year",year);
		
	ajax.onLoading = printVideoLoading;
	ajax.onInteractive = printVideoLoading;
	ajax.onCompletion = printVideoCategoryList;	// Specify function that will be executed after file has been found
	ajax.runAJAX();		
}


function printVideoLoading(){
	var obj = document.getElementById('videoContainer');
	obj.innerHTML='<img class="ajaxLoading" src="images/ajax-loader.gif" >';
}

function printVideoCategoryList(){
	var obj = document.getElementById('videoContainer');
	obj.innerHTML = ajax.response;
}
