
function countVideos() {             
    var url =  '/CountVideos' + ';jsessionid=' + jsid; 
    var myAjax = new Ajax.Request( url, 
	    {
            method: 'get', 
		    onSuccess: countVideosCallback
	    });           
}
    
function countVideosCallback(transport) {
    var msg = transport.responseText;
	$("Count_Videos").innerHTML = msg;
}

function newQuery() {
    $("submitButton").disabled = false;
    $("query_index").value = '';
    _setClassValue('query_index','inputQueryIndex');		
}


/******************************************************************************
 * BEGIN  Live Search
 */
function getLiveSearch() {
   	var url = '/LiveSearch;jsessionid=' + jsid  ; 
    var myAjax = new Ajax.Request( url, {
		    method: 'get',
			onSuccess: getLiveSearchCallback
	    });
    setTimeout("getLiveSearch()", 2012000)	 
}

function getLiveSearchCallback(transport) {
	
	var msg = transport.responseText
	if (msg != null)
    	$("Last_Search").innerHTML = msg; 
}
/* END Live Search ***/

// scroll new videos
function scrollNewVideos(offset){
    var url = '/GetNewVideos;jsessionid=' + jsid;
    var pars = "page="+offset+"&mode=index";
	var myAjax = new Ajax.Request( url, {
		method: 'get', 
	    parameters: pars, 
		onSuccess: scrollNewVideosCallback});
}
function scrollNewVideosCallback(transport) { 
	var msg = transport.responseText;	
    $("LastTopTen").innerHTML = msg;
}
