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 sendtofriend(lp) {
	STFWidth=500;
	STFHeight=380;
	stfpath=lp+"inserts/sendtoafriend/index.php?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('sendtofriend');
	stfdiv.style.display = "inline";
	stfdiv.style.position="absolute";
	stfdiv.style.width=STFWidth;
	stfdiv.style.height=STFHeight;
	stfdiv.style.left = xpos;
	stfdiv.style.top = stfdiv.clientHeight - (STFHeight/2);
	stfdiv.innerHTML='<HTML><BODY><IFRAME SRC="'+stfpath+'" WIDTH="100%" HEIGHT="100%" SCROLLING="no" FRAMEBORDER="0"></IFRAME></BODY></HTML>';
	stfdiv.style.visibility="visible";
	return false;
}
