﻿/*----- 1. Window Open------------*/
function new_window(strName, strFram_ASP, strParam, strWidth, strHeight, strScroll, strResize) 
{
    var sx = window.screen.width  / 2 - parseInt(strWidth) / 2;
    var sy = window.screen.height / 2 - parseInt(strHeight) / 2 - 40;

    window.open(strFram_ASP + strParam, strName, "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars="+strScroll+",resizable="+strResize+",width="+strWidth+",height="+strHeight+",top="+sy+",left="+sx);
}

function openWindow(fileName,windowName,theWidth,theHeight, etcParam) 
{
	var x = theWidth;
	var y = theHeight;

	var sx = window.screen.width  / 2 - x / 2; 
	var sy = window.screen.height / 2 - y / 2 - 40;

	if (etcParam == 'fix') {
		etcParam = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0";
	}
	else if (etcParam == 'resize') {
		etcParam = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1";
	}
	else if (etcParam == 'scroll') {
		etcParam = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1";
	}

	if (sy < 0 ) {
		sy = 0;
	}
	var sz = ",top=" + sy + ",left=" + sx;

	if (windowName == "newMessageWindow")
	{
		windowName = new String(Math.round(Math.random() * 100000));
	}
	
   
	window.open(fileName,windowName, etcParam + ",width=" + x + ",height=" + y + sz);
}