/* ********************************************************************************
 * Objekt-Definition eines Termins
 */
function myTermin(start, stop, id, betreff, inhalt, bezug, wecken, aussen, innen, ganz) {
	// start	- Date();
	// stop		- Date();
	// id		- Number();
	// betreff	- String();
	// inhalt	- String();
	// bezug	- String();
	// wecken	- Boolean();
	// aussen	- String();
	// innen	- String();
	// ganz		- Boolean();

	this.start     = start;			//
	this.stop      = stop;			//

	this.startMS   = start.getTime();	//
	this.stopMS    = stop.getTime();	//

	this.startMSl  = start.getHours();   this.startMSl *= 60;
	this.stopMSl   = stop.getHours();    this.stopMSl  *= 60;

	this.startMSl += start.getMinutes(); this.startMSl *= 60;
	this.stopMSl  += stop.getMinutes();  this.stopMSl  *= 60;

	this.startMSl += start.getSeconds(); this.startMSl *= 1000;
	this.stopMSl  += stop.getSeconds();  this.stopMSl  *= 1000;

	this.startMSl += start.getMilliseconds();
	this.stopMSl  += stop.getMilliseconds();

	/* Termine ohne End-Zeit sollten durch diesen Fix wieder angezeigt werden */
	if (this.startMS  == this.stopMS )
		this.stopMS++ ;
	if (this.startMSl == this.stopMSl)
		this.stopMSl++;

	this.id       = id;		//
	this.betreff  = betreff;	//
	this.inhalt   = inhalt;		//
	this.bezug    = bezug;		//

	this.wecken   = wecken;		//
	this.ganz     = ganz;		//

	/* ganztaegige Termine dauern immer laenger als 24 Stunden */
	if ((this.stopMS - this.startMS) >= (24 * 60 * 60 * 1000)) {
		/* beginnt um 0:00, muß also ganztaegig sein */
		if (this.startMSl == 0)
			this.ganz = true;
		/* wenn der Tag vor diesem anfaengt und nach diesem ended, ist er natuerlich auch ganztaegig */
		else if (Math.abs(this.start.getDate() - this.stop.getDate()) > 1)
			this.ganz = true;
	}

	this.aussen   = aussen;		//
	this.innen    = innen;		//
}

/* Termin-Vergleich auf Ueberlappung */
function kollisionTrm(my, anderer) {
	// my      - myTermin();
	// anderer - myTermin();

	if ((anderer.startMS >= my.stopMS ) ||
	    (anderer.stopMS  <= my.startMS))
		return false;

	return true;
}

function myTerminGranuliert(startGR, stopGR, termin) {
	// startGR	- Number();
	// stopGR	- Number();
	// termin	- myTermin();

	this.startGR  = startGR;
	this.stopGR   = stopGR;

	this.parallel = -1;	// wieviel Termine liegen parallel
	this.spanning =  1;	// wieviel colspan hat dieser Termin
	this.spalte   = -1;	// in welcher Spalte liegt dieser Termin
	this.next     =  3;	// welcher ist der naechste rechterhand liegende Termin
	this.block    = false;	// wenn dieser Termin in der ersten Spalte liegt, ist er auch der stop eines Blocks?
	this.most     =  0;	// welches ist der rechteste Termin des letzte Block

	this.termin   = termin;
}

function kollisionGrn(my, anderer) {
	// my      - myTerminGranuliert();
	// anderer - myTerminGranuliert();

	if ((anderer.startGR >= my.stopGR ) ||
	    (anderer.stopGR  <= my.startGR))
		return false;

	return true;
}

//MB021023--------------------------------------------------------------------------------
function myAufgabe(id, betreff, erledigt, text, highlight) {
	this.id        = id;					// Number();
	this.betreff   = betreff;				// String();
	this.erledigt  = erledigt;				// Boolean();
	this.text      = text;					// String();
	this.highlight = highlight;				// Boolean();
}
//MB021023--------------------------------------------------------------------------------

