ns=((navigator.appName=="Netscape") && (parseInt(navigator.appVersion)>=3));
ie=((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4));

function OpenLink(URL,Target,typ,width,height,center,scrollbars,toolbar,directories,status,resize) {
	
	if (Target=="") {Target="displayWindow"}
	
    xposition=0; yposition=0;
    if (typ==1){
	window.open(URL, Target, 'fullscreen=yes, scrollbars=auto'); 
	} else {
		if (height==0)  {
			height=screen.height-150;
		}
		if (width > screen.width) {
			width=screen.width;
			}
		if (height > screen.height) {
			height=screen.height;
			}
		if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
		    xposition = (screen.width - width) / 2;
		    yposition = (screen.height - height) / 2;
		}    

	    if (typ==2) {
		    if ((ns))
			    window.open(URL,Target,"");
		    if ((ie))
			    window.open(URL,Target,"");
        } else if (typ==3) {
		    if ((ns))
			    window.open(URL,Target,"toolbar=no,width=" + width + ",height=" + height + ",screenx=" + xposition + ",screeny=" + yposition + ",directories=no,status=no,scrollbars=" + scrollbars + ",resize=no,menubar=no");
		    if ((ie))
			    window.open(URL,Target,"type=fullWindow,toolbar=no,width=" + width + ",height=" + height + ",left=" + xposition + ",top=" + yposition + ",directories=no,status=no,scrollbars=" + scrollbars + ",resize=no");
	    } else {
		    yposition=30
		    if ((ns))
			    window.open(URL,Target,"toolbar=" + toolbar + ",width=" + width + ",height=" + height + ",screenx=" + xposition + ",screeny=" + yposition + ",directories=" + directories + ",status=" + status + ",scrollbars=" + scrollbars + ",resize=" + resize + ",menubar=yes");
		    if ((ie))
			    window.open(URL,Target,"type=fullWindow,toolbar=" + toolbar + ",width=" + width + ",height=" + height + ",left=" + xposition + ",top=" + yposition + ",directories=" + directories + ",status=" + status + ",scrollbars=" + scrollbars + ",resize=" + resize);
	    }

	}
	
}

function NewWindow(URL, Target, scrollbars) {

if(document.images)
{
width=document.images.pop.width;
height=document.images.pop.height;

if((screen.Width <= (width)) && (screen.availHeight <= (height)))
	{
	window.resizeTo(screen.Width, screen.availHeight)
	}
else
	{
	window.resizeTo(width+30,height+100)
	}
}

var xposition = (screen.width - width) / 2;
var yposition = (screen.height - height) / 2;

if ((ns))
	win=window.open(URL,Target,"toolbar=no,width=" + width + ",height=" + height + ",screenx=" + xposition + ",screeny=" + yposition + ",directories=no,status=no,scrollbars=" + scrollbars + ",resize=no,menubar=no");
if ((ie))
	win=window.open(URL,Target,"type=fullWindow,toolbar=no,width=" + width + ",height=" + height + ",left=" + xposition + ",top=" + yposition + ",directories=no,status=no,scrollbars=" + scrollbars + ",resize=no");

if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function FocusIt(c) {
document.all(c).focus();
}

function popUp(URL,w,h) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=" + w + ",height=" + h + ",left = 197,top = 353');");
}

function ShowDialog(URL,Target,width,height)
{
	strAppVersion = navigator.appVersion;
	if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4)
	{
	  winstyle = "dialogWidth=" + width + "px; dialogHeight:" + height + "px; center:yes";
	  window.showModelessDialog(URL,Target,winstyle);
	}
	else
	{
	  winstyle="width=" + width + ",height=" + height;
	  window.open(URL,Target,winstyle, true);
	}
}