function go2URL(address)
{
  var elFrame = document.getElementById('doiFrame');
  elFrame.src = address;
}
function newWindow(address)
{
	var maxW = screen.width;
	var maxH = screen.height;
	var w = 800;
	var h = 600;
	var _top = Math.floor((maxH - h) / 2);
	var _left = Math.floor((maxW - w) / 2);
	
	var win = window.open(address,'doiW',"toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width="+w+",height="+h);
	win.moveTo(_left,_top);
	win.focus();
}
//Some Browser Detection 
function Browserinfo() { 
	var agent = navigator.userAgent.toLowerCase(); 
	this.major = parseInt(navigator.appVersion); 
	this.minor = parseFloat(navigator.appVersion); 
	this.op = (agent.indexOf("opera")!= -1); 
} 
function getXPos(w) {

	var is = new Browserinfo(); 
	//Determine the Available Width on the page 
	var fWidth; 
	
	//For old IE browsers 
	if(document.all) 
	{ 
	fWidth = document.body.clientWidth; 
	} 
	//For DOM1 browsers 
	else if(document.getElementById &&!document.all) 
	{ 
	fWidth = innerWidth; 
	} 
	else if(document.getElementById) 
	{ 
	fWidth = innerWidth; 
	} 
	//For Opera 
	else if (is.op) 
	{ 
	fWidth = innerWidth; 
	} 
	//For old Netscape 
	else if (document.layers) 
	{ 
	fWidth = window.innerWidth; 
	} 
	var layerLeft; 
	
	/*Calculate the Left position of the Layer 
	The figure being subtracted is half the width of 
	the layer that you are trying to position. */ 
	layerLeft = fWidth/2 - (w/2); 
	
	return layerLeft;
}

function overlaybox(url,t,w,h) {
/*	STFWidth=(w) ? w : 500;
	STFHeight=(h) ? h : 380;
	stfpath=url+"?refer="+escape(location.href)+"&lptitle="+escape(document.title);
	xpos=getXPos(STFWidth);
	//document.writeln('<div id="mydiv" style="left:'+xpos+'px;">HELLO</div>');
  	var stfdiv = document.getElementById('overlayboxdiv');
	stfdiv.style.display="";
	stfdiv.style.width=STFWidth+"px";
	stfdiv.style.height=STFHeight+"px";
	stfdiv.style.left = xpos+"px";
	stfdiv.style.top = (stfdiv.clientHeight-(STFHeight/2))+"px"; 
	stfdiv.innerHTML='<IFRAME SRC="'+stfpath+'" WIDTH="100%" HEIGHT="100%" SCROLLING="no" FRAMEBORDER="0" id="contentframe"></IFRAME>';
	stfdiv.style.visibility="visible";
*/

	STFWidth=(w) ? w : 500;
	STFHeight=(h) ? h : 380;
	stfpath=url+"?refer="+escape(location.href)+"&lptitle="+escape(document.title);

	var $dialog = $('<div></div>')
		//.html('This dialog will show every time!')
		.html('<IFRAME SRC="'+stfpath+'" WIDTH="100%" HEIGHT="100%" SCROLLING="no" FRAMEBORDER="0" id="contentframe"></IFRAME>')
		.dialog({
			width: STFWidth,
			height: STFWidth,
			autoOpen: STFHeight,
			title: t
		});

$dialog.dialog('open');
		


/*	$(function() {
		$("#dialog").dialog();
	});	*/
	return false;
}

