<!--
function SubmitAndRun(parRedirectOk,parRedirectNo,parType) {
	frmLogin.txtRedirectOk.value = parRedirectOk;
	frmLogin.txtRedirectNo.value = parRedirectNo;
	frmLogin.txtType.value = parType;
    frmLogin.submit();
}

function checkSubmitAndRun(parRedirectOk,parRedirectNo,parType) {
	if (window.event.keyCode == 13) {
		// Enter key is pressed
		frmLogin.txtRedirectOk.value = parRedirectOk
		frmLogin.txtRedirectNo.value = parRedirectNo
		frmLogin.txtType.value = parType
                frmLogin.submit()
	} else {
		// Other than  enter key pressed
		window.event.cancelBubble = true;
	       }
}
	
function doOK() 
	{    
		if (userName.value.length > 0)
		{
			if (userPwd.value.length > 0)   
			{      
				window.returnValue = userName.value + "!" + userPwd.value;
				window.close();
			} else {
				alert("Utilizador ou Password Inválida");
				userPwd.focus();
			}
		} else {
			alert("Utilizador ou Password Inválida");
			userName.focus();
		}
			
		return true;   
}

<!--
var navegar = true;
browserVer = parseInt(navigator.appVersion);
if (browserVer < 3) {navegar = false;}
{if (navegar)
{

bot1on=new Image();bot1on.src="images/bot-on.gif";
bot1off=new Image();bot1off.src="images/bot-off.gif";

bot2on=new Image();bot2on.src="images/bot-on.gif";
bot2off=new Image();bot2off.src="images/bot-off.gif";

bot3on=new Image();bot3on.src="images/bot-on.gif";
bot3off=new Image();bot3off.src="images/bot-off.gif";

bot4on=new Image();bot4on.src="images/bot-on.gif";
bot4off=new Image();bot4off.src="images/bot-off.gif";

bot5on=new Image();bot5on.src="images/bot-on.gif";
bot5off=new Image();bot5off.src="images/bot-off.gif";

}}

function ON_img (imgName){
        if (navegar){
                document[imgName].src = eval(imgName + "on.src");
}}
function OFF_img (imgName){
        if (navegar){
                document[imgName].src = eval(imgName + "off.src");
}}

// *** OnMouseOver text ***
var description = new Array();
description[0] = "";
description[1] = "Localização";
description[2] = "Bolsa de Emprego";
description[3] = "Contactos";
description[4] = "Página Principal";



// *** loginWindow ***
function loginWindow(parSkin,parRedirectNo,parRedirectOk,parType)
{
	var SHeight, SWidth;
	sHeight = screen.height;
	sWidth = screen.width
	var boxWidth, boxHeight, boxLeft, boxTop;
	boxWidth = 350;
	boxHeight = 160;
	boxLeft = (screen.width - boxWidth) / 2;
	boxTop = (screen.height - boxHeight) / 2;

    optionString = "dialogWidth:" + boxWidth + "px;dialogHeight:" + boxHeight + "px;dialogLeft:" + boxLeft + "px;dialogTop:" + boxTop + "px;status: No;"
	var vReturnValue = window.showModalDialog(parSkin,"",optionString);
	if (typeof(vReturnValue) != "undefined")
	{ 
		if (vReturnValue != "out") {
			frmLogin.txtuIDuPWD.value =  vReturnValue;
			frmLogin.txtRedirectOk.value =  parRedirectOk;
			frmLogin.txtRedirectNo.value =  parRedirectNo;
			frmLogin.txtType.value =  parType;						
			frmLogin.submit();
			return true;
		} else {
		    window.close
		}		
	} else {
		window.close
	}
}

// *** POP-UP ***

    var optionString,mainWin;
    function dialogpopper(thisUrl,thisWidth,thisHeight,thisTop,thisLeft)
    {
    optionString = ('dialogWidth:' + thisWidth + ';dialogHeight:' + thisHeight + ';status:no');
    mainWin = showModalDialog(thisUrl,"",optionString);
    }
 
    function NewWindow(mypage, myname, w, h, scroll) {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no,location=no'
    win = window.open(mypage, myname, winprops)
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
    }

//-->

// *** ***
function CaricaFoto(img,tit){	
	
  foto1= new Image();
  foto1.src=(img);
  Controlla(img,tit);
}
function Controlla(img,tit){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img,tit);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewFoto(img,tit){
  largh=foto1.width+20;
  altez=foto1.height+20;
  stringa="width="+largh+",height="+altez;
  finestra=window.open("","",stringa);
  finestra.document.write("<head><title>"+tit+"</title><body bgcolor='#ffffff' topmargin='10'><div align='center' valign='middle'><img src='");
  finestra.document.write(img);
  finestra.document.write("' border='0' bordercolor='#ffffff'></div></body></html>");

}
