// Popup window code
function newPopup(url) {
	popupWindow = window.open(
		url,'popUpWindow','height=700,width=450,left=300,top=100,resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')
}
// Popup window code
function newPopup1(url) {
	popupWindow = window.open(
		url,'popUpWindow','height=900,width=650,left=300,top=100,resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')
}
function newPopup2(url) {
	popupWindow = window.open(
		url,'popUpWindow','height=1000,width=680,left=300,top=100,resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')
}
function newPopup3(url) {
	popupWindow = window.open(
		url,'popUpWindow','height=400,width=340,left=350,top=200,resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')
}
function afisez(s)
 {
  document.getElementById(s).style.visibility="visible";
  }
 function ascund(s)
 {
  document.getElementById(s).style.visibility="hidden";
  }

/*
Strip whitespace from the beginning and end of a string
Input : a string
*/
function trim(str)
{
	return str.replace(/^\s+|\s+$/g,'');
}

/*
Make sure that textBox only contain number
*/
function checkNumber(textBox)
{
	while (textBox.value.length > 0 && isNaN(textBox.value)) {
		textBox.value = textBox.value.substring(0, textBox.value.length - 1)
	}
	
	textBox.value = trim(textBox.value);
}
