function abreimg(dir,nome,title,alt,largura,altura)
{
	//alert("got called" + dir + nome + titulo ;	
	
	myWindow = window.open("" , "popUpImage" , "width="+largura+" , height="+altura+"");
	html = "<html><head><title>"+ title+ "</title></head>";
	html = html + "<body style='margin-top: 0px ; margin-left: 0px'><span style='border-width:10px;'><img src='"+ dir + nome + "' width='" + largura+ "' height='" +altura+ "' alt='"+alt+"' title='"+alt+"' align='left' hspace='0' vspace='0' style='margin-left: 0px; margin-top: 0px'></span></body></html>";
	myWindow.document.write(html);
}

//e is event object passed from function invocation
function checkEnter(e)
{ 
	//literal character code will be stored in this variable
	var characterCode; 

	//if which property of event object is supported (NN4)
	if(e && e.which)
	{ 
		e = e
		//character code is contained in NN4's which property
		characterCode = e.which 
	}
	else
	{
	e = event
	//character code is contained in IE's keyCode property
	characterCode = e.keyCode
	}

	//if generated character code is equal to ascii 13 (if enter key)
	if(characterCode == 13)
	{ 
		document.forms[0].submit() //submit the form
		return false
	}
	else
	{
	return true
	}
}



function showDetails(td)
{
 	var area = document.getElementById(td);                          	
 	
 	if (area.style.display == 'none')
 	{
 		area.style.display = 'inline';                          		
 	}
 	else
 	{
 		area.style.display = 'none';                          		
 	}
 	
 	var icomais = document.getElementById(td+'_mais');
 	var icomens = document.getElementById(td+'_menos');  
 	
 	if ( icomais.style.display == 'block' )
 	{
 		icomais.style.display = 'none';
 		icomens.style.display = 'block';
 	}
 	else
 	{
 		icomais.style.display = 'block';
 		icomens.style.display = 'none';
 	}
}


/* POP UP WINDOWS para link sugerir site */
var myWindow1;
function open_sug_download()
{
	if ( myWindow1 )
	{
		myWindow1.close();
	}
	myWindow1 = window.open("http://10.0.0.69/welldomus/front/sugerir.php", "tinyWindow1", "width=520, height=361, scrollbars=yes" ); //, 'toolbar,width=150,height=100')

}
var myWindow2;
function show_pag( caminho ){
	if ( myWindow2 ){
		myWindow2.close();
	}
	myWindow2 = window.open(caminho, "tinyWindow2", "width=600, height=500, scrollbars=no" ); //, 'toolbar,width=150,height=100')
}

var myWindow3;
function show_pag2( caminho, height ){
	if ( myWindow3 ){
		myWindow3.close();
	}
	myWindow3 = window.open(caminho, "tinyWindow3", "width=610, height="+height, "scrollbars=no" , "resizable=yes" ); //, 'toolbar,width=150,height=100')
}
/* FIM de POP UP code */

function addFav(){
    var url        = "http://www.welldomus.pt";
    var title    = "WELLDOMUS :: Fitness & Spa Services";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}