function openNew(url,name,width,height) {
	var options = "width=" + width + ",height=" + height + "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no";

	new_window = window.open(url, name, options);
	window.self.name = "main";
	new_window.focus();
}

function openInternalWindow(url, name, _width, _height, _id)
{
	var iWindow = document.createElement('div');
	var iHead = document.createElement('div');
	var iBody = document.createElement('div');
	var iFooter = document.createElement('div');
	var iFrameContent = document.createElement('iframe');
	
 	var headerText = document.createTextNode(name);
 	iHead.appendChild(headerText);
 	iFooter.appendChild(document.createTextNode('Press the close button to cancel operations'));
 	
 	iFrameContent.src = url;
 	iFrameContent.frameBorder = 0;
 	iFrameContent.width = "100%";
 	iFrameContent.height = "100%";
 	iBody.appendChild(iFrameContent);
 	
 	iHead.className = "hd";
 	iBody.className = "bd";
 	iFooter.className = "ft";
 	
 	iWindow.appendChild(iHead);
 	iWindow.appendChild(iBody);
 	iWindow.appendChild(iFooter);
 	iWindow.id = _id;
 	
 	document.getElementsByTagName('body')[0].appendChild(iWindow);
	
	var new_panel = new YAHOO.widget.Panel(_id, { width:_width, height:_height, visible:true, constraintoviewport:true, fixedcenter:true,
	effect:[{effect:YAHOO.widget.ContainerEffect.FADE,duration:1}]} );
	                
	new_panel.render('new_panel'); 
}

function openNewwithScrollers(url,name,width,height) {
	var options = "width=" + width + ",height=" + height + "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no";

	new_window = window.open(url, name, options);
	window.self.name = "main";
	new_window.focus();
}

function openNewCenter(url,name,b,h) {

	var winleft = (screen.width - b) / 2;
	var winUp = (screen.height - h) / 2;

	options = "left="+ winleft +", top=" + winUp + ", width=" + b + ", height=" + h;
	options = options+ ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";

	new_window = window.open(url, name, options);
	window.self.name = "main";
	new_window.focus();
}

function TreePopUp(url,name) {

 var winleft = (screen.width) - 220;
 var winheight = (screen.height) - 40;


 options = "left="+ winleft +", top=0, width=" + 210 + ", height=" + winheight;
 options = options+ ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";

 new_window = window.open(url, name, options);
 window.self.name = "main";

 window.resizeTo(winleft, screen.height);
 window.moveTo(0,0)

 new_window.focus();

}