// JavaScript Document

function CaricaFoto(img){
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}

function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}

function viewFoto(img){
  largh=foto1.width+20;
  altez=foto1.height+20;
  stringa="width="+largh+",height="+altez+",left = 130,top = 90";
  finestra=window.open(img,"",stringa);
}

//----------------------------------------------------------------------------------
// dimensiones de "main.htm": w=740, h=550
// dimensiones de "oferta_empleo.htm": w=200, h=200
function popUp(URL,win_w,win_h) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" + win_w + ",height=" + win_h + ",left = 140,top = 100');");
}

//----------------------------------------------------------------------------------

function popupwindow(strURL)
{
	window.open(strURL,'newwindow','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,top,left,width=720,height=540')
}

//----------------------------------------------------------------------------------

function openwin(url,wname,ancho,alto,top,left)
{       
	var wndw = "";	
	wndw = wndw + "width=" + ancho;
	wndw = wndw + ",height=" + alto;
	wndw = wndw + ",resizable=no";
	wndw = wndw + ",title='"+ wname +"'";
	wndw = wndw + ",scrollbars=no";
	wndw = wndw + ",menubar=no";
	wndw = wndw + ",toolbar=no";
	wndw = wndw + ",directories=no";
	wndw = wndw + ",location=no";
	wndw = wndw + ",status=no";
	wndw = wndw + ",top=" + top;
	wndw = wndw + ",left=" + left;		
   window.open(url,wname,wndw);
}

//window.focus();
//self.name='abretesesamo';
//self.moveTo(0,0);

//----------------------------------------------------------------------------------

function abretesesamo(url)
{
	x=screen.availWidth;
	y=screen.availHeight;
	z="texto";
	var ns = (navigator.appName == "Netscape");
	
	if (ns==true)
		{
		x=x-11;
		y=y-30;
		}
	
	HWWTT=window.open(url,"HWWTT","scrollbars=no,width="+x+",height="+y+",top=0,left=0,status=no,toolbar=no,menubar=no,resizable=yes,location=no,titlebar=0,fullscreen=no");
	HWWTT.resizeTo(x,y);
	HWWTT.moveTo(0,0);
	HWWTT.focus();
}

//----------------------------------------------------------------------------------

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();
}