// Neues Fenster bzw. PopUp oeffnen
function openWin(url,oW_width,oW_height,oW_menubar,oW_toolbar,oW_location,oW_status,oW_scrollbars,oW_resizable) {
	values = 'width=' + oW_width + ',height=' + oW_height + ',menubar=' + oW_menubar + ',toolbar=' + oW_toolbar + ',location=' + oW_location + ',status=' + oW_status + ',scrollbars=' + oW_scrollbars + ',resizable=' + oW_resizable;


// alert(values); // Use alert method to test your values
	popup = window.open(url,'popup',values);
	popup.focus();
}

// Selectbox onChange-Event
function onChange(value, pageaction){
	if(value!=''){
		if(pageaction!='')
			document.forms.frm.pageaction.value = pageaction;
		//alert(document.forms.frm.pageaction.value);
		document.forms.frm.submit();
	}
}

// Neues Vorschau-Fenster oeffnen
function openPreview(path){
	var url				= '/index.php/'+path+'/TEMPMODE';
	var oW_width		= 750;
	var oW_height		= 550;
	var oW_menubar		= 0;
	var oW_toolbar		= 0;
	var oW_location		= 0;
	var oW_status		= 1;
	var oW_scrollbars	= 1;
	var oW_resizable	= 1;
	openWin(url,oW_width,oW_height,oW_menubar,oW_toolbar,oW_location,oW_status,oW_scrollbars,oW_resizable);
	return false;
}

// Neues Vorschau-Fenster oeffnen
function openTextblock(mod, action, id, blockId,index){
	var url				= 'textblock.php?mod=textblock&pageAction='+action+'&backModule='+mod+'&backTarget='+id+'&id='+blockId+'&index='+index;
	var oW_width		= 700;
	var oW_height		= 500;
	var oW_menubar		= 0;
	var oW_toolbar		= 0;
	var oW_location		= 0;
	var oW_status		= 1;
	var oW_scrollbars	= 1;
	var oW_resizable	= 1;
	openWin(url,oW_width,oW_height,oW_menubar,oW_toolbar,oW_location,oW_status,oW_scrollbars,oW_resizable);
	return false;
}


window.onload = function() {
	var visibleYears = 1;
	var dateString = new Date().getMonth() * 100 + new Date().getDate(); // getMonth() is zero based!
	if (dateString <= 20) // nur bis zum 20.01. des laufenden Jahres
		visibleYears++;
	$('.news-year').click(function() {
		$('.news-year').next('ul').hide('fast');
		$(this).next('ul').show('slow');
		return false;
	}).slice(visibleYears).each(function() {
		$(this).next('ul').toggle();
	});
	if(document.getElementById("search_pb")){
		elm = document.getElementById("search_pb");
		elm.value ="Nachname o. Durchwahl";
		elm.onfocus = function(){ elm.value = ""; };
	}
}

