//-------------------------------------------------------
// AJAX GET

function getHTMLopinia(myid, act){

	var url = 'includes/dnmc_opinia.php';
	var pars = 'id=' + myid + '&act=' + act;

	new Ajax.Request(url, {method: "get",
	parameters: pars,
	//onLoading:function(){ $(elementID).innerHTML="waiting...";},
	onComplete:function(request){
		if(request.status != 200) {
			$('opinia' + myid).innerHTML="Unavailable."
		}   else {
			$('opinia' + myid).innerHTML=
			request.responseText;}
			if (document.getElementById('opiniaLimit' + myid)) getHTMLkomunikatLimit(myid);
			//document.getElementById('komunikat' + myid).innerHTML ='Dzi¶ już opiniowała¶/łe¶ ten post!';
	}});

}

function getHTMLkomunikatLimit(myid)
{
	var url = 'includes/dnmc_komunikat_limit.php';
	var pars = '';

	var myAjax = new Ajax.Updater(
	'komunikat' + myid,
	url,
	{
		method: 'get',
		parameters: pars
	});
}

function getHTMLopinia2(myid, act)
{
	var url = 'includes/dnmc_opinia.php';
	var pars = 'id=' + myid + '&act=' + act;

	var myAjax = new Ajax.Updater(
	'opinia' + myid,
	url,
	{
		method: 'get',
		parameters: pars
	});
	if (document.getElementById('opiniaLimit' + myid)) document.getElementById('komunikat' + myid).innerHTML ='Dzi¶ już opiniowała¶/łe¶ ten post!';
}

function openCenterWin(url,name,theWidth,theHeight){
	
	var theTop=(screen.height/2)-(theHeight/2);
	var theLeft=(screen.width/2)-(theWidth/2);
	var features='height='+theHeight+',width='+theWidth+',top='+theTop+',left='+theLeft+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no";
	theWin=window.open(url,name,features);
}
