﻿// Created by Elise Tan, July 2008
// To display a general popup panel 
// Call function ShowContent(d)

var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
	rX = self.pageXOffset;
	rY = self.pageYOffset;
	}
else if(document.documentElement && document.documentElement.scrollTop) {
	rX = document.documentElement.scrollLeft;
	rY = document.documentElement.scrollTop;
	}
else if(document.body) {
	rX = document.body.scrollLeft;
	rY = document.body.scrollTop;
	}
if(document.all) {
	cX += rX; 
	cY += rY;
	}
d.style.left = (cX+5) + "px";
d.style.top = (cY+5) + "px";
}
function HideContent(d) {
document.getElementById(d).style.display = "none";
}

function ShowContent(divColorPicker, divColorTitle, inpColorTitle) {
var divColorPicker = document.getElementById(divColorPicker);
AssignPosition(divColorPicker);
divColorPicker.style.display = "block";

document.getElementById('hidDivColor').value = divColorTitle;
document.getElementById('hidInpColor').value = inpColorTitle;

}
