function AutoResize(img){ 

  var img = decodeURI(img);
  foto1= new Image() 
  foto1.src=(img); 
  Controlla(img); 
  
} 

function Controlla(img){
  //var img = unescape(img); 
  if((foto1.width!=0)&&(foto1.height!=0)){ 
    viewFoto(img); 
  } else{ 
    funzione="Controlla('"+img+"')"; 
    intervallo=setTimeout(funzione,20); //20
  } 
} 

function viewFoto(img){
  //var img = unescape(img); 
  largh=foto1.width; 
  altez=foto1.height; 
  if(largh > 800){largh =800;}
  stringa="width="+largh+",height="+altez; 
  WinOpen(img);
} 

function WinOpen(img) {
//var img = unescape(img);
  
var WinOpen1;
  WinOpen1 = window.open("","",stringa);
  WinOpen1.document.open();
  WinOpen1.document.write("<HTML><HEAD><TITLE>Image View</TITLE><META http-equiv='Content-Type' content='text/html; charset=utf-8'></HEAD>");
  WinOpen1.document.write("<BODY topmargin=0 leftmargin=0>");
  
  
  
  WinOpen1.document.write("<a href='javascript:window.close();'><IMG SRC='"+img+"' border='0' width ='"+largh+"' alt='Close' Onfocus='this.blur();' GALLERYIMG='no'></a>");
  WinOpen1.document.write("</BODY></HTML>");
  WinOpen1.document.close();
}


//<!---------------------------------- 플레쉬 패치 ----------------------------->//


function MakeFlashString(source,id,width,height,wmode, otherParam)
{	
	return "<object  align=left classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0\" width="+width+" height="+height+" id="+id+"><param name=wmode value="+wmode+" /><param name=movie value="+source+" /><param name=quality value=high />"+otherParam+"<embed src="+source+" quality=high wmode="+wmode+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\"   width="+width+" height="+height+" align=\"left\"></embed></object>";
}

function MakeFlashString_01(source,id,width,height,wmode, otherParam)
{	
	return "<object  align=left classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0\" width="+width+" height="+height+" id="+id+"><param name=wmode value="+wmode+" /><param name=movie value="+source+" /><param name=quality value=high />"+otherParam+"<embed src="+source+" quality=high wmode="+wmode+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\"   width="+width+" height="+height+" align=\"left\"></embed></object>";
}

function MakeObjectString(classid, codebase, name, id, width,height, param)
{
	return "<object  align=left classid="+classid+" codebase="+codebase+" name="+name+"  width="+width+" height="+height+" id="+id+" align=left><PARAM NAME=Scale VALUE=NoScale><param name=wmode value="+wmode+" />"+param+"</object>";
}

// innerHTML Type
function SetInnerHTML(target, code)
{ 
	target.innerHTML = code; 
}

// Direct Write Type
function DocumentWrite(src)
{
	document.write(src);
}