function Inner(result)
{
	if(result[1]!=0){ document.getElementById(result[0]).innerHTML = result[1]; }
	if(result[2])	{	eval(result[2]); }
}

function close_div(id) {
		document.getElementById(id).style.visibility="hidden"
InnerHtml(id,'')
}

function GetValue(ident)
{
	if(document.getElementById(ident).value!=false){
return document.getElementById(ident).value; }
return "";
}

function inner_value(ident,value)
{
document.getElementById(ident).value=value;
}

function InnerHtml(ident,value)
{
document.getElementById(ident).innerHTML=value
}

function GetInnerHtml(ident)
{
return document.getElementById(ident).innerHTML;
}

function result_shadowt(result){////////// OK
var height = document.body.scrollHeight;
var div="<DIV id=or  style=\"border:#ffffff 1px double;LEFT: 0px;background-color:#000000;VISIBILITY: visible; POSITION: absolute; TOP: 0px;width:100%;height:"+height+"px;filter:alpha(opacity=50);\"></div><div id=o ></div>";
InnerHtml(result[0],div);
InnerHtml("o",result[1]);

if(result[2]!=""){cod=eval(result[2]);}
cod ;
}


function result_innerhtml(result)
{ 
   if(result[1]!="error"){   InnerHtml(result[0],result[1]);  
   if(result[2]!=""){cod=eval(result[2]);}
cod ;
   }
}







function move(div_id){
	 self.onError=null;
       // currentX = currentY = 0; 
    whichIt = null; 
  //  lastScrollX = 0; lastScrollY = 0;
        NS = (document.layers) ? 1 : 0;
    IE = (document.all) ? 1: 0;
    function grabIt(e) {
        if(IE) {
            whichIt = event.srcElement;
            while (whichIt.id.indexOf(div_id) == -1) {
                whichIt = whichIt.parentElement;
                if (whichIt == null) { return true; }
        }
            whichIt.style.pixelLeft = whichIt.offsetLeft;
        whichIt.style.pixelTop = whichIt.offsetTop;
            currentX = (event.clientX + document.body.scrollLeft);
            currentY = (event.clientY + document.body.scrollTop);     
        } else { 
    window.captureEvents(Event.MOUSEMOVE);
    if(checkFocus (e.pageX,e.pageY)) { 
    whichIt = document.div_id;
    StalkerTouchedX = e.pageX-document.div_id.pageX;
    StalkerTouchedY = e.pageY-document.div_id.pageY;
    } 
        }
    return true;
    }
     
    function moveIt(e) {
        if (whichIt == null) { return false; }
        if(IE) {
        newX = (event.clientX + document.body.scrollLeft);
        newY = (event.clientY + document.body.scrollTop);
        distanceX = (newX - currentX); distanceY = (newY - currentY);
        currentX = newX; currentY = newY;
        whichIt.style.pixelLeft += distanceX;
        whichIt.style.pixelTop += distanceY;
            if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop;
            if(whichIt.style.pixelLeft < document.body.scrollLeft-0) whichIt.style.pixelLeft = document.body.scrollLeft-0;
            if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 225) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 225;
            if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 100) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 100;
            event.returnValue = false;
        } else { 
            whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);
    if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset;
    if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;
    if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;
    if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;
    return false;
        }
    return false;
    }
    
    function dropIt() {
        whichIt = null;
    if(NS) window.releaseEvents (Event.MOUSEMOVE);
    return true;
    }
       
    if(NS) {
        window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
        window.onmousedown = grabIt;
        window.onmousemove = moveIt;
        window.onmouseup = dropIt;
    }
    if(IE) {
        document.onmousedown = grabIt;
        document.onmousemove = moveIt;
        document.onmouseup = dropIt;
    }
    }








/**

var menuskin = "skin1"; // skin0, or skin1
var display_url = 0; // Show URLs in status bar?
function showmenuie5() {
var rightedge = document.body.clientWidth-event.clientX;
var bottomedge = document.body.clientHeight-event.clientY;
if (rightedge < ie5menu.offsetWidth)
ie5menu.style.left = document.body.scrollLeft + event.clientX - ie5menu.offsetWidth;
else
ie5menu.style.left = document.body.scrollLeft + event.clientX;
if (bottomedge < ie5menu.offsetHeight)
ie5menu.style.top = document.body.scrollTop + event.clientY - ie5menu.offsetHeight;
else
ie5menu.style.top = document.body.scrollTop + event.clientY;
ie5menu.style.visibility = "visible";


var new_id=GetValue("o_cat_id");
inner_value("w_cat_id",new_id);
inner_value("o_cat_id","");


var new_sub_id=GetValue("o_sub_cat_id");

if(new_sub_id!=false && GetValue("w_sub_cat_id")!=""){
document.getElementById("e_"+GetValue("w_sub_cat_id")).style.backgroundColor='#000000';
document.getElementById("e_"+new_sub_id).style.backgroundColor='#aaaaaa';
}
inner_value("w_sub_cat_id",new_sub_id);
//inner_value("o_sub_cat_id","");


var new_event_id=GetValue("o_event_id");
if(new_event_id!=false && GetValue("w_event_id")!="" && new_event_id!=""){
	inner_value("o_sub_cat_id","");
	inner_value("w_sub_cat_id","");
	
document.getElementById("e_"+GetValue("w_event_id")).style.backgroundColor='#000000';
document.getElementById("e_"+new_event_id).style.backgroundColor='#aaaaaa';
}
inner_value("w_event_id",new_event_id);
//inner_value("o_event_id","");


var menu="<div class='skin0' onMouseover='highlightie5()' onMouseout='lowlightie5()' onClick='jumptoie5()' >";

if(new_id!=''){
menu+="<div  class='menuitems' url='javascript: x_form_add_cat(null,result_shadowt)'>Add Category</div><hr>";
menu+="<div class='menuitems' url='javascript: x_form_add_sub_cat("+new_id+",result_shadowt)' >Add Sub Categories</div>";
menu+="<div class='menuitems' url='javascript: x_form_add_cat("+new_id+",result_shadowt)' >Edit</div>";
menu+="<div class='menuitems' url='javascript: x_delete_cat("+new_id+",result_innerhtml)' >Delete</div>";
}
else if(new_event_id!="") {  inner_value("w_sub_cat_id",""); new_sub_id="";
var sub_cat_id=GetValue('sub_cat_id_m');
menu+="<div class='menuitems' url='javascript: x_add_events("+sub_cat_id+",result_shadowt)' >Add Events</div>";
menu+="<div class='menuitems' url='javascript: x_add_events("+sub_cat_id+","+new_event_id+",result_shadowt)' >Edit Events</div>";
	//	menu+="<div class='menuitems' url='javascript: x_form_add_sub_cat("+sub_cat_id+",result_shadowt)' >Edit Sub Category</div>";
menu+="<div class='menuitems' url='javascript: x_delete_event("+sub_cat_id+","+new_event_id+",result_innerhtml)' >Delete</div>";
}
else if(new_sub_id!="" ) {
	var cat_id=GetValue('cat_id_sub_cat');
	//menu+="<div class='menuitems' url='javascript: x_form_add_sub_cat("+cat_id+",result_shadowt)' ><font class=text style='color:#000000'>Menu</center></div><hr>";
	menu+="<div class='menuitems' url='javascript: x_event_list("+new_sub_id+",result_innerhtml)' >Open</div><hr>";
	menu+="<div class='menuitems' url='javascript: x_form_add_sub_cat("+cat_id+",result_shadowt)' >Add Sub Categories</div>";
menu+="<div class='menuitems' url='javascript: x_form_add_cat("+cat_id+",result_shadowt)' >Edit Categories</div><hr>";
menu+="<div class='menuitems' url='javascript: x_add_events("+new_sub_id+",result_shadowt)' >Add Events</div>";
		menu+="<div class='menuitems' url='javascript: x_form_add_sub_cat("+cat_id+","+GetValue("w_sub_cat_id")+",result_shadowt)' >Edit Sub Category</div>";
menu+="<div class='menuitems' url='javascript: x_delete_sub_cat("+GetValue("w_sub_cat_id")+","+cat_id+",result_innerhtml)' >Delete</div>";

}

else {
	menu+="<div  class='menuitems' url='javascript: x_form_add_cat(null,result_shadowt)'>Add Category</div>";
	menu+="<div  class='menuitems' url='javascript: x_form_add_cat(null,result_shadowt)'>Log Out</div>";
}
menu+="</div>";
document.getElementById("ie5menu").innerHTML=menu

return false;
}

function hidemenuie5() {

if(GetValue("w_event_id")!=""){
document.getElementById("e_"+GetValue("w_event_id")).style.backgroundColor='#000000';}
if(GetValue("w_sub_cat_id")!=""){
document.getElementById("e_"+GetValue("w_sub_cat_id")).style.backgroundColor='#000000';}
inner_value("o_cat_id","");
inner_value("w_cat_id","");
//inner_value("o_sub_cat_id","");
inner_value("w_sub_cat_id","");
inner_value("w_event_id","");

ie5menu.style.visibility = "hidden";
}
function highlightie5() {
if (event.srcElement.className == "menuitems") {
event.srcElement.style.backgroundColor = "highlight";
event.srcElement.style.color = "white";
if (display_url)
window.status = event.srcElement.url;
   }
}
function lowlightie5() {
if (event.srcElement.className == "menuitems") {
event.srcElement.style.backgroundColor = "";
event.srcElement.style.color = "black";
window.status = "";
   }
}
function jumptoie5() {
if (event.srcElement.className == "menuitems") {
if (event.srcElement.getAttribute("target") != null)
window.open(event.srcElement.url, event.srcElement.getAttribute("target"));
else
window.location = event.srcElement.url;
   }
}
//  End -->


if (document.all && window.print) {
ie5menu.className = menuskin;
document.oncontextmenu = showmenuie5;
document.body.onclick = hidemenuie5;
}





function dirtypop(html)
{alert();
  var generator=window.open('','name','height=400,width=500');
  generator.document.write(html[1]);
  if(result[2]!=""){cod=eval(result[2]);}
generator.document.write(eval("<script>alert();</script>")) ;
  generator.document.close();
}

*/