﻿//BUTTONS' PAGE TITLE - MouseOver
var divShowHideElement;
    
// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0
    
//Set X coord
var setX = 0;
    
    
    
// Detect if the browser is IE or not. If it is not IE, we assume that the browser is mozilla.
var IE = document.all?true:false;
// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE);
    
        

var ifDivFullPicMyAccount = false; //if div is the divFullPicMyAccount from Account.aspx then setY differently
var ifDivIMEIInfo = false; //if div is the divIMEIInfo from SubmitMobile.aspx then setY differently

function showHideDiv( param1, param2, param3 ) {  
    if( param2.indexOf("FullPicMyAccount") != -1 ) ifDivFullPicMyAccount = true;
    else ifDivFullPicMyAccount = false;
    
    if ( param2.indexOf("IMEIInfo") != -1 ) ifDivIMEIInfo = true;
    else ifDivIMEIInfo = false;    
    
  
    divShowHideElement = document.getElementById("div" + param2);
    divShowHideElement.style.display = param1;
      
    if( param1 == "none" ) return;
      
    setX = param3;
      
    // Set-up to use getMouseXY function onMouseMove
    document.onmousemove = setDivXY;
}
function setDivXY(e) {    
    if (IE) tempY = event.clientY + document.body.scrollTop + 17; 
    else tempY = e.pageY + 19;
    
    
    
    //this part is only for ifDivFullPicMyAccount and ifDivIMEIInfo. See above. 
    if(ifDivFullPicMyAccount) {
      var totalHeight = document.body.offsetHeight + document.body.scrollTop;
      if( totalHeight - tempY < 320 ) tempY = tempY - 320;
    } else if(ifDivIMEIInfo) {
      var totalHeight = document.body.offsetHeight + document.body.scrollTop;
      if( totalHeight - tempY < 320 ) tempY = tempY - 320;
    }
    
    //end
    
    

    if (IE) tempX = event.clientX + document.body.scrollLeft - setX; // grab the x-y pos.s if browser is IE        
    else tempX = e.pageX - setX;  // grab the x-y pos.s if browser is NS
      
    // catch possible negative values in NS4
    if (tempX < 0) tempX = 0;
    if (tempY < 0) tempY = 0;  
      
    // set up div based on the MouseXY
    divShowHideElement.style.top = tempY;
    divShowHideElement.style.left = tempX;
    return true;
}
// END
