
/********************************************************************************
* Local Time script- © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
* Example of Use:
  <body  onload="goforit()">
  <span id="clock"></span>
**********************************************************************************/


   function FreezeScreen(msg) {
      scroll(0,0);
      var outerPane = document.getElementById('FreezePane');
      var innerPane = document.getElementById('InnerFreezePane');
      if (outerPane) outerPane.className = 'FreezePaneOn';
      if (innerPane) innerPane.innerHTML = msg;
   }



var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")

function getthedate()
{
    var mydate=new Date()
    var year=mydate.getYear()

    if (year < 1000)
        year+=1900

    var day=mydate.getDay()
    var month=mydate.getMonth()
    var daym=mydate.getDate()

    if (daym<10)
        daym="0"+daym

    var hours=mydate.getHours()
    var minutes=mydate.getMinutes()
    var seconds=mydate.getSeconds()
    var dn="AM"

    if (hours>=12)
        dn="PM"

    if (hours>12)
    {
        hours=hours-12
    }

    if (hours==0)
        hours=12
      
    if (minutes<=9)
        minutes="0"+minutes

    if (seconds<=9)
        seconds="0"+seconds

    //change font size here
    var cdate=dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn

    if (document.all)
    {
        document.all.clock.innerHTML=cdate
    }
    else if (document.getElementById)
    {
        document.getElementById("clock").innerHTML=cdate
    }
    else
    {
        document.write(cdate)
    }
}

if (!document.all&&!document.getElementById)
{
    getthedate()
}

function goforit()
{
    if (document.all||document.getElementById)
    {
        setInterval("getthedate()",1000)
    }
}


function ecmPopUpWindow(url, hWind, nWidth, nHeight, nScroll, nResize) {
 var popupwin,  cToolBar;
cToolBar = 'toolbar=0,location=0,directories=0,status=' + nResize + ',menubar=0,scrollbars=' + nScroll + ',resizable=' + nResize + ',width=' + nWidth + ',height=' + nHeight;
popupwin = window.open(url, hWind, cToolBar);
return popupwin;
}

/******************************************************************************
* Clear out the default text in a Textbox and add it back if the user
* clicked into the box then out of it but didn't type anything
*
*
* Example of use:
  <asp:TextBox ID="TextBox1" Text="Default Text" onclick="clickclear(this, 'Default Text')" onblur="clickrecall(this,'Default Text')"></asp:TextBox>
*******************************************************************************/
function clickclear(thisfield, defaulttext) 
{
    if (thisfield.value == defaulttext) 
    {
        thisfield.value = "";
    }
}

function clickrecall(thisfield, defaulttext) 
{
    if (thisfield.value == "") 
    {
        thisfield.value = defaulttext;
    }
}

/*******************************************
* 
* SHOW/HIDE DIV
* Example of Use: 
//  <a href="#" OnClick="toggleDiv('DivNotificationOptions')">Show/Hide the Div</a>
//  <div id="DivToShowOrHide" style="display: none;">stuff to show/hide</div>
********************************************/
function toggleDiv(divID) 
{
	if (document.getElementById(divID).style.display == 'none')
		document.getElementById(divID).style.display = 'block';
	else
		document.getElementById(divID).style.display = 'none';
}

function toggleTreeDiv(divID) 
{
    for(var i = 1; i < 52; i++)
    {
        if (document.getElementById("show" + i) != null && document.getElementById("show" + i) != document.getElementById(divID))
            document.getElementById("show" + i).style.display = 'none'
    } 
	if (document.getElementById(divID).style.display == 'none')
		document.getElementById(divID).style.display = 'block';
	else
		document.getElementById(divID).style.display = 'none';
}
