// JavaScript Document
function popup(url, name, height, width, left, top) {
	
	if (!height) {
		height = 600;	
	}
	
	if (!width) {
		width = 800;	
	}
	
	if(!left)
	{
	   if(typeof __popup_x != "undefined")
	   {
	      left = __popup_x + 30;
	   }
		else
		{
		   left = 30;
		}
	}
	
	if(!top)
	{
	   if(typeof __popup_y != "undefined")
	   {
	      top = __popup_y + 30;
	   }
		else
		{
		   top = 30;
		}
	}
	
	/*
	
	*  dependent - Subwindow closes if parent(the window that opened it) window closes
    * fullscreen - Display browser in full screen mode
    * height - The height of the new window, in pixels
    * width - The width of the new window, in pixels
    * left - Pixel offset from the left side of the screen
    * top - Pixel offset from the top of the screen
    * resizable - Allow the user to resize the window or prevent resizing
    * status - Display the status bar or not
	
	*/
	var newWindow = window.open(url, name, "dependent = 1, fullscreen = 0, height="+height+", width="+width+", left="+left+", top="+top+", resizable=1, status=1, scrollbars=1");
	
	if (newWindow && newWindow.focus) {
		newWindow.focus();
	}
	
	if(newWindow)
	{
	   newWindow.__popup_x = left;
	   newWindow.__popup_y = top;
	   return newWindow;
	}

	return false;
		
}
