

OKAZII.zone = function (){

}

OKAZII.zone.show = function (strZone){
	document.getElementById("zone_"+strZone).style.display = '';
}

OKAZII.zone.hide = function (strZone){
	document.getElementById("zone_"+strZone).style.display = 'none';
}

OKAZII.zone.loadSkin = function (strZone){
	
	callbackLoadSkin = function (response){
		if (response.responseText != ''){
			OKAZII.utils.loadCssFile(response.responseText)
		}
	}
	
	var cb = new Array('ZoneController','getSkin');
	var params = new Array();
		params[0] = strZone;
	var rpc = new Array(cb,params);
	new Ajax.Request ('/rpc/', {
		method: 'post',
		onSuccess: callbackLoadSkin,
		onFailure: null,
		parameters: 'rpc='+rpc.toJSON()});
	return false; 
}

OKAZII.zone.loadDatasources = function (strZone){
	callbackLoadDatasources = function (response){
		if (response.responseText != ''){
			eval(response.responseText);
		}
	}
	var cb = new Array('ZoneController', 'getDatasources');
	var params = new Array();
		params[0] = strZone;
	var rpc = new Array(cb,params);
	new Ajax.Request ('/rpc/', {
		method: 'post',
		onSuccess: callbackLoadDatasources,
		onFailure: null,
		parameters: 'rpc='+rpc.toJSON()});
	return true;
}

OKAZII.zone.loadZoneContainer = function (strZone){
	callbackLoadZoneContainer = function (response){
		if (response.responseText != ''){
			document.getElementById('zone_'+strZone).innerHTML = response.responseText;
		}
		OKAZII.zone.loadDatasources(strZone);
	}
	
	var cb = new Array('ZoneController', 'getZoneContainer');
	var params = new Array();
		params[0] = strZone;
	var rpc = new Array(cb,params);
	new Ajax.Request ('/rpc/', {
		method: 'post',
		onSuccess: callbackLoadZoneContainer,
		onFailure: null,
		parameters: 'rpc='+rpc.toJSON()});
	return true;
}

OKAZII.zone.changeTitle = function (strNewTitle, strNewUrl){
	var objElem = document.getElementById('zone_titlu');
	objElem.href=strNewUrl;
	objElem.innerHTML = strNewTitle;
	return true;
}

OKAZII.zone.showBubble = function (strLiId){
	 $j('.li_zone_auction_active').attr('class','li_zone_auction');
	 $j('#'+strLiId).attr('class','li_zone_auction_active');
	 return true;
}

OKAZII.zone.init = function (strZone){
	if (strStaticPath == null) {
		strStaticPath = './';
	}
	//OKAZII.zone.loadSkin(strZone);
	/**
	OKAZII.utils.loadJsFile(strStaticPath + "js/www/zone/common.js");
	OKAZII.utils.loadJsFile(strStaticPath + "js/www/zone/"+strZone+"/load.js");
	*/
	OKAZII.zone.loadZoneContainer(strZone);
}

