function openPopup(url, name, width, height)
{
	var oTarget = window.open(url, name, 'scrollbars=no, toolbar=no, resizable=yes, menubar=no, status=no, width=' + width + ', height=' + height + ', top=250, left=350');
	oTarget.focus();
	return false;
}

function openPopupNoResizable(url, name, width, height)
{
	var oTarget = window.open(url, name, 'scrollbars=no, toolbar=no, resizable=no, menubar=no, status=no, width=' + width + ', height=' + height + ', top=250, left=350');
	oTarget.focus();
	return false;
}

function openScrolledPopup(url, name, width, height)
{
	var oTarget = window.open(url, name, 'scrollbars=yes, toolbar=no, resizable=yes, menubar=no, status=no, width=' + width + ', height=' + height + ', top=250, left=350');
	oTarget.focus();
	return false;
}

function openModalScrolledPopup(url, name, width, height)
{
	var oTarget = window.showModalDialog(url, name, 'scroll=yes, status=no, dialogWidth=' + width + ', dialogHeight=' + height);
	oTarget.focus();
	return false;
}


function HideControl( id )
{
	document.getElementById( id ).style.display = 'none';
}

function ShowControl( id )
{
	document.getElementById( id ).style.display = 'inline';
}

function nextFieldFocus(curObj, prevObj, nextObj, length, event)
{
	if( event.keyCode == '37' || event.keyCode == '39' )
	{
		return;
	}
  if(nextObj != null && curObj.value.length == length && event.keyCode != '9' && event.keyCode != '16')
  {
    nextObj.focus();
    nextObj.select();
  }
  if(event.keyCode == '8' && curObj.value.length == 0)
  {
    prevObj.focus();
    rng = prevObj.createTextRange(); 
    rng.collapse(false); 
    rng.select(); 
    prevObj.click(); 
  }
}


function newImage(arg)
{
	if (document.images)
	{
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages()
{
	if (document.images)
	{
		for (var i=0; i<changeImages.arguments.length; i+=2)
		{
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

//************************************************************* 
function Trim (str)  
{ 
	return RTrim(LTrim(str)); 
} 
//************************************************************* 	
function LTrim (str) { 
var ret_str = str; 
for (var i=0; i<str.length; i++){ 
	if (str.charAt(i) == ' ') {;} 
	else  
	{ 
		ret_str = str.substring(i); 
		return ret_str; 
	} 
} 
ret_str=''; 
return ret_str; 
} 
//************************************************************* 
function RTrim (str) { 
	var ret_str = str; 
	for (var i=(str.length-1); i>=0; i--) 
	{ 
		if (str.charAt(i) == ' ') {;} 
		else  
		{ 
			ret_str = str.substring(0,(i+1)); 
			return ret_str; 
		} 
	} 
	ret_str=''; 
	return ret_str; 
} 


