jQuery().ready(function()
{
	$("a.zoom").fancybox({
		/*'zoomSpeedIn'		:	500,
		'zoomSpeedOut'		:	500*/
	});
	
	$("a.zoom_guestbook_add").fancybox({
		'hideOnContentClick': false
	});
	
	//scroll the message box to the top offset of browser's scrool bar
	$(window).scroll(function()
	{
  		$('#message_box').animate({top:$(window).scrollTop()+"px" },{queue: false, duration: 350});  
	});

jQuery(function() {
    setInterval( "slideSwitch()", 5000 );
});



	
	
	
/*var maxH = parseInt(jQuery(".container").css("height"));
var lc = parseInt(jQuery("#left_column").css("height"));

alert('cont='+maxH+' lc='+lc);
jQuery(".bottom").css("bottom", '0px');
if (maxH < lc) {
	maxH = lc;
	var myH = parseInt(jQuery("#left_column").css("height"))+300;
	maxH = maxH+300;
	jQuery(".container").css("height", maxH+'px');
	jQuery(".bottom").css("top", maxH+'px');
} else {
	jQuery(".bottom").css("bottom", '0px');
}

	if (document.all) {
		jQuery(".bottom").css("margin-left", '-150px');
	}*/	
//alert(jQuery(".container").css("height"));
//alert(jQuery("#right_column").css("height"));
/*
if ((parseInt(jQuery("#right_column").css("height")) > 500) || (parseInt(jQuery("#left_column").css("height")))>500)
{
var maxH = parseInt(jQuery(".container").css("height"));
if (maxH <  parseInt(jQuery("#right_column").css("height")))
	maxH = parseInt(jQuery("#right_column").css("height"));
if (maxH <  parseInt(jQuery("#left_column").css("height")))
	maxH = parseInt(jQuery("#left_column").css("height"));
var minH = parseInt(jQuery("#left_column").css("height"));
var lc = parseInt(jQuery("#left_column").css("height"));

//alert('cont='+maxH+' lc='+lc);
//jQuery(".bottom").css("bottom", '0px');
if (maxH < lc) {
	minH = maxH;
	maxH = lc;
	var myH = parseInt(jQuery("#left_column").css("height"));
	if (document.all) {
	}else {	
		maxH = maxH+300;
		jQuery(".bottom").css("top", minH+'px'); 
	}
	jQuery(".container").css("height", maxH+'px');
	
} else {
	minH= minH+300;
	jQuery(".bottom").css("top", minH+'px');
}

jQuery(".bottom").css("bottom", '0px');

	if (document.all) {
		jQuery(".bottom").css("margin-left", '-150px');
	}
} else {
jQuery(".bottom").css("bottom", '0px');
	if (document.all) {
		jQuery(".bottom").css("margin-left", '-150px');
	}
}*/

if (document.all) {
	if (jQuery("#slideshow2")) {
		if (!checkVersion())
			jQuery("#slideshow2").css("margin-left", '0px');
	}
}

	jQuery.fn.equalCols = function(){
		//Array Sorter
		var sortNumber = function(a,b){return b - a;};
		var heights = [];
		//Push each height into an array
		$(this).each(function(){
		heights.push($(this).height());
		});
		
		heights.sort(sortNumber);
		var maxHeight = heights[0];
		return this.each(function(){
			//Set each column to the max height
			$(this).css({'height': maxHeight});
		});
	};
	
var userAgent = navigator.userAgent.toLowerCase();
 
// Figure out what browser is being used
jQuery.browser = {
	version: (userAgent.match( /.+(?:rv|it|ra|ie|me)[\/: ]([\d.]+)/ ) || [])[1],
	chrome: /chrome/.test( userAgent ),
	safari: /webkit/.test( userAgent ) && !/chrome/.test( userAgent ),
	opera: /opera/.test( userAgent ),
	msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
	mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
};
var is_chrome = /chrome/.test( navigator.userAgent.toLowerCase() );
var is_safari = /webkit/.test( userAgent ) && !/chrome/.test( userAgent );
var is_mozilla = /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent );

	//Usage
	jQuery(function($){
	//var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome');
	
	//alert(is_chrome);
	if(is_chrome){
		
		var left_content = $("#left_column").html();
		var elementCount = jQuery("#left_column>*").length;
		if (elementCount > 0){
			//$('div.content').equalCols();
			var lh = $("#left_column").height();
			//alert(lh);
			var rh = $(".main_center").height();
			if (lh > rh)
				$(".main_center").height(lh);
			else
				$("#left_column").height(rh);
		}else{
			$("#left_column").hide();
		}
	
	
	}else{
	
		if (is_mozilla || is_safari){
		}else{
		
			//Select the columns that need to be equal e.g
			var left_content = $("#left_column").html();
			var elementCount = $("#left_column > *").length;
			
			if (elementCount > 0){
				$('div.content').equalCols();
				$('#right_column, .right_main_content').equalCols();
				$('#left_column, #right_column').equalCols();
				$('#right_column, #left_column').equalCols();
			}
			else
				$("#left_column").hide();
			//$('.content').equalCols();
		}

	}
		
	});

})

function getInternetExplorerVersion() {

    var rv = -1; // Return value assumes failure.

    if (navigator.appName == 'Microsoft Internet Explorer') {

        var ua = navigator.userAgent;

        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");

        if (re.exec(ua) != null)

            rv = parseFloat(RegExp.$1);

    }

    return rv;

}

function checkVersion() {

    var msg = "You're not using Windows Internet Explorer.";

    var ver = getInternetExplorerVersion();

    if (ver > -1) {

        if (ver >= 8.0)
			return true;
        else
			return false;

    }
}

