// hilf.js

// Blendet div-Container mit id 'toggle_id' ein/aus
function toggle(toggle_id,toggle_link_id,aus,ein,hoehe)
{
	//alert(toggle_id+"\n"+toggle_link_id+"\n"+aus+"\n"+ein);
	var hb  = document.getElementById(toggle_id);
	var tog=document.getElementById(toggle_link_id);
//	var tabelle=document.getElementById('inhalt-layoutcontainer-innen');
	if (hb.style.display=="none")
	{
	    hb.style.display="block";
	    tog.innerHTML=ein;
	//    tabelle.style.height=hoehe+'px';
	 }
	 else
	 {
	    hb.style.display="none";
	    tog.innerHTML=aus;
	  //  tabelle.style.height="250px";
	  };
};

// vergr��ert rows-Attribut von <textarea>-Elementen
function toggle_eingabefeld(toggle_id,toggle_link_id,aus,ein,hoehe)
{
	var hb  = document.getElementById(toggle_id);
	var tog=document.getElementById(toggle_link_id);
//	alert(hb.rows);
//	var tabelle=document.getElementById('inhalt-layoutcontainer-innen');
	if (hb.rows=="30")
	{
		tog.innerHTML=ein;
	    hb.rows="3";
	  //  hb.style.fontSize="100%";
	  //  hb.cols+=20;
	 }
	 else
	 {
	 	tog.innerHTML=aus;
	    hb.rows="30";
	   // hb.style.fontSize="105%";
	   // hb.cols-=20;
	  };
};

function toggle_1(toggle_id,toggle_link_id,aus,ein,hoehe)
{
	//alert(toggle_id+"\n"+toggle_link_id+"\n"+aus+"\n"+ein);
	var hb  = document.getElementById(toggle_id);
	var tog=document.getElementById(toggle_link_id);
	if (hb.style.display=="none")
	{
	    hb.style.display="block";
	    tog.innerHTML=ein;
		if(typeof(document.form.zusammenfassung)!="undefined")
		{
			document.form.zusammenfassung.cols-=25;
			document.form.zusammenfassung.fontSize="100%";
		};
		if(typeof(document.form.geschichte_politik)!="undefined")
		{
			document.form.geschichte_politik.cols-=25;
			document.form.geschichte_politik.fontSize="100%";
		};
		if(typeof(document.form.schlagworte)!="undefined")
		{
			document.form.schlagworte.cols-=25;
			document.form.schlagworte.fontSize="100%";
		};
		if(typeof(document.form.wirtschaft_soziales)!="undefined")
		{
			document.form.wirtschaft_soziales.cols-=25;
			document.form.wirtschaft_soziales.fontSize="100%";
		};
		if(typeof(document.form.infotext)!="undefined")
		{
			document.form.infotext.cols-=25;
			document.form.infotext.fontSize="100%";
		};
		if(typeof(document.form.infotext_kurz)!="undefined")
		{
			document.form.infotext_kurz.cols-=25;
			document.form.infotext_kurz.fontSize="100%";
		};
		if(typeof(document.form.ppa_kommentar)!="undefined")
		{
			document.form.ppa_kommentar.cols-=25;
			document.form.ppa_kommentar.fontSize="100%";
		};
		if(typeof(document.form.landname)!="undefined") document.form.landname.size-=33;
		if(typeof(document.form.projektname)!="undefined") document.form.projektname.size-=33;
		if(typeof(document.form.name)!="undefined") document.form.name.size-=33;
	}
	else
	{
		hb.style.display="none";
		tog.innerHTML=aus;
		if(typeof(document.form.zusammenfassung)!="undefined") document.form.zusammenfassung.cols+=25;
		if(typeof(document.form.geschichte_politik)!="undefined") document.form.geschichte_politik.cols+=25;
		if(typeof(document.form.schlagworte)!="undefined") document.form.schlagworte.cols+=25;
		if(typeof(document.form.landname)!="undefined") document.form.landname.size+=33;
		if(typeof(document.form.wirtschaft_soziales)!="undefined") document.form.wirtschaft_soziales.cols+=25;
		if(typeof(document.form.infotext)!="undefined") document.form.infotext.cols+=25;
		if(typeof(document.form.infotext_kurz)!="undefined") document.form.infotext_kurz.cols+=25;
		if(typeof(document.form.ppa_kommentar)!="undefined") document.form.ppa_kommentar.cols+=25;
		if(typeof(document.form.projektname)!="undefined") document.form.projektname.size+=33;
		if(typeof(document.form.name)!="undefined") document.form.name.size+=33;
	};
};

function setPointer(theRow, thePointerColor)
{
    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('div');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    for (var c = 0; c < rowCellsCnt; c++) {
        theCells[c].style.background = thePointerColor;
    }

    return true;
} // end of the 'setPointer()' function
