﻿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 = (185) + "px";
d.style.top = (140) + "px";
}
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}

function Showtab(d) {
    if (d.length < 1) { return; }
    document.getElementById(d).style.display = "block";
}

function Hidetab(d) {
    if (d.length < 1) { return; }
    document.getElementById(d).style.display = "none";

}

function tabOn(d) {
    if (d.length < 1) { return; }
    document.getElementById(d).style.backgroundColor = "#A51E22";
}

function tabOff(d) {
    if (d.length < 1) { return; }
    document.getElementById(d).style.backgroundColor = "Transparent";
}


function UpdateCursorPosition2(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll2(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll2; }
else { document.onmousemove = UpdateCursorPosition2; }
function AssignPosition2(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 = (185 + 179) + "px";
d.style.top = (155) + "px";
}
function HideContent2(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent2(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition2(dd);
dd.style.display = "block";
}
function ReverseContentDisplay2(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition2(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}


var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition3(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll3(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll3; }
else { document.onmousemove = UpdateCursorPosition3; }
function AssignPosition3(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;
}
var winl = (screen.width-800)/2;
var wint = (screen.height-500)/2;
d.style.left = (winl) + "px";
d.style.top = (wint) + "px";
}
function HideContent3(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent3(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition3(dd);
dd.style.display = "block";
}
function ReverseContentDisplay3(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition3(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}

var win = null;
function NewWindow(mypage, myname, w, h, scroll, pos) {
    if (pos == "random") { LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width - w)) : 100; TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height - h) - 75)) : 100; }
    if (pos == "center") { LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100; TopPosition = (screen.height) ? (screen.height - h) / 2 : 100; }
    else if ((pos != "center" && pos != "random") || pos == null) { LeftPosition = 0; TopPosition = 20 }
    settings = 'width=' + w + ',height=' + h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
    win = window.open(mypage, myname, settings);
}
