/**********************************************
class Cdiv
Behandlung von Bildschirmbereichen
**********************************************/
//--- Konstruktion ----------------------------
function Cdiv(my_name){ 
	this.my_name =my_name;//parameter: variablenname; z.b. var KALENDER =new Ckalender("KALENDER");
	//--- Membervariable (Eigenschaften) ---								
	this.div=document.createElement("div"); 	//ausgabebereich erzeugen
	this.div.style.visibility="hidden";
	this.is_appended=false; 					//bereich wurde noch nicht implementiert
	this.htm="";								//ausgabetext;
	this.stylename="";
	this.m_left=0;
//	this.m_absolute=false;
	this.style=this.div.style;
	this.position ="absolute"; //erlaubt:"static,relative,fixed und absolute"
	
}
//--- Memberfunktionen (ÜBERSCHREIBEN) --------
Cdiv.prototype.html=function(){} //ÜBERSCHREIBEN um bereiche mit HTML-Code zu füllen
//--- Memberfunktionen (Methoden) -------------
//--- folgende methoden nicht überschreiben ---
Cdiv.prototype.show=function(){ //Bereich einblenden
	if(!this.is_appended){ // ggf. bereich für Kalenderausgabe einbinden
		document.body.appendChild(this.div);
	 	this.is_appended=true;
	}
	this.div.innerHTML=this.htm;
	this.div.style.visibility="visible"; //bereich sichtbar machen
	
}
Cdiv.prototype.append=function(){ //Bereich in Dokument implementieren
	if(!this.is_appended){ // ggf. bereich für Kalenderausgabe einbinden
		document.body.appendChild(this.div);
	 	this.is_appended=true;
	}
	this.div.innerHTML=this.htm;
}

Cdiv.prototype.left=function(value,einheit){ //Position im fenster (links)
	einheit=einheit || 'px';
	with(this.div.style){
		position=this.position;
		left=value+einheit;
	}
}
Cdiv.prototype.top=function(value,einheit){//Position im fenster (oben)
	einheit=einheit || 'px';
	with(this.div.style){
		position=this.position;
		top=value+einheit;
	}
}
Cdiv.prototype.width=function(value,einheit){//Breite des ausgabebereichs
	einheit=einheit || 'px';
	this.div.style.width=value+einheit;
}
Cdiv.prototype.height=function(value,einheit){//Höhe des augabebereichs
	einheit=einheit || 'px';
	this.div.style.height=value+einheit;
//	alert("height"); //debug;
}
Cdiv.prototype.hide=function(){ //Bereich ausblenden
	if(this.is_appended) this.div.style.visibility="hidden"; //bereich usichtbar machen
}
Cdiv.prototype.clear=function(){ //textinhalt löschen
	this.htm="";
}
Cdiv.prototype.write=function(text){ //textinhalt hinzufügen
	this.htm +=text;	
}
//-- Bilder --
Cdiv.prototype.img=function(src,alt){
	alt= alt || "";
	write('<img src="" alt="">');
}
//-- Tabellen --
Cdiv.prototype.table=function(option){ //tabelle öffnen/schliessen
	if(typeof(option)=="undefined") option= true;
	if(option) this.write('<table>');
	else	  this.write('</table>');
}
Cdiv.prototype.tr=function(option){ //tabellenzeile öffnen/schliessen
	if(typeof(option)=="undefined") option= true;
	if(option) this.write('<tr>');
	else	  this.write('</tr>');
}
Cdiv.prototype.td=function(text){ //tabellenzelle einfügen
 this.write('<td>'+text+'</td>');
}
//-- Formulare --
Cdiv.prototype.form=function(option){ //formular öffnen/schliessen
	if(typeof(option)=="undefined") option= true;
	if(option) this.write('<form>');
	else	  this.write('</form>');
}
Cdiv.prototype.form_button=function(text){ //tabelle öffnen/schliessen
	this.write('<input style="width:100%;" type=button value ="'+text+'">');

}

