var composeWindowCount = 0;

function openWin(url, winName, width, height, features)
{
	if (features == "compose")
	{
		window.open(url, winName+composeWindowCount,'directories=no,location=no,menubar=no,status=no,scrollbars=yes,resizable=yes,titlebars=no,toolbar=no,width=' + width + ',height=' + height);
		composeWindowCount++;
	}
	else if (features == "yes")
	{
		var hWin = window.open(url, winName, 'directories=no,location=no,menubar=no,status=no,scrollbars=yes,resizable=yes,titlebars=no,toolbar=no,width=' + width + ',height=' + height);
		hWin.focus();
	}
	else if (features == "no")
	{
		var hWin = window.open(url, winName, 'directories=no,location=no,menubar=no,status=no,scrollbars=no,resizable=no,titlebars=no,toolbar=no,width=' + width + ',height=' + height);
		hWin.focus();
	}
	else if(features == "modal")
	{
		var hWin = window.showModalDialog(url, winName, 'location:no;menubar:no;status:no;scrollbars:yes;resizable:yes;titlebars:no;toolbar:no;dialogWidth:' + width + 'px;dialogHeight=' + height +'px;center:yes;');
		hWin.focus();
	}
	else if (features == "editwindow")
	{
		var hWin = window.open(url, winName, 'directories=no,location=no,menubar=no,status=no,scrollbars=no,resizable=no,titlebars=no,toolbar=no,width=' + width + ',height=' + height);
		hWin.focus();
	}
	else if (features == "stickies")
	{
		var hWin = window.open(url, winName, 'directories=no,location=no,menubar=no,status=no,scrollbars=yes,resizable=no,titlebars=no,toolbar=no,width=' + width + ',height=' + height);
		hWin.focus();
	}
	else if (features == "print")
	{
		var hWin = window.open(url, winName, 'height=' + height + ',width=' + width + ',scrollbars=yes,status=yes,resizable=1,toolbar=yes,menubar=yes');
		hWin.focus();
	}
}

function closeWin()
{
	window.close();
}
