/*
* requires jquery.tools.js 1.2.5 with scrollable and jquery 1.4.2
* image fade-in and footer keep to bottom of window
*/
$(function(){
	var footer = $('#footer_wrapper');
	var wrapper = $('#page_wrapper');
	var footer_margin = parseInt(footer.css('margin-top'));
	var win = $(window);
	var resizeTimer = null;
	var window_height = 0;
	var wrapper_height = wrapper.height();
	win.resize(function(){
	setFooter();
	})
	function setFooter() {
	window_height = win.height();
		if (window_height > wrapper_height) {
		footer.css('margin-top', (window_height - wrapper_height + footer_margin) + 'px');
	}
	}
	function slide_fade() {
    var fade_img = $('#slideshow img:first');
		if ($.browser.msie) {
		} else {
	    fade_img.data('org', fade_img.attr('src')).removeAttr('src').load(function(){
	    $(this).fadeIn(550);
	    }).hide().attr('src', fade_img.data('org'));
	}
	}
	function general_fade() {
	$('.fade').each(function(){
	var img = $(this);
		img.data('org', img.attr('src')).removeAttr('alt').removeAttr('src');
    	img.load(function(){
     	img.fadeIn(550)
      }).hide().attr('src', img.data('org'));
	})
	}
	setFooter();
	general_fade();
	var funcName = $('body').attr('id');
	if (eval("typeof " + funcName + " == 'function'")) eval(funcName + '()');
})



