function popbox(widthu, heightu, html, bg, bgtop, border, colorborder, scrolling, title) { 

   var newdivbackground = document.createElement('div');
   newdivbackground.id = "popupboxidbackground";
   newdivbackground.style.position = "absolute";
   var heightvar=window.screen.height;
   var widthtvar=window.screen.width;
   var SCREENscrolltop = $(window).scrollTop();
   newdivbackground.style.width = widthtvar-23;
   newdivbackground.style.height = heightvar+SCREENscrolltop+500;
   newdivbackground.style.top = 0;
   newdivbackground.style.left = 0;
   
   
   document.body.appendChild(newdivbackground);
	

   var newdiv = document.createElement('div');
   newdiv.id = "popupboxid"; 
   
   newdiv.style.position = "absolute";
   if (widthu=="") 
   {
	   newdiv.style.width = 200+"px";
       var width = 200+"px"; 
   } 
   else 
   {
		newdiv.style.width = widthu+"px"; 
		var width = widthu; 
   }
   
   if (heightu=="") {
       newdiv.style.height = 300+"px";
	   var height = 300+"px";
   }   
   else 
   {
		newdiv.style.height = heightu+"px"; 
		var height = heightu; 
   }
	
	var heightvar=window.screen.height;
	var heightvar2=(heightvar-height)/2+SCREENscrolltop-140;
	if(heightvar2<=0)
	{
		heightvar2=10;	
	}
	var widthtvar=window.screen.width;
	var widthvar2=(widthtvar-width)/2;
	newdiv.style.left = widthvar2+"px";
	newdiv.style.border = border+"px solid #"+colorborder;
	newdiv.style.background = "#"+bg;
	newdiv.style.top = heightvar2+"px";   
	newdiv.style.zIndex = "10000";   
	
   if (html!="") {
       newdiv.innerHTML = html;
   } else {
       newdiv.innerHTML = "nothing";
   }   
   
   var heightframe=heightu-28;
  
   newdiv.innerHTML = "<div style='clear:both; background:"+bgtop+"' id='popupbox_top' align='right'><div style='padding:2px; padding-left:6px; font-size:1px; float:left'><span style=\"color:#ffffff; font-size:18px\">"+title+"</span></div><div style='padding:2px; padding-right:6px; font-size:1px; float:right'><span onclick='popboxclose();' id='chiudidiv'><img src='images/close.png' border='0'></span></div></div></div><iframe id='popupboxcontent' src='"+html+"' marginwidth='0' marginheight='0' width='100%' height='"+ heightframe+"' scrolling=\""+scrolling+"\" frameborder=\"0\" style=\"overflow-y:auto; overflow-x:hidden;\"></iframe>";
    
   document.body.appendChild(newdiv);
	
	/*
   ifrm = document.createElement("IFRAME"); 
   ifrm.setAttribute("src", "http://developerfusion.com/"); 
   ifrm.style.width = 240+"px"; 
   ifrm.style.height = 280+"px"; 
   document.body.appendChild(newdiv); 
	*/                      
   
   Drag.init(document.getElementById("popupboxid"));
} 



	   
function popboxclose()
{
	var el = document.getElementById("popupboxid");
	el.parentNode.removeChild(el);
	var el2 = document.getElementById("popupboxidbackground");
	el2.parentNode.removeChild(el2);
};

function popboxplus()
{
	actualwidth=document.getElementById(popupboxid.id).style.width;
	actualwidth=parseInt(actualwidth);
	newwidth=(actualwidth+20);
	document.getElementById(popupboxid.id).style.width=newwidth+'px';
	
	actualheight=document.getElementById(popupboxid.id).style.height;
	actualheight=parseInt(actualheight);
	newheight=(actualheight+20);
	document.getElementById(popupboxid.id).style.height=newheight+'px';
};

function popboxminus()
{
	actualwidth=document.getElementById(popupboxid.id).style.width;
	actualwidth=parseInt(actualwidth);
	newwidth=(actualwidth-20);
	document.getElementById(popupboxid.id).style.width=newwidth+'px';
	
	actualheight=document.getElementById(popupboxid.id).style.height;
	actualheight=parseInt(actualheight);
	newheight=(actualheight-20);
	document.getElementById(popupboxid.id).style.height=newheight+'px';
};




