// checkboxChecked
// jQuery function which will return 1 if checkbox is checked, 0 if not
// requires the jQuery object to be passed through eg. checkboxChecked($('#checkbox-1'))
function checkboxChecked(chkbx){
	if(chkbx.attr('checked')){
		return 1;
	}else{
		return 0;
	}
}

// returns the value of querystring GET parameters
// send parameter by name eg. http://www.example.com/?foo=bar
// getParameterByName('foo') will return 'bar'
function getParameterByName(name)
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return decodeURIComponent(results[1].replace(/\+/g, " "));
}
