function byId(id)
{
	return document.getElementById(id);
}

function popup(url,name,w,h) 
{
	newwindow=window.open(url,name,'height='+h+',width='+w+',left='+((screen.width-w)/2)+',top='+((screen.height-h)/2));
	if (window.focus) {newwindow.focus()}
	return false;
}

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }

function autoCompleteHour(i){
	if($("#zi"+i+":checked").length!=0){
		$("#ora_start"+i).val($("#ora_start"+(i-1)).val())  ;
		$("#min_start"+i).val($("#min_start"+(i-1)).val());
		$("#ora_stop"+i).val($("#ora_stop"+(i-1)).val());
		$("#min_stop"+i).val($("#min_stop"+(i-1)).val());
	}
	else{
		$("#ora_start"+i).val('')  ;
		$("#min_start"+i).val('');
		$("#ora_stop"+i).val('');
		$("#min_stop"+i).val('');
	}
	
}