//  Scriptlets code written by Jeremy Edmiston
//  The functions have been adapted from various sources
//  and re-written to provide maximum flexibility
//  and compatability with various browsers.

//Global Declarations
var ie = (document.all) ? true : false;

function toggleClass(objClass){
//  This function will toggle obj visibility of an Element
//  based on Element's Class
//  Works with IE and Mozilla based browsers

  if (getElementByClass(objClass).style.display=="none"){
    showClass(objClass)
  }else{
    hideClass(objClass)
  }
}

function hideClass(objClass){
//  This function will hide Elements by object Class
//  Works with IE and Mozilla based browsers

var elements = (ie) ? document.all : document.getElementsByTagName('*');
  for (i=0; i<elements.length; i++){
    if (elements[i].className==objClass){
      elements[i].style.display="none"
    }
  }
}

function showClass(objClass){
//  This function will show Elements by object Class
//  Works with IE and Mozilla based browsers
var elements = (ie) ? document.all : document.getElementsByTagName('*');
  for (i=0; i<elements.length; i++){
    if (elements[i].className==objClass){
      elements[i].style.display="block"
    }
  }
}

function toggleID(objID){
//  This function will toggle obj visibility of an Element
//  based on Element's ID
//  Works with IE and Mozilla based browsers
var element = (ie) ? document.all(objID) : document.getElementById(objID);
  if (element.style.display=="none"){
    showID(objID)
  }else{
    hideID(objID)
  }
}

function hideID(objID){
//  This function will hide Elements by object ID
//  Works with IE and Mozilla based browsers
var element = (ie) ? document.all(objID) : document.getElementById(objID);
  element.style.display="none"
}

function showID(objID){
//  This function will show Elements by object ID
//  Works with IE and Mozilla based browsers
var element = (ie) ? document.all(objID) : document.getElementById(objID);
  element.style.display="block"
}

function getElementByClass(objClass){
//  This function is similar to 'getElementByID' since there
//  is no inherent function to get an element by it's class
//  Works with IE and Mozilla based browsers
var elements = (ie) ? document.all : document.getElementsByTagName('*');
  for (i=0; i<elements.length; i++){
    //alert(elements[i].className)
    //alert(objClass)
    if (elements[i].className==objClass){
    return elements[i]
    }
  }
}

var newWindow;
function photoalbum_archives() 
{
newWindow = window.open('../html/photoalbum_archives.html',"photoalbum_archives","toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,scrollbars=yes,width=275,height=220,top=110,left=72");
	if (newWindow.focus)
	{
		newWindow.focus();
	}
}

function disclaimer(goHere){
  message  = "This link will take you to a web site that is external and located on other servers. Bank of Gravett has no responsibility for any external web site. It neither endorses the information, content, presentation, or accuracy nor makes any warranty, express or implied, regarding any external site. The privacy and security practices of any external site may differ from those practiced by Bank of Gravett. The user should review the privacy policy of any site before providing information.";
  
  if (confirm(message)){
	window.open(goHere, '_blank');
	}
}

function emaildisclaimer(goHere){
  message  = "You have requested to send general comments, questions, or suggestions via this unsecured e-mail.  However, we cannot address account-related or personal information through an unsecure e-mail.\n\nFor your protection, please do not send any personal information (i.e., Social Security Number, account number, date of birth, etc.).  If you have an issue regarding your Bank of Gravett account, or an account application or inquiry, please contact a Bank of Gravett representative who will assist you. Use our contact form, call 479.787.5251, or stop by one of our convenient locations.";

  if (confirm(message)){
	window.open(goHere, '_blank');
	}
}

function contactdisclaimer()
{
  alert('You have requested to send general comments, questions, or suggestions via the Bank of Gravett contact form.  However, we cannot address account-related or personal information through an unsecure e-mail.\n\nFor your protection, please do not send any personal information (i.e., Social Security Number, account number, date of birth, etc.).  If you have an issue regarding your Bank of Gravett account, or an account application or inquiry, please contact a Bank of Gravett representative who will assist you. Call 479.787.5251, or stop by one of our convenient locations.');
}

function downloaddisclaimer()
{
  alert('You are requesting access to documents to be completed and returned to Bank of Gravett. These completed documents should be mailed to us directly at Bank of Gravett, PO Box 149, Gravette, AR 72736; or faxed back to 479.787.6102; or delivered in person to one of our convenient locations.\n\nFor your protection, do not attempt to return any of these forms through electronic means[i.e. email]\n\nWe appreciate your interest in our bank and look forward to serving you.');
}