function openWindow(url) {
		  var popupWin = window.open(url, 'newWin',  'dependent,scrollbars=yes,width=650,height=792,left=50,top=50');
			popupWin.focus();
		}

function fetchDepartment(obj){
		obj.form.submit();
		 	
	}
	function setTask(obj,theTask ){
		alert(theTask);
	}

function changeDivVisibility(DivNo){
 	var theForm;
	for (x=1; x<4; x++){
		theForm = document.getElementById('form' + x);
		theForm.style.visibility = "hidden";	
	}
	theForm = document.getElementById('form' + DivNo);
	theForm.style.visibility = "visible";
}
 
function validate(frm){
	var ErrorMessage = "";
	var textValue = "";
	
	for (i=0; i < frm.length - 1; i++){
		if (frm.elements[i].type == "text" || frm.elements[i].type == "textarea"){
			textValue = frm.elements[i].value;
			if (textValue.length == 0){
				ErrorMessage += frm.elements[i].name + " is required \n" ;
			}
		}
	}
	if (ErrorMessage.length > 0){
		alert(ErrorMessage);
		return false;
	}
	else{
		alert('ok');
		return true;
	}

}