function popLink(Link,width,Height,showScroll,isFullScreen)
{
	var strFeatures = "height="+Height+",width="+width+",status=no,titlebar=no";
	
	if(isFullScreen)
		strFeatures+=",fullscreen=yes";
	if(showScroll)
		strFeatures+=",scrollbars=yes";
		
	var popup=window.open(Link, "_blank",strFeatures);
	popup.focus();
}

function openWindow(Link)
{
	window.open(Link, "_blank");
}

function validateBlankField(obj) {
	if(trim(obj.value)=='') {
		alert("All * fields are mandatory");
		obj.value='';
		obj.focus();
		return false;
	}
	return true;
}

function trim(s) {
  while (s.substring(0,1) == ' ') {
    s = s.substring(1,s.length);
  }
  while (s.substring(s.length-1,s.length) == ' ') {
    s = s.substring(0,s.length-1);
  }
  return s;
}

//validate combo box if first field is selected.
function validateCombo(cbo) {
	if(cbo.options.selectedIndex==0) { 
		alert("All * marked fields are mendatory");
		cbo.focus();
		return false;
	}
	return true;
}

function validateRadio(rad) {
	var chk=false;
		
	if(rad.length!=null) {
		for(var i=0;i<rad.length;i++) {
			if(rad[i].checked) {
				chk=true;
				break;
			}
		}
	} else {
		if(rad.checked)
			chk = true;
	}
	
	return chk;
}