// JavaScript Document
	var a = 0;
	var timeout;
	//store some images in an array
	var homePageShowArray = ["images/bg/bg.jpg",
							 "images/bg/bg3.jpg",
							 "images/bg/bg5.jpg",
							 "images/bg/bg2.jpg",
							 "images/bg/bg4.jpg"
							 ];
	
	//background image loading functions, loads first image on page load
	$(document).ready(function() {		
		/*if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
			 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
			 //if (ieversion>=9)
			 	homePageShow();
		}
		else
		{*/
			homePageShow();
		//}
		
	$('#changebg').click( function() {
		 $('#background').npFullBgImg(homePageShowArray[a], {fadeInSpeed: 1000, center: true, callback:function(){startGalleryTimer()}});
		 a++;
		 if(a == homePageShowArray.length) a=0;
		 });
	});
	
	function homePageShow() {
		 $('#background').npFullBgImg(homePageShowArray[a], {fadeInSpeed: 1000, center: true, callback:function(){startGalleryTimer()}});
		 a++;
		 if(a == homePageShowArray.length) a=0;
	}
	
	function startGalleryTimer() {
		clearTimeout(timeout);
		timeout = setTimeout("homePageShow()", 20000);
	}
