﻿// JScript File

function OpenPane(paneIndex)
{
    var behavior = $get("eServicesCenter").AccordionBehavior;
    behavior.set_SelectedIndex(paneIndex);
}

function OnlyNumbers(i)
{
	if (i.value.length > 0) 
		i.value = i.value.replace(/[^\d./]+/g, '');
	if (i.value.length > 0)
		i.value = i.value.replace(i, '');
}

function ShowImageButtons(button, image, mouse_event)
{
    switch(mouse_event)
    {
        case 'over':
        button.src = image;
        break;
        case 'out':
        button.src = image;
        break;
    }
}

function trim(strTrim) 
{
    while (strTrim.substring(0,1) == ' ')
        {
        strTrim = strTrim.substring(1, strTrim.length);
        }   
    while (strTrim.substring(strTrim.length-1, strTrim.length) == ' ')
        {
        strTrim = strTrim.substring(0, strTrim.length-1);
        }
    return strTrim;
}

function showCalendar()
{
    if (document.layers)
    {
        showhide = (document.layers['divCalendar'].visibility == 'hide') ? 'show' : 'hide'
        document.layers['divCalendar'].visibility = showhide;
    }
    else if (document.all)
    {
        showhide = (document.all['divCalendar'].style.visibility == 'hidden') ? 'visible' : 'hidden';
        document.all['divCalendar'].style.visibility = showhide;
    }
    else if (document.getElementById)
    {
        showhide = (document.getElementById('divCalendar').style.visibility == 'hidden') ? 'visible' : 'hidden';
        document.getElementById('divCalendar').style.visibility = showhide;
    }
}

function breakout_of_frame()
{
  // see http://www.thesitewizard.com/archive/framebreak.shtml
  // for an explanation of this script and how to use it on your
  // own website
  if (top.location != location) {
    top.location.href = document.location.href ;
  }
}
