

function check_length(theForm,max) { 
	if(theForm.value.length > max) { 
		theForm.value = theForm.value.substring(0,max);
		alert("(Maximal " + max + " Character)");
		} 
	return true;
}

var http = createRequestObject();
var fieldname='';

function createRequestObject() {
    var obj;
    var browser = navigator.appName;
    
    if(browser == "Microsoft Internet Explorer"){
        obj = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else{
        obj = new XMLHttpRequest();
    }
    return obj;    
}

function handleResponse() {
	if(http.readyState == 4){
        document.getElementById(fieldname+'_alert').innerHTML = http.responseText;
    }
}

function show_status(obj) {
	document.getElementById(obj+'_comment').style.display='inline';
	return;
}

function hideBox(obj) {
	document.getElementById(obj).style.display='none';
	return;
}

function clearBox(obj) {
	document.getElementById(obj).innerHTML='';
	return;
}

/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/
//--------------------------------------------------------
function getData(url,display) {
  if ( window.frames['iframer'] ) {
    window.frames['iframer'].location = url;
    var lyr = document.getElementById? document.getElementById(display): document.all? document.all[display]: null;
    if ( lyr && typeof lyr.innerHTML != "undefined" ) {
      lyr.innerHTML = '<img src="../images/loading.gif"> ...loading '+display;
    }
    return false;
  } 
  return true; // other browsers follow link
}

function displayData(obj) {
  var lyr = document.getElementById? document.getElementById(obj): document.all? document.all[obj]: null;
    if ( window.frames['iframer'] && lyr && typeof lyr.innerHTML != "undefined" ) {
      lyr.innerHTML = window.frames['iframer'].document.getElementById(obj).innerHTML;
    }
}

function displayFrame(obj,frame) {
  var lyr = window.frames[frame].document.getElementById? window.frames[frame].document.getElementById(obj): window.frames[frame].document.all? window.frames[frame].document.all[obj]: null;
    if ( window.frames['iframer'] && lyr && typeof lyr.innerHTML != "undefined" ) {
      lyr.innerHTML = window.frames['iframer'].document.getElementById(obj).innerHTML;
    }
}
