
<!---

	function newwnd(page,_width,_height)
	{
		zufall=Math.random();
		zufall*=16;
		zufall=Math.ceil(zufall);
		
		_left=(screen.width-_width)/2;
		_top=(screen.height-_height)/2-25;
		var newwindow = window.open(page, 'detail' + zufall, 'top=' + _top + ',left=' + _left + ',width=' + _width + ',height=' + _height + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
		newwindow.focus();
	}

	function newwnd_noscroll(page,_width,_height)
	{
		zufall=Math.random();
		zufall*=16;
		zufall=Math.ceil(zufall);
		
		_left=(screen.width-_width)/2;
		_top=(screen.height-_height)/2-25;
		var newwindow = window.open(page, 'detail' + zufall, 'top=' + _top + ',left=' + _left + ',width=' + _width + ',height=' + _height + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
		newwindow.focus();
	}

	function newwnd_fullscreen(page,_width,_height)
	{
		zufall=Math.random();
		zufall*=16;
		zufall=Math.ceil(zufall);
		
		var newwindow = window.open(page, 'detail' + zufall, 'top=5,left=5,width='+(screen.width-10)+',height='+(screen.height-30)+',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
		newwindow.focus();
	}

	function confirm(link)
	{
		_width = 350;
		_height = 230;
		_left=(screen.width-_width)/2;
		_top=(screen.height-_height)/2;
		window.open(link, 'confirm', 'top=' + _top + ',left=' + _left + ',width=' + _width + ',height=' + _height + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
	}

	function fileman(link)
	{
		_width = 550;
		_height = 180;
		_left=(screen.width-_width)/2;
		_top=(screen.height-_height)/2;
		window.open(link, 'fileman', 'top=' + _top + ',left=' + _left + ',width=' + _width + ',height=' + _height + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
	}

	function showwnd(change)
	{
		var newwindow = window.open(change, 'wnd', 'top=10,left=10,width=1000,height=700,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
		newwindow.focus();
	}

	function sizeEditDiv() {

		// gr&ouml;sse des con_ver_edit Div's anpassen
		if (window.innerHeight) hoehe = window.innerHeight;
		else if (document.body && document.body.offsetHeight) hoehe = document.body.offsetHeight;
		if (window.innerWidth) breite = window.innerWidth;
		else if (document.body && document.body.offsetWidth) breite = document.body.offsetWidth;
		
		document.getElementById(sizeEditDiv_div_name).style.height = hoehe-sizeEditDiv_margin_top; 
		document.getElementById(sizeEditDiv_div_name).style.width = breite-sizeEditDiv_margin_left; 
	}

	function chimg(ID_Content, Field, neu)
	{
		change = '/verwaltung/bilder/frame.php?site=' + ID_Content + '&field=' + Field + '&new=' + neu + '&img_openNode=' + img_openNode;
		window.open(change, 'bildpool', 'top=10,left=10,width=1000,height=700,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	}

	function chswf(ID_Content, Field, neu)
	{
		change = '/verwaltung/flash/frame.php?site=' + ID_Content + '&field=' + Field + '&new=' + neu;
		window.open(change, 'flashpool', 'top=10,left=10,width=1000,height=700,toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');
	}
	
	function delimg(Field)
	{
		bild = document.getElementById(Field);
		bild.value='';
		imgbild = document.getElementById('img_'+Field);
		imgbild.src='';
	}

	function chkicker(ID_Content, Field, neu)
	{
		change = '/verwaltung/kicker/index.php?site=' + ID_Content + '&field=' + Field + '&new=' + neu;
		window.open(change, 'kickerpool', 'top=10,left=10,width=800,height=600,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	}

	function delkicker(Field)
	{
		document.getElementById(Field).value = '';  
	}

	function createLink(Field, selText)
	{
		change = '/verwaltung/content/index.php?field=' + Field + '&selText=' + selText;
		window.open(change, 'linkpool', 'top=10,left=10,width=800,height=600,toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');
	}

	function showimg_db(img_nr, size)
	{
		bildname = '/data/imgwnd.php?ID=' + img_nr + '&View='+ size;

		_width=50;
		_height=50;
		_left=(screen.width-_width)/2;
		_top=(screen.height-_height)/2;
		/*
		TM 052308
		window.open(bildname, 'bild_gal', 'top=' + _top + ',left=' + _left + ',width=' + _width + ',height=' + _height + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
		*/
		window.open(bildname, 'bild_gal', 'top=100,left=100,width=' + _width + ',height=' + _height + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
	}

	function showimg_file(img_name)
	{
		bildname = '/data/imgwnd.php?bild=' + img_name;

		_width=50;
		_height=50;
		_left=(screen.width-_width)/2;
		_top=(screen.height-_height)/2;
		window.open(bildname, 'bild_gal', 'top=' + _top + ',left=' + _left + ',width=' + _width + ',height=' + _height + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
	}
	
// Inputfield Filter DropDown
var inputid_sav = -1;
function closeChooseNULL(inputid, objid) {
	choosediv = document.getElementById(objid);

	if (inputid_sav == inputid) { 
		choosediv.style.visibility = "hidden";
		inputid_sav = -1;
		return ;
	}
}

function openChooseNULL_old(inputid, button) {
//	openChooseNULL(inputid, 'choose_NULL', button, 'bottom');
		choosediv = document.getElementById('choose_NULL');
	
		if (inputid_sav == inputid) { 
			choosediv.style.visibility = "hidden";
			inputid_sav = -1;
			return ;
		}
	
		if (document.getElementById(inputid)) {
			inputfield = document.getElementById(inputid);
			
			choosediv.style.visibility = "visible";
			choosediv.style.width = inputfield.offsetWidth + button.offsetWidth;
			

			_offsetLeft = 0;
			el = inputfield;
			while ((el.offsetParent) && (el.tagName != 'DIV')) { _offsetLeft += el.offsetLeft; el = el.offsetParent; }

			choosediv.style.left = _offsetLeft;

			_offsetTop = 0;
			el = inputfield;
			while ((el.offsetParent) && (el.tagName != 'DIV')) { _offsetTop += el.offsetTop; el = el.offsetParent; }

			choosediv.style.top = _offsetTop + inputfield.offsetHeight + 1;
	
			inputid_sav = inputid;
		}
	}

function openChooseNULL(inputid, objid, button, position) {
	choosediv = document.getElementById(objid);

	if (inputid_sav == inputid) { 
		choosediv.style.visibility = "hidden";
		inputid_sav = -1;
		return ;
	}

	if (document.getElementById(inputid)) {
		inputfield = document.getElementById(inputid);
		
		choosediv.style.visibility = "visible";
//		choosediv.style.width = inputfield.offsetWidth + button.offsetWidth;

		_offsetLeft = 0;
		el = inputfield;
		while ((el.offsetParent) ) { _offsetLeft += el.offsetLeft; el = el.offsetParent; } // && (el.tagName != 'DIV')

		choosediv.style.left = _offsetLeft - 19 + 'px';
		_offsetTop = 0;
		el = inputfield;
		while ((el.offsetParent) ) { _offsetTop += el.offsetTop; el = el.offsetParent; } // && (el.tagName != 'DIV')

		//alert (_offsetTop + ' / ' + _offsetLeft);

		if (position=='bottom') {
			choosediv.style.top = _offsetTop + 'px'; // inputfield.offsetHeight + 10 +
		} else if (position=='top') {
			choosediv.style.top = _offsetTop - choosediv.offsetHeight + 'px';
		} else {
		}

		inputid_sav = inputid;
	}
}

	
	
	// openDivFrame PopUp
	var openDivFrame_sav = -1;
	function closeDivFrame(inputid, divObj) {
		choosediv = window.parent.document.getElementById(divObj);
	
		choosediv.style.visibility = "hidden";
		openDivFrame_sav = -1;
		return ;
	}
	function openDivFrame(inputid, divObj) {
		choosediv = document.getElementById(divObj);
/*	
		if (openDivFrame_sav == inputid) { 
			choosediv.style.visibility = "hidden";
			openDivFrame_sav = -1;
			return ;
		}
*/	
		if (document.getElementById(inputid)) {
			inputfield = document.getElementById(inputid);
			
			choosediv.style.visibility = "visible";
//			choosediv.style.width = inputfield.offsetWidth;
			

			_offsetLeft = 0;
			el = inputfield;
			while ((el.offsetParent) && (el.tagName != 'DIV')) { _offsetLeft += el.offsetLeft; el = el.offsetParent; }

			choosediv.style.left = _offsetLeft ;//- (inputfield.offsetWidth-choosediv.style.width);

			_offsetTop = 0;
			el = inputfield;
			while ((el.offsetParent) && (el.tagName != 'DIV')) { _offsetTop += el.offsetTop; el = el.offsetParent; }

			choosediv.style.top = _offsetTop + inputfield.offsetHeight;
	
			openDivFrame_sav = inputid;
		}
	}

	function searchDivFrame(txt, iFrameObj) {
		
		iFrame = document.getElementById(iFrameObj);
		locationStr = iFrame.src;
		if ((ipos = iFrame.src.indexOf('searchStr='))> -1) {
			locationStr = iFrame.src.substring(0, ipos);
		}
		
		iFrame.src =  locationStr + '&searchStr=' + txt;
		
	}	
	
var monate = Array ()
monate[1] = 'Januar';
monate[2] = 'Februar';
monate[3] = 'März';
monate[4] = 'April';
monate[5] = 'Mai';
monate[6] = 'Juni';
monate[7] = 'Juli';
monate[8] = 'August';
monate[9] = 'September';
monate[10] = 'Oktober';
monate[11] = 'November';
monate[12] = 'Dezember';
/*
function createCalenderDropDown (objid, inputid, zindex,this_year,this_month,this_day,funccall,tabindex, formid) {
	var newdiv = document.createElement("<div>");
	newdiv.setAttribute('id', objid);
	newdiv.setAttribute('align', 'center');
	newdiv.setAttribute('class', 'cal');
	newdiv.setAttribute('style', 'position:absolute; visibility:hidden; z-index:'+zindex+';');
	
	document.getElementById(formid).appendChild(newdiv);
	
	var newinput_field = document.createElement("<input>");
	newinput_field.setAttribute('id', inputid);
	newinput_field.setAttribute('name', inputid);
	newinput_field.setAttribute('type', 'text');
	newinput_field.setAttribute('tabindex', tabindex);
	
	document.getElementById(formid).appendChild(newinput_field);
	
	var newinput_dd = document.createElement("<input>");
	newinput_dd.setAttribute('type', 'image');
	newinput_dd.setAttribute('src', '/verwaltung/img/navi_img/dropdown.jpg');
	newinput_dd.setAttribute('tabindex', (999+tabindex));
	newinput_dd.setAttribute('onClick', "openCalender(\''+inputid+'\', \''+objid+'\', this, \'bottom\');return false;");
	newinput_dd.setAttribute('align', 'absmiddle');
	
	document.getElementById(formid).appendChild(newinput_dd);
	
	
	
	// append
	// document.write('<div id="'+objid+'" align="center" class="cal" style="position:absolute; visibility:hidden; z-index:'+zindex+';"></div>');
//	document.write('<input id="'+inputid+'" name="'+inputid+'" type="text" tabindex="'+tabindex+'"><input type="image" src="/verwaltung/img/navi_img/dropdown.jpg" tabindex="999'+tabindex+'"onClick="openCalender(\''+inputid+'\', \''+objid+'\', this, \'bottom\');return false;" align="absmiddle">');
	createCalender (objid, inputid, this_year,this_month,this_day,funccall);
}
*/
function createCalenderDropDown (objid, inputid, zindex,this_year,this_month,this_day,funccall,tabindex,empty,readonly,popposition, formid) {

	if (popposition=='') {popposition='bottom';} 
	
	document.getElementById(formid).innerHTML = '<div id="'+objid+'" align="center" class="cal" style="position:absolute; visibility:hidden; z-index:'+zindex+';"></div><input id="'+inputid+'" name="'+inputid+'" type="text" tabindex="'+tabindex+'"><input type="image" src="/verwaltung/img/navi_img/dropdown.jpg" tabindex="999'+tabindex+'"onClick="openCalender(\''+inputid+'\', \''+objid+'\', this, \'bottom\');return false;" align="absmiddle">';
	createCalender (objid, inputid, this_year,this_month,this_day,funccall,empty);
}

function createCalenderDropDownInner (objid, inputid, zindex,this_year,this_month,this_day,funccall,tabindex,empty,readonly,popposition, formid) {
	if (popposition=='') {popposition='bottom';} 
	
	document.getElementById(formid).innerHTML = '<div id="'+objid+'" align="center" class="cal" style="position:absolute; visibility:hidden; z-index:'+zindex+';"></div><input id="'+inputid+'" name="'+inputid+'" type="text" tabindex="'+tabindex+'"><input type="image" src="/verwaltung/img/navi_img/dropdown.jpg" tabindex="999'+tabindex+'"onClick="openCalender(\''+inputid+'\', \''+objid+'\', this, \'bottom\');return false;" align="absmiddle">';
	createCalender (objid, inputid, this_year,this_month,this_day,funccall,empty);
}

function createCalender (objid, inputid, this_year,this_month,this_day,funccall,empty) {

	this_year = this_year*1;
	this_month = this_month*1;
	this_day = this_day*1;
	
	this_Date = new Date(this_year,(this_month-1),this_day);

	this_year = this_Date.getFullYear()
	this_month = this_Date.getMonth()+1;
	this_day = this_Date.getDate();

	start_Date = new Date(this_year,(this_month-1),1);
	start_tag = start_Date.getDay();
	if (start_tag==0) start_tag=7;

	var max_tag = 31;
	if(this_month==4 ||this_month==6 || this_month==9 || this_month==11 ) --max_tag;
	if(this_month==2)
	{
		max_tag-=3;
		if(this_year%4==0) max_tag++;
		if(this_year%100==0) max_tag--;
		if(this_year%400==0) max_tag++;
	}
	var max_coll = 42;
	var akttag = 1;

	var bgcolor='ffffff';
	var cal_str = '';
	
			cal_str += '<a href="#" class="cal_link" onClick="createCalender(\''+objid+'\', \''+inputid+'\', \''+(this_year-1)+'\',\''+(this_month)+'\',\''+this_day+'\')">&lt;&lt;</a>&nbsp;&nbsp;&nbsp;&nbsp;'+
				'<a href="#" class="cal_link" onClick="createCalender(\''+objid+'\', \''+inputid+'\', \''+this_year+'\',\''+(this_month-1)+'\',\''+this_day+'\')">&lt;</a>&nbsp;&nbsp;'+	
				'<strong>' + monate[this_month] + '&nbsp;'+this_year+'</strong>&nbsp;&nbsp;'+
				'<a href="#" class="cal_link" onClick="createCalender(\''+objid+'\', \''+inputid+'\', \''+this_year+'\',\''+(this_month+1)+'\',\''+this_day+'\')">&gt;</a>&nbsp;&nbsp;&nbsp;&nbsp;' +
				'<a href="#" class="cal_link" onClick="createCalender(\''+objid+'\', \''+inputid+'\', \''+(this_year+1)+'\',\''+(this_month)+'\',\''+this_day+'\')">&gt;&gt;</a>';
			cal_str += '<table cellpadding="2" cellspacing="0" class="cal" style="border: 1px solid black;" width="160">';
			cal_str += '<tr class="cal_headline"><td>M</td><td>D</td><td>M</td><td>D</td><td>F</td><td>S</td><td>S</td></tr>';
			cal_str += '<tr>';			
			
				for (i_tab=1;i_tab<=max_coll;i_tab++) {
					if ((i_tab>=start_tag)&&(i_tab<(max_tag+start_tag))) {
//						if (q_days[akttag-1]['color']!='') bgcolor = q_days[akttag-1]['color']; else bgcolor='ffffff';
						cal_str += '<td bgcolor="#'+bgcolor+'">';
						if (inputid!='') { 
							cal_str += '<a href=# class="';
							if (akttag==this_day) cal_str += 'active_date_link'; else cal_str += 'date_link';
							cal_str += '" onClick="openCalender(\''+inputid+'\', \''+objid+'\');createCalender(\''+objid+'\', \''+inputid+'\', \''+this_year+'\',\''+(this_month)+'\',\''+akttag+'\');'+funccall+';">'; 
						}
						cal_str += akttag;
						if (inputid!='') { cal_str += '</a>'; }
						akttag++;
					} else cal_str += '<td>&nbsp;';
					cal_str += '</td>';
					if ((i_tab%7)==0) cal_str += '</tr><tr>';
				}
			
			cal_str += '</tr>';
			cal_str += '</table>';
/*
// Debug
			cal_str += '<br>';
			cal_str += this_year+'<br>';
			cal_str += this_month+'<br>';
			cal_str += this_day+'<br>';
			cal_str += this_Date+'<br>';
			cal_str += this_Date.getFullYear()+'<br>';
			cal_str += this_Date.getMonth()+'<br>';
			cal_str += this_Date.getDate()+'<br>';
*/
	
	document.getElementById(objid).innerHTML = cal_str;
	if ((inputid!='')&&(!empty)) setInputDate(inputid, objid, this_year,this_month,this_day);
}

function setInputDate(inputid, objid, this_year,this_month,this_day) {
	if (this_day<10) this_day_str = "0" + this_day; else this_day_str = this_day;
	if (this_month<10) this_month_str = "0" + this_month; else this_month_str = this_month;
	document.getElementById(inputid).value = this_year+'-'+this_month_str+'-'+this_day_str;
}

// Inputfield Filter DropDown
var inputid_sav = -1;
function openCalender(inputid, objid, button, position) {
	choosediv = document.getElementById(objid);

	if (inputid_sav == inputid) { 
		choosediv.style.visibility = "hidden";
		inputid_sav = -1;
		return false;
	}

	if (document.getElementById(inputid)) {
		inputfield = document.getElementById(inputid);
		
		choosediv.style.visibility = "visible";
//		choosediv.style.width = inputfield.offsetWidth + button.offsetWidth;

		_offsetLeft = 0;
		el = inputfield;
		while ((el.offsetParent) && (el.tagName != 'DIV')) { _offsetLeft += el.offsetLeft; el = el.offsetParent; }

		choosediv.style.left = _offsetLeft;
//alert(choosediv.style.left);
		_offsetTop = 0;
		el = inputfield;
		while ((el.offsetParent) && (el.tagName != 'DIV')) { _offsetTop += el.offsetTop; el = el.offsetParent; }

		if (position=='bottom') {
			choosediv.style.top = _offsetTop + inputfield.offsetHeight + 20;
		} else if (position=='top') {
			choosediv.style.top = _offsetTop - choosediv.offsetHeight - 5;
		} else {
		}

		inputid_sav = inputid;
	}
		return false;
}

	

//-->
