$(document).ready(function(){

	jQuery('#mycarousel').jcarousel();
	jQuery('#mycarousel2').jcarousel();

	$('.fadeThis').hover(function() {
		var fade = $('> .hover', this).css({ "z-index": 100-i });

		if (fade.is(':animated')) { fade.stop().fadeTo(500, 1);} 
		else {fade.fadeIn(500);}
	}, function () {
		var fade = $('> .hover', this).css({ "z-index": 100-i });
		if (fade.is(':animated')) {
			fade.stop().fadeTo(500, 0);
		} else {
			fade.fadeOut(500);
		}
	});


	// get rid of the text
	$('.fadeThis > .hover').empty();
	
	$("a.zoom").fancybox({
		'zoomSpeedIn':	300, 
		'zoomSpeedOut':	300, 
		'overlayShow': true,
		'overlayOpacity': 0.8,
		'overlayColor':	'#fff'
	});
	
	$("a.iframe").fancybox({
		'frameWidth': 960,
		'frameHeight': 500,
		'overlayShow': true,
		'overlayOpacity': 0.8,
		'overlayColor':	'#fff'
	});
	

function megaHoverOver(){$(this).find(".sub").stop().fadeTo('fast',1).show();(function($){jQuery.fn.calcSubWidth=function(){rowWidth=0;$(this).find("ul").each(function(){rowWidth+=$(this).width();});};})(jQuery);if($(this).find(".row").length>0){var biggestRow=0;$(this).find(".row").each(function(){$(this).calcSubWidth();if(rowWidth>biggestRow){biggestRow=rowWidth;}});$(this).find(".sub").css({'width':biggestRow});$(this).find(".row:last").css({'margin':'0'});}else{$(this).calcSubWidth();$(this).find(".sub").css({'width':rowWidth});}}
function megaHoverOut(){$(this).find(".sub").stop().fadeTo('fast',0,function(){$(this).hide();});}
var config={sensitivity:2,interval:10,over:megaHoverOver,timeout:50,out:megaHoverOut};
$("ul#topnav li .sub").css({'opacity':'0'});
$("ul#topnav li").hoverIntent(config);

});

//NO IE6
if($.browser.msie && $.browser.version.substr(0,1)<7)  {
        alert("Your browser is out of date and does not comply with modern web standards.  \n  OfficeSpaceAmarillo.com it not written for Internet Explorer 6 and below.  \n  Please download:  \n  IE8, Safari, Firefox, or Chrome.");
} 

