if (!document.all) {
  document.write("<link rel='stylesheet' type='text/css' href='../../css/mozilla-styles.css' />");
}
function initContentPage() {
	setBackground();
	showContentPage();
	if (document.all) {
		window.onresize = function onresizeEvent() {
       		showContentPage();
    	}
	} else {
		window.onresize = function onresizeEvent(evt) {
    		showContentPage();
	    }
	}
}

function showContentPage() {
	var boxWidth = 0;
	var boxHeight = 0;
	if (document.all) {
    	boxWidth = document.body.clientWidth;
    	boxHeight = document.body.clientHeight;
	} else {
        boxWidth = window.innerWidth - boxWidth - 30;
        boxHeight = window.innerHeight - 50;
	}
	document.getElementById("content").style.width=(boxWidth - 240); 
	document.getElementById("content").style.height=(boxHeight-180); 
	document.getElementById("content").style.visibility="visible";
}

function checkOn(field) {
  field.style.backgroundColor="#DFDFDF";
}

function checkOut(field) {
  field.style.backgroundColor="#f0f0f0";
}

function displayWaitScreen() {
  if (typeof overlib != 'undefined') {
	nd();
	overlib('<div id="waitmessage" class="shadedbox" style="z-index:1001;"><img id="waitmessageIcon" src="../../images/x.gif"  style="z-index:1001"/></div>',
      FULLHTML,
      CENTERPOPUP,
      STICKY
    );
  }
  return true;
}

function closeWaitScreen() {
    overlib('', FULLHTML);
    nd();
    return true;
}


/*
 * Check whether the feld is empty
 */
function isEmpty(field) {
    if (field != null && field.length > 0) {
        return false;
    }
    return true;
}

var checkFormularErrorMessage = 'please fill all mandatory form elements';
function checkFormular(elem) {
    var form = elem.form;
    var numOfElements;
    var currentElement;
    var count;

    numOfElements = form.length;
    for (count = 0; count < numOfElements; count++) {
        currentElement = form.elements[count];
        if (currentElement.getAttribute("mandatory") != null &&
            (currentElement.getAttribute("mandatory") == true ||
             currentElement.getAttribute("mandatory") == 'true')) {
            //div could be the mandatory label
            if (currentElement.tagName!='DIV') {
                if (currentElement.value == null || currentElement.value == "") {
                   alert(checkFormularErrorMessage);
                   return;
                }
            }
        }
    }

    form.submit();
}