HM_DOM = (document.getElementById) ? true : false;
HM_NS4 = (document.layers) ? true : false;
HM_IE = (document.all) ? true : false;
HM_IE4 = HM_IE && !HM_DOM;
HM_Mac = (navigator.appVersion.indexOf("Mac") != -1);
HM_IE4M = HM_IE4 && HM_Mac;
HM_IsMenu = (HM_DOM || HM_NS4 || (HM_IE4 && !HM_IE4M));

HM_BrowserString = HM_NS4 ? "NS4" : HM_DOM ? "DOM" : "IE4";

function getReal(xy,el){
if (xy=="w") {Pos=el.width;} else {
 if (xy=="h") {Pos=el.height;} else {
  if((HM_IE)||(HM_DOM)){
     Pos=(xy=="x")?el.offsetLeft:el.offsetTop;
     if ((HM_IE)&&(!HM_Mac)&&(el.tagName)&&(el.tagName.toUpperCase()=="TABLE")&&(el.border)&&(el.border>0)) Pos++;
     tmpEl=el.offsetParent;
     while(tmpEl!=null){
       Pos+=(xy=="x")?tmpEl.offsetLeft:tmpEl.offsetTop;
       if ((HM_IE)&&(!HM_Mac)&&(tmpEl.tagName)&&(tmpEl.tagName.toUpperCase()=="TABLE")&&(tmpEl.border)&&(tmpEl.border>0)) Pos++;
       tmpEl=tmpEl.offsetParent;
     }
  }else{Pos=(xy=="x")?el.x:el.y; }
  if (HM_IE&&HM_Mac) {
    MacOffset=(xy=="x")?(document.body.currentStyle.marginLeft):(document.body.currentStyle.marginTop);
    if(MacOffset.indexOf('%')!=-1){
        MacSize=(xy=="x")?parseInt(document.body.offsetWidth):parseInt(document.body.offsetHeight);
        MacOffset=(parseInt(MacOffset)/100)*MacSize;
    }else{MacOffset=parseInt(MacOffset)}
    Pos+=MacOffset;
  }
 }
}
return Pos;
}

function findXY(elementid,xory) {
var thePlacer=
    HM_DOM ? document.getElementById(elementid) :  
    HM_IE ? document.all(elementid) :document.images[elementid];
  retVal=getReal(xory,thePlacer);
 return retVal;
}

