function openWindow(theURL,winName, features) { //v2.0
  	newwindow = window.open(theURL,winName,features);
	if (window.focus) {newwindow.focus()}
}

function CheckLength(maxLength) {

	var charLeft = maxLength - window.event.srcElement.value.length;
	
	document.getElementById("chars").innerHTML = "" + charLeft;	

	if (window.event.srcElement.value.length >= maxLength+1) {
		window.event.srcElement.value = window.event.srcElement.value.substring(0, maxLength);
		//alert('You have reached the maximum length of characters permitted here.');
		return false; 
	}
}

function showHide(id){


	if(document.getElementById(id).style.display != 'table-row'){
           	document.getElementById(id).style.display = 'table-row';
	} else {
           	document.getElementById(id).style.display = 'none';
	}
	
}

function showHide2(id){


	if(document.getElementById(id).style.display != 'block'){
           	document.getElementById(id).style.display = 'block';
	} else {
           	document.getElementById(id).style.display = 'none';
	}
	
}

function hideAll(id){

	i = 1;
	div = id + i;

	while(document.getElementById(div)){

	if(document.getElementById(div).style.display == 'block'){
           	document.getElementById(div).style.display = 'none';
	}

	i++;
	div = id + i;

	}
	
}