function check_limits(theField,min,max)
{
if (!((theField.value >= min) && (theField.value <= max)))
{
return(false);
}
}   
function numbers_only(myfield, e, dec)
{
var key;
var keychar;
if (window.event)
{
key = window.event.keyCode;
}
else if (e)
{
key = e.which;
}
else
{
return true;
}
keychar = String.fromCharCode(key);
if ((key==null) || (key==0) || (key==8) || 
(key==9) || (key==13) || (key==27) )
{
return true;
}
else if ((("0123456789").indexOf(keychar) > -1))
{
return true;
}
else if (dec && (keychar == "."))
{
myfield.form.elements[dec].focus();
return false;
}
else
{
return false;
}
}   
function makeRequest(url) 
{
var http_request = false;
url = url + "?sid=" + Math.random();
data_received = 1;
if (window.XMLHttpRequest) 
{ 
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) 
{
http_request.overrideMimeType('text/xml');
}         
}
else if (window.ActiveXObject) 
{     
try 
{
http_request = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) 
{
try 
{
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) 
{
}
} 
}
if (!http_request) 
{
alert('Giving up :( Cannot create an XMLHTTP instance');
return false;
}
http_request.onreadystatechange = function() { alertContents(http_request); };
http_request.open('GET', url, true);
http_request.send(null);
}   
function alertContents(http_request) 
{
if (http_request.readyState == 4) 
{
if (http_request.status == 200) 
{
parse_vars(http_request.responseText);
data_received = 0;
}
else 
{
data_received = 0;
}
}
}   
function submitCheck()
{
var answer;
answer = confirm("Do you really want to send programming to the panel?");
if (answer == false)
{
return false;
}  
else
{
return true;
}   
}   
function stopRKey(evt) 
{
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if ((evt.keyCode == 13) && ((node.type=="text") || (node.type=="password")))  
{
return false;
}
}	
document.onkeypress = stopRKey; 
