dojo.require("dojo.io.*");
dojo.require("dojo.event.*");
djConfig.isDebug=1;
//var site_url = 'http://www.derana.com.au';
var site_url = '';

/******************************************************************************/
/*
 * Function 
 * @param   
 * @param   
 */
function getVideo(category, video_id){
	dojo.io.bind({
	url: site_url+'/slau_ajax_services/get_video/'+category+'/'+video_id, 
	load: function(type, data, http) {
		commonCallback(type, data, http);
    }
	});
}
/******************************************************************************/
/*
 * Function 
 * @param   
 * @param   
 */
function getTeledramaVideo(video_id){
	dojo.io.bind({
	url: site_url+'/slau_ajax_services/get_teledrama_video/'+video_id, 
	load: function(type, data, http) {
		commonCallback(type, data, http);
    }
	});
}
/******************************************************************************/
/*
 * Function 
 * @param   
 * @param   
 */
function getYoutubeVideo(video_id){
	dojo.io.bind({
	url: '/slau_ajax_services/get_youtube_video/'+video_id, 
	load: function(type, data, http) {
		commonCallback(type, data, http);
    }
	});
}
/******************************************************************************/
/*
 * Function 
 * @param   
 * @param   
 */
function checkNickname(nickname){
	dojo.io.bind({
	url: site_url+'/slau_ajax_services/get_nickname/'+nickname, 
	load: function(type, data, http) {
		nonHtmlCallback(type, data, http);
    }
	});
}
/******************************************************************************/
/*
 * Function :: videoCallback()
 * @param   
 * @param   
 */
function commonCallback(type, data, http){
	if (type == 'error')
		;//alert('Error when retrieving data from the server!');
	else {
		document.getElementById('video_container').innerHTML = data;
	
	}
}
/******************************************************************************/
/*
 * Function :: videoCallback()
 * @param   
 * @param   
 */
function nonHtmlCallback(type, data, http){
	if (type == 'error') {
		alert('Error when retrieving data from the server!');
	}
	else {
		document.getElementById('nickname2').value = data;
	
	}
}
/******************************************************************************/
/*
 * Function :: videoCallback()
 * @param   
 * @param   
 */
String.prototype.trim = function() {
	a = this.replace(/^\s+/, '');
	a.replace(/\s+$/, '');
	a.replace(/\n/, '');
	return a;
};
/******************************************************************************/
/*
 * Function :: videoCallback()
 * @param   
 * @param   
 */
/******************************************************************************/
function dummy() {
	//getDbTime();
	//getCurrentAuctions('','');
	//StartClock();
	//KeyPress();
}

/******************************************************************************/
//document.onkeypress = stopRKey; 
dojo.addOnLoad(dummy);
//map_initialize(from_to);
/******************************************************************************/
