// Function to "activate" images.
function imgAct(imgName) 
{
    if (br == "n3") 
    {
    	document[imgName].src = eval(imgName + "on.src");
    }
}

// Function to "deactivate" images.
function imgInact(imgName) 
{
    if (br == "n3") 
    {
	    document[imgName].src = eval(imgName + "off.src");
    }
}

 function checktextlength (TextEl,CountEl,maxtextlength) 
 {
 	var textlength = TextEl.value.length;
 	if (textlength > maxtextlength) 
 	{
		 TextEl.value = TextEl.value.substring(0,maxtextlength);
		 left = 0;
	 } 
 	else 
 	{
		left = maxtextlength-textlength;
	 }
 	//CountEl.value = left;
 }

function openWindow(urlin, widthin, heightin, windownamein)
{
	var url;
	var windowname;
	var width;
	var height;
	
	if (typeof(urlin) == "undefined" || urlin=="")
	{
		alert("keine URL uebergeben");
	}
	else
	{
		url=urlin;
	}


	if (typeof(windownamein) == "undefined" || windownamein=="")
	{
		windowname="newWindow";
	}
	else
	{
		windowname=windownamein;
	}


	if (typeof(widthin) == "undefined" || widthin=="")
	{
		width=600;
	}
	else
	{
		width=widthin;
	}


	if (typeof(heightin) == "undefined" || heightin=="")
	{
		height=400;
	}
	else
	{
		height=heightin;
	}


	if (typeof(urlin) != "undefined")
	{
		open(url,windowname,"menubar=no,scrollbars=yes,toolbar=no,location=no,resizable=yes,width="+width+",height="+height+",status=no");

	//	splashWin = window.open(url,windowname,'fullscreen=1,toolbar=0,location=1,directories=0,status=0,menubar=0,scrollbars=1,resizable=1');
	//	self.focus();
	//	splashWin.resizeTo(width,height);
	//	splashWin.moveTo(25,25);
	//	splashWin.focus();
	//	splashWin.location=url;
	}

}

function show(section)  {
  if (eval(section + ".style.display != 'none'"))  {
    eval(section + ".style.display='none'");
  }
  else  {
    eval(section + ".style.display='block'");
  }
}


function loeschen_Question()
{
	var agree=confirm("Wirklich löschen?");
	if (agree)
		return true ;
	else
		return false ;
}

function MultiDimensionalArray(iRows,iCols) 
{ 
   var i; 
   var j; 
   var a = new Array(iRows); 
   for (i=0; i < iRows; i++) 
   { 
       a[i] = new Array(iCols); 
       for (j=0; j < iCols; j++) 
       { 
           a[i][j] = ""; 
       } 
   } 
   return(a); 
}
function print(array,arraytext,ebene,combobox,parentindex,defaultebene2) 
{ 
   var i; 
   var j; 
   if (ebene == 1)
   {
       for (i=0; i < array.length; i++) 
	   { 
		   if( array[i][0] != "")
		   {
				combobox.options[i] = new Option(arraytext[i][0],array[i][0]); 
				if (array[i][0] == parentindex)
				{
					combobox.selectedIndex = i;
				}
		   }
	   }
   }
   else if (ebene == 2)
   {
	   combobox.options.length = 0;
	   for (j=1; j < array[parentindex].length; j++) 
	   {
		  if( array[parentindex][j] != "")
		  {
			combobox.options[j-1] = new Option(arraytext[parentindex][j],array[parentindex][j]); 
			if (array[parentindex][j] == defaultebene2)
			{
				combobox.selectedIndex = j - 1;
			}
		  }
	   } 
   }
}

function sendParams(id)
{
	if(id == 0)
	{
		window.document.formular.statistikid0.value=id;
		window.document.formular.preisstatistik0.value="true";
	}
	else if(id == 1)
	{
		window.document.formular.statistikid1.value=id;
		window.document.formular.preisstatistik1.value="true";
	}
	else if(id == 2)
	{
		window.document.formular.statistikid2.value=id;
		window.document.formular.preisstatistik2.value="true";
	}
	else if(id ==3)
	{
		window.document.formular.statistikid3.value=id;
		window.document.formular.preisstatistik3.value="true";
	}
	
	window.document.formular.submit();
}
							
						

