function ChangeTopGFX(bildname) {
	if(!bildname) bildname="default";
	bildnameother="";
	/*
	for(i=1;i<=7;i++) {
		bildid="img"+i;
		if (document.all) {
			if(document.all(bildid).name.indexOf(bildname)==-1) document.all(bildid).className='imgopac';
			else document.all(bildid).className='imgakt';
		}
		else {
			if (document.getElementById(bildid).name.indexOf(bildname) < 0) document.getElementById(bildid).className='imgopac';
			else document.getElementById(bildid).className='imgakt';
			bildnameother=bildnameother+" - "+document.getElementById(bildid).name.indexOf(bildname);
		}
	}
	//document.title=bildnameother +":"+document.images.drosseln1.className;
	*/
}

function SubHeadline(txt) {
	//alert(txt);
	if(document.all) document.all('editHL').innerHTML = document.all('editHL').innerHTML+' <h3>'+txt+'</h3>';
	else document.getElementById('editHL').innerHTML = document.getElementById('editHL').innerHTML+' <h3>'+txt+'</h3>';
}

var stage = null;
stage_div = false;
zoombild = false;
zoombildwidth = 0;
titlePos="bottom";
titleAlign="left";
var bildsrc=null;
var bildid=null;
function Stage(e) {
	initShowBild=0;
	if (document.getElementById) {
		stage_div = document.getElementById('stage');
	}
	else if (document.all) {
		stage_div = document.all['stage'];
	}


	var pos_X = 20, pos_Y = 20;
	if ( !e ) e = window.event;
	if ( e ) {
		if ( typeof(e.pageX) == 'number' ) {
			pos_X = e.pageX; pos_Y = e.pageY;
		} else if ( typeof(e.clientX) == 'number' ) {
			pos_X = e.clientX; pos_Y = e.clientY;
			if ( document.body && ( document.body.scrollTop || document.body.scrollLeft ) && !( window.opera || window.debug || navigator.vendor == 'KDE' ) ) {
				pos_X += document.body.scrollLeft; pos_Y += document.body.scrollTop;
			} else if ( document.documentElement && ( document.documentElement.scrollTop || document.documentElement.scrollLeft ) && !( window.opera || window.debug || navigator.vendor == 'KDE' ) ) {
				pos_X += document.documentElement.scrollLeft; pos_Y += document.documentElement.scrollTop;
			}
		}
	}
 
	var scroll_X = 0, scroll_Y = 0;
	if ( document.body && ( document.body.scrollTop || document.body.scrollLeft ) && !( window.debug || navigator.vendor == 'KDE' ) ) {
		scroll_X = document.body.scrollLeft; scroll_Y = document.body.scrollTop;
	} else if ( document.documentElement && ( document.documentElement.scrollTop || document.documentElement.scrollLeft ) && !( window.debug || navigator.vendor == 'KDE' ) ) {
		scroll_X = document.documentElement.scrollLeft; scroll_Y = document.documentElement.scrollTop;
	}
 
	var win_size_X = 5, win_size_Y = 5;
	if (window.innerWidth && window.innerHeight) {
		win_size_X = window.innerWidth;
		win_size_Y = window.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientWidth && document.documentElement.clientHeight) {
		win_size_X = document.documentElement.clientWidth;
		win_size_Y = document.documentElement.clientHeight;
	}
	else if (document.body && document.body.clientWidth && document.body.clientHeight) {
		win_size_X = document.body.clientWidth;
		win_size_Y = document.body.clientHeight;
	}
 
	pos_X += 5; pos_Y += 5;
	if(document.all) zoombild = document.all('zoombild');
	else zoombild= document.getElementById('zoombild');
	
	if (stage_div && stage_div.offsetWidth && stage_div.offsetHeight) {
		
		if (pos_X - scroll_X + stage_div.offsetWidth + 5 > win_size_X) {
			pos_X -= (stage_div.offsetWidth + 25);
			//if(titlePos=="bottom") zoombild.width=pos_X- scroll_X+ stage_div.offsetWidth;
			if(titleAlign!="right") {
				initShowBild=1;
			
			}
			titleAlign="right";
		}
		else  {
			if(titleAlign!="left") initShowBild=1;
			titleAlign="left";
		}
		
		if (pos_Y - scroll_Y + stage_div.offsetHeight + 5 > win_size_Y) {
			pos_Y -= (stage_div.offsetHeight + 20);
			//if(zoombild.width != zoombildwidth) zoombild.width=pos_Y- scroll_Y+ stage_div.offsetHeight;
			if(titlePos!="bottom") initShowBild=1;
			titlePos="bottom";
			
		}
		else {
			
			if(titlePos!="top") initShowBild=1;
			titlePos="top";
		}
		
	}
	//Bildgroesse lesen
	
	if(zoombild) zoombildwidth=zoombild.width;
	//document.title=zoombild.width;
	if(zoombild && zoombild.width > 0) {
		stage_div.style.width=zoombild.width+"px";
		stage_div.style.overflow="visible";
	}
	
	//stage positionieren
	if(stage_div) {
		stage_div.style.left = pos_X + "px";
		stage_div.style.top = pos_Y + "px";
	}
	
	if(bildsrc && initShowBild!=0) ShowBild(bildsrc,bildid);
	//document.title=pos_X+" - "+ pos_Y;
}

function ShowBild(bb,b) {
	
	
	innerTitle="";
	if(bb.title) {
		innerTitle='<div class="title" style="text-align:'+titleAlign+'">'+bb.title+'</div>';
	}
	if(b) {
		bdisp='block';
		bild='<img src="'+b+'" border="0" id="zoombild" />';
		bcname='opacity100';
		bildsrc=bb;
		bildid=b;
	}
	else {
		bdisp='none';
		bild='<img src="images/trans.gif" border="0" width="0" height="0"id="zoombild" />';
		bcname='opacity80';
		bildsrc=null;
		bildid=null;
	}
	
	if(document.all) {
		stage = document.all('stage');
		zoombild = document.all('zoombild');
		
	}
	else {
		stage = document.getElementById('stage');
		zoombild = document.getElementById('zoombild');
		
	}
	
	
	innerContent=bild+innerTitle;
	if(titlePos=="top") innerContent=innerTitle+bild;
	stage.style.display=bdisp;
	stage.innerHTML=innerContent;
	
	Stage;
	//bb.className=bcname;
	
	
}

document.onmousemove = Stage;
