Add even more of the source
This should be about everything needed to build so far?
This commit is contained in:
parent
af3619d4fa
commit
849723c9cf
547 changed files with 149239 additions and 0 deletions
136
WebAdmin/WebAdminHtml/includes/DarwinDragWidget.js
Normal file
136
WebAdmin/WebAdminHtml/includes/DarwinDragWidget.js
Normal file
|
@ -0,0 +1,136 @@
|
|||
// Constants
|
||||
var offsetX = 12;
|
||||
var offsetY = 0;
|
||||
var tolerance = 6;
|
||||
|
||||
// Globals
|
||||
var darwinOriginalDragX = 0;
|
||||
var darwinOriginalDrayY = 0;
|
||||
var currentDragBox = null;
|
||||
|
||||
// Constructor for the DarwinDragWidget class.
|
||||
function DarwinDragWidget(window, multipleSelectedString) {
|
||||
// Remember some arguments for later.
|
||||
this.window = window;
|
||||
this.id = 'darwinDragWidget';
|
||||
this.body = '';
|
||||
this.multipleSelectedString = multipleSelectedString;
|
||||
// Output a CSS-P style sheet for this document.
|
||||
var d = window.document;
|
||||
d.writeln('<style type="text/css">');
|
||||
d.write('#darwinDragWidget { position: absolute; ');
|
||||
d.write('left: 0px; top: 0px; ');
|
||||
d.write('visibility: hidden; ');
|
||||
d.writeln('}');
|
||||
d.write('#darwinInvisibleCover { position: absolute; ');
|
||||
d.write('left: 0px; top: 0px; ');
|
||||
d.write('width: 4px; height: 4px; ');
|
||||
d.write('visibility: hidden; ');
|
||||
d.writeln('}');
|
||||
d.writeln('<' + '/style>');
|
||||
}
|
||||
|
||||
// This will output the initial HTML
|
||||
DarwinDragWidget.prototype.output = function() {
|
||||
var d = this.window.document;
|
||||
|
||||
d.writeln('<div id="' + this.id + '" class=line-item>');
|
||||
d.writeln(this.body);
|
||||
d.writeln('<' + '/div>');
|
||||
|
||||
d.writeln('<div id="darwinInvisibleCover" onmouseout="SetStyleVisible(\'darwinInvisibleCover\', false)">');
|
||||
d.writeln('<img src="images/invis_dragcover.gif" width=4 height=4>');
|
||||
d.writeln('<' + '/div>');
|
||||
|
||||
// save references to the element
|
||||
this.element = d.getElementById(this.id);
|
||||
this.style = this.element.style;
|
||||
this.window.darwinDragWidget = this;
|
||||
this.element.object = this;
|
||||
}
|
||||
|
||||
DarwinDragWidget.prototype.draw = function() {
|
||||
if (this.contents) {
|
||||
if (this.contents.length == 1)
|
||||
this.element.innerHTML = this.contents[0].draw();
|
||||
else
|
||||
this.element.innerHTML = this.multipleSelectedString;
|
||||
|
||||
this.style.visibility = 'hidden';
|
||||
this.offsetX = this.style.pixelWidth / 2;
|
||||
this.offsetY = this.style.pixelHeight / 2;
|
||||
}
|
||||
}
|
||||
|
||||
function GetScrollPos(d) {
|
||||
|
||||
if ((document.documentElement) && (document.documentElement.scrollTop)) {
|
||||
if (d == 0)
|
||||
return document.body.scrollLeft + document.documentElement.scrollLeft;
|
||||
else
|
||||
return document.body.scrollTop + document.documentElement.scrollTop;
|
||||
}
|
||||
|
||||
else {
|
||||
if (d == 0)
|
||||
return document.body.scrollLeft;
|
||||
else
|
||||
return document.body.scrollTop;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function darwinHandleMouseMove(e) {
|
||||
if (e) {
|
||||
var currentX = e.pageX;
|
||||
var currentY = e.pageY;
|
||||
}
|
||||
else {
|
||||
var currentX = event.clientX + GetScrollPos(0);
|
||||
var currentY = event.clientY + GetScrollPos(1);
|
||||
}
|
||||
if ((Math.abs(currentX - darwinOriginalDragX) > tolerance) || (Math.abs(currentY - darwinOriginalDrayY) > tolerance)) {
|
||||
SetStylePos('darwinDragWidget', 0, currentX + offsetX);
|
||||
SetStylePos('darwinDragWidget', 1, currentY + offsetY);
|
||||
darwinDragWidget.style.visibility = 'visible';
|
||||
if (IsNS6()) {
|
||||
currentDragBox = null;
|
||||
for (i = 0; i < dragRegionBoxes.length; i++) {
|
||||
var g = dragRegionBoxes[i];
|
||||
var regionEndX = g.locationX + g.sizeX;
|
||||
var regionEndY = g.locationY + g.sizeY;
|
||||
if ((currentX > g.locationX) && (currentX < regionEndX) && (currentY > g.locationY) && (currentY < regionEndY)) {
|
||||
g.element.style.backgroundColor = g.highlightcolor;
|
||||
currentDragBox = g;
|
||||
}
|
||||
else {
|
||||
if (currentDragBox == g)
|
||||
currentDragBox = null;
|
||||
g.element.style.backgroundColor = '#FFFFFF';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function darwinHandleMouseUp(e) {
|
||||
var d = darwinDragWidget.window.document;
|
||||
var str = '';
|
||||
darwinDragWidget.style.visibility = 'hidden';
|
||||
// stop tracking events
|
||||
d.onmousemove = null;
|
||||
d.onmouseup = null;
|
||||
if (currentDragBox) {
|
||||
for (i = 0; i < dragRegionBoxes.length; i++) {
|
||||
var g = dragRegionBoxes[i];
|
||||
g.element.style.backgroundColor = '#FFFFFF';
|
||||
}
|
||||
var allElements = currentDragBox.element.getElementsByTagName('div');
|
||||
if (allElements.length > 0) {
|
||||
var lastElement = allElements[allElements.length-1];
|
||||
lastElement.scrollIntoView();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
153
WebAdmin/WebAdminHtml/includes/DarwinListbox.js
Normal file
153
WebAdmin/WebAdminHtml/includes/DarwinListbox.js
Normal file
|
@ -0,0 +1,153 @@
|
|||
var dragRegionBoxes = new Array();
|
||||
var testCount = 0;
|
||||
|
||||
// Constructor for DarwinListbox class.
|
||||
function DarwinListbox(window, id, locationX, locationY, width, height, background, bordercolor, highlightcolor, allowMultipleSelect, allowDrag, allowDrop, allowRearrange) {
|
||||
// Remember some arguments for later.
|
||||
this.window = window;
|
||||
this.id = id;
|
||||
this.body = '';
|
||||
this.contents = new Array();
|
||||
this.highlightcolor = highlightcolor;
|
||||
this.mousedown = false;
|
||||
this.allowMultipleSelect = allowMultipleSelect;
|
||||
this.allowDrag = allowDrag;
|
||||
this.allowDrop = allowDrop;
|
||||
this.locationX = locationX;
|
||||
this.locationY = locationY;
|
||||
this.sizeX = width;
|
||||
this.sizeY = height;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.bordercolor = bordercolor;
|
||||
// If this is droppable, add it to the list of droppable regions.
|
||||
if (allowDrop)
|
||||
dragRegionBoxes[dragRegionBoxes.length] = this;
|
||||
this.allowRearrange = allowRearrange;
|
||||
// Output a CSS-P style sheet for this document.
|
||||
var d = window.document;
|
||||
d.writeln('<style type="text/css">');
|
||||
d.write('#' + id + ' { ');
|
||||
width += 17;
|
||||
d.write('overflow: scroll; ');
|
||||
d.write('border-style: solid; ');
|
||||
d.write('border-width: 1px; ');
|
||||
d.write('border-color: ' + bordercolor + '; ');
|
||||
d.write('background: ' + background + '; ');
|
||||
if (width) d.write('width: ' + width + 'px; ');
|
||||
if (height) d.write('height: ' + width + 'px; ');
|
||||
d.writeln('}');
|
||||
d.writeln('<' + '/style>');
|
||||
}
|
||||
|
||||
// This will output the initial HTML
|
||||
DarwinListbox.prototype.output = function() {
|
||||
var d = this.window.document;
|
||||
|
||||
d.writeln('<div id="' + this.id + '">');
|
||||
d.writeln(this.body);
|
||||
d.writeln('<' + '/div>');
|
||||
|
||||
// save references to the element
|
||||
this.element = d.getElementById(this.id);
|
||||
this.style = this.element.style;
|
||||
|
||||
// set the document's events
|
||||
if (document.captureEvents)
|
||||
document.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN|Event.MOUSEMOVE);
|
||||
}
|
||||
|
||||
DarwinListbox.prototype.draw = function() {
|
||||
var str = '';
|
||||
|
||||
for (var i in this.contents) {
|
||||
str += '<div id="' + this.id + i + '" class="line-item" onmouseover="this.parent.handleMouseOver(this)" onmouseout="this.parent.handleMouseOut(this)" onselectstart="return false" onmousemove="this.parent.handleMouseOver(this)">';
|
||||
this.contents[i].parent = this;
|
||||
str += this.contents[i].draw();
|
||||
str += '<' + '/div>';
|
||||
}
|
||||
|
||||
this.element.innerHTML = str;
|
||||
|
||||
for (var i in this.contents) {
|
||||
this.window.document.getElementById(this.id + i).parent = this;
|
||||
}
|
||||
}
|
||||
|
||||
DarwinListbox.prototype.selectOne = function(obj) {
|
||||
var itemClicked = obj.id.replace(this.id, '');
|
||||
|
||||
// if the item is already selected, do nothing
|
||||
if (!this.contents[itemClicked].selected) {
|
||||
// deselect everything
|
||||
for (var i in this.contents) {
|
||||
this.window.document.getElementById(this.id + i).style.background = 'inherit';
|
||||
this.contents[i].selected = false;
|
||||
}
|
||||
// select the clicked item
|
||||
obj.style.background = this.highlightcolor;
|
||||
this.contents[itemClicked].selected = true;
|
||||
|
||||
// send it a callback message so it can handle any UI changes
|
||||
this.contents[itemClicked].onupdate();
|
||||
}
|
||||
else {
|
||||
}
|
||||
// set the last item clicked in case they shift-click next time
|
||||
this.lastItemClicked = itemClicked;
|
||||
}
|
||||
|
||||
DarwinListbox.prototype.handleMouseOver = function(obj) {
|
||||
var d = this.window.document;
|
||||
this.window.status = obj.id;
|
||||
this.window.currentDarwinObj = obj;
|
||||
if (d.onmousemove == darwinHandleMouseMove) {
|
||||
if (this.allowDrop)
|
||||
this.selectOne(obj);
|
||||
}
|
||||
else {
|
||||
d.onmousedown = darwinHandleMouseDown;
|
||||
}
|
||||
}
|
||||
|
||||
// this gets called when the user mouses out of a list item
|
||||
DarwinListbox.prototype.handleMouseOut = function(obj) {
|
||||
if (this.window.document.onmousemove == darwinHandleMouseMove) {
|
||||
this.window.currentDarwinObj = null;
|
||||
this.window.document.onmousedown = null;
|
||||
}
|
||||
}
|
||||
|
||||
// this should get called when the user drops something onto the listbox
|
||||
DarwinListbox.prototype.handleDrop = function(obj) {
|
||||
|
||||
}
|
||||
|
||||
function darwinHandleMouseDown(e) {
|
||||
if (e) {
|
||||
var currentX = e.pageX;
|
||||
var currentY = e.pageY;
|
||||
}
|
||||
else {
|
||||
var currentX = event.clientX + GetScrollPos(0);
|
||||
var currentY = event.clientY + GetScrollPos(1);
|
||||
e = window.event;
|
||||
}
|
||||
var itemClicked = window.currentDarwinObj.id.replace(window.currentDarwinObj.parent.id, '');
|
||||
window.currentDarwinObj.parent.selectOne(window.currentDarwinObj);
|
||||
|
||||
// set up the drag widget, and send mouse move and up events to it
|
||||
if (darwinDragWidget) {
|
||||
var g = darwinDragWidget;
|
||||
var d = window.document;
|
||||
darwinOriginalDragX = currentX;
|
||||
darwinOriginalDrayY = currentY;
|
||||
g.contents = new Array(window.currentDarwinObj.parent.contents[itemClicked]);
|
||||
g.draw();
|
||||
d.onmousemove = darwinHandleMouseMove;
|
||||
d.onmouseup = darwinHandleMouseUp;
|
||||
}
|
||||
|
||||
this.mousedown = true;
|
||||
return false;
|
||||
}
|
185
WebAdmin/WebAdminHtml/includes/draglib.js
Normal file
185
WebAdmin/WebAdminHtml/includes/draglib.js
Normal file
|
@ -0,0 +1,185 @@
|
|||
var browserYOffset = 0;
|
||||
var browserButtonYOffset = 0;
|
||||
|
||||
// calculate offsets
|
||||
|
||||
if (browserName.indexOf('MSIE 5.0; Mac') > 0) {
|
||||
browserYOffset = 18;
|
||||
browserButtonYOffset = 20;
|
||||
}
|
||||
|
||||
function clearPreinsert() {
|
||||
var newArray = new Array();
|
||||
for (var i = 0; i < playlistFiles.length; i++) {
|
||||
if (playlistFiles[i] != "") {
|
||||
newArray[newArray.length] = playlistFiles[i];
|
||||
}
|
||||
}
|
||||
delete playlistFiles;
|
||||
playlistFiles = newArray;
|
||||
}
|
||||
|
||||
function preInsert(thePos) {
|
||||
var newArray = new Array();
|
||||
for (var i = 0; i < playlistFiles.length; i++) {
|
||||
if (i == thePos) newArray[newArray.length] = "";
|
||||
if (playlistFiles[i] != "") {
|
||||
newArray[newArray.length] = playlistFiles[i];
|
||||
}
|
||||
}
|
||||
delete playlistFiles;
|
||||
playlistFiles = newArray;
|
||||
}
|
||||
|
||||
function doInsert(theItem) {
|
||||
for (var i = 0; i < playlistFiles.length; i++) {
|
||||
if (playlistFiles[i] == "") {
|
||||
playlistFiles[i] = theItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function buildLibrary() {
|
||||
for (var i = scrollPos1; i <= GetMin(directoryListing.length - 1, scrollPos1+gNumLayersVisible-1); i++) {
|
||||
generateLayerText('library'+i, directoryListing[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function buildPlaylist() {
|
||||
for (var i = scrollPos2; i <= GetMin(playlistFiles.length - 1, scrollPos2+gNumLayersVisible-1); i++) {
|
||||
generateLayerText('playlist'+i, playlistFiles[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function buildLists() {
|
||||
buildLibrary();
|
||||
buildPlaylist();
|
||||
}
|
||||
|
||||
function stageCall(s) {
|
||||
currentStepNumber++;
|
||||
if ((currentStepNumber == gNumberOfSteps) || ((GetStylePos(s, 0) == xFinalValue) && (GetStylePos(s, 1) == yFinalValue))) {
|
||||
SetStylePos(s, 0, xFinalValue);
|
||||
SetStylePos(s, 1, yFinalValue);
|
||||
SetStyleVisible("draglayer", false);
|
||||
}
|
||||
else {
|
||||
SetStylePos(s, 0, (GetStylePos(s, 0) - xStepValue));
|
||||
SetStylePos(s, 1, (GetStylePos(s, 1) - yStepValue));
|
||||
var currentTimer = setTimeout('stageCall("' + s + '")', gStepTiming);
|
||||
}
|
||||
}
|
||||
|
||||
function moveInStages(s, xVal, yVal) {
|
||||
currentStepNumber = 0;
|
||||
xStepValue = ((GetStylePos(s, 0) - xVal) / gNumberOfSteps);
|
||||
yStepValue = ((GetStylePos(s, 1) - yVal) / gNumberOfSteps);
|
||||
xFinalValue = xVal;
|
||||
yFinalValue = yVal;
|
||||
var currentTimer = setTimeout('stageCall("' + s + '")', gStepTiming);
|
||||
}
|
||||
|
||||
function handleMouseDown(e) {
|
||||
if (IsIE()) var theTarget = window.event.srcElement;
|
||||
else var theTarget = e.target;
|
||||
if (IsIE()) var theButton = event.button;
|
||||
else var theButton = e.which;
|
||||
|
||||
layerClicked = "";
|
||||
movingStatus = "";
|
||||
|
||||
if (IsIE()) {
|
||||
oldX = window.event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
|
||||
oldY = window.event.clientY + document.body.scrollTop + document.documentElement.scrollTop;
|
||||
offsetX = window.event.offsetX;
|
||||
offsetY = window.event.offsetY;
|
||||
}
|
||||
else {
|
||||
oldX = e.pageX
|
||||
oldY = e.pageY
|
||||
}
|
||||
|
||||
for (var i=0; i<=(Math.min(gNumLayersVisible-1,directoryListing.length-1)); i++) {
|
||||
if ((oldX >= GetStylePos('library'+i, 0)) && (oldX <= (GetStylePos('library'+i, 0) + gLayerWidth)) && (oldY >= GetStylePos('library'+i, 1) + browserYOffset) && (oldY <= (GetStylePos('library'+i, 1) + gLayerHeight) + browserYOffset)) {
|
||||
SetStylePos("highlight", 0, GetStylePos('library'+i, 0));
|
||||
SetStylePos("highlight", 1, GetStylePos('library'+i, 1) + browserYOffset);
|
||||
SetStyleVisible("highlight", true);
|
||||
SetButtonsEnabled(true);
|
||||
SetStylePos('draglayer', 0, GetStylePos('library'+i, 0));
|
||||
SetStylePos('draglayer', 1, GetStylePos('library'+i, 1) + browserYOffset);
|
||||
itemDragged = i;
|
||||
generateLayerText('draglayer',directoryListing[i]);
|
||||
layerClicked = 'draglayer';
|
||||
}
|
||||
}
|
||||
|
||||
if (layerClicked == "") {
|
||||
if (allowDeselect) {
|
||||
SetStyleVisible("highlight", false);
|
||||
SetButtonsEnabled(false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((layerClicked != "") && (allowDrag)) {
|
||||
if (theButton == 1) {
|
||||
movingStatus = "drag";
|
||||
origX = GetStylePos(layerClicked, 0);
|
||||
origY = GetStylePos(layerClicked, 1);
|
||||
}
|
||||
|
||||
if (!IsIE()) {
|
||||
document.captureEvents(Event.MOUSEMOVE);
|
||||
}
|
||||
document.onmousemove = handleDrag;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function handleMouseUp(e) {
|
||||
if (movingStatus == "drag") {
|
||||
movingStatus = "false";
|
||||
if (!IsIE()) document.releaseEvents(Event.MOUSEMOVE);
|
||||
|
||||
if (GetStyleVisible("inserthere")) {
|
||||
SetStyleVisible(layerClicked, false);
|
||||
SetStyleVisible("inserthere", false);
|
||||
playlistFiles[playlistFiles.length] = directoryListing[itemDragged];
|
||||
// doInsert();
|
||||
buildLists();
|
||||
}
|
||||
else moveInStages(layerClicked, origX, origY);
|
||||
}
|
||||
}
|
||||
|
||||
function handleDrag(e) {
|
||||
if (movingStatus == "drag") {
|
||||
SetStylePos(layerClicked, 0, window.event.clientX - offsetX);
|
||||
SetStylePos(layerClicked, 1, window.event.clientY - offsetY);
|
||||
var didHighlight = false;
|
||||
for (var i = 0; i <= (gNumLayersVisible-1); i++) {
|
||||
if ((window.event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft >= GetStylePos('playlist'+i, 0)) && (window.event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft <= (GetStylePos('playlist'+i, 0) + gLayerWidth)) && (window.event.clientY + document.body.scrollTop + document.documentElement.scrollTop >= GetStylePos('playlist'+i, 1)) && (window.event.clientY + document.body.scrollTop + document.documentElement.scrollTop <= (GetStylePos('playlist'+i, 1) + gLayerHeight))) {
|
||||
SetStylePos("inserthere", 0, GetStylePos('playlist'+i, 0));
|
||||
SetStylePos("inserthere", 1, GetStylePos('playlist'+GetMin(i,playlistFiles.length), 1));
|
||||
SetStyleVisible("inserthere", true);
|
||||
//preInsert(0);
|
||||
//buildPlaylist();
|
||||
didHighlight = true;
|
||||
}
|
||||
}
|
||||
if ((!didHighlight) && (GetStyleVisible("inserthere"))) {
|
||||
SetStyleVisible("inserthere", false);
|
||||
//clearPreinsert();
|
||||
buildPlaylist();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// re-route events to handlers
|
||||
|
||||
if (!IsIE()) document.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
|
||||
|
||||
document.onmousedown = handleMouseDown;
|
||||
document.onmouseup = handleMouseUp;
|
45
WebAdmin/WebAdminHtml/includes/encode_unicode.js
Normal file
45
WebAdmin/WebAdminHtml/includes/encode_unicode.js
Normal file
|
@ -0,0 +1,45 @@
|
|||
entities = new Array();
|
||||
chars = new Array();
|
||||
|
||||
entities[entities.length] = 'ô';
|
||||
chars[chars.length] = "ô";
|
||||
entities[entities.length] = 'é';
|
||||
chars[chars.length] = "é";
|
||||
entities[entities.length] = 'ê';
|
||||
chars[chars.length] = "ê";
|
||||
entities[entities.length] = 'à';
|
||||
chars[chars.length] = "à";
|
||||
entities[entities.length] = 'ô';
|
||||
chars[chars.length] = "ô";
|
||||
entities[entities.length] = 'Ê';
|
||||
chars[chars.length] = "Ê";
|
||||
entities[entities.length] = 'û';
|
||||
chars[chars.length] = "û";
|
||||
entities[entities.length] = 'ü';
|
||||
chars[chars.length] = "ü";
|
||||
entities[entities.length] = 'Ä';
|
||||
chars[chars.length] = "Ä";
|
||||
entities[entities.length] = 'ä';
|
||||
chars[chars.length] = "ä";
|
||||
entities[entities.length] = 'ö';
|
||||
chars[chars.length] = "ö";
|
||||
entities[entities.length] = 'ß';
|
||||
chars[chars.length] = "ß";
|
||||
|
||||
|
||||
function replaceEntities(theString) {
|
||||
for (var i = 0; i < chars.length; i++) {
|
||||
theString = eval('theString.replace(/' + entities[i] + '/g, chars[i])');
|
||||
}
|
||||
return theString
|
||||
}
|
||||
|
||||
function entityAlert(theString) {
|
||||
theString = replaceEntities(theString);
|
||||
alert(theString);
|
||||
}
|
||||
|
||||
function entityConfirm(theString) {
|
||||
theString = replaceEntities(theString);
|
||||
return confirm(theString)
|
||||
}
|
268
WebAdmin/WebAdminHtml/includes/standardNav.js
Normal file
268
WebAdmin/WebAdminHtml/includes/standardNav.js
Normal file
|
@ -0,0 +1,268 @@
|
|||
isMoving = false
|
||||
// browserName = "OmniWeb/4";
|
||||
// try {
|
||||
// tempVal = window.location.href.indexOf('lucy');
|
||||
browserName = window.navigator.userAgent
|
||||
// }
|
||||
// catch(theErr) {
|
||||
// browserName = "OmniWeb/4";
|
||||
// }
|
||||
browserVersion = parseInt(browserName.charAt(browserName.indexOf("/")+1),10)
|
||||
gMakeVisibleAfter = ""
|
||||
gIsVisible = false
|
||||
prevVisible = ""
|
||||
openDrawer = ""
|
||||
mainNav = new Array("hrweblogo","benefits","money","staffing","training","records","policies","manager","appledir","searchbox"); // jaa
|
||||
defaultPos = new Array(0,93,114,135,156,185,206,228,306,344); // jaa
|
||||
baseLoc = "/areas/hrweb/employee/"
|
||||
maxY = 490
|
||||
menuBGColor = "#336633"
|
||||
menuLineColor = "#669966"
|
||||
|
||||
// standard subroutines
|
||||
|
||||
function popUp(URL,w,h,s) {
|
||||
eval("window.open(URL, 'AppleHelp', 'width="+w+",height="+h+",scrollbars="+s+"');");
|
||||
}
|
||||
|
||||
|
||||
function browserAlert() {
|
||||
if (browserVersion < 4) alert("This web site only works with Netscape and Internet Explorer version 4.0 or higher.")
|
||||
}
|
||||
|
||||
|
||||
function FindStyleInArray(theStyle) {
|
||||
for (var i = 0; i < (mainNav.length); i++) if (mainNav[i] == theStyle) return i
|
||||
|
||||
return (-1)
|
||||
}
|
||||
|
||||
|
||||
function closeAllDrawers() {
|
||||
ridLayers(1)
|
||||
for (var i = 0; i < (mainNav.length); i++) SetStylePos(mainNav[i], 1, defaultPos[i])
|
||||
}
|
||||
|
||||
|
||||
function IsIE() {
|
||||
return browserName.indexOf("MSIE") > 0
|
||||
}
|
||||
|
||||
|
||||
function IsNS6() {
|
||||
return ((browserName.indexOf("Netscape6") > 0) ||
|
||||
(browserName.indexOf("Gecko") > 0));
|
||||
}
|
||||
|
||||
|
||||
function IsWin32() {
|
||||
return browserName.indexOf("Win") > 0
|
||||
}
|
||||
|
||||
|
||||
function GetIEStyle(s) {
|
||||
// return document.all.tags("div") [s].style
|
||||
return document.all[s].style
|
||||
}
|
||||
|
||||
|
||||
function GetNSStyle(s) {
|
||||
if (IsNS6()) return document.getElementById(s).style
|
||||
else return document.layers[s]
|
||||
}
|
||||
|
||||
|
||||
function GetIEScrollPos(d) {
|
||||
|
||||
if ((document.documentElement) && (document.documentElement.scrollTop)) {
|
||||
if (d == 0)
|
||||
return document.body.scrollLeft + document.documentElement.scrollLeft;
|
||||
else
|
||||
return document.body.scrollTop + document.documentElement.scrollTop;
|
||||
}
|
||||
|
||||
else {
|
||||
if (d == 0)
|
||||
return document.body.scrollLeft;
|
||||
else
|
||||
return document.body.scrollTop;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function GetStyle(s) {
|
||||
if (IsIE()) return GetIEStyle(s)
|
||||
else return GetNSStyle(s)
|
||||
}
|
||||
|
||||
|
||||
function GetMin(x, y) {
|
||||
return Math.min(x, y)
|
||||
}
|
||||
|
||||
|
||||
function GetMax(x, y) {
|
||||
return Math.max(x, y)
|
||||
}
|
||||
|
||||
|
||||
function SetStylePos(s, d, p) {
|
||||
if (IsIE()) {
|
||||
if (d == 0) GetIEStyle(s).posLeft = p
|
||||
else GetIEStyle(s).posTop = p
|
||||
}
|
||||
else {
|
||||
if (d == 0) return GetNSStyle(s).left = p
|
||||
else GetNSStyle(s).top = p
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
function GetStyleVisible(s) {
|
||||
if (IsIE()) return (GetIEStyle(s).visibility == "visible")
|
||||
else {
|
||||
if (IsNS6()) return (document.getElementById(s).style.visibility == "visible")
|
||||
else return (GetNSStyle(s).visibility == "show")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function SetStyleVisible(s, whichOne) {
|
||||
if (IsIE()) {
|
||||
GetIEStyle(s).visibility = whichOne ? "visible" : "hidden"
|
||||
}
|
||||
else {
|
||||
if (IsNS6()) {
|
||||
document.getElementById(s).style.visibility = whichOne ? "visible" : "hidden"
|
||||
}
|
||||
else GetNSStyle(s).visibility = whichOne ? "show" : "hide"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function findObj(n, d) { //v3.0 (thanks Austin!)
|
||||
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
|
||||
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
|
||||
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
|
||||
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document); return x;
|
||||
}
|
||||
|
||||
|
||||
function SetStyleText(s, theText) { // sets to contents of divText var
|
||||
if (IsIE() || IsNS6()) {
|
||||
document.getElementById(s).innerHTML = theText;
|
||||
}
|
||||
else {
|
||||
GetStyle(s).document.write(theText);
|
||||
GetStyle(s).document.close();
|
||||
}
|
||||
SetStyleVisible(s, true)
|
||||
}
|
||||
|
||||
|
||||
function clearSearchbox() {
|
||||
document.searchbox.document.Search.elements['queryText'].value=''
|
||||
document.searchbox.document.Search.elements['queryText'].blur()
|
||||
SetStyleVisible('searchbox', false)
|
||||
}
|
||||
|
||||
|
||||
function SetMenu(menuLevel, whichMenu, top) {
|
||||
var s = "menu"+menuLevel+"text"
|
||||
if (!(GetStyleVisible(s) && (GetStylePos(s, 1) == top))) {
|
||||
var s2 = "menu"+menuLevel+"bg"
|
||||
var myHeight = (eval('navarray'+menuLevel)[whichMenu].length/2)*15
|
||||
var theLink = ""
|
||||
if ((top+myHeight>maxY) && ((top-myHeight+15)>0)) {
|
||||
top = top-myHeight+15
|
||||
}
|
||||
var posSoFar = top
|
||||
SetStylePos(s,1,top)
|
||||
SetStylePos(s2,1,top)
|
||||
var theText="<table width=140 height="+String(myHeight)+" cellpadding=0 cellspacing=0 border=0 bgcolor=\"" + menuBGColor + "\">\r"
|
||||
theText+=" <tr><td><spacer type=\"block\" width=138 height="+String(myHeight-2)+"> </td></tr>\r"
|
||||
theText+="</table></div>\r"
|
||||
SetStyleText(s2, theText)
|
||||
theText = "<table width=140 border=0 cellspacing=0 cellpadding=0>\r"
|
||||
theText+=" <tr>\r"
|
||||
theText+=" <td width=122 height=1><spacer type=\"block\" width=122 height=1></td>\r"
|
||||
theText+=" <td width=12 height=1><spacer type=\"block\" width=12 height=1></td>\r"
|
||||
theText+=" </tr>\r"
|
||||
var isMenuItem = false
|
||||
var theURL = ""
|
||||
for (var i = 0; i<eval('navarray'+menuLevel)[whichMenu].length; i=i+2) {
|
||||
isMenuItem = (typeof(eval('navarray'+menuLevel)[whichMenu][i+1]) == 'string')
|
||||
theText+=" <tr>\r"
|
||||
theText+=" <td class=\"leftnav\" width=122 height=14"
|
||||
if (isMenuItem) theText+=" colspan=2"
|
||||
theText+="><a class=\"leftnav\" href=\""
|
||||
theURL = String(eval('navarray'+menuLevel)[whichMenu][i+1])
|
||||
if ((theURL.indexOf("http") != 0) && isMenuItem) theText+=baseLoc
|
||||
if (isMenuItem) theText+=theURL+"\" onmouseover=\"moveBar("+menuLevel+", "+posSoFar+", "+(menuLevel+1)+")\""
|
||||
else theText+="#\" onmouseover=\"moveBar("+menuLevel+", "+posSoFar+", "+(menuLevel+1)+"); SetMenu("+String(menuLevel+1)+", "+eval('navarray'+menuLevel)[whichMenu][i+1]+", "+posSoFar+")\""
|
||||
theText+=" onmouseout=\"ridLater("+String(ridOnTimeout)+")"
|
||||
var newItemText = eval('navarray'+menuLevel)[whichMenu][i]
|
||||
if (IsIE()) var numChars = (24-newItemText.length)*0.7
|
||||
else var numChars = (24-newItemText.length)*1.69
|
||||
if (numChars >= 1) for (var j = 1; j<=numChars; j++) newItemText += " "
|
||||
theText+="\"> " + newItemText + "</a></td>\r"
|
||||
if (!isMenuItem) theText+="<td align=right><b><a class=\"leftnav\" href=\"#\" onmouseover=\"moveBar("+menuLevel+", "+posSoFar+", "+(menuLevel+1)+"); SetMenu("+String(menuLevel+1)+", "+eval('navarray'+menuLevel)[whichMenu][i+1]+", "+posSoFar+")\" onmouseout=\"ridLater("+String(ridOnTimeout)+")\">></a></td>"
|
||||
theText+=" </tr>\r"
|
||||
if (i+2<eval('navarray'+menuLevel)[whichMenu].length) theText+="<tr>\r <td colspan=2 height=1 bgcolor=\"" + menuLineColor + "\"><spacer type=\"block\" width=140 height=1></td>\r </tr>\r"
|
||||
posSoFar+=15
|
||||
}
|
||||
theText+="</table>\r"
|
||||
SetStyleText(s, theText)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function GetStylePos(s, d) {
|
||||
if (IsIE()) {
|
||||
if (d == 0) return GetIEStyle(s).posLeft
|
||||
else return GetIEStyle(s).posTop
|
||||
}
|
||||
else {
|
||||
if (d == 0) return GetNSStyle(s).left
|
||||
else return GetNSStyle(s).top
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function slideLayer(s, d, p, makeVisibleAfter) {
|
||||
var theDifference = 0
|
||||
var isInArray = FindStyleInArray(s) + 1
|
||||
SetStyleVisible(s, true)
|
||||
if (isInArray > 0) {
|
||||
closeAllDrawers()
|
||||
}
|
||||
var currentPos = GetStylePos(s, d)
|
||||
|
||||
var theDifference = p - currentPos
|
||||
if (!((isInArray > 0) & (makeVisibleAfter == openDrawer))) {
|
||||
SetStylePos(s, d, currentPos + theDifference)
|
||||
if (isInArray > 0) for (var i = isInArray; i<mainNav.length; i++) {
|
||||
SetStylePos(mainNav[i], d, GetStylePos(mainNav[i],d) + theDifference)
|
||||
}
|
||||
if ((makeVisibleAfter != "") & (isInArray > 0)) {
|
||||
if (currentPos == defaultPos[isInArray-1]) {
|
||||
// activateMenu(makeVisibleAfter, 1)
|
||||
|
||||
var menuTop = defaultPos[isInArray-1]
|
||||
if (makeVisibleAfter=='manager') menuTop -= 49
|
||||
|
||||
SetMenu(1,isInArray-2,menuTop)
|
||||
|
||||
if (openDrawer != "") restoreImage(openDrawer)
|
||||
openDrawer = mainNav[isInArray-2]
|
||||
exciteImage(makeVisibleAfter)
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
openDrawer = ""
|
||||
ridLayers(0)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue