/*
Scripts Include

This file is to be used for custom javascripts throughout the site.
*/



/*
Leaving Site popup alert script Copyright 2008 Mike McBrien
Simply add a class of .external to an element to apply the script to the link.
*/	

window.addEvent('domready', function(){


$$('.external a').each(function(el){
	el.addEvent('click', function(e){
		new Event(e).stop();
		alert('By accessing this website link you will be viewing a website hosted and maintained by another party. Citizens National Bank does not control the content or policies of any external website that is linked through this browser. Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of Citizens National Bank. We encourage you to read and evaluate the privacy and security policies on the site you are viewing, which may be different than those of this financial institution. Click OK to continue to this link.');
		window.open(this.href);
					return false;
	});
});
 
});


/*
Leaving Site popup alert script Copyright 2008 Mike McBrien
Simply add a class of .external to an element to apply the script to the link.


window.addEvent('domready', function(){


var list = $$('a');
list.each(function(element) {


 
	var fx = new Fx.Styles(element, {duration:200, wait:false});
 
	element.addEvent('mouseenter', function(){
		fx.start({
			'margin-left': 10,
			'color': '#060'
		});
	});
 
	element.addEvent('mouseleave', function(){

		fx.start({
			'margin-left': 0,
			'color': '#036'
		});
	});
 
});

});
*/	
window.addEvent('load', function(){


$$('#idList li a').each(function(el){
	new Element('div', {
		'class': 'bgTrans'
	}).injectBefore(el).setStyle('opacity',0);
	var textFx = new Fx.Styles(el, {duration:1200, wait:false}); 
	var bgFx = new Fx.Style(el.getPrevious(), 'opacity', {duration:200, wait:false});
	el.addEvent('mouseenter', function(){
		textFx.start({
			'color': '#009'
		 })
		bgFx.start(0,.8);
	});
	el.addEvent('mouseleave', function(){
		textFx.start({
			'color': '#003e74'
		 })
		bgFx.start(.8,0);
	});
});

});

window.addEvent('domready', function(){
									 						 
	
new CNETcarousel($('simpleCarousel'), {
				   slideInterval: 5000,
				   transitionDuration: 500,
				   rotateAction: 'click' /*lets make the user click to jump*/
				   });
//the default slideInterval is 4 seconds, 
//let's make this example go a little faster

});
