// Code obtained from http://WillMaster.com/
//
// Each required form field can be checked with JavaScript. Here are 
//    the function names for the different kinds of checks:
//
//       1. WithoutContent() -- check if the text, textarea, password, 
//              or file fields has no content.
//       2. NoneWithContent() -- check if none of the set of text, 
//              textarea, password, or file fields have content. 
//              (Set: More than one with the same field name.)
//
//       3. NoneWithCheck() -- check if none of the set of radio buttons 
//              or checkboxes are checked. (Set: More than one with the 
//              same field name.)
//       4. WithoutCheck() -- check if the single radio button or checkbox 
//              is unchecked.
//
//       5. WithoutSelectionValue() -- check if selected drop-down list or 
//              select box entries have no value.
//
//
// The format for using the above functions is
//             if(       WithoutContent([FORMFIELDVALUE])) [ERRORMESSAGE]
//             if(      NoneWithContent([FORMFIELD])     ) [ERRORMESSAGE]
//             if(        NoneWithCheck([FORMFIELD])     ) [ERRORMESSAGE]
//             if(         WithoutCheck([FORMFIELD])     ) [ERRORMESSAGE]
//             if(WithoutSelectionValue([FORMFIELD])     ) [ERRORMESSAGE]
//
// The if(...) part and the error message part may be on separate lines, like
//             if(WithoutContent([FORMFIELDVALUE]))
//                [ERRORMESSAGE]
//             if(NoneWithContent([FORMFIELD]))
//                [ERRORMESSAGE]
//             if(NoneWithCheck([FORMFIELD]))
//                [ERRORMESSAGE]
//             if(WithoutCheck([FORMFIELD]))
//                [ERRORMESSAGE]
//             if(WithoutSelectionValue([FORMFIELD]))
//                [ERRORMESSAGE]
//
//
//      FORMFIELD -- The format for specifying a "form field" is 
//                         document.[FORMNAME].[FIELDNAME]
// FORMFIELDVALUE -- The format for specifying a "form field value" is 
//                         document.[FORMNAME].[FIELDNAME].value
//   ERRORMESSAGE -- The format for specifying an "error message" is
//                         { errormessage += "\n\n[MESSAGE]"; }
//                   If the message itself contains quotation marks, 
//                      they must be preceded with a back slash. 
//                      Example: \"
//
//
//      FORMNAME -- The name assigned to the form in the <FORM... tag. 
//     FIELDNAME -- The field name being checked.
// 
//
// For use with this JavaScript, the only non-alphanumeric character a 
//    fieldname may have is the underscore. Replace any hyphens, colons, 
//    spaces, or other non-alphanumeric characters in your field names 
//    with an underscore character.
//
//
// Put field checks into the function CheckRequiredFields(), in the order 
//    you want the fields checked.
//


function CheckRequiredFields() {
var errormessage = new String();
// Put field checks below this point.

if(WithoutContent(document.seatform.sNUMM.value))
	{ errormessage += "\n\nÄeren Numm feelt."; }
if(WithoutContent(document.seatform.sVIRNUMM.value))
	{ errormessage += "\n\nÄere Virnumm feelt."; }
if(WithoutContent(document.seatform.sSTROOSS.value))
	{ errormessage += "\n\nÄer Strooss feelt."; }
if(WithoutContent(document.seatform.sUERTSCHAFT.value))
	{ errormessage += "\n\nÄer Uertschaft feelt."; }
if(WithoutContent(document.seatform.sTELEFON.value))
	{ errormessage += "\n\nÄeren Telefonsnummer feelt."; }

if(WithoutContent(document.seatform.hncaptcha_private_key.value))
	{ errormessage += "\n\n Och de Captcha muss ausgefëllt sinn."; }

// Put field checks above this point.
if(errormessage.length > 2) {
	alert('Opgepasst:' + errormessage+'\n\n\n Fëllt w.e.g de Formulair komplett aus.');
	return false;
	}
return true;
} // end of function CheckRequiredFields()


function WithoutContent(ss) {
if(ss.length > 0) { return false; }
return true;
}

function NoneWithContent(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].value.length > 0) { return false; }
	}
return true;
}

function NoneWithCheck(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].checked) { return false; }
	}
return true;
}

function WithoutCheck(ss) {
if(ss.checked) { return false; }
return true;
}

function WithoutSelectionValue(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].selected) {
		if(ss[i].value.length) { return false; }
		}
	}
return true;
}






























// Funktion zur Referenzierung von Div-Layern mit Zugriff auf CSS-Eigenschaften
  function div_ref_style(id) {
    if      (document.layers)         return document.layers[id];              
    else if (document.all)            return document.all[id].style;           
    else if (document.getElementById) return document.getElementById(id).style;
    else                              return null;        
  }
  
  
  function div_show(id) {
  	div_ref_style(id).visibility = 'visible';
  }
  function div_hide(id) {
  	div_ref_style(id).visibility = 'hidden';
  }
  
  function div(id) {
  	var v = div_ref_style(id).visibility;
  	if (v == 'hidden') 	div_ref_style(id).visibility = 'visible';
  	if (v == 'visible') div_ref_style(id).visibility = 'hidden';
  }
  
  function div_vis(id) {
  	div_ref_style(id).visibility = 'visible';
  }
  
    
  function decision(message, url){
		if(confirm(message)) location.href = url;
  }
  
function oeffnefenster(URI,b,h)
{
var eigenschaft,sbreite,shoehe,fenster02;

// stellt die Bildschirmabmessungen fest
var ns6 = (!document.all && document.getElementById);
var ie4 = (document.all);
var ns4 = (document.layers);

if(ns6||ns4) {
sbreite = innerWidth;
shoehe = innerHeight;
}
else if(ie4) {
sbreite = document.body.clientWidth;
shoehe = document.body.clientHeight;
}

// Fensterpossition linke obere Ecke
x = (sbreite-b)/2;
y = (shoehe-h)/2;

var eigenschaften="left="+x+",top="+y+",screenX="+x+",screenY="+y+"";
eigenschaften= eigenschaften + ",width="+b+",height="+h+",menubar=no, status=no";
fenster02=window.open(URI,"simpleviewer",eigenschaften);
fenster02.focus();
}
