function MM_openBrWindow(theURL,winName,features)
{
  window.open(theURL,winName,features);
}

function fullScreen(theURL) {
window.open(theURL, 'winname', 'fullscreen=yes, scrollbars=no');
}

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 fncShowHideSwitch()
{
	var i, v, obj;
	var args = fncShowHideSwitch.arguments;
	if ( ( obj=MM_findObj(args[0]) ) != null ) { 
		if (obj.style) 
		{
			obj = obj.style;
		}
			if ( obj.display == "block")
				obj.display = "none";
			else 
				obj.display = "block";
	}
}

function fncShowHide()
{
	var i, v, obj, args=fncShowHide.arguments;
	for( i = 0 ; i < args.length-1 ; i+=2)
	{
		if ( ( obj=MM_findObj(args[i])) != null ) { 
			v = args[i+1];
			if (obj.style) 
			{
				obj = obj.style;
				v=(v=='show')?'block':(v=='hide')?'none':v; 
			}
				obj.display=v;
		}
	}
}

function popview(img)
{
  img = unescape(img);
  foto1= new Image();
  foto1.src=(img);
  contImg(img);
}

function contImg(img)
{
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewImg(img);
  }
  else{
    funzione="contImg('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}

function viewImg(img){
//  largh=foto1.width+20;
//  altez=foto1.height+20;
 largh=100;
 altez=100;
 stringa="width="+largh+",height="+altez + ",scrollbars=yes";
 
  finestra=window.open("blog_imgview.php?filename="+img,"",stringa);
}

function resizeImage(num)
{

	var width = eval('document.all.userImg'+num+'.width');
	if( width > 490 )
	{
		eval('document.all.userImg'+num+'.width = 490');
	}
}

