﻿
	var ShowPopHeadKeyID;
	var ShowPopOldMouseOverFunctions;
	var ShowPopns4=document.layers;
	var ShowPopns6=document.getElementById&&!document.all;
	function ShowPopInstall() {
		var RootElement = document.createElement('span');
				RootElement.style.position='absolute';
				RootElement.style.left='0px';
				RootElement.style.top='0px';
				//RootElement.style.height='10px';
				RootElement.style.width='140px';
				RootElement.style.backgroundColor ="#FFFFCC";
				RootElement.style.border = "solid 1px #000000";
				RootElement.innerHTML ="";
				
				//RootElement.visibility="visible";
				//RootElement.display="none";
				
				ShowPopHeadKeyID = "ShowPopHeadKeyID"+Math.floor(Math.random()*1000)+Math.floor(Math.random()*1000); 
				RootElement.id = ShowPopHeadKeyID;
				RootElement.style.zIndex =90;
	
	
				document.getElementsByTagName('body')[0].appendChild(RootElement);
	
	}
	
	function ShowPopFollowMouse(e){
		
		var x=(ShowPopns4||ShowPopns6)?e.pageX:event.x+document.body.scrollLeft;
		var y=(ShowPopns4||ShowPopns6)?e.pageY:event.y+document.body.scrollTop;
		
		ob = document.getElementById(ShowPopHeadKeyID);
		ob.style.left=(x+15)+'px';
		
		ob.style.top = (y+10)+'px';
	}
	
	function pop (instr) {
		
		if(!ShowPopHeadKeyID) {
		ShowPopInstall();
		
		} else {
		
		document.getElementById(ShowPopHeadKeyID).style.display = '';
		}

		if(instr) {
			document.getElementById(ShowPopHeadKeyID).innerHTML="<center style='border:solid 3px #FFFFCC'>"+instr+"</center>";
		}else {
			document.getElementById(ShowPopHeadKeyID).style.display = 'none';
		}
		
		ShowPopOldMouseOverFunctions = document.onmousemove;
		
		document.onmousemove = ShowPopFollowMouse;
		
	}
	
	function hide () {
		
		document.getElementById(ShowPopHeadKeyID).style.display = 'none';
		document.onmousemove = ShowPopOldMouseOverFunctions;
		
	}
	
	



// GET FROM http://www.jojoxx.net/jscript/archive/show.asp?id=91
function center(width,height,cx,cy){
	var x=(cx==0)?0:(cx==1)?parseInt((screen.width-width-10)/2):screen.width-width-10;
	var y=(cy==0)?0:(cy==1)?parseInt((screen.height-height-56)/2):screen.height-height-56;
	return (",top="+y+",left="+x);
}
function openwindow(url, wintname){ 
window.open(url,
			"admin "+ wintname,
			"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=750,height=600"+center(500,400,1,1)+""); 
}

function adminpop(varurl) {
openwindow('editor.php?com=' + varurl + "&back="+escape(location.href),  varurl);
}