function popWin(url, w, h, scroll){
    URL = url + '';
    popWindow = window.open(url,'win','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=' + scroll + ',resizeable=1,copyhistory=0,height=' + h + ',width=' + w);
    // return(false);
}//popWin

/*
* Checks whether the string str is empty
* Returns true if the string is empty
*/
function isEmptyString(str){
	
	//trim the leading whitespaces:
	regEx = /^\s*/gi;
	newStr = str.replace(regEx,"");
	if(newStr.length == 0){
		return true;
	}
	
	return false;
}//isEmptyString

/*
* Checks whether the string is valid decimal number (not in exponential form)
* Note: this is not 100% robust matching
* Returns true if the string is a valid number
*/
function isValidNumber(str){
	regEx = /^[+-]?\d+\.?\d*$/;
	res = str.search(regEx);
	if(res==-1){
		return false;
	}
	return true;
}//isValidNumber

/*
* Checks whether the string is longer than a maximalLength
*/
function isLongerThan(str, maxLen){
	if(str.length>maxLen){
		return true;
	}
	return false;
}//isLongerThan

/*
* Checks whether the string is valid date in 'YYYY-MM' format
* Returns true if the string is valid
*/
function isYYYYMM(str){
	regEx = /^\d{4}\-{1}01|02|03|04|05|06|07|08|09|10|11|12$/;
	res = str.search(regEx);
	if(res==-1){
		return false;
	}
	return true;
}//isYYYYMM

/*
* Returns the selected value of select box
*/
function getSelectedValue(selectBox){
	selInd = selectBox.selectedIndex;
	selOpt = selectBox.options[selInd];
	return selOpt.value;
}//getSelectedValue

/*
* Asks for confirmation berore executins link delAction
*/
function confirmDel(delAction){
	if (confirm("Are you sure you want to delete it?")){
		location.href = delAction;
	}
}//confirmDel
