﻿function confirm_delete()
{
  if (confirm("Are you sure you want to delete this address?")==true)
    return true;
  else
    return false;
}

function confirm_deleteAll(msg)
{
  if (confirm(msg)==true)
    return true;
  else
    return false;
}

function selectAll() 
{
    var inputElements = document.getElementsByTagName('input');

    for (var i = 0; i < inputElements.length; i++) {
        var myElement = inputElements[i];

        // Filter through the input types looking for checkboxes
        if (myElement.type == "checkbox") {

            // Use the involker (our calling element) as the reference 
            //  for our checkbox status
            myElement.checked = true;
        }
    }
}

function selectNone() 
{
    var inputElements = document.getElementsByTagName('input');

    for (var i = 0; i < inputElements.length; i++) {
        var myElement = inputElements[i];

        // Filter through the input types looking for checkboxes
        if (myElement.type == "checkbox") {

            // Use the involker (our calling element) as the reference 
            //  for our checkbox status
            myElement.checked = false;
        }
    }
}

function clickButton(e, buttonid)
{
   var bt = document.getElementById(buttonid);
   if (typeof bt == 'object')
   {
        if(navigator.appName.indexOf("Netscape")>(-1))
        {
             if (e.keyCode == 13)
             {
                  bt.click();
                  return false;
             }
        }
        if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
        {
             if (event.keyCode == 13)
             {
                  bt.click();
                  return false;
             }
        }
   }
}

function clickOnce(btn, msg) 
{
    // Test if we are doing a validation
    if (typeof (Page_ClientValidate) == 'function') 
    {
        // if we are doing a validation, return if it's false
        if (Page_ClientValidate() == false) 
        {
            return false;
        }
    }

    // Ensure that the button is not of type "submit"
    if (btn.getAttribute('type') == 'button') 
    {
        // The msg attibute is absolutely optional
        // msg will be the text of the button while it's disabled
        if (!msg || (msg == 'undefined')) 
        {
            msg = 'Loading...';
        }

        btn.value = msg;

        // The magic :D
        btn.disabled = true;
    }

    return true;
}
        
function start() 
{ 
  CycleBanner1(); 
  CycleBanner2(); 
  CycleBanner3();
}

