YAHOO.namespace("z3.naptar");

var handleSuccess = function(o){
		if(o.responseText !== undefined){
				var type = o.responseText.split("<!")[0];
				var header = o.responseText.split("<!")[1];
				var text = o.responseText.split("<!")[2];
				
				if (type == "ERROR") {
					document.getElementById('naptar_napok').innerHTML += '<font color="#ff0000"><b>(!)</b></font> ' +text;
				}
				if (type == "OK") {
					document.getElementById('naptar_fejlec').innerHTML = header;
					document.getElementById('naptar_napok').innerHTML = text;
				}
				else {
					
					alert('Az oldal teljes értékű használatához engedélyeznie kell a sütiket (cookie) a böngészőjében!');
				}
		}else {
			
		}
};


var handleFailure = function(o)
{
		if(o.responseText !== undefined){
			document.getElementById('naptar_napok').innerHTML += '<font color="#ff0000"><b>(!)</b> Sikertelen csatlakozas... </font> ';
		}
};


var callback =
{
		success:handleSuccess,
		failure:handleFailure,
		argument:['webid','2313asd32asf22!42']
};



function calRequest(toURL, ctime){
	document.getElementById('naptar_napok').innerHTML = '<div style="width:180px;height:100px;"><center><img src="./html/img/loading.gif"/></center></div>';
	var request = YAHOO.util.Connect.asyncRequest('POST', toURL, callback, '&caltime='+ctime);
}

	
function init() {
		
	
}



YAHOO.util.Event.onDOMReady(init);
