﻿//<script type="text/javascript">
// YinYang index script
function SetHiddenFields()
{ 
  //var hidden = document.getElementById('<%= HiddenField1.ClientID %>');
  //var hidden1 = document.getElementById('Wizard1_HiddenField1');
  //hidden1.value = myMouseX;
  var hdf1 = document.getElementById("Wizard1_HiddenField1"); //.value = myMouseX;
  hdf1.value  = myMouseX; // document.getElementById("Wizard1_HiddenField1").value = myMouseX;
  //var hidden2 = document.getElementById('Wizard1_HiddenField2');
  //hidden2.value = myMouseY;
  //document.getElementById("Wizard1_HiddenField2").value = myMouseY;
  var hdf2 = document.getElementById("Wizard1_HiddenField2");
  hdf2.value = myMouseY;
  
  // Use a literal because genhost hiddenfields aren't supported!
  //document.getElementById("Literal1").value = myMouseX;  
  //document.getElementById("Literal2").value = myMouseY;
  //var lit1 = document.getElementById("Literal1");
  //lit1.value = myMouseX;
  //var lit2 = document.getElementById("Literal2");
  //lit2.value = myMouseY;
}
   
      //document.onmouseup=getXYPosition;
     


//The rest of the work is done by the getXYPosition() and toggleXY() //javascript functions, which can be either in the <head> area of //your HTML page, or in a separate javascript file: 

// Cursor coordinate functions
var myX, myY, xyOn, myMouseX, myMouseY;
//xyOn = true;
xyOn = false;

//var cw = 640;
//var chz = 460;
var cw = 150  + 100;
var chz = 130 + 100;

function getXYPosition(e){
// 9/22/08, KM: add 4 lines below:
var w = window.innerWidth? window.innerWidth : document.body.clientWidth? document.body.clientWidth : 640;
var hpx = window.innerHeight? window.innerHeight : document.body.clientHeight ? document.body.clientHeight : 460;

if (hpx <= 19) {
 hpx = screen.availHeight * 0.8; 
 }
//cw = 150 + 30 + 100;
//chz = 50 + 100;

myMouseX=(e||event).clientX;
myMouseY=(e||event).clientY;
if (document.documentElement.scrollTop > 0) {
myMouseY = myMouseY + document.documentElement.scrollTop;
}

if (xyOn) {
alert("X is " + myMouseX + "\nY is " + myMouseY + "\n CenterWidth is " + cw + "\n CenterHght is " + chz  );
//alert("WinW is " + winwidth() + "\n WinH is " + windHeight());
}

// Just force showing of xy pts
// 9/22/08, KM : move alert box inside this function
//alert("X is " + myMouseX + "\nY is " + myMouseY + "\n CenterWidth is " + cw + "\n CenterHght is " + chz  );
SetHiddenFields();
}

function toggleXY() {
xyOn = !xyOn;
document.getElementById('xyLink').blur();
return false;
} 

function SetXYon() {
xyOn = true;
}

function SetXYoff() {
xyOn = false;
}
//    </script>