function coverWindow(url){
   coverPop = window.open (url, "coverPop","location=0,status=0,toolbar=0,scrollbars=0,width=480,height=680");
 // mywindow.moveTo(0,0);
} 

function newsImagePop(imgUrl){
 // console.log(imgUrl);
  img= new Image();
  img.src=(imgUrl);
  if((img.width!=0)&&(img.height!=0)){
	width=img.width+20;
	height=img.height+20;
//	console.log('Image Found: '+imgUrl+' img object: ');
//	console.log(img);
	myWindow=window.open(imgUrl,"newsImg","location=0,status=0,toolbar=0,scrollbars=0,width="+width+",height="+height);
  }else{
   interval=setTimeout("newsImagePop('"+imgUrl+"')",20);
   //console.log('whoops!');
  }
}

// shows & hides 'search' text in searchbox
function searchBox(){
	/*$('searchField').onfocus = function(){
			if(this.value == 'search'){
				this.value = '';	
			}
			this.className = 'over';
	}
	$('searchField').onblur = function(){
			if(this.value == ''){
				this.value = 'search';	
			}
			this.className = '';
	}	*/
}

//this function expects to be passed x coord as CENTER of element.  Y as usual.
/*function showToolTip(x,y,text){
	Element.update('tooltip',text);
	toolTip = $('tooltip');
	toolTipDim = toolTip.getDimensions();
	var posX = x-(toolTipDim.width/2);
	var posY = y-toolTipDim.height-10;
	toolTip.setStyle({position:'absolute',left:posX+'px',top:posY+'px'});
	Effect.Appear('tooltip');
	//console.log('x: '+x+' ---- y: '+y);
	//console.log('width: '+toolTipDim.width+' ---- height: '+toolTipDim.height);
}
function hideToolTip(){
	$('tooltip').setStyle({position:'absolute',left:'0px',top:'0px',display:'none'});	
}*/



/* AUTOSIZE POP */
function autoSizeImagePop(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="location=0,status=0,toolbar=0,scrollbars=0,width="+largh+",height="+altez;
  finestra=window.open(img,"",stringa);
}
/* END AUTOSIZE POP */
