/*
* Funktion für PopUp-Fenster
*/
function popUp(popUpURL, popUpName, popUpWidth, popUpHeight) {
	var popUpParamString = "";	
	if(popUpName == "fix"){//feste grösse, keine scrollbars
		if(popUpHeight == ""){
			popUpHeight = 180;
		}		
		if(popUpWidth == ""){
			popUpWidth = 200;
		}
		popUpParamString = "menubar=0,location=0,toolbar=0,status=0,resizable=0,scrollbars=yes,dependent=1,height=" + popUpHeight +",width=" + popUpWidth;
	}	
	else if(popUpName == "flex"){//keine feste grösse, mit scrollbars
		if(popUpHeight == ""){
			popUpHeight = 600;
		}		
		if(popUpWidth == ""){
			popUpWidth = 400;
		}
		popUpParamString = "menubar=1,location=0,toolbar=0,status=1,resizable=1,dependent=1,scrollbars=yes,height=" + popUpHeight +",width=" + popUpWidth;
	}	
		
	else if(popUpName == "flux"){//feste grösse, mit scrollbars
		
		if(popUpHeight == ""){
			popUpHeight = 600;
		}
		
		if(popUpWidth == ""){
			popUpWidth = 400;
		}
		popUpParamString = "menubar=0,location=0,toolbar=0,status=0,resizable=0,dependent=1,scrollbars=yes,height=" + popUpHeight +",width=" + popUpWidth;
	}	
	else if(popUpName == "pix"){//keine feste grösse, keine scrollbars
		if(popUpHeight == ""){
			popUpHeight = 400;
		}		
		if(popUpWidth == ""){
			popUpWidth = 600;
		}
		popUpParamString = "menubar=0,location=0,toolbar=0,status=0,resizable=1,dependent=0,scrollbars=no,height=" + popUpHeight +",width=" + popUpWidth;
	}	
	else if(popUpName == "media"){//keine feste grösse, mit scrollbars
		if(popUpHeight == ""){
			popUpHeight = 600;
		}		
		if(popUpWidth == ""){
			popUpWidth = 400;
		}
		popUpParamString = "menubar=1,location=0,toolbar=1,status=1,resizable=1,dependent=1,scrollbars=yes,height=" + popUpHeight +",width=" + popUpWidth;
	}
	else if(popUpName == "agb"){//keine feste grösse, mit scrollbars
		if(popUpHeight == ""){
			popUpHeight = 600;
		}		
		if(popUpWidth == ""){
			popUpWidth = 700;
		}
		popUpParamString = "menubar=0,location=0,toolbar=1,status=0,resizable=1,dependent=1,scrollbars=yes,height=" + popUpHeight +",width=" + popUpWidth;
	}
	newwindow = window.open(popUpURL,popUpName,popUpParamString);
	newwindow.focus();
}

/*
* Funktion zur Ausgabe des aktuellen Datums mit oder ohne Wochentag
*/
DatArray = new Array("So","Mo","Di","Mi","Do","Fr","Sa","??" )

function GetDate(offset, withDayOfWeek){
	var time = new Date()
	time.setTime( time.getTime()+offset*86400000);
	tag     = time.getDate();
	monat   = time.getMonth()+1;
	jahr    = time.getYear() % 100;
	if (tag   < 10)   tag   = "0"+tag;
	if (monat < 10)   monat = "0"+monat;
	if (jahr  < 10)   jahr  = "0"+jahr;
	
	var aDate = tag+'.'+monat+'.'+jahr;
	
	if(withDayOfWeek) aDate = aDate +' '+DatArray[time.getDay()];
	
	return aDate;
}


function openWindow(popUpURL, popUpName, popUpWidth, popUpHeight) {
	var popUpParamString = "";	
	if(popUpName == "calendar"){		
		if(popUpHeight == ""){
			popUpHeight = 250;
		}		
		if(popUpWidth == ""){
			popUpWidth = 250;
		}
		popUpParamString = "menubar=0,location=0,toolbar=0,status=0,resizable=0,scrollbars=no,dependent=1,height=" + popUpHeight +",width=" + popUpWidth;
	}
	newwindow = window.open(popUpURL,popUpName,popUpParamString);
	newwindow.focus();
}
