
function JSL_SimpleWindow(URL,xposStyle,yposStyle,xpos,ypos,width,height,OPTIONS)
{
    var clientTop,clientLeft;
	if (URL==null) return JSL_DebugMessage("JSL Debug:\nSimpleWindow function called with null URL");
	if (xposStyle==null) return JSL_DebugMessage("JSL Debug:\nSimpleWindow function called with null xposStyle");
	if (yposStyle==null) return JSL_DebugMessage("JSL Debug:\nSimpleWindow function called with null yposStyle");
	  clientTop=0;
	  clientLeft=0;
	  if (JSL_BrowserType() == "IE")
//alert("window.screen.width="+window.screen.width+"\nwindow.screen.availWidth="+window.screen.availWidth+"\nwindow.screen.height="+window.screen.height+"\nwindow.screen.availHeight="+window.screen.availHeight);
	 if (xpos==null || xpos=="")
	  xpos=0;
	 else
		 if (isNaN(parseInt(xpos,10))) 
    		 return JSL_DebugMessage("JSL Debug:\nSimpleWindow function called with invalid xpos");
		 else
       	     xpos=parseInt(xpos,10); 
	if (ypos==null || ypos=="")
	 ypos=0;
	else
		 if (isNaN(parseInt(ypos,10))) 
    		 return JSL_DebugMessage("JSL Debug:\nSimpleWindow function called with invalid ypos");
		 else
       	     ypos=parseInt(ypos,10); 
	if (width==null || width=="") 
		width="500";
	else
		 if (isNaN(parseInt(width,10))) 
    		 return JSL_DebugMessage("JSL Debug:\nSimpleWindow function called with invalid width");
		 else
       	     width=parseInt(width,10); 
	if (height==null || height=="") 
		height="200";
	else
		 if (isNaN(parseInt(height,10))) 
    		 return JSL_DebugMessage("JSL Debug:\nSimpleWindow function called with invalid height");
		 else
       	     height=parseInt(height,10); 
    var menubar=0,status=0,toolbar=0;
	if (OPTIONS==null || OPTIONS=="") OPTIONS="menubar=no,status=no,toolbar=no,titlebar=no,scrollbars=no,resizable=no";
	else
	{
		var tmp=OPTIONS;
		while (tmp.indexOf(" ") != -1)
			tmp=tmp.replace(" ","");
        i=tmp.toLowerCase().indexOf("menubar=");
        if (i != -1) 
			if (tmp.toLowerCase().substr(i+8,3) == "yes") menubar=46;
        i=tmp.toLowerCase().indexOf("status=");
        if (i != -1) 
			if (tmp.toLowerCase().substr(i+7,3) == "yes") status=20;
        i=tmp.toLowerCase().indexOf("toolbar=");
        if (i != -1) 
			if (tmp.toLowerCase().substr(i+8,3) == "yes") toolbar=42;
	}
//		alert("menubar="+menubar+"\nstatus="+status+"\ntoolbar="+toolbar);
	if (xposStyle == 0)
 	 xpos=xpos+clientLeft;
	else  
	 if (xposStyle == 1)
 	  xpos=clientLeft;
	 else  
	  if (xposStyle == 2)
	  {
	   xpos=window.screen.availWidth-parseInt(width,10)-xpos-10;
	  }
	  else  
	   if (xposStyle == 3)
	   {
	    xpos=Math.round(window.screen.availWidth/2)+Math.round(clientLeft/2)-Math.round(parseInt(width,10)/2)+xpos;
	   }
	   else
	     return JSL_DebugMessage("JSL Debug:\nSimpleWindow function called with invalid xposStyle");
	if (yposStyle == 0)
 	 ypos=ypos+clientTop;
	else  
	 if (yposStyle == 1)
 	  ypos=clientTop;
	 else  
	  if (yposStyle == 2)
	  {
	   ypos=window.screen.availHeight-parseInt(height)-menubar-status-toolbar-28;
//	   alert(ypos);
	  }
	  else  
	   if (yposStyle == 3)
	   {
	    ypos=Math.round(window.screen.availHeight/2)+Math.round(clientTop/2)-Math.round(parseInt(height,10)/2)-Math.round((menubar-status-toolbar-28)/2);
	   }
	   else
	     return JSL_DebugMessage("JSL Debug:\nSimpleWindow function called with invalid yposStyle");
    window.open(URL,"","top="+ypos+",left="+xpos+",width="+width+",height="+height+","+OPTIONS);
}

function JSL_MouseWindow(URL,xpos,ypos,width,height,OPTIONS)
{
    var clientTop,clientLeft;
	if (URL==null) return JSL_DebugMessage("JSL Debug:\nSimpleWindow function called with null URL");
	  clientTop=0;
	  clientLeft=0;
	 if (xpos==null || xpos=="")
	  xpos=window.event.screenX;
	 else
		 if (isNaN(parseInt(xpos,10))) 
    		 return JSL_DebugMessage("JSL Debug:\nSimpleWindow function called with invalid xpos");
		 else
       	     xpos=window.event.screenX+parseInt(xpos,10); 
	if (ypos==null || ypos=="")
	 ypos=window.event.screenY;
	else
		 if (isNaN(parseInt(ypos,10))) 
    		 return JSL_DebugMessage("JSL Debug:\nSimpleWindow function called with invalid ypos");
		 else
       	     ypos=window.event.screenY+parseInt(ypos,10); 
	if (width==null || width=="") 
		width="500";
	else
		 if (isNaN(parseInt(width,10))) 
    		 return JSL_DebugMessage("JSL Debug:\nSimpleWindow function called with invalid width");
		 else
       	     width=parseInt(width,10); 
	if (height==null || height=="") 
		height="200";
	else
		 if (isNaN(parseInt(height,10))) 
    		 return JSL_DebugMessage("JSL Debug:\nSimpleWindow function called with invalid height");
		 else
       	     height=parseInt(height,10); 
//	  xpos=window.event.screenX;
//	  ypos=window.event.screenY;
	  if (width==null || width=="") width="500";
	  if (height==null || height=="") height="200";
	  if (OPTIONS==null || OPTIONS=="") OPTIONS="menubar=no,status=no,toolbar=no,titlebar=no,scrollbars=no,resizable=no";
      window.open(URL,null,"top="+ypos+",left="+xpos+",width="+width+",height="+height+","+OPTIONS);
}

