var dynMenuDivID = "dynmenu";
var iFrameDivID = "dynmenuiframe";


function displayDynMenu(dateFieldName)
{
  var targetDateField = document.getElementsByName (dateFieldName).item(0);
 


  var x = targetDateField.offsetLeft;
  var y = targetDateField.offsetTop + targetDateField.offsetHeight ;
 
  var parent = targetDateField;
  while (parent.offsetParent) {
    parent = parent.offsetParent;
    x = (parent.offsetWidth/2)-255;
    y += parent.offsetTop ;
  }
 
  y-=8;


  if (!document.getElementById(dynMenuDivID)) {
    var newNode = document.createElement("div");
    newNode.setAttribute("id", dynMenuDivID);
    newNode.setAttribute("class", "dpDiv");
    newNode.setAttribute("style", "visibility: hidden;");
    newNode.onmouseout = function(){dynmenu.style.visibility ='hidden';};
    newNode.onmouseover = function(){dynmenu.style.visibility ='visible';};
    document.body.appendChild(newNode);

  }
 
  // move the datepicker div to the proper x,y coordinate and toggle the visiblity
  var dynmenuDiv = document.getElementById(dynMenuDivID);
  dynmenuDiv.style.position = "absolute";
  dynmenuDiv.style.left = x + "px";
  dynmenuDiv.style.top = y + "px";
  dynmenuDiv.style.visibility = "visible";
  dynmenuDiv.style.display = "block";
  dynmenuDiv.style.zIndex = 10000;


  refreshDynMenu();
}


function refreshDynMenu()
{
  
  var html = "<div style='border-style:none; text-align:left;background-color:#a6a6a6;'>";
  html+="<table border=0 width=100 cellpadding=5 style=\"font-family:Arial, Helvetica, sans-serif;color:#24181a; font-size:13px;  \">";
  html+="<tr style=\"cursor:pointer; cursor: hand\" onclick=\"javascript: location.href = 'gallery.php?girls=all'; \"><td style=\"border-bottom-style:solid;border-bottom-width:1px;\">All Girls</td></tr>";
  html+="<tr style=\"cursor:pointer; cursor: hand\" onclick=\"javascript: location.href = 'gallery.php?girls=massage'; \"><td style=\"border-bottom-style:solid;border-bottom-width:1px;\">Massage</td></tr>";
  html+="<tr style=\"cursor:pointer; cursor: hand\" onclick=\"javascript: location.href = 'gallery.php?girls=incalls'; \"><td style=\"border-bottom-style:solid;border-bottom-width:1px;\">Incalls</td></tr>";
  html+="<tr style=\"cursor:pointer; cursor: hand\" onclick=\"javascript: location.href = 'gallery.php?girls=outcalls'; \"><td>Outcalls</td></tr>";
  html+="</table>";
  html+="</div>";
  document.getElementById(dynMenuDivID).innerHTML = html;
}





