function trim(str)
{
	return str.replace(/(^[\s]+)|([\s]+$)/g, '');
}
function checkemail(str)
{
var email = /([\._\w-]+)@([\._\w-]+)\.([a-zA-Z]+)/;
	str = trim(str);
        var result = str.match(email);
        if (result != null) { 
          if (result[0] != str) { return false; }
          else { return true; }
        }
        else { return false; }

}

function openQues(thePage, w, h) {
  x = parseInt((screen.width - w)/2);
  y = parseInt((screen.height - h)/2);
 args = "\"toolbar=0,location=0,directories=0,status=0,menubar=0,left=" + x + ",top=" + y + ",scrollbars=0,resizable=0,copyhistory=0,width=" + w + ",height=" + h +"\"";
 
 /**
  * Here is where we add the number of inputs selected - sam
  */
 var inputs = document.getElementById('upload_select').value;
 // Add them to the url
 thePage = thePage+'&inputs='+inputs;
 /**
  * done
  */
      
 openwin = window.open(thePage,"OpenWindow",args);
 openwin.focus();
}

function saveinput() {
	challengeid = document.forms["frminput"].challengeid.value;
	challenge_step = document.forms["frminput"].challenge_step.value;

	document.forms["frminput"].action = "savechallengeinputs.asp";
	document.forms["frminput"].submit();
	
}