<!--
var MousePosition;
function MouseClick(MouseEvent) {
	if (!MouseEvent) {MousePosition=window.event;} else {MousePosition=MouseEvent;}
}
try {document.onmousedown = MouseClick;} catch(e) {void(0);}
try {document.onmousemove = MouseClick;} catch(e) {void(0);}

function SetPosition(DisplayObject, X, Y) {
	var scrollPositonX=0; var scrollPositonY=0;
	if (window.pageXOffset) {
		scrollPositonX=window.pageXOffset;
	} else if (document.body.scrollLeft) {
		scrollPositonX=document.body.scrollLeft;
	}
	if (window.pageYOffset) {
		scrollPositonY=window.pageYOffset;
	} else if (document.body.scrollTop) {
		scrollPositonY=document.body.scrollTop;
	}
	var xPos = scrollPositonX+MousePosition.clientX;
	var yPos = scrollPositonY+MousePosition.clientY;
	if (!isNaN(X)) xPos+=X;
	if (!isNaN(Y)) yPos+=Y;
	DisplayObject.style.left=xPos+'px';
	DisplayObject.style.top=yPos+'px';
}

var inlineCalendarValues=new Array();
function InitInlineCalendar() {
	var jetzt=new Date();
	inlineCalendarValues[0]=jetzt.getFullYear();
	inlineCalendarValues[1]=jetzt.getMonth()+1;
	inlineCalendarValues[2]=jetzt.getDate();
	inlineCalendarValues[3]=undefined; //FormObject
	inlineCalendarValues[4]=''; //FieldName
	inlineCalendarValues[5]=0; // YearType
	inlineCalendarValues[6]=0; //MonthType
	inlineCalendarValues[7]=0; //DayType
	inlineCalendarValues[8]=0; //HourType
	inlineCalendarValues[9]=0; //MinuteType
	inlineCalendarValues[10]=0; //SecondType
	inlineCalendarValues[11]=0; //ShowImage
	inlineCalendarValues[12]=0; //HourValue
	inlineCalendarValues[13]=0; //MinuteValue
	inlineCalendarValues[14]=0; //SecondValue
	inlineCalendarValues[15]=0; //Texteditor
	inlineCalendarValues[16]=''; //ActiveDay
}
InitInlineCalendar();

function SetInlineCalendar(DisplayYear,DisplayMonth,DisplayDay,DiffMonth,DiffYear) {
	try {
		var daySize=24*60*60*1000;
		var monDay=new Date(2001,0,1,0,0,0,0);var c=monDay.getDay();
		if (DisplayYear<=0) DisplayYear=inlineCalendarValues[0];
		if (DisplayMonth<=0) DisplayMonth=inlineCalendarValues[1];
		if (DisplayDay<=0) DisplayDay=inlineCalendarValues[2];
		if ((DisplayYear<=0) || (DisplayMonth<=0) || (DisplayDay<=0)) {
			var jetzt=new Date();
			DisplayYear=jetzt.getFullYear();
			DisplayMonth=jetzt.getMonth()+1;
			DisplayDay=jetzt.getDate();
		}
		if (DiffMonth==-1) {
			DisplayMonth--;
			if (DisplayMonth<=0) {
				DisplayMonth=12; DisplayYear--;
			}
		}
		if (DiffMonth==1) {
			DisplayMonth++;
			if (DisplayMonth>12) {
				DisplayMonth=1; DisplayYear++;
			}
		}
		if ((DiffYear==-1) && (DisplayYear>1)) DisplayYear--;
		if (DiffYear==1) DisplayYear++;
		displayDate=new Date(DisplayYear,DisplayMonth-1,DisplayDay,0,0,0,0);
		while(displayDate.getMonth()!=DisplayMonth-1) displayDate.setTime(displayDate.getTime()-daySize);
		inlineCalendarValues[0]=displayDate.getFullYear();
		inlineCalendarValues[1]=displayDate.getMonth()+1;
		inlineCalendarValues[2]=displayDate.getDate();
		var calDate=new Date(inlineCalendarValues[0],inlineCalendarValues[1]-1,1,0,0,0,0);
		var d=document.getElementById('inlinecalendar_m');d.innerHTML=MonthNames[calDate.getMonth()];
		var d=document.getElementById('inlinecalendar_y');d.innerHTML=calDate.getFullYear();
		var t=false; var i; var j; var dClass;
		for (i=1;i<=6;i++) {
			for (j=1;j<=7;j++) {
				if (i==1) {
					if (calDate.getDay()==c) t=true;
					c++; if (c>6) c=0;
				} else if (calDate.getMonth()!=(DisplayMonth-1)) {
					t=false;
				}
				var d=document.getElementById('inlinecalendar_d'+i+j);
				if (t) {
					dClass='inlinecalendar_day';
					if (calDate.getDate()==inlineCalendarValues[2]) {
						inlineCalendarValues[16]=''+i+''+j;
						dClass='inlinecalendar_dayselected';
					}	
					d.innerHTML='<a onClick="SetInlineCalendarDay('+calDate.getDate()+',\''+i+j+'\');" class="'+dClass+'">'+calDate.getDate()+'</a>';
					calDate.setTime(calDate.getTime()+daySize);
				} else {
					d.innerHTML='';
				}
			}
		}	
	} catch(e) {
		alert('InlineCalendar: '+e.message);
	}
}

function SetInlineCalendarDay(DayValue,DayIndex) {
	try {
		if (inlineCalendarValues[16]!='') {
			var d=document.getElementById('inlinecalendar_d'+inlineCalendarValues[16]);
			d.innerHTML='<a onClick="SetInlineCalendarDay('+inlineCalendarValues[2]+',\''+inlineCalendarValues[16]+'\');" class="inlinecalendar_day">'+inlineCalendarValues[2]+'</a>';
		}
		inlineCalendarValues[2]=DayValue;
		inlineCalendarValues[16]=DayIndex;
		var d=document.getElementById('inlinecalendar_d'+DayIndex);
		d.innerHTML='<a onClick="SetInlineCalendarDay('+DayValue+',\''+DayIndex+'\');" class="inlinecalendar_dayselected">'+DayValue+'</a>';
	} catch(e) {
		alert('InlineCalendar: '+e.message);
	}
}

function DisplayInlineCalendar(FormObject,FieldName,YearType,MonthType,DayType,HourType,MinuteType,SecondType,ShowImage,YearValue,MonthValue,DayValue,HourValue,MinuteValue,SecondValue,Texteditor) {
	try {
		inlineCalendarValues[3]=FormObject;
		inlineCalendarValues[4]=FieldName;
		inlineCalendarValues[5]=YearType;
		inlineCalendarValues[6]=MonthType;
		inlineCalendarValues[7]=DayType;
		inlineCalendarValues[8]=HourType;
		inlineCalendarValues[9]=MinuteType;
		inlineCalendarValues[10]=SecondType;
		inlineCalendarValues[11]=ShowImage;
		if (HourValue!='') {inlineCalendarValues[12]=parseInt(HourValue);} else {inlineCalendarValues[12]=0;}
		if (MinuteValue!='') {inlineCalendarValues[13]=parseInt(MinuteValue);} else {inlineCalendarValues[13]=0;}
		if (SecondValue!='') {inlineCalendarValues[14]=parseInt(SecondValue);} else {inlineCalendarValues[14]=0;}
		inlineCalendarValues[15]=Texteditor;
		var jsYearValue=0;var jsMonthValue=0;var jsDayValue=0;
		if (YearValue!='') jsYearValue=parseInt(YearValue);
		if (MonthValue!='') jsMonthValue=parseInt(MonthValue);
		if (DayValue!='') jsDayValue=parseInt(DayValue);
		SetInlineCalendar(jsYearValue,jsMonthValue,jsDayValue,0,0);
		var d=document.getElementById('inlinecalendar');
		SetPosition(d);
		d.style.visibility='visible';
	} catch(e) {
		alert('InlineCalendar: '+e.message);
	}
}

function HideInlineCalendar() {
	try {
		var cal=document.getElementById('inlinecalendar');
		cal.style.visibility='hidden';
	} catch(e) {
		alert('InlineCalendar: '+e.message);
	}
}

function ValueFromInlineCalendar() {
	try {
		if ((inlineCalendarValues[3]!=undefined) && (inlineCalendarValues[4]!='')) {
			InputSetDate(inlineCalendarValues[3],inlineCalendarValues[4],inlineCalendarValues[5],inlineCalendarValues[6],inlineCalendarValues[7],inlineCalendarValues[8],inlineCalendarValues[9],inlineCalendarValues[10],inlineCalendarValues[11],inlineCalendarValues[0],inlineCalendarValues[1],inlineCalendarValues[2],inlineCalendarValues[12],inlineCalendarValues[13],inlineCalendarValues[14],inlineCalendarValues[15],0);
		}
		HideInlineCalendar();	
	} catch(e) {
		alert('InlineCalendar: '+e.message);
	}
}

function InitInlineColor() {
	try {
		var jetzt=new Date();
		inlineColorValues[0]=new Array(0, 0, 0); //Red, Green, Blue
		inlineColorValues[1]=new Array(false, false, false); //Change
		inlineColorValues[2]=undefined; //FormObject
		inlineColorValues[3]=''; //FieldName
		inlineColorValues[4]=0; //Texteditor
	} catch(e) {
		alert('InlineColor: '+e.message);
	}
}
var inlineColorValues=new Array();
InitInlineColor();

function SetColorDiff(ColorIndex,DiffColor) {
	try {
		if (inlineColorValues[1][ColorIndex]) {
			inlineColorValues[0][ColorIndex]+=DiffColor;
			if (inlineColorValues[0][ColorIndex]>255) {
				inlineColorValues[0][ColorIndex]=255; inlineColorValues[1][ColorIndex]=false;
			}
			if (inlineColorValues[0][ColorIndex]<0) {
				inlineColorValues[0][ColorIndex]=0; inlineColorValues[1][ColorIndex]=false;
			}
			DisplayColorValue();
			window.setTimeout('SetColorDiff('+ColorIndex+','+DiffColor+')',1);
		}		
	} catch(e) {
		alert('InlineColor: '+e.message);
	}
}

function ColorDiff(ColorIndex,ColorState,DiffColor) {
	try {
		if (inlineColorValues[1][ColorIndex]!=ColorState) {
			inlineColorValues[1][ColorIndex]=ColorState;
			if (ColorState) SetColorDiff(ColorIndex,DiffColor);
		}
	} catch(e) {
		alert('InlineColor: '+e.message);
	}
}

function SetColorValue(RedValue,GreenValue,BlueValue) {
	try {
		inlineColorValues[0][0]=RedValue;
		inlineColorValues[0][1]=GreenValue;
		inlineColorValues[0][2]=BlueValue;
		DisplayColorValue();
	} catch(e) {
		alert('InlineColor: '+e.message);
	}
}

function DisplayColorValue() {
	try {
		var d;
		d=document.getElementById('inlinecolor_0');
		d.style.backgroundColor='#'+Dez2Hex(inlineColorValues[0][0],2)+'0000';
		d=document.getElementById('inlinecolor_1');
		d.style.backgroundColor='#00'+Dez2Hex(inlineColorValues[0][1],2)+'00';
		d=document.getElementById('inlinecolor_2');
		d.style.backgroundColor='#0000'+Dez2Hex(inlineColorValues[0][2],2);
		var col='#'+Dez2Hex(inlineColorValues[0][0],2)+Dez2Hex(inlineColorValues[0][1],2)+Dez2Hex(inlineColorValues[0][2],2);
		d=document.getElementById('inlinecolor_selected');
		d.style.backgroundColor=col;
	} catch(e) {
		alert('InlineColor: '+e.message);
	}
}

function DisplayInlineColor(HTMLColor,FormObject,FieldName,Texteditor) {
	try {
		if (HTMLColor!='') {
			if (HTMLColor.substr(0,1)!='#') HTMLColor='#'+HTMLColor;
			if (HTMLColor.length>=3) inlineColorValues[0][0]=Hex2Dez(HTMLColor.substr(1,2));
			if (HTMLColor.length>=5) inlineColorValues[0][1]=Hex2Dez(HTMLColor.substr(3,2));
			if (HTMLColor.length>=7) inlineColorValues[0][2]=Hex2Dez(HTMLColor.substr(5,2));
		}
		inlineColorValues[2]=FormObject;
		inlineColorValues[3]=FieldName;
		inlineColorValues[4]=Texteditor;
		var d=document.getElementById('inlinecolor');
		SetPosition(d);
		d.style.visibility='visible';
		DisplayColorValue();
	} catch(e) {
		alert('InlineColor: '+e.message);
	}
}

function HideInlineColor() {
	try {
		inlineColorValues[1][0]=false;
		inlineColorValues[1][1]=false;
		inlineColorValues[1][2]=false;
		var d=document.getElementById('inlinecolor');
		d.style.visibility='hidden';
	} catch(e) {
		alert('InlineColor: '+e.message);
	}
}

function ValueFromInlineColor() {
	try {
		if ((inlineColorValues[2]!=undefined) && (inlineColorValues[3]!='')) {
			var colorValue='#'+Dez2Hex(inlineColorValues[0][0],2)+Dez2Hex(inlineColorValues[0][1],2)+Dez2Hex(inlineColorValues[0][2],2)
			if (inlineColorValues[4]!=0) {
				Texteditor_SetText(inlineColorValues[2],inlineColorValues[3],colorValue);
			} else {
				inlineColorValues[2].elements[inlineColorValues[3]].value=colorValue;
			}
			ChangeColor(inlineColorValues[3],colorValue);
		}
		HideInlineColor();	
	} catch(e) {
		alert('InlineColor: '+e.message);
	}
}
function DisplayObjectPreview(Image) {
	try {
		if ((Image!=undefined) && (Image!=''))
		{
			var i=document.getElementById('objectpreviewimage');
			i.src=Image;
			var d=document.getElementById('objectpreview');
			SetPosition(d,20,20);
			d.style.visibility='visible';
		}
		else
		{
			HideObjectPreview();
		}
	} catch(e) {
		alert('ObjectPreview: '+e.message);
	}
}

function HideObjectPreview(Image) {
	try {
		var d=document.getElementById('objectpreview');
		d.style.visibility='hidden';
		var i=document.getElementById('objectpreviewimage');
		i.src=Image;
	} catch(e) {
		alert('ObjectPreview: '+e.message);
	}
}
-->
