var newwindow;
var isopen = "no";

function jump(whereto)
{
if((isopen=="yes")&&(navigator.appName != "Netscape"))
	{
	newwindow.close();
	isopen="no";
	};
var features = 'top=50,left=50,height=450,width=450,toolbar=no,resizable=yes,scrollbars=yes';
newwindow = window.open('', 'info', features);
var contents;

contents = '<html><head><title>Information</title></head><form><textarea>';
 contents += whereto;
contents += '</textarea></form></html>';

newwindow.document.write(contents);
isopen = "yes";
newwindow.focus();
}



function jumpFull(whereto)
{
if((isopen=="yes")&&(navigator.appName != "Netscape"))
	{
	newwindow.close();
	isopen="no";
	};
newwindow = window.open(whereto, 'info');
isopen = "yes";
newwindow.focus();
}

function getRadioValue (name) 
{
	var value = null;
	var radioButtonOrGroup = document.getElementById(name);
	alert(radioButtonOrGroup.length);
	if (radioButtonOrGroup.length) // group 
	{
		for (var b = 0; b < radioButtonOrGroup.length; b++)
		{
			if (radioButtonOrGroup[b].checked)
			{
				value = radioButtonOrGroup[b].value;
			}
		}
	}
	else if (radioButtonOrGroup.checked)
	{
		value = radioButtonOrGroup.value;
	}
	alert("Radio value" + value);
	return value;
}

function selectDropDownMember(asName, asCode)
{
	var dropDown = document.getElementById(asName);
	if(dropDown && dropDown.options)
	{
		for(var i=0; i<dropDown.options.length; i++)
		{
			if(dropDown.options[i].value == asCode)
			{
				dropDown.options[i].selected = true;
				//alert("Selecting " + dropDown.options[i].value + " for " + asName);
			}
			else
			{
				dropDown.options[i].selected = false;
			}
		}
	}
}

function IsNumeric(sText, wholeNumberOnly)
{
	var ValidChars = "0123456789";
	var IsNumber=true;
	var Char;

	if (!wholeNumberOnly) ValidChars += ".";	// allow a decimal point
 
	for (i = 0; i < sText.length && IsNumber == true; i++) { 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1)
			IsNumber = false;   
    }
   
	return IsNumber;
   
}

function trim(strText) { 
    
    strText = strText.toString();
    
    // this will get rid of leading spaces 
    while (strText.substring(0,1) == ' ') 
        strText = strText.substring(1, strText.length);

    // this will get rid of trailing spaces 
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
} 

