function CheckBoxold(feld,divname){
	
	if(document.formular[feld].value == '1'){
		//uncheck the checkbox
		document.formular[feld].value = '0';
		if(divname!=undefined){
			hideDivhard(divname);
		}
 	}else{
 		// check the checkbox
		document.formular[feld].value = '1';
		if(divname!=undefined){
			underkill(divname);
		}
	}
	// ReRender CheckBoxImages
	reRenderCheckBoxState(feld)
}
/**
* similar to CheckBoxold but with 
 and softkillfunction. the animation is not longer with
* opacity, but with width animation - so the iepngfix will work with our special friend ie6
*/
function CheckBox(feld,divname){
	
	if(document.formular[feld].value == '1'){
		//uncheck the checkbox
		document.formular[feld].value = '0';
		if(divname!=undefined && divname.indexOf('settings')== 0){
			softkill(divname);
			
		}else{ 
		
 	        hideDivhard(divname);
 	        }
 	}else{
 		// check the checkbox
 		document.formular[feld].value = '1';
		if(divname!=undefined && divname.indexOf('settings')== 0){
			
			doublefire(divname);
		}else{ 
		
 	        underkill(divname);
 	        }
	}
	// ReRender CheckBoxImages & settingdiv
	reRenderCheckBoxState(feld);
	
	
}
/**
* rerenders Checkbox Image depending on Checkboxes State
*/
function reRenderCheckBoxState(checkboxInputElementName){
	if(document.formular[checkboxInputElementName].value == '1'){
		document.images[checkboxInputElementName].src = 'img/checkbox2.jpg';
	}else{
		document.images[checkboxInputElementName].src = 'img/checkbox1.jpg';			
	}
}



/**
* Seems like this function is used for small images only 
* 
*
*/
function checkBox(feld,divname){
	
	if(document.formular[feld].value == '1'){
		//uncheck the checkbox
		document.formular[feld].value = '0';
		document.images[feld].src = 'img/checkbox1small.jpg';
		if(divname!=undefined){
			hideDivhard(divname);
		}
 	}else{
		// check the checkbox
		document.formular[feld].value = '1';
		document.images[feld].src = 'img/checkbox2small.jpg';
		if(divname!=undefined){
			underkill(divname);
		}
	}
}
function update(divname){
	$(divname).jScrollPane({showArrows:true,dragMaxHeight:25});
}


function toggle(divname,scrolldiv)
{
	$(divname).slideToggle('slow', function(){update(scrolldiv);});
}
// Diese Funktion brauche ich um die showdiv funktion zweimal �bereinanderlegen zu k�nnen. beim overkill wird z-index:9 gesetzt.
// bei der showDiv funcion z-index:10. Ansonsten sind beide funktionien identisch. // da kann man einen parameter z-index einf�hren den man �bergibt 
// das ersetzt eine function dann durch eine zahl und eine variable sodass man unmengen zeichen spart ... 
function doublefire(divname){
	$(divname).css({"visibility":"visible","z-index":"10","width":"0px"}).animate({"width":"746px"},1500);
};

function killit(divname){
	$(divname).animate({"width":"0px"},1500,function(){
		$(this).css({"visibility":"hidden","z-index":"-10"}).empty();
	});
}

function softkill(divname){
	$(divname).animate({"width":"0px"},1500,function(){
		$(this).css({"visibility":"hidden","z-index":"-10"});
	});
}


// Diese Funktion brauche ich f�r die Infotour. Wenn man bei -> Komponeten->Bog auf Zur�ck dr�ckt (blogerkl�rung), soll der div beim schlie�en der 
// blogdemo den halbtransparenten abdunklungsdiv (smoothe) wiederherstelen.
function rebuild(divname){
	$(divname).css({"visibility":"visible","z-index":"100","opacity":"0"}).animate({"opacity":"0.8","filter":"alpha(opacity=80)","-moz-opacity": "0.8"},1200);
}

// Diese Funktion brauche ich f�r die Infotour. Wenn man bei -> Komponeten->Bog auf Zur�ck dr�ckt (blogerkl�rung), soll der div beim schlie�en der 
// blogdemo den halbtransparenten abdunklungsdiv (smoothy) wiederherstelen.
function rebuilds(divname){	
	$(divname).css({"visibility":"visible","z-index":"100","opacity":"0"}).animate({"opacity":"1","filter":"alpha(opacity=100)","-moz-opacity": "1"},1200);
}

function underkill(divname){
	$(divname).css({"visibility":"visible","z-index":"9","opacity":"0"}).animate({"opacity":"1","filter":"alpha(opacity=100)","-moz-opacity": "1"},1200);
}


function showDiv(divname){
	$(divname).css({"visibility":"visible","z-index":"10","opacity":"0"}).animate({"opacity":"1","filter":"alpha(opacity=100)","-moz-opacity": "1"},1200);
}

function showbut(divname){
	$(divname).css({"visibility":"visible","z-index":"1","opacity":"0"}).animate({"opacity":"1","filter":"alpha(opacity=100)","-moz-opacity": "1"},1200);
}


function hideDiv(divname){	
	$(divname).animate({"opacity":"0","z-index":"0"},1200, null, function(){
		$(this).css({"visibility":"hidden","opacity":"0","z-index":"0"})
		});		
}
	
function hideDivhard(divname){
	$(divname).css({"visibility":"hidden","opacity":"0","z-index":"0"});		
}

/****************LOGOs*************************/
function toggleCheckBox(checkboxId,ImageName){
	if(document.formular[checkboxId].value == '1'){
		//uncheck the checkbox
		document.formular[checkboxId].value = '0';
 	}else{
		// check the checkbox
		document.formular[checkboxId].value = '1';	
	}
	reRenderCheckBoxState(ImageName);
}

/**
* Deactivates slaveInput Checkbox if the MasterInput is active
* if MasterInput is inactive nothing happens
*/
function toogleActivationBetween(masterInput,slaveInput){
	// check master
	if(document.formular[masterInput].value == '1'){
		// change slave state
		document.formular[slaveInput].value=0;
		// reREnder Image slave
		reRenderCheckBoxState(slaveInput);
	}
}
/**
* Shows the given div using the I6 Save doublefireMethod 
*/
function ieSaveAnimateIfChecked(checkboxId,divIdToAnim){
	if(document.formular[checkboxId].value == '1'){
		doublefire(divIdToAnim);
	}
}
/**
* brings the componendetails to its place with background-scrolling. 
*/


function scrollBgToRightPos (posx,posy, divname){
		var div=$(divname);
		div.css({"visibility":"visible","background-position":posx+" "+posy,"z-index":"50"});
}

function appendDivWithin(targetDiv,newDivId,text,style){
	var div=$(targetDiv);
	div.append('<div id="'+newDivId+'" style="'+style+'">'+text+'</div>');	
}
function removeDivFrom(fromDiv,toRemoveId){
	var div=$(targetDiv+'>'+toRemoveId);
	div.remove();
	
}
	
function killscrollBgToRightPos (divname){
	var div=$(divname);
	div.css({"visibility":"hidden","z-index":"-10"});
	}


