function openWindow(url) {
    try {
        window.open(url, "_self");
    }
    catch (e) {
    }
}

function openNewWindow(url) {
    try {
        window.open(url, "_blank");
    }
    catch (e) {
    }
}

function OpenUrl(url, left, top, width, height)
{
	var sFeatures = 'toolbar=0, directories=0, location=0, menubar=0, status=0, titlebar=0, scrollbars=0, resizable=0, '
		+ 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top;
    var newWin = window.open(url,'_blank', sFeatures, true);
    newWin.opener=self;
    if (window.focus) {newWin.focus()}
    return newWin;
}

function OpenUrlResizable(url, left, top, width, height)
{
	var sFeatures = 'toolbar=0, directories=0, location=0, menubar=0, status=0, titlebar=0, scrollbars=0, resizable=1, '
		+ 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top;
    var newWin = window.open(url,'_blank', sFeatures, true);
    newWin.opener=self;
    if (window.focus) {newWin.focus()}
    return newWin;
}

function OpenUrlModal(url, width, height, args)
{
	var sFeatures = 'help:0; status:0; dialogWidth:' + width + 'px;dialogHeight:' + height + 'px;';
	try
	{
		if (window.screen.height < 770)
		{
			sFeatures += '; dialogTop:0px';
		}
	}
	catch (e){}
	return window.showModalDialog(url, args, sFeatures);
}

function OpenUrlModalResizable(url, width, height, args)
{
	var sFeatures = 'help:0; status:0; resizable:1; dialogWidth:' + width + 'px;dialogHeight:' + height + 'px;';
	try
	{
		if (window.screen.height < 770)
		{
			sFeatures += '; dialogTop:0px';
		}
	}
	catch (e){}
	return window.showModalDialog(url, args, sFeatures);
}

function OpenUrlModeless(url, width, height, args)
{
	var sFeatures = 'help:0; status:0; dialogWidth:' + width + 'px;dialogHeight:' + height + 'px;';
	return window.showModelessDialog(url, args, sFeatures);
}

function OpenUrlModelessResizable(url, width, height, args)
{
	var sFeatures = 'help:0; resizable:1; status:0; dialogWidth:' + width + 'px;dialogHeight:' + height + 'px;';
	return window.showModelessDialog(url, args, sFeatures);
}

