
function showAJAX(AJAXName,mPos)
{
    var posx = 0;
    var posy = 0;
    var waitTime = 10000;
    var win = document.getElementById("AJAX");
    
    
    if (!mPos)
    {   
        var mPos = window.event;
    }
    if (mPos.pageX || mPos.pageY)
    {
        posx = mPos.pageX;
        posy = mPos.pageY;
    }
    else if (mPos.clientX || mPos.clientY)
    {    
        posx = mPos.clientX;
        posy = mPos.clientY;    
    }
    
    if (navigator.appName == "Microsoft Internet Explorer")
    {
        win.style.top = posy + document.documentElement.scrollTop - 10 + 'px'; 
    }
    else
    {
        win.style.top = posy - 10 + 'px';
    }
    win.style.left = posx + 20 + 'px';
    win.style.width = AJAXName.length * 5 + 30 + 'px';
    win.style.height= '15px';
    win.innerHTML = AJAXName ;
    win.style.display = 'block';
    
   
  
   
    
    
    

}


function hideAJAX()
{
    var win = document.getElementById("AJAX");
     win.style.display = 'none';
     win.innerHTML = '';

}

var aCategory

function getAJAXInfo(ajaxCategory)
{
    //WinPopup('AJAX_Details.asp?sid=V(ID)',600,500,'scrollbars=yes,menubar=no,toolbar=no,location=no,status=no,resizable=yes');return false
    var mainWin = document.getElementById("NewsBox");
    var ctr = 0;
    mainWin.innerHTML = "<div style='margin-top:70px;text-align:center;width:inherit'><img src='/Ajax/siteimages/bigrotation2.gif'></div>"; 
    aCategory = ajaxCategory;
    codeWait();
    //setTimeout("codeWait()",500); 
    mainWin.style.display = 'block';
    
}

function codeWait()
{
   var mainWin = document.getElementById("NewsBox");
   // mainWin.innerHTML = '<div id="infoBoxContent"></div>' ;

    ajaxMapAJAXData("/Ajax/AJAX.asp?category=" + aCategory ) ;
    aCategory="";
}

function closeAJAXWindow()
{

    var mainWin = document.getElementById("NewsBox");
    mainWin.style.display = 'none';
    document.getElementById("infoBoxContent").innerHTML
    
    

}

function ajaxMapAJAXData(url) 
{
    
				
    http_request = false;

    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
              http_request.overrideMimeType('text/xml');
        }
        } else if (window.ActiveXObject) { // IE
        try {
             http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
              try {
                  http_request = new ActiveXObject("Microsoft.XMLHTTP");
              } catch (e) {}
         }
         }

         if (!http_request) {
              alert('Giving up :( Cannot create an XMLHTTP instance');
              return false;
         }
          http_request.onreadystatechange = alertMapAJAXData;
          http_request.open('GET', url, true);
          http_request.send(null);
              

}        


function alertMapAJAXData() 
{
    if (http_request.readyState == 4) 
    {
        if (http_request.status == 200) 
        {
            var xmldoc = http_request.responseXML;

            var root_node = xmldoc.getElementsByTagName('AjaxInfo').item(0);
            document.getElementById("NewsBox").innerHTML = root_node.firstChild.data ;
         } 
         else 
         {
                        alert(http_request.status);
                        alert('There was a problem with the request.');
         }
     }

}
