
function getPosition(){
   // getMouseXY(document);

  if(IE){
		document.all.Layer2.style.left = tempX -17 + "px";
        document.all.Layer2.style.top = tempY - 34 + "px";
       // r = document.all.select1.radius.value;
       // b = document.all.select1.beruf.value;
        lastX = tempX ;
        lastY = tempY;
    }else if(document.layers) {
        document.nsLayer.left = tempX -17 +50 ;
        document.nsLayer.top = tempY - 34 +50 ;
        temp = document.select1.radius.selectedIndex;
      //  r =    document.select1.radius[temp].value;
       // temp = document.select1.beruf.selectedIndex;
      //  b =    document.select1.beruf[temp].value;
        lastX = tempX;
        lastY = tempY;
    }else{
        document.getElementById('Layer2').style.left= tempX -17 + "px";
        document.getElementById('Layer2').style.top = tempY - 34 + "px";
      //  r= document.select1.radius.value;
      //  b = document.select1.beruf.value;
        lastX = tempX ;
        lastY = tempY;
    }
    //Neue Anfrage senden /* */
    loadResultPage((tempX),(tempY));
}

//x und y => position; r => radius ; b => berufsid
function loadResultPage(x,y)  {
  x = x-19;
  y = y-101;
//alert("./result.asp?x=" + x + "&y=" + y + "&r=" + r + "&b=" + b);
  top.daten.location.href="./daten.php?x=" + x + "&y=" + y;
 // alert(document.firmenliste.location.href);

 //alert("./result.asp?x=" + x + "&y=" + y + "&r=" + r + "&b=" + b);
}
function loadResultPageFromCombo() {
    //wurde schon auf die Karte geklickt?
    if( lastX != 0 & lastY != 0 ){
        if(IE){
            r = document.all.select1.radius.value;
            b = document.all.select1.beruf.value;
        }
        else if(document.layers)
        {
            temp = document.select1.radius.selectedIndex;
            r =    document.select1.radius[temp].value

            temp = document.select1.beruf.selectedIndex;
            b =    document.select1.beruf[temp].value
        }else{
            r = document.select1.radius.value;
            b = document.select1.beruf.value;
        }
        loadResultPage(lastX,lastY,r,b);
    }else{
        alert('Bitte wählen Sie Ihren Wohnort auf der Karte.');
    }
}
function loadResultPageHelp() {
        top.firmenliste.location.href="./result.asp?op=help";
}

var b=0;
var r=30;

//bei änderung der Combobox werden die letzte Position genommen (-1 => unbenutzt)
var lastX = 0;
var lastY = 0;


/*  Mouse detection */


// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) { document.captureEvents(Event.MOUSEMOVE) }

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0

// Main function to retrieve mouse x-y pos.s
function getMouseXY(e) {
 // alert('hallo');
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft;
    tempY = event.clientY + document.body.scrollTop;
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX;
    tempY = e.pageY;
  }
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}
  tempX = parseInt(tempX);
  tempY = parseInt(tempY);
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
 // document.Show.MouseX.value = tempX;
 // document.Show.MouseY.value = tempY;
  return true
}
