
function roundTo(num,pow){
  num *= Math.pow(10,pow);
  num = (Math.round(num)/Math.pow(10,pow))+ "" ;
  if(num.indexOf(".") == -1)
    num += "." ;
  while(num.length - num.indexOf(".") - 1 < pow)
    num += "0" ;
  return num ;
}



function isNullString(str) {
	
	var i, isNull = true;

	if (str.length == 0)
		isNull = true;
	else {
		for (i=0; i<str.length; i++) {
			if (str.substring(0, 1) != " ") {
				isNull=false;
				break;
			}
		}
	}

	return isNull;

}


//Advanced Email Check credit-
//By JavaScript Kit (http://www.javascriptkit.com)
//Over 200+ free scripts here!

function checkemail(str) {

	var valid;
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	
	if (filter.test(str))
		valid = true;
	else {
		valid = false;
	}

	return valid;
}

