    function getCurrentDateTime() {
        var today_date = new Date()
        var year = today_date.getFullYear()
        var month = today_date.getMonth()+1
        var day = today_date.getDate()
        var hours = today_date.getHours();
        var minutes = today_date.getMinutes();
        if (month < 10) {
            month = "0" + month;
        }
        if (day < 10) {
            day = "0" + day;
        }
        if( hours < 10 ) {
            hours = "0" + hours;
        }
        if( minutes < 10 ) {
            minutes = "0" + minutes;
        }

        return month + "/" + day + "/" + year + " " + hours + ":" + minutes;
    }

    function remove(element) {
        element.parentNode.removeChild(element);
    }

    function removeElement( elementId ) {
        remove(document.getElementById(elementId));
    }

    function insert(parent, element) {
        element.appendChild(element);
    }

    var IS_CHECKED = false;

    function selectAll( inputName, inputName2 ) {
        var isChecked = IS_CHECKED;
        var elements = document.getElementsByName( inputName );
        if( elements ) {
            for( i = 0; i < elements.length; i++ ) {
                elements[i].checked = !isChecked;
            }
        }
        if( inputName2 ) {
            elements = document.getElementsByName( inputName2 );
            if( elements ) {
                for( i = 0; i < elements.length; i++ ) {
                    elements[i].checked = !isChecked;
                }
            }
        }
        IS_CHECKED = !isChecked;
    }

    function showHelp(contextPath, helpPage) {
    	
    	var path = "/" + contextPath +  "/help/" + helpPage;
    	/***
    	if(IsAdmin(contextPath)){
    		path = "help/hh_start.htm";
    	}else{
    		path = "/"+contextPath +"/help/hh_start.htm";
	}
	***/
        var vWinCal = window.open(path,
                                  "help",
                                  "width=750,height=500,resizable=1,scrollbars=1,status=0,toolbar=0,location=0,menubar=0,screenX=5,screenY=5,left=20,top=20" );
    	vWinCal.focus();
    }
    
// this gets the cookie when called
    function GetCookie (name) {
        var arg = name + "=";
        var alen = arg.length;
        var clen = document.cookie.length;
        var i = 0;
        while (i < clen) {
            var j = i + alen;
            if (document.cookie.substring(i, j) == arg)
                return getCookieVal (j);
            i = document.cookie.indexOf(" ", i) + 1;
            if (i == 0) break;
        }
        return null;
    }

    function getCookieVal(offset) {
        var endstr = document.cookie.indexOf (";", offset);
        if (endstr == -1)
            endstr = document.cookie.length;
        return unescape(document.cookie.substring(offset, endstr));
    }
    
// this deletes the cookie when called
   function DeleteCookie (name,path,domain) {
	        var exp = new Date();
	        exp.setTime (exp.getTime() - 1);
	        document.cookie = name + '=; expires=' + exp.toGMTString() + '; path=' + path + '; domain=' + domain;
   }
    
   function showPsynch(){
        DeleteCookie('SMSESSION','/','.transentric.com');
        DeleteCookie('JSESSIONID','/','.transentric.com');
        window.location.href="/ors";
        var cval = GetCookie (name);
    	var path = 'https://psy.www.transentric.com';
        var vWinCal = window.open(path,
                                  "help",
                                  "width=750,height=500,resizable=1,scrollbars=1,status=0,toolbar=0,location=0,menubar=0,screenX=5,screenY=5,left=20,top=20" );
    	vWinCal.focus();
    }
    
    function IsAdmin(aTextField) {
	   if (aTextField =='admin') {
	      return true;
	   }
	   else { return false; }
}	
    
    function showContract(url) {   	
        var vWinCal = window.open(url );
    	vWinCal.focus();
    }
    
    function openCFReports(url) {
    window.open(url, "reportWin");
	}