// call after every checkbox that needs to be checked or not according to the state of trigger
// trigger must match to value of checkbox to select checkbox
// example for call: <input type=checkbox ....><script>checkboxChecker("%module.criteria%")</script>
// v2 [8.5.03]: trigger can also be a comma-separated string of values. If there are several checkboxes with the same name, all of them will be selected which value matches one of the values in the string
function checkboxChecker(trigger,def)
{
	myForm = document.forms[document.forms.length-1];
	myElement = myForm.elements[myForm.elements.length-1];
	if(myForm.elements[myElement.name].length>1)
	{
		// split values into array
		if(trigger.substr(0,1)=='%')
			if(def) var myValues = def.toString().split(",");
			else return;
		else
			var myValues = trigger.split(",");
		var trueVals = new Array();
		for( var i = 0;i<myValues.length;i++)
			trueVals[myValues[i]] = true;
		
		for( var i = 0;i<myForm.elements[myElement.name].length;i++)
		{
			if(myForm.elements[myElement.name][i].type=="checkbox")
			{
				myForm.elements[myElement.name][i].checked = trueVals[myForm.elements[myElement.name][i].value];
			}
		}
	}
	else
	{
		if(trigger.substr(0,1)=='%')
		{
			if(def) myElement.checked=true;
		 	return;
		}
		myElement.checked=(myElement.value==trigger);
	}
}



/* Schrift verändern */
if(typeof fontsize != 'undefined')
{
    if(fontsize == "%font" + "size%") {
    	fontsize = 100;
    }

    if(cookieRead("fontsizesave_hssaz")) {
    	fontsize = cookieRead("fontsizesave_hssaz");
    	document.write('<style type="text/css">body{font-size:'+ fontsize +'%;}</style>');
    }
    else {
    	document.write('<style type="text/css">body{font-size:'+ fontsize2 +'%;}</style>');
    }
    
}
function changeFontSize(step,todo) {
	if (todo == 'inc') {
		if(fontsize <= fontmax) {
			fontsize = parseInt(fontsize) + step;						
		}
	}
	else  {
		if(fontsize >= fontmin) {
			fontsize = parseInt(fontsize) - step;						
		}						
	}
	document.body.style.fontSize = fontsize + "%";
	//var myAjax = new Ajax.Request('dyn_output.html', {parameters: 'content.void='+ cmsvoid +'&SID='+ SID +'&sess_fontsize=' + fontsize});
	cookieWrite("fontsizesave_hssaz",fontsize,60);
	//alert(fontsize);
	//alert(fontmax);
	if(fontsize <= fontmax) {
		document.getElementById('incfont1').style.visibility = 'visible';
	}
	else {
		document.getElementById('incfont1').style.visibility = 'hidden';
	}
	//alert(fontmin);
	if(fontsize >= fontmin) {
		document.getElementById('decfont1').style.visibility = 'visible';
	}
	else {
		document.getElementById('decfont1').style.visibility = 'hidden';
	}
}





/* END */





function openPicWin(pFileName,pWinName,pWidth,pHeight) {
	var isNS = (document.layers) ? true : false;
	
	if (isNS) pHeight = pHeight + 19;
		eval("allSettings = 'width="+pWidth+",height="+pHeight+",menubar=yes,scrollbars=yes,status=yes,resizable=yes'");
		w=window.open(pFileName,pWinName,allSettings);
		w.window.focus();
}

// functions for iframe expander in all various browsers [START]

function getIFrameDoc( name ) {
  var IFrameDoc;
  var Height;
  var IFrameObj = document.getElementsByName(''+name)[0];
  
  if (typeof document.frames != 'undefined') {
    IFrameObj = document.frames[name];
  }
  
  if (IFrameObj.contentDocument) {
    // For NS6
    IFrameDoc = IFrameObj.contentDocument; 
  } else if (IFrameObj.contentWindow) {
    // For IE5.5 and IE6
    IFrameDoc = IFrameObj.contentWindow.document;
  } else if (IFrameObj.document) {
    // For IE5
    IFrameDoc = IFrameObj.document;
  } else {
    return false;
  }
  
  if(typeof IFrameDoc.body != 'undefined')
  {
    return IFrameDoc.body;
  }
  else
  {
    return IFrameDoc.documentElement;
  }
}

/*
* gets the height of an iframe document
*/
function getIFrameDocHeight( name )
{
var IFrameDoc = getIFrameDoc( name );
  if(typeof IFrameDoc == 'undefined')
    return false;
  return IFrameDoc.scrollHeight;
}

/*
* gets the width of an iframe document
*/
function getIFrameDocWidth( name )
{
var IFrameDoc = getIFrameDoc( name );
  if(typeof IFrameDoc == 'undefined')
    return false;
  return IFrameDoc.scrollWidth;
}

// functions for iframe expander in all various browsers [END]




