first commit
429
hrmsWeb/hrms/includes/ENRGISE.css
Normal file
@@ -0,0 +1,429 @@
|
||||
/*------------------------------------------------------------------------------
|
||||
StyleSheet for Web-Enrgise.
|
||||
--------------------------
|
||||
Author: Amitava Basak
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
/*Html Body, Scrollbars, background Color, Font etc for html BODY
|
||||
-----------------------------------------------------------------*/
|
||||
BODY {
|
||||
margin:0px;
|
||||
background-color:#eff9ff;
|
||||
text: #000000;
|
||||
font-size:8pt;
|
||||
font-family:"Arial, Helvetica, sans-serif";
|
||||
scrollbar-arrow-color:#006699;
|
||||
scrollbar-face-color:#FFFFFF;
|
||||
scrollbar-track-color:"#eeeeee";
|
||||
scrollbar-shadow-color:#006699;
|
||||
scrollbar-highlight-color:'#006699';
|
||||
scrollbar-3dlight-color:'#FFFFFF';
|
||||
scrollbar-darkshadow-Color:'#FFFFFF';
|
||||
|
||||
}
|
||||
|
||||
/*For INPUT tag
|
||||
----------------------------*/
|
||||
INPUT
|
||||
{
|
||||
text: #000000;
|
||||
font-size:8pt;
|
||||
font-family:"Arial, Helvetica, sans-serif";
|
||||
}
|
||||
|
||||
/*For TEXTAREA tag
|
||||
----------------------------*/
|
||||
TEXTAREA
|
||||
{
|
||||
text: #000000;
|
||||
font-size:8pt;
|
||||
font-family:"Arial, Helvetica, sans-serif";
|
||||
scrollbar-arrow-color:#006699;
|
||||
scrollbar-face-color:#FFFFFF;
|
||||
scrollbar-track-color:"#eeeeee";
|
||||
scrollbar-shadow-color:#006699;
|
||||
scrollbar-highlight-color:'#006699';
|
||||
scrollbar-3dlight-color:'#FFFFFF';
|
||||
scrollbar-darkshadow-Color:'#FFFFFF';
|
||||
}
|
||||
|
||||
/*for TABLE tag
|
||||
----------------------------*/
|
||||
TABLE {
|
||||
border-collapse:separate;
|
||||
border-spacing:0px 0px;
|
||||
border: 0px;
|
||||
padding:0px;
|
||||
width:100%;
|
||||
font-size:8pt;
|
||||
font-family:"Arial, Helvetica, sans-serif";
|
||||
|
||||
}
|
||||
|
||||
/*for Hyperlinks
|
||||
----------------------------*/
|
||||
A:hover {color: orange;}
|
||||
a{ color: blue; text-decoration: underline; font-family:verdana; font-size:12}
|
||||
A:hover {color: orange;}
|
||||
|
||||
|
||||
|
||||
/*DIV for entire html Body
|
||||
----------------------------*/
|
||||
#divBody {
|
||||
position:RELATIVE;
|
||||
left:0px;
|
||||
top:0px;
|
||||
width:100%;
|
||||
height:100%;
|
||||
overflow-y:scroll;
|
||||
overflow-x:hidden;
|
||||
background-color:#eff9ff;
|
||||
}
|
||||
|
||||
.blueLine
|
||||
{
|
||||
background-color:#4682b4;
|
||||
}
|
||||
.disTab
|
||||
{
|
||||
background-color:#76A2C7;
|
||||
}
|
||||
.actTab
|
||||
{
|
||||
background-color:#4682b4;
|
||||
}
|
||||
|
||||
/*DIV for Detail Table
|
||||
----------------------------*/
|
||||
#divDtlTable {
|
||||
position:RELATIVE;
|
||||
left:0px;
|
||||
top:0px;
|
||||
width:100%;
|
||||
height:100%;
|
||||
overflow:scroll;
|
||||
}
|
||||
|
||||
/*DIV For Tree Menu
|
||||
---------------------------*/
|
||||
#divHdrTable {
|
||||
position:RELATIVE;
|
||||
left:0px;
|
||||
top:0px;
|
||||
width:100%;
|
||||
height:100%;
|
||||
overflow:scroll;
|
||||
}
|
||||
|
||||
/*
|
||||
----------------------------*/
|
||||
.BannerText
|
||||
{
|
||||
color:black;
|
||||
font-size:15pt;
|
||||
text-align:right;
|
||||
font-family:"Arial, Helvetica, sans-serif";
|
||||
}
|
||||
|
||||
/*Main Header of the Page
|
||||
----------------------------*/
|
||||
.mainHeader
|
||||
{
|
||||
color:black;
|
||||
font-size:10pt;
|
||||
text-align:center;
|
||||
font-weight:bold;
|
||||
font-family:"verdana, Arial, Helvetica, sans-serif";
|
||||
background-color:#eff9ff;
|
||||
}
|
||||
|
||||
|
||||
/*for Sub Headers (non tab header)
|
||||
----------------------------------*/
|
||||
.subHeader
|
||||
{
|
||||
color :black;
|
||||
font-size:8pt;
|
||||
font-weight:bold;
|
||||
text-align:left;
|
||||
font-family:"verdana,Arial, Helvetica, sans-serif";
|
||||
}
|
||||
|
||||
/*for Labels
|
||||
----------------------------*/
|
||||
.labelText
|
||||
{
|
||||
color:black;
|
||||
font-size:8pt;
|
||||
text-align:right;
|
||||
font-weight:normal;
|
||||
font-family:"verdana, Arial, Helvetica, sans-serif";
|
||||
padding:7px;
|
||||
}
|
||||
|
||||
/*For radio button text (left align)
|
||||
------------------------------------*/
|
||||
.radioText
|
||||
{
|
||||
color:black;
|
||||
font-size:8pt;
|
||||
text-align:left;
|
||||
font-weight:normal;
|
||||
font-family:"verdana, Arial, Helvetica, sans-serif";
|
||||
}
|
||||
|
||||
/*Activated tab text (yellow)
|
||||
----------------------------*/
|
||||
.actTabText
|
||||
{
|
||||
cursor:default;
|
||||
color:yellow;
|
||||
background-color:#4682B4;
|
||||
font-size:8pt;
|
||||
text-align:left;
|
||||
font-weight:bold;
|
||||
font-family:"verdana, Arial, Helvetica, sans-serif";
|
||||
}
|
||||
.actDriverTabText
|
||||
{
|
||||
cursor:default;
|
||||
color:yellow;
|
||||
background-color:#4682B4;
|
||||
font-size:25pt;
|
||||
text-align:left;
|
||||
font-weight:bold;
|
||||
font-family:"verdana, Arial, Helvetica, sans-serif";
|
||||
}
|
||||
|
||||
/*Deactivated Tab Text
|
||||
----------------------------*/
|
||||
.disTabText
|
||||
{
|
||||
cursor:hand;
|
||||
background-color:#76A2C7;
|
||||
color:white;
|
||||
font-size:8pt;
|
||||
text-align:left;
|
||||
font-weight:normal;
|
||||
font-family:"verdana, Arial, Helvetica, sans-serif";
|
||||
}
|
||||
|
||||
/*
|
||||
----------------------------*/
|
||||
.userText
|
||||
{
|
||||
color:white;
|
||||
font-size:8pt;
|
||||
text-align:right;
|
||||
font-weight:bold;
|
||||
font-family:"verdana, Arial, Helvetica, sans-serif";
|
||||
background-color:#eff9ff;
|
||||
|
||||
}
|
||||
|
||||
/*for Font in bottom (blue) bar
|
||||
------------------------------*/
|
||||
.bottomBarText
|
||||
{
|
||||
color:black;
|
||||
font-size:8pt;
|
||||
text-align:center;
|
||||
font-weight:normal;
|
||||
font-family:"verdana, Arial, Helvetica, sans-serif";
|
||||
}
|
||||
|
||||
/*for Font in Header Navigation Bar
|
||||
-----------------------------------*/
|
||||
.navText
|
||||
{
|
||||
color:navy;
|
||||
font-size:8pt;
|
||||
text-align:center;
|
||||
font-weight:normal;
|
||||
font-family:"verdana, Arial, Helvetica, sans-serif";
|
||||
}
|
||||
|
||||
/*for Font in Detail Navigation Bar
|
||||
-----------------------------------*/
|
||||
.dtlNavText
|
||||
{
|
||||
color:navy;
|
||||
font-size:8pt;
|
||||
text-align:right;
|
||||
v-align:center;
|
||||
font-weight:normal;
|
||||
font-family:"verdana, Arial, Helvetica, sans-serif";
|
||||
}
|
||||
|
||||
/*for Detail Table Header
|
||||
----------------------------*/
|
||||
.tableHeader
|
||||
{
|
||||
color:white;
|
||||
font-size:8pt;
|
||||
text-align:center;
|
||||
font-weight:normal;
|
||||
background-color:#4682b4;
|
||||
font-family:"verdana, Arial, Helvetica, sans-serif";
|
||||
Z-INDEX: 50;
|
||||
TOP: expression(document.getElementById("divDtlTable").scrollTop);
|
||||
POSITION: relative;
|
||||
}
|
||||
|
||||
/*for Detail Table Body
|
||||
----------------------------*/
|
||||
.tableText
|
||||
{
|
||||
color:black;
|
||||
font-size:10pt;
|
||||
text-align:center;
|
||||
font-weight:normal;
|
||||
font-family:"verdana, Arial, Helvetica, sans-serif";
|
||||
z-order:0;
|
||||
}
|
||||
|
||||
/*for Mandatory fields
|
||||
----------------------------*/
|
||||
.required
|
||||
{
|
||||
background-color: #ffffd3;
|
||||
font-size=8pt;
|
||||
font-weight:normal;
|
||||
border-right: #699bb3 1px solid;
|
||||
border-top: #699bb3 1px solid;
|
||||
border-left:#699bb3 1px solid;
|
||||
border-bottom:#699bb3 1px solid;
|
||||
|
||||
}
|
||||
|
||||
/*for Non-Mandatory fields
|
||||
----------------------------*/
|
||||
.optional
|
||||
{
|
||||
background-color: #ffffff;
|
||||
font-size=8pt;
|
||||
font-weight:normal;
|
||||
border-right: #699bb3 1px solid;
|
||||
border-top: #699bb3 1px solid;
|
||||
border-left:#699bb3 1px solid;
|
||||
border-bottom:#699bb3 1px solid;
|
||||
}
|
||||
|
||||
/*for Disabled Fields
|
||||
----------------------------*/
|
||||
.locked
|
||||
{
|
||||
background-color: #e0e0e0;
|
||||
font-size:8pt;
|
||||
|
||||
border-right: #c0c0c0 1px solid;
|
||||
border-top: #c0c0c0 1px solid;
|
||||
border-left:#c0c0c0 1px solid;
|
||||
border-bottom:#c0c0c0 1px solid;
|
||||
}
|
||||
|
||||
/*for Disabled Tab
|
||||
----------------------------*/
|
||||
.lockedTab
|
||||
{
|
||||
color:"#c0c0c0";
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
|
||||
|
||||
/*for "blue" color of the bottom Bar
|
||||
--------------------------------------*/
|
||||
.blueBar
|
||||
{
|
||||
background-color: #4682B4;
|
||||
font-size:8pt;
|
||||
font-family:"verdana, Arial, Helvetica, sans-serif";
|
||||
}
|
||||
|
||||
/*for "Hand" cursor
|
||||
----------------------------*/
|
||||
.icon
|
||||
{
|
||||
cursor:hand;
|
||||
}
|
||||
|
||||
|
||||
/*for Toggling colors in detail table (odd rows)
|
||||
------------------------------------------------*/
|
||||
.oddRow
|
||||
{
|
||||
background-color: #eff9ff;
|
||||
}
|
||||
|
||||
/*for Toggling colors in detail table (even rows)
|
||||
------------------------------------------------*/
|
||||
.evenRow
|
||||
{
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
/*for highlighting detail table rows on mouseover
|
||||
--------------------------------------------------*/
|
||||
.highlightRow
|
||||
{
|
||||
background-color : #a6d2f4;
|
||||
}
|
||||
|
||||
/*when detail table rows are deleted
|
||||
-------------------------------------*/
|
||||
.deletedRow
|
||||
{
|
||||
background-color : #e0e0e0;
|
||||
}
|
||||
|
||||
/*For disaplying erros */
|
||||
.errorList
|
||||
{
|
||||
font-weight:normal;
|
||||
color: red;
|
||||
font-size:8pt;
|
||||
font-family:verdana;
|
||||
text-align:left;
|
||||
background-color :"#eff9ff";
|
||||
|
||||
}
|
||||
|
||||
.launchPad
|
||||
{
|
||||
font-weight:bold;
|
||||
color: black;
|
||||
font-size:8pt;
|
||||
font-family:verdana;
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
|
||||
.HelpChapHeadText
|
||||
{
|
||||
color:black;
|
||||
font-size:15pt;
|
||||
font-weight:bold;
|
||||
text-align:center;
|
||||
font-family:"verdana,Arial, Helvetica, sans-serif";
|
||||
}
|
||||
|
||||
.HelpPartHeadText
|
||||
{
|
||||
color:blue;
|
||||
font-size:12pt;
|
||||
font-weight:bold;
|
||||
text-align:left;
|
||||
font-family:"verdana,Arial, Helvetica, sans-serif";
|
||||
}
|
||||
|
||||
|
||||
.HelpContentText
|
||||
{
|
||||
color:black;
|
||||
font-size:10pt;
|
||||
text-align:left;
|
||||
font-weight:normal;
|
||||
font-family:"verdana, Arial, Helvetica, sans-serif";
|
||||
padding:7px;
|
||||
}
|
893
hrmsWeb/hrms/includes/ENRGISE.js
Normal file
@@ -0,0 +1,893 @@
|
||||
appPath="/hrms";
|
||||
contextRoot="/hrms/";
|
||||
module="HRM";
|
||||
helpPath="helpfile/";
|
||||
|
||||
//******************************************************************************
|
||||
// HOT KEYS
|
||||
//******************************************************************************
|
||||
var keyActions = new Array ();
|
||||
|
||||
keyActions [0] = {character: "n",
|
||||
actionType: "Alt",
|
||||
butName: "butInsert",
|
||||
param: "doBaseInsertMode();"};
|
||||
keyActions [1] = {character: "q",
|
||||
actionType: "Ctrl",
|
||||
butName: "butQuery",
|
||||
param: "doBaseQueryMode();"};
|
||||
keyActions [2] = {character: "u",
|
||||
actionType: "Ctrl",
|
||||
butName: "butExecute",
|
||||
param: "doBaseExecute();"};
|
||||
keyActions [3] = {character: "s",
|
||||
actionType: "Ctrl",
|
||||
butName: "butSave",
|
||||
param: "doBaseSave();"};
|
||||
keyActions [4] = {character: "d",
|
||||
actionType: "Ctrl",
|
||||
butName: "butDelete",
|
||||
param: "doBaseDelete();"};
|
||||
keyActions [5] = {character: "r",
|
||||
actionType: "Ctrl",
|
||||
butName: "butRefresh",
|
||||
param: "doBaseRefresh();"};
|
||||
keyActions [6] = {character: "p",
|
||||
actionType: "Ctrl",
|
||||
butName: "butPrint",
|
||||
param: "doBasePrint();"};
|
||||
keyActions [7] = {character: "x",
|
||||
actionType: "Alt",
|
||||
butName: "butExit",
|
||||
param: "doBaseExit();"};
|
||||
keyActions [8] = {character: "?",
|
||||
actionType: "Ctrl",
|
||||
butName: "butHelp",
|
||||
param: "doBaseHelp();"};
|
||||
keyActions [9] = {character: 188,
|
||||
actionType: "Ctrl",
|
||||
butName: "butPrevHeader",
|
||||
param: "doBasePrevHeader();"};
|
||||
keyActions [10] = {character: 190,
|
||||
actionType: "Ctrl",
|
||||
butName: "butNextHeader",
|
||||
param: "doBaseNextHeader();"};
|
||||
keyActions [11] = {character: "g",
|
||||
actionType: "Ctrl",
|
||||
butName: "butJumpHeader",
|
||||
param: "doBaseJumpHeader();"};
|
||||
keyActions [12] = {character: "t",
|
||||
actionType: "Ctrl",
|
||||
butName: "butGetDetail",
|
||||
param: "doBaseGetDetail();"};
|
||||
keyActions [13] = {character: "r",
|
||||
actionType: "Alt",
|
||||
butName: "butAddRow",
|
||||
param: "doBaseAddRow();"};
|
||||
keyActions [14] = {character: "d",
|
||||
actionType: "Alt",
|
||||
butName: "butDelRow",
|
||||
param: "doBaseDelRow();"};
|
||||
keyActions [15] = {character: 188,
|
||||
actionType: "Alt",
|
||||
butName: "butPrevDetail",
|
||||
param: "doBasePrevDetail();"};
|
||||
keyActions [16] = {character: 190,
|
||||
actionType: "Alt",
|
||||
butName: "butNextDetail",
|
||||
param: "doBaseNextDetail();"};
|
||||
keyActions [17] = {character: "g",
|
||||
actionType: "Alt",
|
||||
butName: "butJumpDetail",
|
||||
param: "doBaseJumpDetail();"};
|
||||
|
||||
///////For Mandatory Checking//////////////////////
|
||||
var recordNum=0
|
||||
var argCount
|
||||
var items
|
||||
var arrAttributeNames
|
||||
var arrDataBase
|
||||
|
||||
function mandatory_check(){
|
||||
var elems=document.all;
|
||||
for(i=0; i<elems.length; i++){
|
||||
if(elems[i].tagName=="INPUT" || elems[i].tagName=="SELECT" || elems[i].tagName=="TEXTAREA" ){
|
||||
if(elems[i].className && elems[i].className=="required"){
|
||||
if(elems[i].value==""){
|
||||
alert("Please fill in "+ elems[i].alt);
|
||||
elems[i].focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// End of user defined array
|
||||
|
||||
function hotKeys (event) {
|
||||
var action;
|
||||
event = (event) ? event : ((window.event) ? event : null);
|
||||
if (event) {
|
||||
if (event.ctrlKey){
|
||||
// Pick up the Unicode value of the character of the depressed key.
|
||||
|
||||
var charCode = (event.charCode) ? event.charCode : ((event.which) ? event.which : event.keyCode);
|
||||
|
||||
// Convert Unicode character to its lowercase ASCII equivalent
|
||||
var myChar = String.fromCharCode (charCode).toLowerCase();
|
||||
|
||||
// Convert it back into uppercase if the shift key is being held down
|
||||
if (event.shiftKey) {myChar = myChar.toUpperCase();}
|
||||
for (var i = 0; i < keyActions.length; i++) {
|
||||
if ( (keyActions[i].character == myChar || keyActions[i].character == charCode ) && keyActions[i].actionType == "Ctrl") {
|
||||
action = new Function (keyActions[i].param);
|
||||
action ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} //If event.ctrlKey ends
|
||||
if (event.altKey){
|
||||
// Pick up the Unicode value of the character of the depressed key.
|
||||
var charCode = (event.charCode) ? event.charCode : ((event.which) ? event.which : event.keyCode);
|
||||
// Convert Unicode character to its lowercase ASCII equivalent
|
||||
var myChar = String.fromCharCode (charCode).toLowerCase();
|
||||
// Convert it back into uppercase if the shift key is being held down
|
||||
if (event.shiftKey) {myChar = myChar.toUpperCase();}
|
||||
for (var i = 0; i < keyActions.length; i++) {
|
||||
if ((keyActions[i].character == myChar || keyActions[i].character == charCode )&& keyActions[i].actionType == "Alt") {
|
||||
action = new Function (keyActions[i].param);
|
||||
action ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} //If event.altKey ends
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//******************************************************************************
|
||||
// CHECK FOR VALIDATIONS
|
||||
//******************************************************************************
|
||||
|
||||
/*
|
||||
function isValidated(){
|
||||
var elems=document.all;
|
||||
var sLabel;
|
||||
var sDataType;
|
||||
var val;
|
||||
|
||||
for(i=0; i<elems.length; i++){
|
||||
sLabel=elems[i].title;
|
||||
sDataType=elems[i].alt;
|
||||
val=Trim(elems[i].value);
|
||||
|
||||
//dataType checks
|
||||
if( elems[i].tagName=="INPUT" && elems[i].type=="text" ){
|
||||
|
||||
//Design time code (delete after coding is completed)
|
||||
if(!elems[i].title ){
|
||||
alert('title field not properly set for ' + elems[i].name);
|
||||
return false;
|
||||
}
|
||||
if(!elems[i].alt ){
|
||||
alert('alt field not set for ' + elems[i].name);
|
||||
return false;
|
||||
}
|
||||
//Design time code ends here
|
||||
|
||||
|
||||
//Numeric Check
|
||||
if(sDataType=="N"){
|
||||
if(!isNumeric(val)){
|
||||
alert(sLabel + " should be Numeric");
|
||||
elems[i].focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Alphanumeric Check
|
||||
if(sDataType=="A"){
|
||||
if(!isAlphaNumeric(val)){
|
||||
alert(sLabel + " should be AlphaNumeric");
|
||||
elems[i].focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Alphanumeric Check
|
||||
if(sDataType=="ALPHA"){
|
||||
if(!isAlpha(val)){
|
||||
alert(sLabel + " should be Alphabets");
|
||||
elems[i].focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Currency Check
|
||||
if(sDataType=="C"){
|
||||
if(!isCurrency(val)){
|
||||
alert(sLabel + " should be Currency");
|
||||
elems[i].focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Time Check
|
||||
if(sDataType=="T"){
|
||||
if(!isTime(val)){
|
||||
alert(sLabel + " should be Time");
|
||||
elems[i].focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Float Check
|
||||
if(sDataType.charAt(0)=="F"){
|
||||
if(sDataType.charAt(1)){
|
||||
if(!isFloat(val,sDataType.charAt(1))){
|
||||
alert(sLabel + " should be Float");
|
||||
elems[i].focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Mandatory Check
|
||||
if( elems[i].tagName=="INPUT" || elems[i].tagName=="SELECT" || elems[i].tagName=="TEXTAREA" ){
|
||||
if(elems[i].className && elems[i].className=="required"){
|
||||
if(val==""){
|
||||
alert("Please fill in "+ sLabel);
|
||||
elems[i].focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
*/
|
||||
//******************************************************************************
|
||||
//Helper Functions for expression checks.
|
||||
//******************************************************************************
|
||||
|
||||
//Trim spaces on left
|
||||
function LTrim(str){
|
||||
if (str==null){return null;}
|
||||
for(var i=0;str.charAt(i)==" ";i++);
|
||||
return str.substring(i,str.length);
|
||||
}
|
||||
//Trim spaces on Right
|
||||
function RTrim(str){
|
||||
if (str==null){return null;}
|
||||
for(var i=str.length-1;str.charAt(i)==" ";i--);
|
||||
return str.substring(0,i+1);
|
||||
}
|
||||
//Trim spaces on left and right
|
||||
function Trim(str){
|
||||
return LTrim(RTrim(str));
|
||||
}
|
||||
//Check for integers
|
||||
function isNumeric(val)
|
||||
{
|
||||
if(val=="")
|
||||
return true;
|
||||
else
|
||||
return new RegExp(/^\d+$/).test(val);
|
||||
}
|
||||
//check for currency (x, x.x, x.xx)
|
||||
function isCurrency(val)
|
||||
{
|
||||
if(val=="")
|
||||
return true;
|
||||
else
|
||||
return new RegExp(/^\d+(\.\d(\d)?)?$/).test(val);
|
||||
}
|
||||
|
||||
//check for Floating (x.x, x.xx , x.nx)
|
||||
function isFloat(val,prec)
|
||||
{
|
||||
if(val=="")
|
||||
return true;
|
||||
else{
|
||||
switch ( prec ){
|
||||
case 1: return new RegExp(/^\d+\.\d$/).test(val);break;;
|
||||
case 2: return new RegExp(/^\d+\.\d{1,2}?$/).test(val);break;;
|
||||
case 3: return new RegExp(/^\d+\.\d{1,3}?$/).test(val);break;;
|
||||
case 4: return new RegExp(/^\d+\.\d{1,4}?$/).test(val);break;;
|
||||
case 5: return new RegExp(/^\d+\.\d{1,5}?$/).test(val);break;;
|
||||
case 6: return new RegExp(/^\d+\.\d{1,6}?$/).test(val);break;;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Check for Aphanumerics (a, a33, not a a2, a a)
|
||||
function isAlphaNumeric(val)
|
||||
{
|
||||
if(val=="")
|
||||
return true;
|
||||
else
|
||||
return new RegExp(/^[A-Za-z0-9]+$/).test(val);
|
||||
}
|
||||
|
||||
//Check for Time (hh:mm)
|
||||
function isTime(val)
|
||||
{
|
||||
if(val=="")
|
||||
return true;
|
||||
else
|
||||
return new RegExp(/^[0-2][0-3]:[0-5][0-9]$/).test(val);
|
||||
}
|
||||
|
||||
//Check for Alphabelts (. and space)
|
||||
function isAlpha(val)
|
||||
{
|
||||
if(val=="")
|
||||
return true;
|
||||
else
|
||||
return new RegExp(/^[A-Za-z. ]+$/).test(val);
|
||||
}
|
||||
|
||||
function isTime(event) {
|
||||
if(!((event.keyCode >= 48 && event.keyCode <= 58) || event.keyCode==46 || event.keyCode==9 || event.keyCode==8 ||event.keyCode==37 ||event.keyCode==39 )){
|
||||
event.returnValue=false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function isInteger(event) {
|
||||
if(!((event.keyCode >= 48 && event.keyCode <= 57) || event.keyCode==46 || event.keyCode==9 || event.keyCode==8 || event.keyCode==39 )){
|
||||
event.returnValue=false;
|
||||
}
|
||||
}
|
||||
|
||||
function isNumber(event) {
|
||||
if(!((event.keyCode >= 48 && event.keyCode <= 57) )){
|
||||
event.returnValue=false;
|
||||
}
|
||||
}
|
||||
|
||||
function isName(event) {
|
||||
if(!((event.keyCode >= 65 && event.keyCode <= 90)|| (event.keyCode >= 97 && event.keyCode <= 122) || event.keyCode==46 || event.keyCode==9 || event.keyCode==8 ||event.keyCode==37 ||event.keyCode==39 || event.keyCode==190 || event.keyCode== 32 )){
|
||||
event.returnValue=false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function isFloat(event)
|
||||
{
|
||||
if(!((event.keyCode >= 48 && event.keyCode <= 57) || event.keyCode==46 || event.keyCode==9 || event.keyCode==8
|
||||
||event.keyCode==37 ||event.keyCode==39 || event.keyCode==190 )){
|
||||
event.returnValue=false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//******************************************************************************
|
||||
// CHECK/UNCHECK TEXT BOXES IN DETAIL
|
||||
//******************************************************************************
|
||||
function toggleCheckBox(chkBoxName){
|
||||
var chkBoxes=document.getElementsByName(chkBoxName);
|
||||
var chkFlag=document.getElementById("selectAll").checked?true:false;
|
||||
for(i=0;i<chkBoxes.length;i++){
|
||||
chkBoxes[i].checked=chkFlag;
|
||||
if(chkBoxes[i].checked)
|
||||
{
|
||||
document.getElementsByName("itemChecked")[i].value = "Y";
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementsByName("itemChecked")[i].value = "N";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//***************************************************************************
|
||||
// CALENDAR CONTROL
|
||||
//****************************************************************************
|
||||
function showCalendar(inputId, butId) {
|
||||
if(butId.alt)
|
||||
{
|
||||
iIndex=butId.alt;
|
||||
}
|
||||
else
|
||||
{
|
||||
iIndex="-1";
|
||||
}
|
||||
Calendar.setup({inputField : inputId,
|
||||
ifFormat : "%d-%b-%Y",
|
||||
button : butId,
|
||||
position: iIndex
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
// LOV CONTROL
|
||||
//****************************************************************************
|
||||
function showLov(pageName, formName) {
|
||||
var oLovWin=window.open(pageName,formName, "height=380,width=600,resizable=yes,menubar=no,toolbar=none,statusbar=none");
|
||||
oLovWin.moveTo(200,200);
|
||||
//oLovWin.document.all.hdnLOVFlag.value = '0';
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
// CONFIRM BOX CONTROL
|
||||
//****************************************************************************
|
||||
function showConfirm(pageName, formName) {
|
||||
var oLovWin=window.open(pageName,formName, "height=100,width=400,resizable=yes,menubar=no,toolbar=none,statusbar=none");
|
||||
oLovWin.moveTo(300,280);
|
||||
}
|
||||
|
||||
|
||||
//function doBaseHelp() : Changes to Insert Mode.
|
||||
//--------------------------------------------------------------
|
||||
function doBaseHelp()
|
||||
{
|
||||
helpFile=appPath+contextRoot+helpPath+module+document.forms[0].screenName.value+".html"
|
||||
window.open(helpFile);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//*************************************************************
|
||||
// MODE CHANGE FUNCTIONS
|
||||
//*************************************************************
|
||||
//function doBaseQueryMode() : Changes to Query Mode.
|
||||
//--------------------------------------------------------------
|
||||
function doBaseQueryMode()
|
||||
{
|
||||
if(isClearedToSubmit()){
|
||||
document.forms[0].action = contextRoot + doQueryMode();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
|
||||
//function doBaseInsertMode() : Changes to Insert Mode.
|
||||
//--------------------------------------------------------------
|
||||
function doBaseInsertMode()
|
||||
{
|
||||
if(isClearedToSubmit()){
|
||||
document.forms[0].action = contextRoot+ doInsertMode();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
|
||||
//*************************************************************
|
||||
// EXECUTE,SAVE,DELETE,REFRESH,PRINT FUNCTIONS
|
||||
//*************************************************************
|
||||
//function doBaseExecute() : Gets Header Records for First time.
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
function doBaseExecute()
|
||||
{
|
||||
if(isClearedToSubmit()){
|
||||
document.forms[0].action= contextRoot + doExecute();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
|
||||
//function doBaseSave() : Gets Header Record as demanded.
|
||||
//-----------------------------------------------------------------
|
||||
var preSaveCount=0;
|
||||
iCount = parseInt(preSaveCount);
|
||||
function doBaseSave()
|
||||
{
|
||||
document.forms[0].action = contextRoot+ doSave();
|
||||
preSaveCount=preSaveCount+1;
|
||||
if (preSaveCount == 1)
|
||||
{
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//function doBaseDelete() : Delete an entire Record as demanded.
|
||||
//------------------------------------------------------------------------
|
||||
function doBaseDelete()
|
||||
{
|
||||
if(isClearedToSubmit()){
|
||||
document.forms[0].action = contextRoot+ doDelete();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
|
||||
//function doBaseRefresh() : Refresh the data.
|
||||
//-----------------------------------------------------
|
||||
function doBaseRefresh()
|
||||
{
|
||||
if(isClearedToSubmit()){
|
||||
document.forms[0].action = contextRoot+ doRefresh();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
|
||||
//function doBaseApprove() : Approve the data.
|
||||
//-----------------------------------------------------
|
||||
function doBaseApprove()
|
||||
{
|
||||
document.forms[0].action = contextRoot+ doApprove();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
//function doBaseCancel() : Cancel the data.
|
||||
//-----------------------------------------------------
|
||||
function doBaseCancel()
|
||||
{
|
||||
document.forms[0].action = contextRoot+ doCancel();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
|
||||
//function doBaseReject() : Reject the data.
|
||||
//-----------------------------------------------------
|
||||
|
||||
function doBaseReject()
|
||||
{
|
||||
document.forms[0].action = contextRoot+ doReject();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
|
||||
function doBaseSubmit()
|
||||
{
|
||||
document.forms[0].action = contextRoot+ doSubmit();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
|
||||
//*************************************************************
|
||||
// HEADER NAVIGATION FUNCTIONS
|
||||
//*************************************************************
|
||||
//function doBasePrevHeader() : Gets Previous Header Record.
|
||||
//--------------------------------------------------------------------
|
||||
function doBasePrevHeader()
|
||||
{
|
||||
if(isClearedToSubmit()){
|
||||
document.forms[0].userPositionRequested.value = 1*document.forms[0].positionRequested.value - 1;
|
||||
document.forms[0].action = contextRoot+ doPrevHeader();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
|
||||
//function doBaseNextHeader() : Gets Next Header Record.
|
||||
//----------------------------------------------------------------
|
||||
function doBaseNextHeader()
|
||||
{
|
||||
if(isClearedToSubmit()){
|
||||
document.forms[0].userPositionRequested.value =1*document.forms[0].positionRequested.value + 1;
|
||||
document.forms[0].action = contextRoot+ doNextHeader();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
|
||||
//function doBaseJumpHeader() : Gets Header Record as demanded.
|
||||
//-----------------------------------------------------------------------
|
||||
function doBaseJumpHeader()
|
||||
{
|
||||
if(isClearedToSubmit()){
|
||||
if(document.forms[0].newPositionRequested.value!="")
|
||||
{
|
||||
document.forms[0].userPositionRequested.value = 1*document.forms[0].newPositionRequested.value;
|
||||
document.forms[0].action = contextRoot+ doJumpHeader();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//function doBaseValidate() : Cross field Validation.
|
||||
//------------------------------------------------------------------------
|
||||
function doBaseValidate()
|
||||
{
|
||||
document.forms[0].action= contextRoot + doValidate();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
|
||||
function doBaseValidate(obj)
|
||||
{
|
||||
document.forms[0].action= contextRoot + doValidate(obj);
|
||||
document.forms[0].submit();
|
||||
}
|
||||
|
||||
//function doBaseOnLoad() : On Load Processing.
|
||||
//------------------------------------------------------------------------
|
||||
function doBaseOnLoad()
|
||||
{
|
||||
var sAction=doOnLoad();
|
||||
if(sAction!=null)
|
||||
{
|
||||
document.forms[0].action= contextRoot + sAction;
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//function doBaseExit() : On Exit Processing.
|
||||
//------------------------------------------------------------------------
|
||||
function doBaseExit()
|
||||
{
|
||||
document.forms[0].action= contextRoot + doExit();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
|
||||
//***********************************************************
|
||||
// FOR CHECKING THE MAXLENGTH OF TEXTAREA (or any control)
|
||||
//*************************************************************
|
||||
function doCheckLength(evt,iLength)
|
||||
{
|
||||
if(evt.srcElement.value.length >= iLength )
|
||||
{
|
||||
evt.keyCode=0;
|
||||
}
|
||||
}
|
||||
|
||||
//***********************************************************
|
||||
// FOR DISABLING THE CONTROL KEY
|
||||
//*************************************************************
|
||||
function doOnPressCtrl()
|
||||
{
|
||||
if (event.ctrlKey)
|
||||
{
|
||||
event.keycode=0;
|
||||
event.returnValue = false;
|
||||
}
|
||||
}
|
||||
|
||||
//*************************************************************
|
||||
// DETAIL TABLE FUNCTIONS
|
||||
//*************************************************************
|
||||
//function doBaseGetTab(tabName,action) : Gets the Tab Page.
|
||||
//----------------------------------------------------------
|
||||
function doGetTab(tabName,action)
|
||||
{
|
||||
if(isClearedToSubmit()){
|
||||
document.forms[0].forwardedPage.value = tabName;
|
||||
document.forms[0].action = contextRoot+ action;
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
|
||||
//function doBaseGetDetail() : Gets the Details for First set.
|
||||
//----------------------------------------------------------------------
|
||||
function doBaseGetDetail()
|
||||
{
|
||||
var sAction=doGetDetail();
|
||||
if(sAction!=null)
|
||||
{
|
||||
document.forms[0].action=contextRoot+ sAction;
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
|
||||
//function doBaseAddRow() : Adds a Row in Detail Table.
|
||||
//---------------------------------------------------------------
|
||||
function doBaseAddRow()
|
||||
{
|
||||
var sAction=doAddRow();
|
||||
if(sAction!=null)
|
||||
{
|
||||
document.forms[0].action = contextRoot+ sAction ;
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
|
||||
//function doBaseDelRow() : Deletes Row/Rows from Detail table.
|
||||
//-----------------------------------------------------------------------
|
||||
function doBaseDelRow()
|
||||
{
|
||||
//if(isClearedToSubmit()){
|
||||
// var oTable = document.getElementById(doGetDetailTableName());
|
||||
// if(oTable == null)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
// var iTr2 = oTable.rows.length;
|
||||
// var i = 0;
|
||||
|
||||
// for(i=0; i < iTr2; i++)
|
||||
//{
|
||||
// if(document.getElementsByName("selectAll")[i].checked)
|
||||
// {
|
||||
// document.getElementsByName("selectAll")[i].value = "Y";
|
||||
// }
|
||||
// }
|
||||
|
||||
document.forms[0].action = contextRoot+ doDelRow();
|
||||
document.forms[0].submit();
|
||||
//}
|
||||
}
|
||||
|
||||
//function doBasePrevDetail() : Gets Previous Detail Record.
|
||||
//--------------------------------------------------------------------
|
||||
function doBasePrevDetail()
|
||||
{
|
||||
if(isClearedToSubmit()){
|
||||
document.forms[0].userPageRequested.value = 1*document.forms[0].pageRequested.value - 1;
|
||||
document.forms[0].action = contextRoot+ doPrevDetail();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
|
||||
//function doBaseNextDetail() : Gets Next Detail Record.
|
||||
//----------------------------------------------------------------
|
||||
function doBaseNextDetail()
|
||||
{
|
||||
if(isClearedToSubmit()){
|
||||
document.forms[0].userPageRequested.value = 1*document.forms[0].pageRequested.value + 1;
|
||||
document.forms[0].action = contextRoot+ doNextDetail();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
|
||||
//function doBaseJumpDetail() : Gets Detail Page Set as demanded.
|
||||
//-------------------------------------------------------------------------
|
||||
function doBaseJumpDetail()
|
||||
{
|
||||
if(isClearedToSubmit()){
|
||||
document.forms[0].userPageRequested.value =1* document.forms[0].newPageRequested.value;
|
||||
document.forms[0].action = contextRoot+ doJumpDetail();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
|
||||
//function doChangeHeader() : Sets the Header Modified flag to true.
|
||||
//-----------------------------------------------------------------------
|
||||
function doChangeHeader()
|
||||
{
|
||||
if(document.forms[0].screenMode.value!="Q")
|
||||
{
|
||||
document.forms[0].headerDataChanged.value = "true";
|
||||
}
|
||||
}
|
||||
|
||||
//function doChangeDetail(val) : Sets the Detail Status flag.
|
||||
//-----------------------------------------------------------------------
|
||||
function doChangeDetail(val)
|
||||
{
|
||||
document.forms[0].detailDataChanged.value = "true";
|
||||
//var r=new RegExp(/\d+/);
|
||||
//iIndex=parseInt(r.exec(val));
|
||||
//alert(val);
|
||||
iIndex=val;
|
||||
document.forms[0].txtIndex.value=iIndex;
|
||||
if(document.getElementsByName("status")[iIndex])
|
||||
{
|
||||
if(document.getElementsByName("status")[iIndex].value!="N")
|
||||
{
|
||||
document.getElementsByName("status")[iIndex].value="U";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//function doBaseSetFields(arr,rows,cols) : Returns data to pages from lov.
|
||||
//-----------------------------------------------------------------------
|
||||
function doBaseSetFields(arr,rows,cols)
|
||||
{
|
||||
if(window.doSetFields)
|
||||
{
|
||||
doSetFields(arr,rows,cols);
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('doSetFields(arr,rows,cols) function not present in jsp');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function baseSearch()
|
||||
{
|
||||
var oLovWin=window.open(contextRoot+"ultraSearch.do","myWindow", "height=380,width=600,resizable=yes,menubar=no,toolbar=none,statusbar=none");
|
||||
oLovWin.moveTo(20,20);
|
||||
}
|
||||
|
||||
|
||||
function isClearedToSubmit()
|
||||
{
|
||||
/*
|
||||
if(document.getElementById("headerDataChanged").value == "true" ){
|
||||
if(confirm('You have Unsaved Data.\nSave them First?'))
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
if(document.getElementById("detailDataChanged").value == "true" ){
|
||||
if(confirm('You have Unsaved Data.\nSave them First?'))
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//******************************************************************************
|
||||
//Enable/disable all
|
||||
//******************************************************************************
|
||||
//Disable all controls except ones that are passed as comma separated arguments
|
||||
function disable_all(){
|
||||
var len=arguments.length;
|
||||
var elems=document.all;
|
||||
for(i=0; i<elems.length; i++){
|
||||
if(elems[i].tagName=="INPUT" || elems[i].tagName=="SELECT" || elems[i].tagName=="TEXTAREA" ){
|
||||
for(j=0;j<len;j++){
|
||||
if(arguments[j].name==elems[i].name){
|
||||
elems[i].disabled=false;
|
||||
break;
|
||||
}
|
||||
else{
|
||||
elems[i].disabled=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//Enable all controls except the ones that are passed as comma separated args
|
||||
function enable_all(){
|
||||
var len=arguments.length;
|
||||
var elems=document.all;
|
||||
for(i=0; i<elems.length; i++){
|
||||
if(elems[i].tagName=="INPUT" || elems[i].tagName=="SELECT" || elems[i].tagName=="TEXTAREA" ){
|
||||
for(j=1;j<len;j++){
|
||||
if(arguments[j].name==elems[i].name){
|
||||
elems[i].disabled=true;
|
||||
break;
|
||||
}
|
||||
else{
|
||||
elems[i].disabled=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//******************************************************************************
|
||||
//Toolbar Button Navigation
|
||||
//******************************************************************************
|
||||
var first_dis="<img alt='First' src='../INCLUDES/IMAGES/butn_first_dis.jpg' style='CURSOR: default' >";
|
||||
var first_act="<img alt='First' src='../INCLUDES/IMAGES/butn_first.jpg' hsrc='../INCLUDES/IMAGES/butn_first_act.jpg' style='CURSOR: default' onclick='parent.frmBody.doFirst()'>";
|
||||
var prev_dis="<img alt='Previous' src='../INCLUDES/IMAGES/butn_prev_dis.jpg' style='CURSOR: default' >";
|
||||
var prev_act="<img alt='Previous' src='../INCLUDES/IMAGES/butn_prev.jpg' hsrc='../INCLUDES/IMAGES/butn_prev_act.jpg' style='CURSOR: default' onclick='parent.frmBody.doPrev()'>";
|
||||
var next_dis="<img alt='Next' src='../INCLUDES/IMAGES/butn_next_dis.jpg' style='CURSOR: default' >";
|
||||
var next_act="<img alt='Next' src='../INCLUDES/IMAGES/butn_next.jpg' hsrc='../INCLUDES/IMAGES/butn_next_act.jpg' style='CURSOR: default' onclick='parent.frmBody.doNext()'>";
|
||||
var last_dis="<img alt='Last' src='../INCLUDES/IMAGES/butn_last_dis.jpg' style='CURSOR: default'>";
|
||||
var last_act="<img alt='Last' src='../INCLUDES/IMAGES/butn_last.jpg' hsrc='../INCLUDES/IMAGES/butn_last_act.jpg' style='CURSOR: default' onclick='parent.frmBody.doLast()'>";
|
||||
|
||||
function NavButtons()
|
||||
{
|
||||
this.firstRec=function fr(){ return (first_dis + prev_dis + next_act + last_act) }
|
||||
this.lastRec=function lr(){ return (first_act + prev_act + next_dis + last_dis) }
|
||||
this.midRec=function mr(){ return (first_act + prev_act + next_act + last_act) }
|
||||
this.onlyRec=function or(){ return (first_dis + prev_dis + next_dis + last_dis) }
|
||||
}
|
||||
|
||||
function firstRec(){
|
||||
return (first_dis + prev_dis + next_act + last_act)
|
||||
}
|
||||
function lastRec(){
|
||||
return (first_act + prev_act + next_dis + last_dis)
|
||||
}
|
||||
function midRec(){
|
||||
return (first_act + prev_act + next_act + last_act)
|
||||
}
|
||||
function onlyRec(){
|
||||
return (first_dis + prev_dis + next_dis + last_dis)
|
||||
}
|
||||
|
262
hrmsWeb/hrms/includes/Menu_addins.js
Normal file
@@ -0,0 +1,262 @@
|
||||
/******************************************
|
||||
CM_ADD-IN - hideselectboxes (last updated: 11/13/02)
|
||||
IE5+ and NS6+ only - ignores the other browsers
|
||||
|
||||
Because of the selectbox bug in the browsers that makes
|
||||
selectboxes have the highest z-index whatever you do
|
||||
this script will check for selectboxes that interfear with
|
||||
your menu items and then hide them.
|
||||
|
||||
Just add this code to the coolmenus js file
|
||||
or link the cm_addins.js file to your page as well.
|
||||
*****************************************/
|
||||
if(bw.dom&&!bw.op){
|
||||
makeCM.prototype.sel=0
|
||||
makeCM.prototype.onshow+=";this.hideselectboxes(pm,pm.subx,pm.suby,maxw,maxh,pm.lev)"
|
||||
makeCM.prototype.hideselectboxes=function(pm,x,y,w,h,l){
|
||||
var selx,sely,selw,selh,i
|
||||
if(!this.sel){
|
||||
this.sel=this.doc.getElementsByTagName("SELECT")
|
||||
this.sel.level=0
|
||||
}
|
||||
var sel=this.sel
|
||||
for(i=0;i<sel.length;i++){
|
||||
selx=0; sely=0; var selp;
|
||||
if(sel[i].offsetParent){selp=sel[i]; while(selp.offsetParent){selp=selp.offsetParent; selx+=selp.offsetLeft; sely+=selp.offsetTop;}}
|
||||
selx+=sel[i].offsetLeft; sely+=sel[i].offsetTop
|
||||
selw=sel[i].offsetWidth; selh=sel[i].offsetHeight
|
||||
if(selx+selw>x && selx<x+w && sely+selh>y && sely<y+h){
|
||||
if(sel[i].style.visibility!="hidden"){sel[i].level=l; sel[i].style.visibility="hidden"; if(pm){ if(!pm.mout) pm.mout=""; pm.mout+=this.name+".sel["+i+"].style.visibility='visible';"}}
|
||||
}else if(l<=sel[i].level && !(pm&&l==0)) sel[i].style.visibility="visible"
|
||||
}
|
||||
}
|
||||
}
|
||||
/******************************************
|
||||
CM_ADD-IN - checkscrolled (last updated: 01/29/02)
|
||||
This is supported by all browsers
|
||||
- IE5 for MAC has some screen refreshing problems
|
||||
- Using this for non-ie browsers might slow down the page
|
||||
because the other browsers do not support the onscroll event
|
||||
so the script uses a timer.
|
||||
|
||||
Now with two new features.
|
||||
- Set scrollstop to 1 to get another scrolling effect.
|
||||
If you do it will work the way it does on DHTMLCentral.com.
|
||||
Note that this feature is not perfect on menus not in rows.
|
||||
- If you have the hideselectboxes add-in as well this function
|
||||
will now check for interfearing selectboxes when you scroll as
|
||||
well.
|
||||
|
||||
Just add this code to the coolmenus js file
|
||||
or link the cm_addins.js file to your page as well.
|
||||
*****************************************/
|
||||
if(bw.ie) makeCM.prototype.onconstruct='document.body.onscroll=new Function(c.name+".checkscrolled("+c.name+")")'
|
||||
else makeCM.prototype.onconstruct='setTimeout(c.name+".checkscrolled()",200)' //REMOVE THIS LINE TO HAVE SCROLLING ON FOR EXPLORER ONLY!!
|
||||
makeCM.prototype.lscroll=0
|
||||
makeCM.prototype.scrollstop=0 //Set this variable to 1 for another scrolling effect. Leave at 0 to scroll regular
|
||||
makeCM.prototype.checkscrolled=function(obj){
|
||||
var i;
|
||||
if(bw.mac) return //REMOVE THIS LINE TO HAVE SCROLLING ON THE MAC AS WELL - unstable!
|
||||
var c=bw.ie?obj:this, o
|
||||
if(bw.ns4 || bw.ns6 || bw.op5) c.scrollY=window.pageYOffset
|
||||
else c.scrollY=document.body.scrollTop
|
||||
if(c.scrollY!=c.lscroll){
|
||||
c.hidesub()
|
||||
if(c.scrollY>c.fromTop&&c.scrollstop){
|
||||
for(i=0;i<c.l[0].m.length;i++){o=c.m[c.l[0].m[i]].b; o.moveIt(o.x,c.scrollY)}
|
||||
if(c.useBar) c.bar.moveIt(c.bar.x,c.scrollY)
|
||||
}else{
|
||||
if(c.scrollstop){
|
||||
for(i=0;i<c.l[0].m.length;i++){o=c.m[c.l[0].m[i]].b; o.moveIt(o.x,c.fromTop)}
|
||||
if(c.useBar) c.bar.moveIt(c.bar.x,c.barY)
|
||||
}else{
|
||||
for(i=0;i<c.l[0].m.length;i++){o=c.m[c.l[0].m[i]].b; o.moveIt(o.x,o.oy+c.scrollY)}
|
||||
if(c.useBar) c.bar.moveIt(c.bar.x,c.barY+c.scrollY)
|
||||
}
|
||||
}
|
||||
c.lscroll=c.scrollY; cmpage.y=c.scrollY; cmpage.y2=cmpage.orgy+c.scrollY
|
||||
if(bw.ie){ clearTimeout(c.tim); c.isover=0; c.hidesub()}
|
||||
if(c.hideselectboxes){ //If you are using the hideselect add-in as well the script will now check for selectboxes when scrolling as well
|
||||
var x = c.useBar?c.m[c.l[0].m[0]].b.x>c.bar.x?c.bar.x:c.m[c.l[0].m[0]].b.x:c.m[c.l[0].m[0]].b.x;
|
||||
var y = c.useBar?c.m[c.l[0].m[0]].b.y>c.bar.y?c.bar.y:c.m[c.l[0].m[0]].b.y:c.m[c.l[0].m[0]].b.y;
|
||||
var maxw = c.useBar?c.bar.w:c.rows?c.totw:c.maxw; var maxh = c.useBar?c.bar.h:!c.rows?c.toth:c.maxh
|
||||
c.hideselectboxes(0,x,y,maxw,maxh,0)
|
||||
}
|
||||
}
|
||||
if(!bw.ie) setTimeout(c.name+".checkscrolled()",200)
|
||||
}
|
||||
/******************************************
|
||||
CM_ADD-IN - pagecheck (last updated: 08/02/02)
|
||||
|
||||
Simple code that *tries* to keep the menus inside the
|
||||
bounderies of the page.
|
||||
|
||||
Code updated. It's still not perfect (obviosly)
|
||||
but it will now do another check to try and place
|
||||
the menus inside.
|
||||
|
||||
|
||||
Just add this code to the coolmenus js file
|
||||
or link the cm_addins.js file to your page.
|
||||
*****************************************/
|
||||
makeCM.prototype.onshow+=";this.pagecheck(b,pm,pm.subx,pm.suby,maxw,maxh)"
|
||||
makeCM.prototype.pagecheck=function(b,pm,x,y,w,h,n){
|
||||
var l=pm.lev+1,a=b.align; if(!n) n=1
|
||||
var ok=1
|
||||
if(x<cmpage.x) {pm.align=1; ok=0;}
|
||||
else if(x+w>cmpage.x2){ pm.align=2; ok=0;}
|
||||
else if(y<cmpage.y) { pm.align=3; ok=0;}
|
||||
else if(h+y>cmpage.y2) {pm.align=4; ok=0;}
|
||||
if(!ok) this.getcoords(pm,this.l[l-1].borderX,this.l[l-1].borderY,pm.b.x,pm.b.y,w,h,this.l[l-1].offsetX,this.l[l-1].offsetY)
|
||||
x=pm.subx; y=pm.suby
|
||||
//Added check --- still not ok? --- part of the code by Denny Caldwell (thanks) -- badly immplemented by me though
|
||||
if(x<cmpage.x) {x += cmpage.x-x;}
|
||||
else if(x+w>cmpage.x2){ x = -(x+w-cmpage.x2);}
|
||||
else if(y<cmpage.y) { y = cmpage.y-y; }
|
||||
else if(h+y>cmpage.y2) {y = -(y+h-cmpage.y2);}
|
||||
if(x<cmpage.x) {x += cmpage.x-x;}
|
||||
else if(x+w>cmpage.x2){ x = -(x+w-cmpage.x2);}
|
||||
else if(y<cmpage.y) { y = cmpage.y-y;}
|
||||
else if(h+y>cmpage.y2) {y = -(y+h-cmpage.y2);}
|
||||
b.moveIt(x,y)
|
||||
}
|
||||
/******************************************
|
||||
CM_ADD-IN - pagecheck (last updated: 01/26/02)
|
||||
Simple code that *tries* to keep the menus inside thebounderies of
|
||||
the page.A more advanced version of this code will come later.
|
||||
Just add this code to the coolmenus js fileor link the cm_addins.
|
||||
js file to your page as well.
|
||||
*****************************************/
|
||||
//makeCM.prototype.onshow+=";this.pagecheck2(b,pm,x,y,maxw,maxh)"
|
||||
makeCM.prototype.pagecheck2=function(b,pm,x,y,w,h){
|
||||
var fixX = 0
|
||||
var fixY = 0
|
||||
var ok=1
|
||||
if(x+w>cmpage.x2) {
|
||||
;
|
||||
ok=0;
|
||||
}else if(x<cmpage.x) {
|
||||
ok=0;
|
||||
}if(y+h>cmpage.y2){
|
||||
fixY = -(y+h-cmpage.y2);
|
||||
ok=0;
|
||||
}else if(y<cmpage.y) {
|
||||
fixY = cmpage.y-y;
|
||||
ok=0;
|
||||
}// self.status="x:"+x+" y:" +y+ " fixX:" +fixX+ " fixY:" +fixY
|
||||
if(!ok) {
|
||||
self.status = x + " - " +cmpage.x + " - " + fixX + " - " + (x+fixX)
|
||||
x+=fixX;
|
||||
y+=fixY
|
||||
pm.moveIt(x,y)
|
||||
self.status = b.css.left
|
||||
}
|
||||
}
|
||||
|
||||
/******************
|
||||
CM_ADD-IN - filterIt (last updated: 01/26/02)
|
||||
|
||||
Explorer5.5+ only. Other browser will ignore it.
|
||||
|
||||
This function uses filters for Explorer to show
|
||||
the subitems.
|
||||
If you use this add-in you will get 1 new
|
||||
level property called "filter". You have
|
||||
to specify which filter to use and what
|
||||
level to use them on.
|
||||
(this properties will also be inherited though)
|
||||
|
||||
Example setting:
|
||||
oCMenu.level[3].filter="progid:DXImageTransform.Microsoft.Fade(duration=0.5)"
|
||||
|
||||
Examples on how to use this will come later.
|
||||
|
||||
Just add this code to the coolmenus js file
|
||||
or link the cm_addins.js file to your page as well.
|
||||
*****************/
|
||||
bw.filter=(bw.ie55||bw.ie6) && !bw.mac
|
||||
makeCM.prototype.onshow+=";if(c.l[pm.lev].filter) b.filterIt(c.l[pm.lev].filter)"
|
||||
cm_makeLevel.prototype.filter=null
|
||||
cm_makeObj.prototype.filterIt=function(f){
|
||||
if(bw.filter){
|
||||
if(this.evnt.filters[0]) this.evnt.filters[0].Stop();
|
||||
else this.css.filter=f;
|
||||
this.evnt.filters[0].Apply();
|
||||
this.showIt();
|
||||
this.evnt.filters[0].Play();
|
||||
}
|
||||
}
|
||||
/******************
|
||||
CM_ADD-IN - slide (last updated: 01/26/02)
|
||||
|
||||
This works in all browsers, but it can be
|
||||
unstable on all other browsers then Explorer.
|
||||
|
||||
This function shows the submenus in a sliding
|
||||
effect. If you use this add-in you get two
|
||||
new level properties called "slidepx" and
|
||||
"slidetim". You have to specify this for
|
||||
the levels you want this to happen on
|
||||
(these properties will also be inherited though)
|
||||
|
||||
slidepx is the number of pixels you want the
|
||||
div to slide each setTimout, while "slidetim"
|
||||
is the setTimeout speed (in milliseconds)
|
||||
|
||||
Example setting:
|
||||
oCMenu.level[3].slidepx=10
|
||||
oCMenu.level[3].slidetim=20
|
||||
|
||||
Just add this code to the coolmenus js file
|
||||
or link the cm_addins.js file to your page as well.
|
||||
*****************/
|
||||
makeCM.prototype.onshow+="; if(c.l[pm.lev].slidepx){b.moveIt(x,b.y-b.h); b.showIt(); b.tim=null; b.slide(y,c.l[pm.lev].slidepx,c.l[pm.lev].slidetim,c,pm.lev,pm.name)}"
|
||||
makeCM.prototype.going=0
|
||||
cm_makeObj.prototype.tim=10;
|
||||
cm_makeLevel.prototype.slidepx=null
|
||||
cm_makeLevel.prototype.slidetim=30
|
||||
cm_makeObj.prototype.slide=function(end,px,tim,c,l,name){
|
||||
if(!this.vis || c.l[l].a!=name) return
|
||||
if(this.y<end-px){
|
||||
if(this.y>(end-px*px-px) && px>1) px-=px/5; this.moveIt(this.x,this.y+px)
|
||||
this.clipTo(end-this.y,this.w,this.h,0)
|
||||
this.tim=setTimeout(this.obj+".slide("+end+","+px+","+tim+","+c.name+","+l+",'"+name+"')",tim)
|
||||
}else{this.moveIt(this.x,end)}
|
||||
}
|
||||
/******************
|
||||
CM_ADD-IN - clipout (last updated: 01/26/02)
|
||||
|
||||
This works in all browsers, but it can be
|
||||
unstable on all other browsers then Explorer.
|
||||
|
||||
This function shows the submenus with a clipping
|
||||
effect. If you use this add-in you get two
|
||||
new level properties called "clippx" and
|
||||
"cliptim". You have to specify this for
|
||||
the levels you want this to happen on
|
||||
(these properties will also be inherited though)
|
||||
|
||||
"clippx" is the number of pixels you want the
|
||||
div to slide each setTimout, while "cliptim"
|
||||
is the setTimeout speed (in milliseconds)
|
||||
|
||||
Example setting:
|
||||
oCMenu.level[3].clippx=10
|
||||
oCMenu.level[3].cliptim=20
|
||||
|
||||
Just add this code to the coolmenus js file
|
||||
or link the cm_addins.js file to your page as well.
|
||||
|
||||
*****************/
|
||||
makeCM.prototype.onshow+="if(c.l[pm.lev].clippx){h=b.h; if(!rows) b.clipTo(0,maxw,0,0,1); else b.clipTo(0,0,maxh,0,1); b.clipxy=0; b.showIt(); clearTimeout(b.tim); b.clipout(c.l[pm.lev].clippx,!rows?maxw:maxh,!rows?maxh:maxw,c.l[pm.lev].cliptim,rows)}"
|
||||
cm_makeObj.prototype.tim=10;
|
||||
cm_makeLevel.prototype.clippx=null
|
||||
cm_makeLevel.prototype.cliptim=30
|
||||
cm_makeObj.prototype.clipxy=0
|
||||
cm_makeObj.prototype.clipout=function(px,w,stop,tim,rows){
|
||||
if(!this.vis) return; if(this.clipxy<stop-px){this.clipxy+=px;
|
||||
if(!rows) this.clipTo(0,w,this.clipxy,0,1);
|
||||
else this.clipTo(0,this.clipxy,w,0,1);
|
||||
this.tim=setTimeout(this.obj+".clipout("+px+","+w+","+stop+","+tim+","+rows+")",tim)
|
||||
}else{if(bw.ns6){this.hideIt();}; if(!rows) this.clipTo(0,w,stop,0,1); else this.clipTo(0,stop,w,0,1);if(bw.ns6){this.showIt()}}
|
||||
}
|
441
hrmsWeb/hrms/includes/Menu_func.js
Normal file
@@ -0,0 +1,441 @@
|
||||
/************************************************************
|
||||
Coolmenus Beta 4.06 - Copyright Thomas Brattli - www.dhtmlcentral.com
|
||||
Last updated: 11.13.02
|
||||
|
||||
v4.06 - with basic frame support
|
||||
*************************************************************/
|
||||
/*Browsercheck object*/
|
||||
function cm_bwcheck(){
|
||||
//In theory we should use object detection, but this script needs work-arounds for almost every browser...
|
||||
this.ver=navigator.appVersion
|
||||
this.agent=navigator.userAgent.toLowerCase()
|
||||
this.dom=document.getElementById?1:0
|
||||
this.ns4=(!this.dom && document.layers)?1:0;
|
||||
this.op=window.opera
|
||||
this.moz=(this.agent.indexOf("gecko")>-1 || window.sidebar)
|
||||
this.ie=this.agent.indexOf("msie")>-1 && !this.op
|
||||
if(this.op){
|
||||
this.op5=(this.agent.indexOf("opera 5")>-1 || this.agent.indexOf("opera/5")>-1)
|
||||
this.op6=(this.agent.indexOf("opera 6")>-1 || this.agent.indexOf("opera/6")>-1)
|
||||
this.op7=this.dom&&!this.op5&&!this.op6 //So all higher opera versions will use it
|
||||
}else if(this.moz) this.ns6 = 1
|
||||
else if(this.ie){
|
||||
this.ie4 = !this.dom && document.all
|
||||
this.ie5 = (this.agent.indexOf("msie 5")>-1)
|
||||
this.ie55 = (this.ie5 && this.agent.indexOf("msie 5.5")>-1)
|
||||
this.ie6 = this.dom && !this.ie4 && !this.ie5 && ! this.ie55
|
||||
}
|
||||
this.mac=(this.agent.indexOf("mac")>-1)
|
||||
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.op5 || this.op6 || this.op7)
|
||||
this.usedom= this.ns6||this.op7//Use dom creation
|
||||
this.reuse = this.ie||this.op7||this.usedom //Reuse layers
|
||||
this.px=this.dom&&!this.op5?"px":""
|
||||
return this
|
||||
}
|
||||
var bw=new cm_bwcheck()
|
||||
/*Variable declaration*/
|
||||
var cmpage
|
||||
/*Crossbrowser objects functions*/
|
||||
function cm_message(txt){alert(txt); return false}
|
||||
function cm_makeObj(obj,nest,o,doc){ //Changed in v4.05
|
||||
if(!doc) doc=document
|
||||
if(bw.usedom&&o) this.evnt=o
|
||||
else{nest=(!nest) ? "doc.":'doc.layers.'+nest+'.'
|
||||
this.evnt=bw.dom? doc.getElementById(obj):
|
||||
bw.ie4?doc.all[obj]:bw.ns4?eval(nest+"layers." +obj):0;
|
||||
}
|
||||
if(!this.evnt) return cm_message('The layer does not exist ('+obj+')'
|
||||
+'- \nIf your using Netscape please check the nesting of your tags (on the entire page)\nNest:'+nest)
|
||||
this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt; this.ok=0
|
||||
this.ref=bw.dom||bw.ie4?doc:this.css.document;
|
||||
this.obj = obj + "Object"; eval(this.obj + "=this");
|
||||
this.x=0; this.y=0; this.w=0; this.h=0; this.vis=0; return this
|
||||
}
|
||||
cm_makeObj.prototype.moveIt = function(x,y){this.x=x;this.y=y; this.css.left=x+bw.px;this.css.top=y+bw.px}
|
||||
cm_makeObj.prototype.showIt = function(o){this.css.visibility="visible"; this.vis=1; if(bw.op5&&this.arr){ this.arr.showIt(); }}//alert('showing arrow')}}
|
||||
cm_makeObj.prototype.hideIt = function(no){this.css.visibility="hidden"; this.vis=0;}
|
||||
cm_makeObj.prototype.clipTo = function(t,r,b,l,setwidth){
|
||||
this.w=r; this.h=b; if(bw.ns4){this.css.clip.top=t;this.css.clip.right=r; this.css.clip.bottom=b;this.css.clip.left=l
|
||||
}else{if(t<0)t=0;if(r<0)r=0;if(b<0)b=0;if(b<0)b=0; this.css.clip="rect("+t+bw.px+","+r+bw.px+","+b+bw.px+","+l+bw.px+")";
|
||||
if(setwidth){if(bw.op5||bw.op6){this.css.pixelWidth=r; this.css.pixelHeight=b;}else{this.css.width=r+bw.px; this.css.height=b+bw.px;}}}}
|
||||
function cm_active(on,h){
|
||||
if(this.o.arr) on?this.o.arr.hideIt():bw.op5?this.o.arr.showIt():this.o.arr.css.visibility="inherit"
|
||||
if(bw.reuse||bw.usedom){
|
||||
if(!this.img2) this.o.evnt.className=on?this.cl2:this.cl
|
||||
else this.o.ref.images["img"+this.name].src=on?this.img2.src:this.img1.src; //Changed v4.05
|
||||
if(on && bw.ns6){this.o.hideIt(); this.o.css.visibility='inherit' }; //netscape 6 bug fix
|
||||
}else{
|
||||
if(!this.img2){ if(on) this.o.over.showIt(); else this.o.over.hideIt();
|
||||
}else this.o.ref.images["img"+this.name].src=on?this.img2.src:this.img1.src;
|
||||
}this.isactive=on?1:0
|
||||
}
|
||||
/***Pageobject **/
|
||||
function cm_page(frame){ //Changed v4.05
|
||||
if(!frame) frame = self
|
||||
this.x=0; this.x2 =(!bw.ie)?frame.innerWidth:frame.document.body.offsetWidth-20;
|
||||
this.y=0; this.orgy=this.y2= (!bw.ie)?frame.innerHeight:frame.document.body.offsetHeight-6;
|
||||
this.x50=this.x2/2; this.y50=this.y2/2; return this
|
||||
}
|
||||
/***check positions**/
|
||||
function cm_cp(num,w,minus){
|
||||
if(num){if(num.toString().indexOf("%")!=-1){var t = w?cmpage.x2:cmpage.y2; num=parseInt((t*parseFloat(num)/100))
|
||||
if(minus) num-=minus }else num=eval(num);} else num=0; return num
|
||||
}
|
||||
/**Level object**/
|
||||
function cm_makeLevel(){//changed 4.06
|
||||
var c=this, a=arguments; c.width=a[0]||null; c.height=a[1]||null;
|
||||
c.regClass=a[2]||null; c.overClass=a[3]||null; c.borderX=a[4]>-1?a[4]:null;
|
||||
c.borderY=a[5]>-1?a[5]:null; c.borderClass=a[6]||null; c.rows=a[7]>-1?a[7]:null;
|
||||
c.align=a[8]||null; c.offsetX=a[9]||null; c.offsetY=a[10]||null; c.arrow=a[11]||null;
|
||||
c.arrowWidth=a[12]||null; c.arrowHeight=a[13]||null; c.roundBorder=a[14]||null; return c
|
||||
}
|
||||
/***Making the main menu object**/
|
||||
function makeCM(name){ //Changed v4.06
|
||||
var c=this; c.mc=0; c.name = name; c.m=new Array(); c.scrollY=-1; c.level=new Array(); c.l=new Array(); c.tim=100; c.isresized=0;
|
||||
c.isover=0; c.zIndex=100; c.frameStartLevel=1; c.bar=0; c.z=0; c.totw=0; c.toth=0; c.maxw=0; c.maxh=0; cmpage = new cm_page(); c.constructed = 0;
|
||||
return this
|
||||
}//events
|
||||
makeCM.prototype.onshow=""; makeCM.prototype.onhide=""; makeCM.prototype.onconstruct="";
|
||||
/***Creating layers**/
|
||||
function cm_divCreate(id,cl,txt,w,c,app,ex,txt2){
|
||||
if(bw.usedom){var div=document.createElement("DIV"); div.className=cl; div.id=id;
|
||||
if(txt) div.innerHTML=txt; if(app){app.appendChild(div); return div}
|
||||
if(w) document.body.appendChild(div); return div
|
||||
}else{var dstr='<div id="'+id+'" class="'+cl+'"'
|
||||
if(ex&&bw.reuse) dstr+=" "+ex; dstr+=">"+txt; ; if(txt2) dstr+=txt2;
|
||||
if(c) dstr+='</div>'; if(w) document.write(dstr); else return dstr
|
||||
}return ""
|
||||
}
|
||||
/***Getting layer string for each menu**/
|
||||
function cm_getLayerStr(m,app,name,fill,clb,arrow,ah,aw,root){
|
||||
var no=m.nolink,arrstr='',l=m.lev,str='',txt=m.txt,ev='', id=name + '_' + m.name,d1; if(app) d1=app
|
||||
if((!bw.reuse||l==0) && !no){
|
||||
ev=' onmouseover="'+name+'.showsub(\''+m.name+'\')"'
|
||||
+' onmouseout="'+name+'.mout(\''+m.name+'\')"'
|
||||
+' onclick="'+name+'.onclck(\''+m.name+'\'); return false" '
|
||||
}
|
||||
if(bw.reuse&&l!=0) txt=''; if(l==0) str+=d1=cm_divCreate(id+'_0',clb,''); str+=m.d2=cm_divCreate(id,m.cl,txt,0,0,d1,ev)
|
||||
if(l==0&&bw.usedom){
|
||||
m.d2.onclick=new Function(name+'.onclck("'+m.name+'")');
|
||||
m.d1=d1;
|
||||
m.d2.onmouseover=new Function(name+'.showsub("'+m.name+'")');
|
||||
m.d2.onmouseout=new Function(name+'.mout("'+m.name+'")')
|
||||
}if(!bw.reuse && !m.img1 && !no){
|
||||
str+=cm_divCreate(id+'_1',m.cl2,txt,0,1)
|
||||
str+=cm_divCreate(id+'_3',"clCMAbs",'<a href="#" '+ev+'><img alt="" src="'+root+fill+'" width="'+m.w+'" height="'+m.h+'" border="0" /></a>',0,1)
|
||||
}str+='</div>';
|
||||
if(l==0){if(arrow)str+=m.d3=cm_divCreate(id+'_a','clCMAbs','<img alt="" height="'+aw+'" width="'+ah+'" src="'+root+arrow+'" />',0,1,d1); str+="</div>"}
|
||||
str+="\n"; if(!bw.reuse){m.txt=null; m.d2=null; m.d3=null;}
|
||||
if(bw.usedom){ if(l==0) document.body.appendChild(d1); str=''}
|
||||
return str
|
||||
}
|
||||
/***get align num from text (better to evaluate numbers later)**/
|
||||
function cm_checkalign(a){
|
||||
switch(a){
|
||||
case "right": return 1; break; case "left": return 2; break;
|
||||
case "bottom": return 3; break; case "top": return 4; break;
|
||||
case "righttop": return 5; break; case "lefttop": return 6; break;
|
||||
case "bottomleft": return 7; break; case "topleft": return 8; break;
|
||||
}return null
|
||||
}
|
||||
/**Making each individual menu **/
|
||||
makeCM.prototype.makeMenu=function(name,parent,txt,lnk,targ,w,h,img1,img2,cl,cl2,align,rows,nolink,onclick,onmouseover,onmouseout){
|
||||
var c = this; if(!name) name = c.name+""+c.mc; var p = parent!=""&&parent&&c.m[parent]?parent:0;
|
||||
if(c.mc==0){
|
||||
//Added 4.07 - bug(?) in opera 7 - you cannot dom-add layers created in one document to another one (or so it seems) - so turn of usedom
|
||||
if(bw.op7 && this.frames) bw.usedom=0
|
||||
var tmp=location.href;
|
||||
if(tmp.indexOf('file:')>-1||tmp.charAt(1)==':') c.root=c.offlineRoot; else c.root=c.onlineRoot
|
||||
if(c.useBar){if(!c.barBorderClass) c.barBorderClass=c.barClass; c.bar1 = cm_divCreate(c.name+'bbar_0',c.barClass,'',0,1);
|
||||
c.bar = cm_divCreate(c.name+'bbar',c.barBorderClass,'',1,1,0,0,c.bar1); if(bw.usedom) c.bar.appendChild(c.bar1);
|
||||
}}var create=1,img,arrow; var m = c.m[name] = new Object(); m.name=name; m.subs=new Array(); m.parent=p; m.arnum=0; m.arr=0
|
||||
var l = m.lev = p?c.m[p].lev+1:0; c.mc++; m.hide=0;
|
||||
if(l>=c.l.length){
|
||||
var p1,p2=0; if(l>=c.level.length) p1=c.l[c.level.length-1];
|
||||
else p1=c.level[l]; c.l[l]=new Array(); if(!p2) p2=c.l[l-1]
|
||||
if(l!=0){ if(isNaN(p1.align)) p1["align"]=cm_checkalign(p1.align)
|
||||
for(var i in p1){if(i!="str"&&i!="m"){if(p1[i]==null) c.l[l][i]=p2[i]; else c.l[l][i]=p1[i] }}
|
||||
}else{c.l[l]=c.level[0]; c.l[l].align=cm_checkalign(c.l[l].align)}
|
||||
c.l[l]["str"]=''; c.l[l].m=new Array(); if(!c.l[l].borderClass) c.l[l].borderClass=c.l[l].regClass
|
||||
c.l[l].app=0; c.l[l].max=0; c.l[l].arnum=0; c.l[l].o=new Array(); c.l[l].arr=new Array()
|
||||
c.level[l]=p1=p2=null
|
||||
if(l!=0) c.l[l].str=c.l[l].app=cm_divCreate(c.name+ '_' +l+'_0',c.l[l].borderClass,'')
|
||||
}if(p){p = c.m[p]; p.subs[p.subs.length]=name;
|
||||
if(p.subs.length==1&&c.l[l-1].arrow){ p.arr=1;
|
||||
if(p.parent){c.m[p.parent].arnum++
|
||||
if(c.m[p.parent].arnum>c.l[l-1].arnum){
|
||||
c.l[l-1].str+=c.l[l-1].arr[c.l[l-1].arnum]=cm_divCreate(c.name+ '_a' +(l-1)+'_'+c.l[l-1].arnum,'clCMAbs','<img height="'+c.l[l-1].arrowHeight
|
||||
+'" width="'+c.l[l-1].arrowWidth+'" src="'+c.root+c.l[l-1].arrow+'" alt="" />',0,1,c.l[l-1].app); c.l[l-1].arnum++
|
||||
}}}if(bw.reuse) if(p.subs.length>c.l[l].max) c.l[l].max = p.subs.length; else create=0
|
||||
}m.rows=rows>-1?rows:c.l[l].rows; m.w=cm_cp(w||c.l[l].width,1); m.h=cm_cp(h||c.l[l].height,0); m.txt=txt; m.lnk=lnk;
|
||||
if(align) align=cm_checkalign(align); m.align=align||c.l[l].align; m.cl=cl=cl||c.l[l].regClass;
|
||||
m.targ=targ; m.cl2=cl2||c.l[l].overClass; m.create=create; m.mover=onmouseover; m.mout=onmouseout;
|
||||
m.onclck=onclick; m.active = cm_active; m.isactive=0; m.nolink=nolink
|
||||
if(create) c.l[l].m[c.l[l].m.length]=name
|
||||
if(img1){m.img1 = new Image(); m.img1.src=c.root+img1; if(!img2) img2=img1; m.img2 = new Image(); m.img2.src=c.root+img2;
|
||||
m.cl="clCMAbs"; m.txt=''; if(!bw.reuse&&!nolink) m.txt = '<a href="#" onmouseover="'+c.name+'.showsub(\''+name+'\')" onmouseout="'+c.name+'.mout(\''+name+'\')" onclick="'+c.name+'.onclck(\''+name+'\'); return false">';;
|
||||
m.txt+='<img alt="" src="'+c.root+img1+'" width="'+m.w+'" height="'+m.h+'" id="img'+m.name+'" '
|
||||
if(bw.dom&&!nolink) m.txt+='style="cursor:pointer; cursor:hand"'; if(!bw.reuse){if(!bw.dom) m.txt+='name="img'+m.name+'"'; m.txt+=' border="0"'}; m.txt+=' />'; if(!bw.reuse&&!nolink) m.txt+='</a>'
|
||||
}else{m.img1=0; m.img2=0};
|
||||
if(l==0||create) c.l[l].str+=cm_getLayerStr(m,c.l[l].app,c.name,c.fillImg,c.l[l].borderClass,c.l[l].arrow,c.l[l].arrowWidth,c.l[l].arrowHeight,c.root)
|
||||
if(l==0){if(m.w>c.maxw) c.maxw=m.w; if(m.h>c.maxh) c.maxh=m.h; c.totw+=c.pxBetween+m.w+c.l[0].borderX;c.toth+=c.pxBetween+m.h+c.l[0].borderY}
|
||||
if(lnk && !onmouseover){
|
||||
var path=lnk.indexOf("mailto:")>-1||lnk.indexOf("http://")>-1?"":c.root
|
||||
m.mover="self.status='"+path+m.lnk+"'"
|
||||
if(!m.mout) m.mout=""; m.mout+=";self.status='';"
|
||||
}
|
||||
}
|
||||
/**Getting x/y coords for subs **/
|
||||
makeCM.prototype.getcoords=function(m,bx,by,x,y,maxw,maxh,ox,oy){
|
||||
var a=m.align; x+=m.o.x; y+=m.o.y
|
||||
switch(a){
|
||||
case 1: x+=m.w+bx; break; case 2: x-=maxw+bx; break;
|
||||
case 3: y+=m.h+by; break; case 4: y-=maxh+by; break;
|
||||
case 5: x-=maxw+bx; y-=maxh-m.h; break;
|
||||
case 6: x+=m.w+bx; y-=maxh-m.h; break;
|
||||
case 7: y+=m.h+by; x-=maxw-m.w; break;
|
||||
case 8: y-=maxh+by; x-=maxw-m.w+bx; break;
|
||||
}//Added v4.05
|
||||
if(m.lev==this.frameStartLevel-1 && this.frames){
|
||||
switch(a){
|
||||
case 1: x=0; break;
|
||||
case 2: x=this.cmpage.x2-maxw; break;
|
||||
case 3: y=0; break;
|
||||
case 4: y-=maxh+by; break;
|
||||
case 5: x-=maxw+bx; y-=maxh-m.h; break;
|
||||
case 6: x+=m.w+bx; y-=maxh-m.h; break;
|
||||
case 7: y+=m.h+by; x-=maxw-m.w; break;
|
||||
case 8: y-=maxh+by; x-=maxw-m.w+bx; break;
|
||||
}
|
||||
}
|
||||
m.subx=x + ox; m.suby=y + oy
|
||||
}
|
||||
/**Showing sub elements**/
|
||||
makeCM.prototype.showsub=function(el){ //Changed v4.06
|
||||
var c=this,pm=c.m[el],m,o,nl
|
||||
if(!pm.b||(c.isresized&&pm.lev>0)) pm.b=c.l[pm.lev].b; c.isover=1
|
||||
clearTimeout(c.tim);
|
||||
var ln=pm.subs.length,l=pm.lev+1
|
||||
if(c.l[pm.lev].a==el&&l!=c.l.length && !c.openOnClick){if(c.l[pm.lev+1].a) c.hidesub(l+1,el); return}
|
||||
c.hidesub(l,el); if(pm.mover) eval(pm.mover); if(!pm.isactive) pm.active(1);
|
||||
c.l[pm.lev].a = el; if(ln==0) return;
|
||||
if(c.openOnClick && !c.clicked) return//Added v4.06
|
||||
if(!c.l[l].b) return //Added v4.05
|
||||
var b = c.l[l].b, bx=c.l[l].borderX, by=c.l[l].borderY, rows=pm.rows
|
||||
var rb=c.l[l].roundBorder;//added 4.06
|
||||
var x=bx+rb,y=by+rb,maxw=0,maxh=0,cn=0; b.hideIt()
|
||||
for(var i=0;i<c.l[l].m.length;i++){
|
||||
if(!bw.reuse) m=c.m[c.l[l].m[i]]
|
||||
else m=c.m[c.m[el].subs[i]]
|
||||
if(m && m.parent==el&&!m.hide){
|
||||
if(!bw.reuse) o=m.o; else o=m.o=c.l[l].o[i]
|
||||
if(x!=o.x||y!=o.y) o.moveIt(x,y); nl=m.subs.length //changed 4.06
|
||||
if(bw.reuse){
|
||||
if(o.w!=m.w || o.h!=m.h) o.clipTo(0,m.w,m.h,0,1)
|
||||
if(o.evnt.className!=m.cl){
|
||||
m.isactive=0; o.evnt.className=m.cl
|
||||
if(bw.ns6){o.hideIt(); o.css.visibility='inherit'} //NS6 bugfix
|
||||
}if(bw.ie6) b.showIt()//IE6 bugfix (scrollbars)
|
||||
o.evnt.innerHTML=m.txt; if(bw.ie6) b.hideIt()
|
||||
if(!m.nolink){
|
||||
o.evnt.onmouseover=new Function(c.name+".showsub('"+m.name+"')")
|
||||
o.evnt.onmouseout=new Function(c.name+".mout('"+m.name+"')") //Added v4.05
|
||||
o.evnt.onclick=new Function(c.name+".onclck('"+m.name+"')")
|
||||
if(o.oldcursor){o.css.cursor=o.oldcursor; o.oldcursor=0;}
|
||||
}else{o.evnt.onmouseover=''; o.evnt.onclick=''; if(o.css.cursor=='') o.oldcursor=bw.ns6?"pointer":"hand"; else o.oldcursor=o.css.cursor; o.css.cursor="auto"}
|
||||
}if(m.arr){o.arr=c.l[l].arr[cn]; o.arr.moveIt(x + m.w-c.l[l].arrowWidth-3,y+m.h/2-(c.l[l].arrowHeight/2));
|
||||
o.arr.css.visibility="inherit"; cn++;} else o.arr=0
|
||||
if(!rows){y+=m.h+by; if(m.w>maxw) maxw=m.w; maxh=y}
|
||||
else{x+=m.w+bx; if(m.h>maxh) maxh=m.h; maxw=x;}
|
||||
o.css.visibility="inherit"; if(bw.op5||bw.op6) o.showIt()
|
||||
}else{o = c.m[c.l[l].m[i]].o; o.hideIt();} }
|
||||
if(!rows) maxw+=bx*2+rb; else maxh+=by*2+rb; //changed 4.06
|
||||
if(rb){maxw+=rb; maxh+=rb}//added 4.06
|
||||
b.clipTo(0,maxw,maxh,0,1)
|
||||
//Check frame scroll
|
||||
if(c.chkscroll) c.chkscroll() //Added v4.05 - not the best solution
|
||||
if(c.chkscroll||!pm.subx||!pm.suby||c.scrollY>-1||c.isresized) c.getcoords(pm,c.l[l-1].borderX,c.l[l-1].borderY,pm.b.x,pm.b.y,maxw,maxh,c.l[l-1].offsetX,c.l[l-1].offsetY) //Changed 4.06
|
||||
x=pm.subx; if(c.chkscroll&&l==c.frameStartLevel) pm.suby+=c.scrollY; y=pm.suby; b.moveIt(x,y); if(c.onshow) eval(c.onshow); b.showIt()
|
||||
}
|
||||
/**Hide sub elements **/
|
||||
makeCM.prototype.hidesub=function(l,el){ //Changed v4.05
|
||||
var c = this,tmp,m,i,j,hide
|
||||
if(!l) {l=1; hide=1; c.clicked=0}
|
||||
for(i=l-1;i<c.l.length;i++){
|
||||
if(i>0&&i>l-1) if(c.l[i].b) c.l[i].b.hideIt()//Changed v4.05
|
||||
if(c.l[i].a&&c.l[i].a!=el){
|
||||
m=c.m[c.l[i].a]; m.active(0,1); if(m.mout) eval(m.mout); c.l[i].a=0
|
||||
if(i>0&&i>l-1) if(bw.op5||bw.op6) for(j=0;j<c.l[i].m.length;j++) c.m[c.l[i].m[j]].o.hideIt()
|
||||
}if(i>l){for(j=0;j<c.l[i-1].arnum;j++){c.l[i-1].arr[j].hideIt(); if(bw.op6) c.l[i-1].arr[j].moveIt(-1000,-1000)}} //opera bug
|
||||
}if(hide&&c.onhide) eval(c.onhide) //onhide event
|
||||
}
|
||||
/***Make all menu div objects**/
|
||||
makeCM.prototype.makeObjects=function(nowrite,fromframe){ //Changed v4.06
|
||||
var c = this,oc,name,bx,by,w,h,l,no,ar,id,nest,st=0,en=c.l.length,bobj,o,m,i,j
|
||||
//Added v4.05
|
||||
if(fromframe){
|
||||
st = this.frameStartLevel
|
||||
this.body = fromframe.document.body
|
||||
this.doc = fromframe.document
|
||||
this.deftarget=fromframe
|
||||
this.cmpage = new cm_page(fromframe)
|
||||
}else{
|
||||
this.body=document.body
|
||||
this.doc=document
|
||||
if(this.frames) en = this.frameStartLevel
|
||||
this.deftarget=self
|
||||
}
|
||||
if(!nowrite){
|
||||
for(i=st;i<en;i++){ //changed 4.06
|
||||
if(!bw.usedom) this.doc.write(c.l[i].str)
|
||||
else if(i>0) this.body.appendChild(c.l[i].app)
|
||||
if(!this.frames) c.l[i].str=null
|
||||
}}c.z=c.zIndex+2
|
||||
for(i=st;i<en;i++){oc=0
|
||||
if(i!=0){bobj=c.l[i].b = new cm_makeObj(c.name + "_"+i+"_0","",c.l[i].app,this.doc); bobj.css.zIndex=c.z;
|
||||
if(bw.dom) bobj.css.overflow='hidden'}; bx=c.l[i].borderX; by=c.l[i].borderY; c.l[i].max=0;
|
||||
for(j=0;j<c.l[i].m.length;j++){
|
||||
m = c.m[c.l[i].m[j]]; name=m.name; w=m.w; h=m.h; l=m.lev; no=m.nolink;
|
||||
if(i>0){m.b = bobj; nest=i}
|
||||
else{m.b = new cm_makeObj(c.name + "_"+name+"_0","",m.d1,this.doc); m.b.css.zIndex=c.z; m.b.clipTo(0,w+bx*2,h+by*2,0,1); nest=name}
|
||||
id = c.name + "_"+name; nest=c.name + "_"+nest;
|
||||
if(m.create){
|
||||
o=m.o=new cm_makeObj(id,nest+"_0",m.d2,this.doc); o.z=o.css.zIndex=c.z+1; if(bw.reuse){c.l[l].o[oc]=o; oc++};
|
||||
if(l==0&&m.img1) o.css.visibility='inherit'; if(bw.op5) o.showIt(); o.arr=0;
|
||||
}if(!bw.reuse||l==0) o.clipTo(0,w,h,0,1); o.moveIt(bx,by); o.z=o.css.zIndex=c.z+2
|
||||
if(j<c.l[i].arnum){
|
||||
c.l[i].arr[j]=new cm_makeObj(c.name+"_a"+i+"_"+j,nest+"_0",nowrite?0:c.l[i].arr[j],this.doc)
|
||||
c.l[i].arr[j].css.zIndex=c.z+30+j;
|
||||
}else if(l==0&&m.arr==1){
|
||||
o.arr=new cm_makeObj(id+"_a",nest+"_0",m.d3,this.doc)
|
||||
o.arr.moveIt(bx+m.w-c.l[i].arrowWidth-3,by+m.h/2-(c.l[i].arrowHeight/2));
|
||||
o.arr.css.zIndex=c.z+20;
|
||||
}if(!no && !bw.reuse && !m.img1){
|
||||
o.over=new cm_makeObj(c.name + "_"+name+"_1",nest+"_0"+".document.layers."+id,"",this.doc)
|
||||
o.over.moveIt(0,0); o.over.hideIt(); o.over.clipTo(0,w,h,0,1); o.over.css.zIndex=c.z+3
|
||||
img=new cm_makeObj(c.name + "_"+name+"_3",nest+"_0"+".document.layers."+id,"",this.doc); img.moveIt(0,0)
|
||||
img.css.visibility="inherit"; img.css.zIndex=c.z+4; if(bw.op5) img.showIt()
|
||||
}c.z++;
|
||||
}
|
||||
}
|
||||
if(fromframe){ ///Set scroll vars - added v4.05
|
||||
c.chkscroll = function(){//changed 4.06
|
||||
if (bw.ie&&!bw.ie6) this.scrollY=this.body.scrollTop;
|
||||
else if (bw.ie6 || bw.op7){
|
||||
if (this.doc.compatMode && document.compatMode != "BackCompat") this.scrollY=this.doc.documentElement.scrollTop
|
||||
else this.scrollY=this.body.scrollTop
|
||||
}else this.scrollY=this.deftarget.pageYOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**Onmouseout**/
|
||||
makeCM.prototype.mout = function(){ //Changed v4.06
|
||||
var c = this; clearTimeout(c.tim); c.isover = 0; var f="if(!"+c.name+".isover)"+c.name+".hidesub()"
|
||||
if(!c.closeOnClick) c.tim = setTimeout(f,c.wait)
|
||||
else{
|
||||
if(bw.ns4){ document.captureEvents("Event.MOUSEDOWN"); document.onmousedown=new Function(f)}
|
||||
else document.onclick=new Function(f);
|
||||
if(this.frames){
|
||||
if(bw.ns4){this.doc.captureEvents("Event.MOUSEDOWN"); this.doc.onmousedown=new Function(f)}
|
||||
else this.doc.onclick=new Function(f)
|
||||
}
|
||||
}
|
||||
}
|
||||
/**Constructing and initiating top items and bar**/
|
||||
makeCM.prototype.construct=function(nowrite){ //Changed v4.06
|
||||
var c=this; if(!c.l[0]||c.l[0].m.length==0) return null;
|
||||
if(!nowrite){for(var i=1;i<c.l.length;i++){c.l[i].str+="</div>"}} //Added 4.06
|
||||
c.makeObjects(nowrite); cmpage = new cm_page();
|
||||
var mpa,o,maxw=c.maxw,maxh=c.maxh,i,totw=c.totw,toth=c.toth,m,px=c.pxBetween
|
||||
var bx=c.l[0].borderX,by=c.l[0].borderY,x=c.fromLeft,y=c.fromTop,mp=c.menuPlacement,rows=c.rows
|
||||
if(rows){toth=maxh+by*2; totw=totw-px+bx;}else{totw=maxw+bx*2; toth=toth-px+by;}
|
||||
switch(mp){
|
||||
case "center": x=cmpage.x2/2-totw/2; if(bw.ns4) x-=9; break;
|
||||
case "right": x=cmpage.x2-totw; break;
|
||||
case "bottom": case "bottomcenter": y=cmpage.y2-toth; if(mp=="bottomcenter") x=cmpage.x2/2-totw/2; break;
|
||||
default: if(mp.toString().indexOf(",")>-1) mpa=1; break;
|
||||
}for(var i=0;i<c.l[0].m.length;i++){
|
||||
m = c.m[c.l[0].m[i]]; o = m.b; if(mpa) rows?x=cm_cp(mp[i]):y=cm_cp(mp[i],0,0,1);
|
||||
o.moveIt(x,y); o.showIt(); if(m.arr) m.o.arr.showIt(); o.oy=y;
|
||||
if(!mpa) rows?x+=m.w+px+bx:y+=m.h+px+by
|
||||
}if(c.useBar==1){ //Background-Bar
|
||||
var bbx=c.barBorderX,bby=c.barBorderY;
|
||||
var bar1=c.bar1= new cm_makeObj(c.name+'bbar_0',c.name+'bbar',nowrite?0:c.bar1,document)
|
||||
var bar=c.bar= new cm_makeObj(c.name+'bbar','',nowrite?0:c.bar,document); bar.css.zIndex=c.zIndex+1
|
||||
var barx=c.barX=="menu"?c.m[c.l[0].m[0]].b.x-bbx:cm_cp(c.barX,1);
|
||||
var bary=c.barY=="menu"?c.m[c.l[0].m[0]].b.y-bby:cm_cp(c.barY);
|
||||
var barw=c.barWidth=="menu"?totw:cm_cp(c.barWidth,1,bbx*2);
|
||||
var barh=c.barHeight=="menu"?toth:cm_cp(c.barHeight,0,bby*2);
|
||||
bar1.clipTo(0,barw,barh,0,1); bar1.moveIt(bbx,bby); bar1.showIt();
|
||||
bar.clipTo(0,barw+bbx*2,barh+bby*2,0,1); bar.moveIt(barx,bary); bar.showIt();
|
||||
}if(c.resizeCheck){ //Window resize code - updated 4.06 - stil sucks
|
||||
if(bw.ns4||bw.op5||bw.op6)setTimeout('window.onresize=new Function("'+c.name+'.resized()")',500)
|
||||
else window.onresize=new Function(c.name+".resized()")
|
||||
c.resized=cm_resized; if(bw.op5||bw.op6) document.onmousemove=new Function(c.name+".resized()")
|
||||
}if(c.onconstruct) eval(c.onconstruct) //onconstruct event
|
||||
c.constructed = 1 //Added v4.05
|
||||
return true
|
||||
}
|
||||
/**Capturing resize**/
|
||||
var cm_inresize=0
|
||||
function cm_resized(){
|
||||
if(cm_inresize) return
|
||||
page2=new cm_page(); var off=(bw.op6||bw.op5)?20:5
|
||||
if(page2.x2<cmpage.x2-off || page2.y2<cmpage.orgy-off || page2.x2>cmpage.x2+off || page2.y2>cmpage.orgy+off){
|
||||
if(bw.ie||bw.ns6||bw.op7||bw.ns4){
|
||||
cmpage=page2; this.isresized=1;
|
||||
if(this.onresize) eval(this.onresize); this.construct(1);
|
||||
if(this.onafterresize) eval(this.onafterresize);
|
||||
}else{cm_inresize=1; location.reload()}
|
||||
}
|
||||
}
|
||||
/**Onclick of an item**/
|
||||
makeCM.prototype.onclck=function(m){ //Changed v4.06
|
||||
|
||||
m = this.m[m]
|
||||
if(m.onclck) eval(m.onclck);
|
||||
if(this.openOnClick && m.subs.length>0){
|
||||
this.clicked = 1; this.showsub(m.name); return
|
||||
}
|
||||
var lnk=m.lnk, targ=m.targ
|
||||
if(lnk){
|
||||
if(lnk.indexOf("mailto")!=0 && lnk.indexOf("http")!=0) lnk=this.root+lnk
|
||||
if(String(targ)=="undefined" || targ=="" || targ==0 || targ=="_self"){
|
||||
if(this.frames){ //Turning of all level 1 + vars
|
||||
if(this.l[0].a){
|
||||
this.m[this.l[0].a].active(0,1)
|
||||
this.l[0].a =0
|
||||
}
|
||||
for(i=this.frameStartLevel;i<this.l.length;i++){
|
||||
if(this.l[i].b){
|
||||
this.l[i].b.hideIt()
|
||||
this.l[i].b = null
|
||||
for(j=0;j<this.l[i].m.length;j++){
|
||||
this.m[this.l[i].m[j]].b = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.isover=0
|
||||
}
|
||||
|
||||
var _bases=document.getElementsByTagName("base");
|
||||
var _fullbase=_bases[0].href;
|
||||
var _base=new Array();
|
||||
_base=_fullbase.split("/");
|
||||
_base[_base.length-1]="";
|
||||
_base[_base.length-2]="";
|
||||
_base[_base.length-3]=lnk;
|
||||
_efflnk=_base.join("/");
|
||||
_efflnk=_efflnk.substr(0,_efflnk.length-2)
|
||||
this.deftarget.location.href=_efflnk;
|
||||
}
|
||||
else if(targ=="_blank"){
|
||||
oWin=window.open(lnk)
|
||||
oWin.frmBody.location.href=lnk;
|
||||
}
|
||||
else if(targ=="_top" || targ=="window") top.location.href=lnk
|
||||
else if(top[targ]) top[targ].location.href=lnk
|
||||
else if(parent[targ]) parent[targ].location.href=lnk
|
||||
}else return false
|
||||
}
|
||||
|
28
hrmsWeb/hrms/includes/Menucss.css
Normal file
@@ -0,0 +1,28 @@
|
||||
<style>
|
||||
/* CoolMenus 4 - default styles - do not edit */
|
||||
.clCMAbs{position:absolute; visibility:hidden; left:0; top:0}
|
||||
/* CoolMenus 4 - default styles - end */
|
||||
|
||||
/*Style for the background-bar*/
|
||||
.clBar{position:absolute; width:10; height:10; background-color:#0080c0; layer-background-color:Navy; visibility:hidden}
|
||||
|
||||
/*Styles for level 0*/
|
||||
.clLevel0,.clLevel0over{position:absolute; z-order:30; padding:2px; font-family:tahoma,arial,helvetica; font-size:10px; font-weight:normal}
|
||||
.clLevel0{background-color:#0080c0; layer-background-color:Navy; color:white;}
|
||||
.clLevel0over{background-color:#0099cc; layer-background-color:#0099cc; color:Yellow; cursor:pointer; cursor:hand; }
|
||||
.clLevel0border{position:absolute; visibility:hidden; background-color:#006699; layer-background-color:#006699}
|
||||
|
||||
/*Styles for level 1*/
|
||||
.clLevel1, .clLevel1over{position:absolute; z-order:30; padding:2px; font-family:tahoma, arial,helvetica; font-size:10px; font-weight:normal}
|
||||
.clLevel1{background-color:#0080c0; layer-background-color:Navy; color:white;}
|
||||
.clLevel1over{background-color:#0099cc; layer-background-color:#0099cc; color:Yellow; cursor:pointer; cursor:hand; }
|
||||
.clLevel1border{position:absolute; visibility:hidden; background-color:#006699; layer-background-color:#006699}
|
||||
|
||||
/*Styles for level 2*/
|
||||
.clLevel2, .clLevel2over{position:absolute; z-order:30; padding:2px; font-family:tahoma,arial,helvetica; font-size:10px; font-weight:normal}
|
||||
.clLevel2{background-color:#0080c0; layer-background-color:Navy; color:white;}
|
||||
.clLevel2over{background-color:#0099cc; layer-background-color:#0099cc; color:Yellow; cursor:pointer; cursor:hand; }
|
||||
.clLevel2border{position:absolute; visibility:hidden; background-color:#006699; layer-background-color:#006699}
|
||||
</style>
|
||||
|
||||
|
100
hrmsWeb/hrms/includes/Menujs.js
Normal file
@@ -0,0 +1,100 @@
|
||||
//Menu object creation
|
||||
MyMenu=new makeCM("MyMenu") //Making the menu object. Argument: menuname
|
||||
|
||||
MyMenu.frames = 0
|
||||
|
||||
//Menu properties
|
||||
MyMenu.pxBetween=5 //10
|
||||
MyMenu.fromLeft=0
|
||||
MyMenu.fromTop=0
|
||||
MyMenu.rows=1
|
||||
MyMenu.menuPlacement="center"
|
||||
|
||||
MyMenu.offlineRoot=""
|
||||
MyMenu.onlineRoot=""
|
||||
MyMenu.resizeCheck=1
|
||||
MyMenu.wait=100
|
||||
MyMenu.fillImg="cm_fill.gif"
|
||||
MyMenu.zIndex=1
|
||||
|
||||
//Background bar properties
|
||||
MyMenu.useBar=1
|
||||
MyMenu.barWidth="110%"
|
||||
MyMenu.barHeight="menu"
|
||||
MyMenu.barClass="clBar"
|
||||
MyMenu.barX=0 //10
|
||||
MyMenu.barY=0
|
||||
MyMenu.barBorderX=0
|
||||
MyMenu.barBorderY=0
|
||||
MyMenu.barBorderClass=""
|
||||
|
||||
MyMenu.onresize="makeCM('MyMenu'); MyMenu.construct(1);"
|
||||
|
||||
//Level properties - ALL properties have to be spesified in level 0
|
||||
MyMenu.level[0]=new cm_makeLevel() //Add this for each new level
|
||||
MyMenu.level[0].width=79 //130
|
||||
MyMenu.level[0].height=25
|
||||
MyMenu.level[0].regClass="clLevel0"
|
||||
MyMenu.level[0].overClass="clLevel0over"
|
||||
MyMenu.level[0].borderX=0
|
||||
MyMenu.level[0].borderY=1
|
||||
MyMenu.level[0].borderClass="clLevel0border"
|
||||
MyMenu.level[0].offsetX=0
|
||||
MyMenu.level[0].offsetY=0
|
||||
MyMenu.level[0].rows=0
|
||||
MyMenu.level[0].arrow=0
|
||||
MyMenu.level[0].arrowWidth=0
|
||||
MyMenu.level[0].arrowHeight=0
|
||||
MyMenu.level[0].align="bottom"
|
||||
|
||||
//EXAMPLE SUB LEVEL[1] PROPERTIES - You have to specify the properties you want different from LEVEL[0] - If you want all items to look the same just remove this
|
||||
MyMenu.level[1]=new cm_makeLevel() //Add this for each new level (adding one to the number)
|
||||
MyMenu.level[1].width=180 //200
|
||||
MyMenu.level[1].height=22
|
||||
MyMenu.level[1].regClass="clLevel1"
|
||||
MyMenu.level[1].overClass="clLevel1over"
|
||||
MyMenu.level[1].borderX=1
|
||||
MyMenu.level[1].borderY=1
|
||||
MyMenu.level[1].align="right"
|
||||
MyMenu.level[1].offsetX=0//-(MyMenu.level[0].width-2)/2+20
|
||||
MyMenu.level[1].offsetY=0
|
||||
MyMenu.level[1].borderClass="clLevel1border"
|
||||
|
||||
|
||||
//EXAMPLE SUB LEVEL[2] PROPERTIES - You have to spesify the properties you want different from LEVEL[1] OR LEVEL[0] - If you want all items to look the same just remove this
|
||||
MyMenu.level[2]=new cm_makeLevel() //Add this for each new level (adding one to the number)
|
||||
MyMenu.level[2].width=180 //200
|
||||
MyMenu.level[2].height=20
|
||||
MyMenu.level[2].offsetX=0
|
||||
MyMenu.level[2].offsetY=0
|
||||
MyMenu.level[2].regClass="clLevel2"
|
||||
MyMenu.level[2].overClass="clLevel2over"
|
||||
MyMenu.level[2].borderClass="clLevel2border"
|
||||
|
||||
|
||||
/******************************************
|
||||
Menu item creation:
|
||||
|
||||
*************************************/
|
||||
MyMenu.makeMenu('4002000252','','Organisation Setup')
|
||||
MyMenu.makeMenu('4002000584','4002000252','Holiday Type Master', 'HrmOrgHolTypeMst.jsp')
|
||||
MyMenu.makeMenu('4002000582','4002000252','Calendar Master', 'HrmOrgCalMst.jsp')
|
||||
MyMenu.makeMenu('4002000593','4002000252','Holiday Calendar', 'HrmOrgHolCal.jsp')
|
||||
MyMenu.makeMenu('4002000592','4002000252','Qualification Master', 'HrmOrgQualMst.jsp')
|
||||
MyMenu.makeMenu('4002000591','4002000252',' Rating Master', 'HrmOrgRatingMst.jsp')
|
||||
MyMenu.makeMenu('4002000590','4002000252',' Skill Master', 'HrmOrgSkillMst.jsp')
|
||||
MyMenu.makeMenu('4002000589','4002000252',' Religion Master', 'HrmOrgReligionMst.jsp')
|
||||
MyMenu.makeMenu('4002000588','4002000252',' Classification Detail', 'HrmOrgClassDtl.jsp')
|
||||
MyMenu.makeMenu('4002000585','4002000252',' Country Master', 'HrmOrgCntryMst.jsp')
|
||||
MyMenu.makeMenu('4002000576','4002000252',' Work Group Master', 'HrmOrgWorkGroupMst.jsp')
|
||||
MyMenu.makeMenu('4002000577','4002000252',' Scale Master', 'HrmOrgScaleMst.jsp')
|
||||
MyMenu.makeMenu('4002000580','4002000252',' Relation Master', 'HrmOrgRelationMst.jsp')
|
||||
MyMenu.makeMenu('4002000578','4002000252',' Language Master', 'HrmOrgLangMst.jsp')
|
||||
MyMenu.makeMenu('4002000581','4002000252',' Eligibility Rule', 'HrmGenEligRule.jsp')
|
||||
MyMenu.makeMenu('4002000501','4002000252',' Eligibility Rule Query', 'HrmGenEligRuleQuery.jsp')
|
||||
|
||||
//Leave this line - it constructs the menu
|
||||
MyMenu.construct()
|
||||
|
||||
//MyMenu.showsub("top3")
|
||||
MyMenu.hidesub()
|
232
hrmsWeb/hrms/includes/calendar-blue.css
Normal file
@@ -0,0 +1,232 @@
|
||||
/* The main calendar widget. DIV containing a table. */
|
||||
|
||||
div.calendar { position: relative; width:120; }
|
||||
|
||||
.calendar, .calendar table {
|
||||
border: 1px solid #556;
|
||||
font-size: 11px;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
background: #eef;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
}
|
||||
|
||||
/* Header part -- contains navigation buttons and day names. */
|
||||
|
||||
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
|
||||
text-align: center; /* They are the navigation buttons */
|
||||
padding: 2px; /* Make the buttons seem like they're pressing */
|
||||
}
|
||||
|
||||
.calendar .nav {
|
||||
background: #778 url(menuarrow.gif) no-repeat 100% 100%;
|
||||
}
|
||||
|
||||
.calendar thead .title { /* This holds the current "month, year" */
|
||||
font-weight: bold; /* Pressing it will take you to the current date */
|
||||
text-align: center;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
|
||||
background: #778;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar thead .daynames { /* Row <TR> containing the day names */
|
||||
background: #bdf;
|
||||
}
|
||||
|
||||
.calendar thead .name { /* Cells <TD> containing the day names */
|
||||
border-bottom: 1px solid #556;
|
||||
padding: 2px;
|
||||
text-align: center;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.calendar thead .weekend { /* How a weekend day name shows in header */
|
||||
color: #a66;
|
||||
}
|
||||
|
||||
.calendar thead .hilite { /* How do the buttons in header appear when hover */
|
||||
background-color: #aaf;
|
||||
color: #000;
|
||||
border: 1px solid #04f;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar thead .active { /* Active (pressed) buttons in header */
|
||||
background-color: #77c;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
/* The body part -- contains all the days in month. */
|
||||
|
||||
.calendar tbody .day { /* Cells <TD> containing month days dates */
|
||||
width: 2em;
|
||||
color: #456;
|
||||
text-align: right;
|
||||
padding: 2px 4px 2px 2px;
|
||||
}
|
||||
.calendar tbody .day.othermonth {
|
||||
font-size: 80%;
|
||||
color: #bbb;
|
||||
}
|
||||
.calendar tbody .day.othermonth.oweekend {
|
||||
color: #fbb;
|
||||
}
|
||||
|
||||
.calendar table .wn {
|
||||
padding: 2px 3px 2px 2px;
|
||||
border-right: 1px solid #000;
|
||||
background: #bdf;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td {
|
||||
background: #def;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td.wn {
|
||||
background: #eef;
|
||||
}
|
||||
|
||||
.calendar tbody td.hilite { /* Hovered cells <TD> */
|
||||
background: #def;
|
||||
padding: 1px 3px 1px 1px;
|
||||
border: 1px solid #bbb;
|
||||
}
|
||||
|
||||
.calendar tbody td.active { /* Active (pressed) cells <TD> */
|
||||
background: #cde;
|
||||
padding: 2px 2px 0px 2px;
|
||||
}
|
||||
|
||||
.calendar tbody td.selected { /* Cell showing today date */
|
||||
font-weight: bold;
|
||||
border: 1px solid #000;
|
||||
padding: 1px 3px 1px 1px;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.calendar tbody td.weekend { /* Cells showing weekend days */
|
||||
color: #a66;
|
||||
}
|
||||
|
||||
.calendar tbody td.today { /* Cell showing selected date */
|
||||
font-weight: bold;
|
||||
color: #00f;
|
||||
}
|
||||
|
||||
.calendar tbody .disabled { color: #999; }
|
||||
|
||||
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* The footer part -- status bar and "Close" button */
|
||||
|
||||
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
|
||||
text-align: center;
|
||||
background: #556;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
|
||||
background: #fff;
|
||||
color: #445;
|
||||
border-top: 1px solid #556;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar tfoot .hilite { /* Hover style for buttons in footer */
|
||||
background: #aaf;
|
||||
border: 1px solid #04f;
|
||||
color: #000;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
|
||||
background: #77c;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
/* Combo boxes (menus that display months/years for direct selection) */
|
||||
|
||||
.calendar .combo {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 4em;
|
||||
cursor: default;
|
||||
border: 1px solid #655;
|
||||
background: #def;
|
||||
color: #000;
|
||||
font-size: 90%;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.calendar .combo .label,
|
||||
.calendar .combo .label-IEfix {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar .combo .label-IEfix {
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
.calendar .combo .hilite {
|
||||
background: #acf;
|
||||
}
|
||||
|
||||
.calendar .combo .active {
|
||||
border-top: 1px solid #46a;
|
||||
border-bottom: 1px solid #46a;
|
||||
background: #eef;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time {
|
||||
border-top: 1px solid #000;
|
||||
padding: 1px 0px;
|
||||
text-align: center;
|
||||
background-color: #f4f0e8;
|
||||
}
|
||||
|
||||
.calendar td.time .hour,
|
||||
.calendar td.time .minute,
|
||||
.calendar td.time .ampm {
|
||||
padding: 0px 3px 0px 4px;
|
||||
border: 1px solid #889;
|
||||
font-weight: bold;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time .ampm {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar td.time .colon {
|
||||
padding: 0px 2px 0px 3px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time span.hilite {
|
||||
border-color: #000;
|
||||
background-color: #667;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time span.active {
|
||||
border-color: #f00;
|
||||
background-color: #000;
|
||||
color: #0f0;
|
||||
}
|
127
hrmsWeb/hrms/includes/calendar-en.js
Normal file
@@ -0,0 +1,127 @@
|
||||
// ** I18N
|
||||
|
||||
// Calendar EN language
|
||||
// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
|
||||
// Encoding: any
|
||||
// Distributed under the same terms as the calendar itself.
|
||||
|
||||
// For translators: please use UTF-8 if possible. We strongly believe that
|
||||
// Unicode is the answer to a real internationalized world. Also please
|
||||
// include your contact information in the header, as can be seen above.
|
||||
|
||||
// full day names
|
||||
Calendar._DN = new Array
|
||||
("Sunday",
|
||||
"Monday",
|
||||
"Tuesday",
|
||||
"Wednesday",
|
||||
"Thursday",
|
||||
"Friday",
|
||||
"Saturday",
|
||||
"Sunday");
|
||||
|
||||
// Please note that the following array of short day names (and the same goes
|
||||
// for short month names, _SMN) isn't absolutely necessary. We give it here
|
||||
// for exemplification on how one can customize the short day names, but if
|
||||
// they are simply the first N letters of the full name you can simply say:
|
||||
//
|
||||
// Calendar._SDN_len = N; // short day name length
|
||||
// Calendar._SMN_len = N; // short month name length
|
||||
//
|
||||
// If N = 3 then this is not needed either since we assume a value of 3 if not
|
||||
// present, to be compatible with translation files that were written before
|
||||
// this feature.
|
||||
|
||||
// short day names
|
||||
Calendar._SDN = new Array
|
||||
("Sun",
|
||||
"Mon",
|
||||
"Tue",
|
||||
"Wed",
|
||||
"Thu",
|
||||
"Fri",
|
||||
"Sat",
|
||||
"Sun");
|
||||
|
||||
// First day of the week. "0" means display Sunday first, "1" means display
|
||||
// Monday first, etc.
|
||||
Calendar._FD = 0;
|
||||
|
||||
// full month names
|
||||
Calendar._MN = new Array
|
||||
("January",
|
||||
"February",
|
||||
"March",
|
||||
"April",
|
||||
"May",
|
||||
"June",
|
||||
"July",
|
||||
"August",
|
||||
"September",
|
||||
"October",
|
||||
"November",
|
||||
"December");
|
||||
|
||||
// short month names
|
||||
Calendar._SMN = new Array
|
||||
("Jan",
|
||||
"Feb",
|
||||
"Mar",
|
||||
"Apr",
|
||||
"May",
|
||||
"Jun",
|
||||
"Jul",
|
||||
"Aug",
|
||||
"Sep",
|
||||
"Oct",
|
||||
"Nov",
|
||||
"Dec");
|
||||
|
||||
// tooltips
|
||||
Calendar._TT = {};
|
||||
Calendar._TT["INFO"] = "About the calendar";
|
||||
|
||||
Calendar._TT["ABOUT"] =
|
||||
"DHTML Date/Time Selector\n" +
|
||||
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
|
||||
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
|
||||
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
|
||||
"\n\n" +
|
||||
"Date selection:\n" +
|
||||
"- Use the \xab, \xbb buttons to select year\n" +
|
||||
"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" +
|
||||
"- Hold mouse button on any of the above buttons for faster selection.";
|
||||
Calendar._TT["ABOUT_TIME"] = "\n\n" +
|
||||
"Time selection:\n" +
|
||||
"- Click on any of the time parts to increase it\n" +
|
||||
"- or Shift-click to decrease it\n" +
|
||||
"- or click and drag for faster selection.";
|
||||
|
||||
Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)";
|
||||
Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)";
|
||||
Calendar._TT["GO_TODAY"] = "Go Today";
|
||||
Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)";
|
||||
Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)";
|
||||
Calendar._TT["SEL_DATE"] = "Select date";
|
||||
Calendar._TT["DRAG_TO_MOVE"] = "Drag to move";
|
||||
Calendar._TT["PART_TODAY"] = " (today)";
|
||||
|
||||
// the following is to inform that "%s" is to be the first day of week
|
||||
// %s will be replaced with the day name.
|
||||
Calendar._TT["DAY_FIRST"] = "Display %s first";
|
||||
|
||||
// This may be locale-dependent. It specifies the week-end days, as an array
|
||||
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
|
||||
// means Monday, etc.
|
||||
Calendar._TT["WEEKEND"] = "0,6";
|
||||
|
||||
Calendar._TT["CLOSE"] = "Close";
|
||||
Calendar._TT["TODAY"] = "Today";
|
||||
Calendar._TT["TIME_PART"] = "(Shift-)Click or drag to change value";
|
||||
|
||||
// date formats
|
||||
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
|
||||
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
|
||||
|
||||
Calendar._TT["WK"] = "wk";
|
||||
Calendar._TT["TIME"] = "Time:";
|
225
hrmsWeb/hrms/includes/calendar-setup.js
Normal file
@@ -0,0 +1,225 @@
|
||||
/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/
|
||||
* ---------------------------------------------------------------------------
|
||||
*
|
||||
* The DHTML Calendar
|
||||
*
|
||||
* Details and latest version at:
|
||||
* http://dynarch.com/mishoo/calendar.epl
|
||||
*
|
||||
* This script is distributed under the GNU Lesser General Public License.
|
||||
* Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* This file defines helper functions for setting up the calendar. They are
|
||||
* intended to help non-programmers get a working calendar on their site
|
||||
* quickly. This script should not be seen as part of the calendar. It just
|
||||
* shows you what one can do with the calendar, while in the same time
|
||||
* providing a quick and simple method for setting it up. If you need
|
||||
* exhaustive customization of the calendar creation process feel free to
|
||||
* modify this code to suit your needs (this is recommended and much better
|
||||
* than modifying calendar.js itself).
|
||||
*/
|
||||
|
||||
// $Id: calendar-setup.js,v 1.25 2005/03/07 09:51:33 mishoo Exp $
|
||||
|
||||
/**
|
||||
* This function "patches" an input field (or other element) to use a calendar
|
||||
* widget for date selection.
|
||||
*
|
||||
* The "params" is a single object that can have the following properties:
|
||||
*
|
||||
* prop. name | description
|
||||
* -------------------------------------------------------------------------------------------------
|
||||
* inputField | the ID of an input field to store the date
|
||||
* displayArea | the ID of a DIV or other element to show the date
|
||||
* button | ID of a button or other element that will trigger the calendar
|
||||
* eventName | event that will trigger the calendar, without the "on" prefix (default: "click")
|
||||
* ifFormat | date format that will be stored in the input field
|
||||
* daFormat | the date format that will be used to display the date in displayArea
|
||||
* singleClick | (true/false) wether the calendar is in single click mode or not (default: true)
|
||||
* firstDay | numeric: 0 to 6. "0" means display Sunday first, "1" means display Monday first, etc.
|
||||
* align | alignment (default: "Br"); if you don't know what's this see the calendar documentation
|
||||
* range | array with 2 elements. Default: [1900, 2999] -- the range of years available
|
||||
* weekNumbers | (true/false) if it's true (default) the calendar will display week numbers
|
||||
* flat | null or element ID; if not null the calendar will be a flat calendar having the parent with the given ID
|
||||
* flatCallback | function that receives a JS Date object and returns an URL to point the browser to (for flat calendar)
|
||||
* disableFunc | function that receives a JS Date object and should return true if that date has to be disabled in the calendar
|
||||
* onSelect | function that gets called when a date is selected. You don't _have_ to supply this (the default is generally okay)
|
||||
* onClose | function that gets called when the calendar is closed. [default]
|
||||
* onUpdate | function that gets called after the date is updated in the input field. Receives a reference to the calendar.
|
||||
* date | the date that the calendar will be initially displayed to
|
||||
* showsTime | default: false; if true the calendar will include a time selector
|
||||
* timeFormat | the time format; can be "12" or "24", default is "12"
|
||||
* electric | if true (default) then given fields/date areas are updated for each move; otherwise they're updated only on close
|
||||
* step | configures the step of the years in drop-down boxes; default: 2
|
||||
* position | configures the calendar absolute position; default: null
|
||||
* cache | if "true" (but default: "false") it will reuse the same calendar object, where possible
|
||||
* showOthers | if "true" (but default: "false") it will show days from other months too
|
||||
*
|
||||
* None of them is required, they all have default values. However, if you
|
||||
* pass none of "inputField", "displayArea" or "button" you'll get a warning
|
||||
* saying "nothing to setup".
|
||||
*/
|
||||
Calendar.setup = function (params) {
|
||||
function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } };
|
||||
|
||||
param_default("inputField", null);
|
||||
param_default("displayArea", null);
|
||||
param_default("button", null);
|
||||
param_default("eventName", "click");
|
||||
param_default("ifFormat", "%Y/%m/%d");
|
||||
param_default("daFormat", "%Y/%m/%d");
|
||||
param_default("singleClick", true);
|
||||
param_default("disableFunc", null);
|
||||
param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined
|
||||
param_default("dateText", null);
|
||||
param_default("firstDay", null);
|
||||
param_default("align", "Br");
|
||||
param_default("range", [1900, 2999]);
|
||||
param_default("weekNumbers", true);
|
||||
param_default("flat", null);
|
||||
param_default("flatCallback", null);
|
||||
param_default("onSelect", null);
|
||||
param_default("onClose", null);
|
||||
param_default("onUpdate", null);
|
||||
param_default("date", null);
|
||||
param_default("showsTime", false);
|
||||
param_default("timeFormat", "24");
|
||||
param_default("electric", true);
|
||||
param_default("step", 2);
|
||||
param_default("position", null);
|
||||
param_default("cache", false);
|
||||
param_default("showOthers", false);
|
||||
param_default("multiple", null);
|
||||
|
||||
var tmp = ["inputField", "displayArea", "button", "position" ];
|
||||
for (var i in tmp) {
|
||||
if (typeof params[tmp[i]] == "string") {
|
||||
iIndex=params[tmp[3]];
|
||||
if(iIndex != "-1" )
|
||||
{
|
||||
params[tmp[i]] = document.getElementsByName(params[tmp[i]])[iIndex];
|
||||
}
|
||||
else
|
||||
{
|
||||
params[tmp[i]] = document.getElementsByName(params[tmp[i]])[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) {
|
||||
alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");
|
||||
return false;
|
||||
}
|
||||
|
||||
function onSelect(cal) {
|
||||
|
||||
var p = cal.params;
|
||||
|
||||
//Added by Amitava
|
||||
var oldDate=p.inputField.value;
|
||||
//Added by Amitava
|
||||
|
||||
var update = (cal.dateClicked || p.electric);
|
||||
if (update && p.inputField) {
|
||||
p.inputField.value = cal.date.print(p.ifFormat);
|
||||
if (typeof p.inputField.onchange == "function")
|
||||
p.inputField.onchange();
|
||||
}
|
||||
if (update && p.displayArea)
|
||||
p.displayArea.innerHTML = cal.date.print(p.daFormat);
|
||||
if (update && typeof p.onUpdate == "function")
|
||||
p.onUpdate(cal);
|
||||
if (update && p.flat) {
|
||||
if (typeof p.flatCallback == "function")
|
||||
p.flatCallback(cal);
|
||||
}
|
||||
if (update && p.singleClick && cal.dateClicked){
|
||||
//Added by Amitava
|
||||
if(window.doOnChangeCalendar)
|
||||
{
|
||||
if(oldDate!=cal.date.print(p.ifFormat))
|
||||
{
|
||||
window.doOnChangeCalendar(p.button.name);
|
||||
}
|
||||
}
|
||||
//Added by Amitava
|
||||
cal.callCloseHandler();
|
||||
}
|
||||
};
|
||||
|
||||
if (params.flat != null) {
|
||||
if (typeof params.flat == "string")
|
||||
params.flat = document.getElementsByName(params.flat)[0];
|
||||
if (!params.flat) {
|
||||
alert("Calendar.setup:\n Flat specified but can't find parent.");
|
||||
return false;
|
||||
}
|
||||
var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect);
|
||||
cal.showsOtherMonths = params.showOthers;
|
||||
cal.showsTime = params.showsTime;
|
||||
cal.time24 = (params.timeFormat == "24");
|
||||
cal.params = params;
|
||||
cal.weekNumbers = params.weekNumbers;
|
||||
cal.setRange(params.range[0], params.range[1]);
|
||||
cal.setDateStatusHandler(params.dateStatusFunc);
|
||||
cal.getDateText = params.dateText;
|
||||
if (params.ifFormat) {
|
||||
cal.setDateFormat(params.ifFormat);
|
||||
}
|
||||
if (params.inputField && typeof params.inputField.value == "string") {
|
||||
cal.parseDate(params.inputField.value);
|
||||
}
|
||||
cal.create(params.flat);
|
||||
cal.show();
|
||||
return false;
|
||||
}
|
||||
|
||||
var triggerEl = params.button || params.displayArea || params.inputField;
|
||||
triggerEl["on" + params.eventName] = function() {
|
||||
var dateEl = params.inputField || params.displayArea;
|
||||
var dateFmt = params.inputField ? params.ifFormat : params.daFormat;
|
||||
var mustCreate = false;
|
||||
var cal = window.calendar;
|
||||
if (dateEl)
|
||||
params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt);
|
||||
if (!(cal && params.cache)) {
|
||||
window.calendar = cal = new Calendar(params.firstDay,
|
||||
params.date,
|
||||
params.onSelect || onSelect,
|
||||
params.onClose || function(cal) { cal.hide(); });
|
||||
cal.showsTime = params.showsTime;
|
||||
cal.time24 = (params.timeFormat == "24");
|
||||
cal.weekNumbers = params.weekNumbers;
|
||||
mustCreate = true;
|
||||
} else {
|
||||
if (params.date)
|
||||
cal.setDate(params.date);
|
||||
cal.hide();
|
||||
}
|
||||
if (params.multiple) {
|
||||
cal.multiple = {};
|
||||
for (var i = params.multiple.length; --i >= 0;) {
|
||||
var d = params.multiple[i];
|
||||
var ds = d.print("%Y%m%d");
|
||||
cal.multiple[ds] = d;
|
||||
}
|
||||
}
|
||||
cal.showsOtherMonths = params.showOthers;
|
||||
cal.yearStep = params.step;
|
||||
cal.setRange(params.range[0], params.range[1]);
|
||||
cal.params = params;
|
||||
cal.setDateStatusHandler(params.dateStatusFunc);
|
||||
cal.getDateText = params.dateText;
|
||||
cal.setDateFormat(dateFmt);
|
||||
if (mustCreate)
|
||||
cal.create();
|
||||
cal.refresh();
|
||||
if (!params.position)
|
||||
cal.showAtElement(params.button || params.displayArea || params.inputField, params.align);
|
||||
else
|
||||
cal.showAt(params.position[0], params.position[1]);
|
||||
return false;
|
||||
};
|
||||
|
||||
return cal;
|
||||
};
|
||||
|
1808
hrmsWeb/hrms/includes/calendar.js
Normal file
BIN
hrmsWeb/hrms/includes/images/Balesh_Photo.jpg
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
hrmsWeb/hrms/includes/images/Brand.jpg
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
hrmsWeb/hrms/includes/images/Brand_Final.gif
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
hrmsWeb/hrms/includes/images/Brand_Final_10.gif
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
hrmsWeb/hrms/includes/images/Brand_Final_7.gif
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
hrmsWeb/hrms/includes/images/Brand_Final_TCS.gif
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
hrmsWeb/hrms/includes/images/Brand_Final_peerless.gif
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
hrmsWeb/hrms/includes/images/LaunchPad.jpg
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
hrmsWeb/hrms/includes/images/LaunchPad1.jpg
Normal file
After Width: | Height: | Size: 87 KiB |
BIN
hrmsWeb/hrms/includes/images/Launchpad_second.bmp
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
hrmsWeb/hrms/includes/images/Launchpad_third.bmp
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
hrmsWeb/hrms/includes/images/Login.jpg
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
hrmsWeb/hrms/includes/images/Navigator.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
hrmsWeb/hrms/includes/images/Thumbs.db
Normal file
BIN
hrmsWeb/hrms/includes/images/alert.jpg
Normal file
After Width: | Height: | Size: 817 B |
BIN
hrmsWeb/hrms/includes/images/blueline.GIF
Normal file
After Width: | Height: | Size: 846 B |
BIN
hrmsWeb/hrms/includes/images/bullet.gif
Normal file
After Width: | Height: | Size: 834 B |
BIN
hrmsWeb/hrms/includes/images/butn_AssetManagement.jpg
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_AssetManagement_act.jpg
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_BillingAndCollection.jpg
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_BillingAndCollection_act.jpg
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_BillingAndCollection_dis.jpg
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_ExitLaunchPad.jpg
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_GeneralLedger.jpg
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_GeneralLedger_act.jpg
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_GeneralLedger_dis.jpg
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_HumanResourceManagement.jpg
Normal file
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 5.9 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_InventoryAccounting.jpg
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_InventoryAccounting_act.jpg
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_InventoryAccounting_dis.jpg
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_InventoryManagement.jpg
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_InventoryManagement_act.jpg
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_InventoryManagement_dis.jpg
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_OperationAndMaintainance.jpg
Normal file
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 5.7 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_OperationAndManagement.jpg
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_PayrollAccounting.jpg
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_PayrollAccounting_act.jpg
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_PayrollAccounting_dis.jpg
Normal file
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 2.8 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_PurchaseManagement.jpg
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_PurchaseManagement_act.jpg
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_PurchaseManagement_dis.jpg
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_SystemAdministration.jpg
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_SystemAdministration_act.jpg
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_SystemAdministration_dis.jpg
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_dtl_next.jpg
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_dtl_next_act.jpg
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_dtl_next_dis.jpg
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_dtl_prev.jpg
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_dtl_prev_act.jpg
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_dtl_prev_dis.jpg
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_first.jpg
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_first_act.jpg
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_first_dis.jpg
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_last.jpg
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_last_act.jpg
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_last_dis.jpg
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_lov.gif
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_next.jpg
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_next_act.jpg
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_next_dis.jpg
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_prev.jpg
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_prev_act.jpg
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
hrmsWeb/hrms/includes/images/butn_prev_dis.jpg
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
hrmsWeb/hrms/includes/images/cal.gif
Normal file
After Width: | Height: | Size: 127 B |
BIN
hrmsWeb/hrms/includes/images/cal_act.gif
Normal file
After Width: | Height: | Size: 127 B |
BIN
hrmsWeb/hrms/includes/images/cal_dis.gif
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
hrmsWeb/hrms/includes/images/cross.jpg
Normal file
After Width: | Height: | Size: 883 B |
BIN
hrmsWeb/hrms/includes/images/delete.jpg
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
hrmsWeb/hrms/includes/images/delete_act.jpg
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
hrmsWeb/hrms/includes/images/delete_dis.jpg
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
hrmsWeb/hrms/includes/images/enrgise.jpg
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
hrmsWeb/hrms/includes/images/execute.jpg
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
hrmsWeb/hrms/includes/images/execute_act.jpg
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
hrmsWeb/hrms/includes/images/execute_dis.jpg
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
hrmsWeb/hrms/includes/images/execute_undo.jpg
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
hrmsWeb/hrms/includes/images/execute_undo_act.jpg
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
hrmsWeb/hrms/includes/images/execute_undo_dis.jpg
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
hrmsWeb/hrms/includes/images/exit.jpg
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
hrmsWeb/hrms/includes/images/exit_act.jpg
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
hrmsWeb/hrms/includes/images/formtab_b.gif
Normal file
After Width: | Height: | Size: 89 B |
BIN
hrmsWeb/hrms/includes/images/formtab_b_dis.gif
Normal file
After Width: | Height: | Size: 244 B |
BIN
hrmsWeb/hrms/includes/images/formtab_lb.gif
Normal file
After Width: | Height: | Size: 84 B |
BIN
hrmsWeb/hrms/includes/images/formtab_lb_dis.gif
Normal file
After Width: | Height: | Size: 244 B |
BIN
hrmsWeb/hrms/includes/images/formtab_r.gif
Normal file
After Width: | Height: | Size: 89 B |
BIN
hrmsWeb/hrms/includes/images/formtab_r_dis.gif
Normal file
After Width: | Height: | Size: 244 B |