// JavaScript Document

jQuery.preloadImages = function()
{
	for(var i = 0; i<arguments.length; i++)
	{
		jQuery("<img>").attr("src", arguments[i]);
	}
}

// preload images
$.preloadImages("images/holy-family-on.jpg", "images/ei-on.jpg", "images/aiab-on.jpg", "images/tammy-darlene-on.jpg", "images/dtd-on.jpg", "images/klk-on.jpg",  "images/coo-on.jpg", "images/aprime-on.jpg", "images/vc-on.jpg", "images/bop-on.jpg");
$(function(){
	// set up rollover
	$("img.rollover").hover(
	function(){
		this.src = this.src.replace("-off","-on");
	},
	function(){
		this.src = this.src.replace("-on","-off");
	});
});

$(document).ready(function() {
    $('a[href=#top]').click(function(){
        $('html, body').animate({scrollTop:0}, 'slow');
        return false;
    });
});


/**
* Styleswitch stylesheet switcher built on jQuery
* Under an Attribution, Share Alike License
* By Kelvin Luck ( http://www.kelvinluck.com/ )
**/

(function($)
{
   $(document).ready(function() {
      $('.styleswitch').click(function()
      {
         switchStylestyle(this.getAttribute("rel"));
         return false;
      });
      var c = readCookie('style');
      if (c) switchStylestyle(c);
   });

   function switchStylestyle(styleName)
   {
      $('link[@rel*=style][title]').each(function(i)
      {
         this.disabled = true;
         if (this.getAttribute('title') == styleName) this.disabled = false;
      });
      createCookie('style', styleName, 365);
   }
})(jQuery);

