function popup(url, width, height, name){
  pop = window.open(url,name,'width=' + width + ',height=' + height + ',status=yes,resizable=yes,menubar=no,locationbar=no,scrollbars=yes,dependent=yes' );
}
function popup_centered(url, width, height, name)
{
    var sWidth   = screen.width;
    var sHeight  = screen.height;
        
    // Center Popup
    var posX    =  (sWidth/2) - (width/2);
    var posY    =  (sHeight/2) - (height/2);

	pop = window.open(url,name,'width=' + width + ',height=' + height + ',left=' + posX + ',top=' + posY + ',status=no,resizable=yes,menubar=no,locationbar=no,scrollbars=no,dependent=yes' );
}

function popup_resize(width, height) {
    window.resizeTo(width, height);
    // Center Popup
    var sWidth   = screen.width;
    var sHeight  = screen.height;
    var posX    =  (sWidth/2) - (width/2);
    var posY    =  (sHeight/2) - (height/2);
    moveTo(posX,posY);
}

// fortuna http://www.fortuna-gmbh.de/
// ©2004 Werb'Office R.&F. Müller GmbH http://www.werboffice.de/
//-------------------------------------------------------------------------
function CSSRollover(theObject, theAction, theColor){ // wechselt Hintergrundfarbe bei Hauptnavigation (Rollover)
	if(theAction == 'in'){
		theObject.style.backgroundColor = theColor;
	}else{
		theObject.style.backgroundColor = '';
	}
}

function PopWin(theURL,winName,features) {
  nWindow = window.open(theURL,winName,features);
  nWindow.focus();
}

//-------------------------------------------------------------------------
// Formularvalidierung
// Bei Funktionsaufruf muss Sprache als erstes Argument mit übergeben werden
// Kommen weitere Sprachen hinzu, muss der "switch-Anweisungs-Block" dementsprechend erweitert werden
myOrigCol="#4c4c4c";

function checkForm(language){
	var sendform=1; var theMessage=""; var theAlert1=""; var theAlert2=""; var myAlertCol="#CC0000"; var isChecked=0;
	
	switch (language){
		case "deutsch":
			theMessage="Bitte ergänzen: "; theAlert1="Das Feld \""; theAlert2="\" muss noch ausgefüllt werden!"; break;
		case "english":
			theMessage="Please fill out: "; theAlert1="Please fill out \""; theAlert2="\"!"; break;
	}
	
	for(i=1;i<checkForm.arguments.length-1;i+=3){
	
		if (checkForm.arguments[i].type=="text" || checkForm.arguments[i].type=="textarea"){ // Wenn es sich um ein Formularelement vom Typ "text" handelt
			if (checkForm.arguments[i].value=="" || checkForm.arguments[i].value==theMessage+checkForm.arguments[i+1] || checkForm.arguments[i].value==checkForm.arguments[i+2]){
				if(checkForm.arguments[i].type!="textarea"){
					checkForm.arguments[i].value=theMessage+checkForm.arguments[i+1];
					checkForm.arguments[i].style.color=myAlertCol;
				}
				alert(theAlert1+checkForm.arguments[i+1]+theAlert2);
				checkForm.arguments[i].focus();
				sendform=0;
				break;
			}else{ // Falls Feld OK, wird Schriftfarbe wieder auf "normal" (myOrigCol) gesetzt.
				checkForm.arguments[i].style.color=myOrigCol;
			}
		}
		
		/* Diesen Anweisungsblock kann OPERA nicht abarbeiten und das Formular wird nicht abgeschickt. 
		if (checkForm.arguments[i][0]){ // Wenn es sich um ein Formularelement vom Typ "radio" handelt
			theRadioLength=checkForm.arguments[i].length // Speichert Anzahl der zusammengehörigen Radiobuttons
			isChecked=0;
			for(t=0;t<theRadioLength;t++){
				if(checkForm.arguments[i][t].checked==1){ // Alle zusammengehörigen Radiobuttons werden auf "checked" überprüft
					isChecked=1;
					break;
				}
			}
			if (isChecked==0){
				alert(theAlert1+checkForm.arguments[i+1]+theAlert2);
				checkForm.arguments[i][0].focus();
				sendform=0;
				break;
			}
		}*/
		
	} //END FOR
	
	if (sendform==0){
		return false;
	}else{
		return true;
	}
}



function resetStyle(){
	for(i=0;i<resetStyle.arguments.length;i++){
		resetStyle.arguments[i].style.color=myOrigCol;
	}
}

function popup(url, width, height, name){
  pop = window.open(url,name,'width=' + width + ',height=' + height + ',status=yes,resizable=yes,menubar=no,locationbar=no,scrollbars=yes,dependent=yes' );
}
function popup_centered(url, width, height, name)
{
    var sWidth   = screen.width;
    var sHeight  = screen.height;
        
    // Center Popup
    var posX    =  (sWidth/2) - (width/2);
    var posY    =  (sHeight/2) - (height/2);

	pop = window.open(url,name,'width=' + width + ',height=' + height + ',left=' + posX + ',top=' + posY + ',status=no,resizable=yes,menubar=no,locationbar=no,scrollbars=no,dependent=yes' );
}

function popup_resize(width, height) {
    window.resizeTo(width, height);
    // Center Popup
    var sWidth   = screen.width;
    var sHeight  = screen.height;
    var posX    =  (sWidth/2) - (width/2);
    var posY    =  (sHeight/2) - (height/2);
    moveTo(posX,posY);
}

