function showMenuV( id )
	{
		layers = new Array('subCarr');
		if (document.getElementById( id ).style.display=='block')
			flag = true
		else 
			flag = false
		
		for(i=0;i<layers.length;i++)
			{
			document.getElementById( layers[i] ).style.display = 'none';
			document.getElementById( layers[i]+'2' ).style.backgroundPosition='';
			}
		if (!flag)
			{
			document.getElementById( id ).style.display='block';
			document.getElementById( id+'2' ).style.backgroundPosition='right';
			}
			else 
			document.getElementById( id+'2' ).style.backgroundPosition='';
	}


function checaMensagem(ok)
{
	if (ok == '1')
		alert('Mensagem enviada com sucesso.')
	else if (ok == '0')
		alert('Occorreu um erro no envio da mensagem.')
}


function ampliar(x,y) {
	window.open('ampliar.php','','resizable=no, statusbar=no');	
}


// wallpaper
function closeAmp() {
window.close();
}

function closeErro() {
window.close();
}


function popFoto(url,x,y) {
	window.open(url,'','width='+x+', height='+y+',resizable=no, status=no, scrollbars=no');
}
//


/* 
function showMenuV( id )
	{
		layers = new Array('subCarr','subBiog','subImpr','subMult');
		if (document.getElementById( id ).style.display=='block')
			flag = true
		else 
			flag = false
		
		for(i=0;i<layers.length;i++)
		{
				document.getElementById( id ).style.display = 'none';
		}
		if (!flag)
			{
			document.getElementById( id ).style.display='block';
			document.getElementById( id+'2' ).style.backgroundPosition='right';
			}
			else 
			document.getElementById( id+'2' ).style.backgroundPosition='';
	}
*/



function favoritos() {
title = "Rita Guedes - Site oficial";
url = "http://www.ritaguedes.com";
if (window.sidebar) { // Mozilla Firefox Bookmark
window.sidebar.addPanel(title, url,"");
} else if( window.external ) { // IE Favorite
window.external.AddFavorite( url, title);
} else if(window.opera && window.print) { // Opera Hotlist
return true;
}
}

function addToNewsletter() {
	var url = '/newsletter/index.php';
	var vSerial = $('frmNewsletter').serialize()

	new Ajax.Request(url, {
		method: 'get',
		parameters: vSerial,
		onSuccess: function(transport) {
			switch (transport.responseText) {
				case "OK":
					alert("Email incluído com sucesso");
					break;
				case "EXISTS":
					alert("Email já cadastrado");
					break;
				case "ERROR":
					alert("Email não foi incluído na newsletter\nFavor entrar em contato.");
					break;
			} // end :: switch
		} // end :: function

	}); // end :: ajaxRequest
}



function loader(action) {
	obj = $('loadFotos')
	if (loader == 'start') {
		obj.style.display = 'none';
	} else {
		obj.style.display = 'block';
		destroyElement('load');
	}
}

function destroyElement(id) {
    elm = document.getElementById(id)
    elm.parentNode.removeChild(elm)
}

