function imgSwap( imageName1, swapSrc1 ) {
	document[imageName1].src = swapSrc1;
}

function divImgSwap( imageName1, swapSrc1, divName ) {
  if( divName )
    eval( divName + '.document.' + imageName1 + '.src = ' + 'swapSrc1' );
  else
    document[imageName1].src = swapSrc1;
}

function newImg( argPath ) {
	if( document.images ) {
		rslt = new Image();
		rslt.src = argPath;
		return rslt;
	}
}


function viewImage( topic ) {
	window.open(topic, "newWindow","history=no,align=center,width=850,height=650,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable");
}	
	
var imgPage="";


function ViewImage(img,page){
  imgPage = page;
  photo1= new Image();
  photo1.src=( img );
  setImageSize( img );

}

function setImageSize(img){
  if( ( photo1.width != 0 ) && ( photo1.height != 0 ) ) {
	popupImage(img);
  } else{
	functionID="setImageSize( '"+img+"' )";
	interival = setTimeout( functionID , 20 );
  }
} 

function popupImage( img ) {
  width = photo1.width + 30;
  height = photo1.height + 30;
  stringa = "width="+width+",height="+height;
  finestra = window.open(imgPage,"",stringa + ",scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,status=no");
}
