
	
/* ----------- MENU ----------- */

(function($){ 
		// Preload method for jQuery
		var cache = [];
		// Arguments are image paths relative to the current page.
		$.preLoadImages = function() {
			var args_len = arguments.length;
			for (var i = args_len; i--;) {
				var cacheImage = document.createElement('img');
				cacheImage.src = arguments[i];
				cache.push(cacheImage);
			}
		}
		$(function(){
			// subnav jQuery
			if ($('#Menu').length > 0){
				jQuery.preLoadImages('menu-bg.jpg', 'menu-bg-double.jpg', 'menu-bg-right.jpg', 'menu-bg-left.jpg', 'menu-tab.jpg');
				// First and last classes
				$('#Menu li:first').addClass('first');
				$('#Menu li a.top').mouseover(function(){
					$(this).parent().prev().addClass('previous-current');
					$(this).parent().next().addClass('next-current');
				});
				$('#Menu li a').mouseout(function(){
					$(this).parent().prev().removeClass('previous-current');
					$(this).parent().next().removeClass('next-current');
					$('#Menu li.current_page_item').prev().addClass('previous-current');
					$('#Menu li.current_page_item').next().addClass('next-current');
				});
				$('#Menu li.current_page_item').prev().addClass('previous-current');
				$('#Menu li.current_page_item').next().addClass('next-current');
			}
		});
	})(jQuery);


/* ----------- SLIDESHOW ----------- */


	$(document).ready(function(){$('.btn').after("<span class='btn_bck'></span>");
	
	$('#Slideshow').after("<span id='c'></span>");
	
	$('#c').stop().animate({opacity:"1"},{queue:true,duration:500}).animate({opacity:".5"},{queue:true,duration:1000});$('.btn_bck').animate({opacity:".5"},{queue:true,duration:0});
	
	$('.btn a').hover(function(){$('.btn_bck').stop().animate({opacity:".9"},{queue:false,duration:400});},function(){$('.btn_bck').stop().animate({opacity:".25"},{queue:false,duration:700});});
												 
	$('#c').hover(function(){$(this).stop().animate({opacity:"1"},{queue:false,duration:300});},function(){$(this).stop().animate({opacity:"1"},{queue:true,duration:800}).animate({opacity:".5"},{queue:false,duration:800});});
	
	$("#Slideshowul").click(function(){window.location=$(this).find("a").attr("href");return false;});	
	
	$('#Slideshow').cycle({fx:'fade',speed:800,timeout:10000,cleartype:1,pager:'#c',pause:true,pagerEvent:'click'});
	
	function onAfter(curr, next, opts) { var index = $(this).parent().children().index(this);$('#p')[index == 0 ? 'hide' : 'show']();$('#n')[index == opts.slideCount - 1 ? 'hide' : 'show'](); } 																																																																																																																																																																																																		   
	});
	
	
	
/* ----------- POP-UP MESSAGE ----------- */

function linkRef(yurl ){
var linkref = yurl;
if(confirm("Due to the fact that you are leaving Vinton County National Bank's website, please note the following:\n\n -The bank is not endorsing or guaranteeing the products, information, or recommendations provided by linked web sites.\n\n -The bank is not liable for any failure of products or services advertised on those web linked sites.\n\n -Each third-party website may have a privacy policy different than that of the bank.\n\n -The linked third-party web sites may provide less security than the bank's website.")){
window.location.href=linkref;
}
}


/* ----------- POP-UP WINDOW ----------- */


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


