function menuItem(whichImg,offsrc,onsrc){
	this.imgname = new Object(whichImg);
	this.imgname.createHiliteImages = createImgObjs;
	this.imgname.createHiliteImages(offsrc,onsrc);
}

//hilite-image method
function createImgObjs(offsrc,onsrc){
	this.offimg = new Image();
    this.offimg.src = offsrc;
	this.onimg = new Image();
	this.onimg.src = onsrc;
}

function showHigh(whichButton,whichPic){
         //imagechange
         if(whichPic != 0) document.images[whichButton.imgname].src = whichButton.imgname.onimg.src;
}

function resetHigh(whichButton,whichPic){
	if(whichPic != 0) document.images[whichButton.imgname].src = whichButton.imgname.offimg.src;

}

activeList = '';
activeImg = '';

function showList(whichLayer){
	if(document.getElementById(whichLayer).style.display == "block"){
		document.getElementById(whichLayer).style.display = "none";	
	}
	else{
		document.getElementById(whichLayer).style.display = "block";
		if(activeList && activeList != whichLayer) document.getElementById(activeList).style.display = "none";
		activeList = whichLayer;
	}
	
}

function showArticle(whichLayer){
	if(document.getElementById(whichLayer).style.display == "block"){
		document.getElementById(whichLayer).style.display = "none";
		document.getElementById('btn_weiterlesen').className = "weiterlesen";
	}
	else{
		document.getElementById(whichLayer).style.display = "block";
		document.getElementById('btn_weiterlesen').className = "weiterlesen_aktiv";
	}
	
}

function zoomImage(whichBtn,whichImg){
	var myCurTop = findPos(whichBtn) - 140;
	document.getElementById('zoomimg_container').style.display = "none";
	whichImg = whichImg.replace(".files","files");
	newPicHTML = '<div class="zoomimg_top"></div><div class="zoomimg_img"><img src="' + whichImg + '" width="522" alt="Vergrößerte Bildansicht" /></div><div class="zoomimg_bottom"></div><div class="img_zoombutton"><a title="Bild schließen" onclick="closeZoomImage();return false" href=""><img class="zoombtn" src="pix/btn_minus.png" width="23" height="23" alt="Bild schließen" /></a></div>';
	document.getElementById('zoomimg_container').innerHTML = newPicHTML;		
	document.getElementById('zoomimg_container').style.display = "block";
	document.getElementById('zoomimg_container').style.position = "absolute";
	document.getElementById('zoomimg_container').style.left = 196 + 'px';
	document.getElementById('zoomimg_container').style.top = myCurTop + 'px';	
}

function closeZoomImage(){
	document.getElementById('zoomimg_container').style.display = "none";
}

function findPos(obj) {
	var curleft = curtop = 0;

	if (obj.offsetParent) {

	do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;


	} while (obj = obj.offsetParent);

	return curtop;
	}
}

