// JavaScript Document for TaniaMarise


	<!--Image pre-loader-->
	(function () {

	// run init() when page loads
	if (window.addEventListener) {
		window.addEventListener('load', init, false);
	} else if (window.attachEvent) {
		window.attachEvent('onload', init);
	}
	
	function init() {
		// when page loads:
		
		var imageelements = document.getElementsByTagName('img');
		
		var classRegExp = /(^|\s)rollover(\s|$)/;
		
		for (var i=0; i < imageelements.length; i++) {
			
			if (classRegExp.test(imageelements[i].className)) {
				// add rollover events
				imageelements[i].onmouseover = function () {
					var s = this.src;
					var extension = s.substring(s.length-4);
					var firstpart = s.substring(0,s.length-4);
					this.src = firstpart + "_rollover" + extension;
				}
				imageelements[i].onmouseout = function () {
					var s = this.src;
					var extension = s.substring(s.length-4);
					var firstpart = s.substring(0,s.length-13);
					this.src = firstpart + extension;
				}
				var s = imageelements[i].src;
				var extension = s.substring(s.length-4);
				var firstpart = s.substring(0,s.length-4);
				
				// preload the image
				(new Image()).src = firstpart + "_rollover" + extension;
				
			}
		}
		
	}
	
}) ();
	
	<!--/Image pre-loader-->
	
	
	<!--LightBox -->

	$(function() {
		$('#gallery a').lightBox(); // Select all links in object with gallery ID
	});
	<!--/Lightbox-->		
	
	
	<!--Smooth Scroll using jQuery animated scrolling -->
	$(document).ready(function(){
		$(".scroll").click(function(event){
			//prevent the default action for the click event
			event.preventDefault();
	
			//get the full url - like mysitecom/index.htm#home
			var full_url = this.href;
	
			//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
			var parts = full_url.split("#");
			var trgt = parts[1];
	
			//get the top offset of the target anchor
			var target_offset = $("#"+trgt).offset();
			var target_top = target_offset.top;
	
			//goto that anchor by setting the body scroll top to anchor top
			$('html, body').animate({scrollTop:target_top}, 500);
		});
	});
	
	<!--/Smooth Scrolling-->
