var undefined;


function LinkAlert(URL)
	{
	BANK_NAME = "BankORION";
	MSG =       "You are leaving "+BANK_NAME+"'s website and will be redirected to another site. ";
	MSG = MSG + ""+BANK_NAME+" makes no endorsements or claims about the accuracy or content of ";
	MSG = MSG + "the information contained in these sites.  The security and privacy policies on ";
	MSG = MSG + "these sites may be different than those of "+BANK_NAME+".";
	if (URL!=undefined) 
		{
		if (confirm(MSG)) window.open(URL,"_blank");
		}
	else return confirm(MSG);
	}

function EmailAlert()
	{
	MSG = "Messages sent to the above email address are not encrypted or transmitted in a secure format. Please do not include any confidential information in an email. Contact us by phone or mail with confidential information.";
	return confirm(MSG);
	}

function PDFAlert(URL)
	{
	MSG = "Messages sent to the email addresses in the Identity Theft Brochure are not encrypted or transmitted in a secure format.  Please do not include any confidential information to any email link in this brochure.  Contact us by phone or mail with confidential information.";
	if (URL!=undefined) 
		{
		if (confirm(MSG)) window.open(URL,"_blank");
		}
	else return confirm(MSG);
	}
	
var state = 1;

function animate_rewards(new_state) {
	state = (new_state==1) ? 2 : 1;
	document.getElementById("rewards").src = "images/reward-checking"+state.toString()+".jpg";
	setTimeout("animate_rewards("+state+");", 500);
	}


images = Array();
var fade_interval = 2;
var rotate_interval = 4000;

images.push(Array("images/ads/gift_card.gif","services.asp#gift_cards","_self")); // default image
images.push(Array("images/ads-home/BO-HiIntweb.jpg","http://www.bankorionrewards.com/","_blank"));
images.push(Array("images/ads-home/remote-deposit-sm.jpg","http://www.bankorion.com/save_fuel.asp","_self"));
//alert(images.length);

function init(pos) {
	pos++;
	if (pos==images.length) pos = 0;		
	//pos = Math.floor(Math.random()*images.length);
	//alert(pos);
	// crossfade(elementbyid, new image url, new alt text);
	obj_link = document.getElementById("animation_link");
	obj_link.href = images[pos][1];
	obj_link.target = images[pos][2];
	crossfade(document.getElementById('animation'), images[pos][0], fade_interval, null);
	next = window.setTimeout("init("+pos+");", rotate_interval);
	}
	
	
	
	
	

function SearchSite(URL)
	{
	myQuery = document.f.q.value;
	UpdateQuery = myQuery + " site:"+URL;
	document.f.q.value = UpdateQuery;
	}

function MM_preloadimages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadimages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

function Calculator(URL)
	  	{
		window.open('https://gateway.fundsxpress.com/calculators/'+URL,'myCalculator','width=590,height=450,scrollbars=yes,resizable=yes');
		}
	  //--></script>

function confirmAllLinks() {
  for(var i = 0; i < document.links.length; i++) {
    this_href = document.links[i].href;
	if (this_href.indexOf("http://www.accuweather.com/us/il/orion/61273/city-weather-forecast.asp?partner=accuweather&u=1&traveler=0")>0) {
		document.links[i].href = "javascript:LinkAlert('"+this_href+"');"
		//document.links[i].onclick = confirmLink;
		document.links[i].target = "_self";
	}
  }
}


window.onload = confirmAllLinks;