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://ladysfit.pt";
    var title    = "LADY'S FIT";
    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);}
}

function switchMenu(){
	var menu 	= document.getElementById('menu');
	var	gestao 	= document.getElementById('menugestao');
	
	if (menu.style.display == 'block')
		menu.style.display = 'none';
	else
		menu.style.display = 'block';
	
	if (gestao.style.display == 'block')
		gestao.style.display = 'none';
	else
		gestao.style.display = 'block';		
}

function MM_findObj(n , d) 
{ //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function setColor(objName,bg)
{
	obj = MM_findObj(objName);
	if (obj.style)
	{
		obj.style.backgroundColor = bg;
	}
}



function MM_reloadPage(init) 
{  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function setColor(objName,bg)
{
	obj = MM_findObj(objName);
	if (obj.style)
	{
		obj.style.backgroundColor = bg;
	}
}