
function NewWindowOpen(NewWindowUrl, NewWindowTate, NewWindowYoko)
{	
	var NewWindowOption;
	
	if (NewWindowYoko != "" && NewWindowTate != "")
	{
		NewWindowOption = "width=" + NewWindowYoko + "," + "height=" + NewWindowTate;
	}
	else
	{
		if (NewWindowYoko != "")
		{
			NewWindowOption = "width=" + NewWindowYoko;
		}
		else if (NewWindowTate != "")
		{
			NewWindowOption = "height=" + NewWindowTate;
		}
	}

	if (NewWindowOption != "")
	{
		window.open(NewWindowUrl,"NewWindow",NewWindowOption + ",toolbar=yes,status=yes,scrollbars=yes,resizable=yes");
	}
	else
	{
		window.open(NewWindowUrl,"NewWindow","toolbar=yes,status=yes,scrollbars=yes,resizable=yes");
	}
	
}

function Trim(strTemp)
{
	var strRet, strFinal;

	strRet = LTrim(strTemp);
	strFinal = RTrim(strRet);
	
	return strFinal;
}

function RTrim(strTemp)
{
	var nLoop = 0;
	var strReturn = strTemp;
	while (nLoop < strTemp.length)
	{
		if (strReturn.substring(strReturn.length - 1, strReturn.length) == " ")
		{
			strReturn = strTemp.substring(0, strTemp.length - (nLoop + 1));
		}
		else
		{
			break;
		}
		nLoop++;
	}
	return strReturn;
}

function LTrim(strTemp)
{
	var nLoop = 0;
	var strReturn = strTemp;
	while (nLoop < strTemp.length)
	{
		if (strReturn.substring(0, 1) == " ")
		{
			strReturn = strTemp.substring(nLoop + 1, strTemp.length);
		}
		else
		{
			break;
		}
		nLoop++;
	}
	return strReturn;
}

function NewWindowOpen2(NewWindowUrl, NewWindowTate, NewWindowYoko)
{	
	var NewWindowOption;
	
	if (NewWindowYoko != "" && NewWindowTate != "")
	{
		NewWindowOption = "width=" + NewWindowYoko + "," + "height=" + NewWindowTate;
	}
	else
	{
		if (NewWindowYoko != "")
		{
			NewWindowOption = "width=" + NewWindowYoko;
		}
		else if (NewWindowTate != "")
		{
			NewWindowOption = "height=" + NewWindowTate;
		}
	}

	if (NewWindowOption != "")
	{
		window.open(NewWindowUrl,"NewWindow",NewWindowOption + ",toolbar=no,status=no,scrollbars=yes,resizable=yes,menubar=yes,directories=no,location=no");
	}
	else
	{
		window.open(NewWindowUrl,"NewWindow","toolbar=no,status=no,scrollbars=yes,resizable=yes,menubar=yes,directories=no,location=no");
	}
	
}