
var hilfe = 'yes';

function popup(datei,breite,hoehe,fenster){
	var winseite = (screen.availWidth - breite) / 2;
	var winoben = (screen.availHeight - hoehe) / 2;
	var paras = "width="+breite+",height="+hoehe+",left="+winseite+",top="+winoben+",locationbar=0,status=0,menubar=0,scrollbars=1,resizable=1";
  	popupWin=window.open(datei,fenster,paras);
  	popupWin.focus();
  	return false;
}
wmtt = null;
document.onmousemove = updateWMTT;
function updateWMTT(e) { 
	x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX; 
	y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY; 
	if (wmtt != null) { 
		wmtt.style.left = (x + 1) + "px"; 
		wmtt.style.top 	= (y + 1) + "px"; 
	} 
}

function showWMTT(value,valuehilfe,id) { 
	//wmtt = document.getElementById(id); 
	wmtt = document.getElementById('meinTest'); 
	
	if(hilfe == 'yes'){
		if(value != 'none'){
			wmtt.innerHTML = '<span class="top">'+value+'</b><br><br>'+valuehilfe+'</span><b class="bottom">url of the link, max 30 chars</b>';
		}else{
			wmtt.innerHTML = '<div class="top">'+valuehilfe+'</div><div class="bottom">&nbsp;</div>';
		}
		if(ADMIN == true && id > 1){
			link = '<a class="admin" href="" onclick="popup('+"'"+HOME_URL+'Admin/edit?CoId='+id+"'"+',800,400,'+"'"+'Admintool'+"'"+');return false;">edit</a>';
			document.getElementById('adminHelp').innerHTML = '<div><span style="color:#FF0000">Admin Help</span><br>'+valuehilfe+link+'</div>'; 
		}
		wmtt.style.display = "block" 
	}else{
		if(value != 'none'){
			wmtt.innerHTML = value;
			wmtt.style.display = "block" 
		}
		document.getElementById('adminHelp').innerHTML = '';
	}
}
function hideWMTT() { 
	wmtt.style.display = "none"; 
} 

function hilfeShow(){
	if(document.getElementById('showHelp')){
		if(document.getElementById('showHelp').checked == true){
			hilfe = 'yes';
		}else{
			hilfe = 'no';
		}
		new Ajax.Request(HOME_URL + 'Index/help', {method: 'get', parameters: 'showHelp=' + hilfe, onComplete: myResponse.bind(this)});
	}
}