/********************************************************************/
/* Javascript file Danipa Business Systems Inc.                     */
/* Author: Patrick Aboagye                                          */
/* Date: August 9, 2007                                             */
/********************************************************************/

function show(object){
    document.getElementById(object.id).style.visibility = "visible"; 
    return false;
}

function hide(object){
    document.getElementById(object.id).style.visibility = "hidden"; 
}

function processingMessage(message){
    document.getElementById("processingMessage").firstChild.nodeValue = message;
}

function confirmDelete(message){
    return confirm(message);
}

function confirmCancel(){
    return confirm('Are you sure you want to cancel?');
}

function upper(object){
    document.getElementById(object.id).value = document.getElementById(object.id).value.toUpperCase();
}

// Pop Up Window
<!--
/****************************************************
     Author: Eric King
     Url: http://redrival.com/eak/index.shtml
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
    if(pos=="random"){
        LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
        TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
    }
    if(pos=="center"){
        LeftPosition=(screen.width)?(screen.width-w)/2:100;
        TopPosition=(screen.height)?(screen.height-h)/2:100;
    } else if((pos!="center" && pos!="random") || pos==null){
        LeftPosition=0;
        TopPosition=20
    }
    settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
    win=window.open(mypage,myname,settings);
}
// -->

// This is an override function from 
// http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/navmenu/htmlnavmenu/resource/HMenuIEHover.js?revision=427657&view=markup
startList = function() 
{
    if (document.all && document.getElementById) 
    {
        // original file used "hNav_outer", while this script uses "linkDummyForm"
        // as the navDivRoot
        if(document.getElementById("linkDummyForm")){
            navDivRoot = document.getElementById("linkDummyForm");
            navRoot = navDivRoot.childNodes[0];    
            for (i=0; i<navRoot.childNodes.length; i++) {
                node = navRoot.childNodes[i];
                if (node.nodeName=="LI") {
                    node.onmouseover=function() {
                        this.className+=" over";
                    }
                    node.onmouseout=function() {
                        this.className=this.className.replace(" over", "");
                    }
                }
            }
        }
    }
}
window.onload=startList;

clearInput = function(elem){
    if(elem.value && elem.defaultValue == elem.value){
        elem.value = new String();
    }
    elem.style.color = 'black';
}