function sendCtcForm()
{
	$('#loading').css('visibility', 'visible');
	pars = 'XHR=1&';
	pars = pars + $('input[@type=text]').serialize();
	pars = pars +'&msg='+document.getElementById('msg').value;
	$.post('index.php?view=enviaContacto', pars, function(resposta)
													{
														xml = resposta.documentElement;
														ctcStatus = $('status', xml).text();
														ctcError = $('error', xml).text();
														$('#loading').css('visibility', 'hidden');
														if (ctcStatus != 0)
														{
															alert(ctcError);
														}
														else
														{
															document.getElementById('frmContactos').reset();
															alert(ctcError);
														}
														return false;
													}
	);
	return false;
}

function getNewsPage(p)
{
	$('#newsNav').css('background-image', 'url(img/all/loading2.gif)');
	$.post('index.php?view=noticias&p='+p+'&isXHR=1', function(resposta)
														{
															$('#newsToc').html(resposta);
															$('#newsNav').css('background-image', 'none');
															if ($.browser.msie)
															{
																$('#footer').css('display', 'none');
																$('#footer').css('display', 'block');
															}
															return false;
														}
	);
	return false;
}

function showNews(nid, p)
{
	$('#newsDtl').html('');
	$('#newsDtl').css('background-image', 'url(img/all/loading2.gif)');
	$.post('index.php?isXHR=1&view=noticias&p='+p+'&noticia='+nid, function(resposta)
																	{
																		$('#newsDtl').html(resposta);
																		$('#newsDtl').css('background-image', 'none');
																		return false;
																	}
	);
	return false;
}

function findLeftPos(obj)
{
	var curleft = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
		}
	}
	return curleft;
}

function mnuRollover(el)
{
	elId = el.id;
	elId = elId.slice(6, 7);
	img = document.createElement('img');
	document.body.appendChild(img);
	
	xPos = findLeftPos(el);
	
	img.setAttribute('id', 'imgOver'+elId);
	if (!$.browser.msie)
	{
		img.setAttribute('style', 'position: absolute; top: 370px; left: '+xPos+'px;');
	}
	if ($.browser.msie)
	{
		img.style.top = '370px';
		img.style.left = xPos+'px';
		img.style.position = 'absolute';
	}
	img.setAttribute('src', 'galeria/categorias/'+elId+'.jpg');
}
function mnuRollout(el)
{
	elId = el.id;
	elId = elId.slice(6, 7);
	img = document.getElementById('imgOver'+elId);
	document.body.removeChild(img);
}