/* Gem, added cross browser support for ie5+ and dom conforming browsers */
/* mozilla (including netscape) only accept 1 parameter */
/* to make revision easier, added 3 globals */
var showcontext_a=0, showcontext_b=0
var global_set=false;
function setmouse(e){
    if(!global_set) return;
    if(!e)
        e=window.event
    // Reposition the element, with a bit of an offset.  
    if(e.pageX || e.pageY){
        posx=e.pageX;
        posy=e.pageY;
        window.status=posx + "; " +posy
    }else if(e.clientX || e.clientY){
        posx=e.clientX + document.body.scrollLeft;
        posy=e.clientY + document.body.scrollTop ;
        window.status=posx + "; " +posy
    }
    var ct = document.getElementById("contextBox");
    if (ct){
        ct.style.display = "block";
        ct.style.visibility="hidden";
        
        if(ct.offsetHeight && ct.offsetWidth)
        {
            
            ct.style.left = posx- ct.offsetWidth/2;
            if(posy>ct.offsetHeight)
                ct.style.top = posy -ct.offsetHeight-10; 
            else
                ct.style.top = posy+10; 
            
        }  
        else{
            ct.style.left = posx+ showcontext_a;
            ct.style.top = posy + showcontext_b;   
        }
        ct.style.visibility="visible";
        window.status=ct.style.left + "; " +ct.style.top

    }
}

function ShowContext(stitle,sText,a,b)
{
    showcontext_a=a;
    showcontext_b=b;
    // Retrieve the element.
    var ct = document.getElementById("contextBox");
    if(ct){
        ct.innerHTML ="<table class='notetitle' cellspacing='0' cellpadding='0'><tr><td>"+stitle+":</td></tr></table>"+sText;
        //alert(ct.innerHTML);
    }
    global_set=true
}

function HideContext()
{
    // Retrieve and hide the context box
    global_set=false;
    document.getElementById("contextBox").style.display = "none";
}

function loc(){
    var path=window.location.pathname;
    path=path.toLowerCase();
    if(path.indexOf("testvmsl")!=-1)
        document.cookie="vd=testvmsl; path=/";
    else
        document.cookie="vd=vmsl; path=/";
    //alert(document.cookie);
}
var cookieSeparator=" ";
var nameValueSeparator="#";
function getCookie(name) {
  var cookies = document.cookie.split("; "); // break cookie into array of bites
  for (var i=0; i < cookies.length; i++) {
    nameAndValue = cookies[i].split("="); // break into name and value
    if (nameAndValue[0] == name) // if name matches
      return unescape(nameAndValue[1]); // return value
  }
  return null;
}