jQuery(document).ready(function(){
	var obj = null;
	
	/* RESIZE HTML TO FILL VIEWABLE SCREEN */
	var htmlheight = jQuery('body').height();
	var windowheight = window.screen.height; 
	var blank = jQuery('div.fill'); 
	if ( htmlheight < windowheight ){ 	
		jQuery('div.fill').height(windowheight-htmlheight+"px"); 
	} 
	
	if(jQuery('#text').is('*')){
		jQuery('#text').columnize({columns: 2});
	}
	
	/* LINK OVER */
	jQuery('a').hover(function(){
		jQuery(this).find('.link').css({'border-bottom':'1px solid #c9b899','height':'0px'});
		jQuery(this).find('.link_second').css({'border-bottom':'1px solid #44290d','height':'0px'});
		jQuery(this).find('.link_nav').css({'border-bottom':'1px solid #663e13','height':'0px'});
		jQuery(this).find('.map').css({'border-bottom':'1px solid #c9b899'});
	}, function(){
		jQuery(this).find('.link').css({'border-bottom':'0px solid #44290d','height':'1px'});
		jQuery(this).find('.link_second').css({'border-bottom':'0px solid #44290d','height':'1px'});
		jQuery(this).find('.link_nav').css({'border-bottom':'0px solid #663e13','height':'1px'});
		jQuery(this).find('.map').css({'border-bottom':'1px solid #44290d'});
	});
	
	
	/* SECOND LVL MENU */
	jQuery('#second_nav > li').hover(function() {
		if (obj) {
			obj.find('div').fadeOut('fast');
			obj = null;
		}
		
		jQuery(this).find('div').fadeIn('fast');
	}, function() {
		obj = jQuery(this);
		setTimeout(
			function() {
				if (obj) {
					obj.find('div').fadeOut('fast');	
				}
			},
			0);
	});
	
	/* SHOWCASE */
	if(jQuery("#showcase").is('*')){
		jQuery("#showcase").showcase({
			animation: { type: "fade" },
			navigator: {
					css: {display:"none" }},
			titleBar: { enabled: false }
		});
	}
	/* CAROUSSEL (the jcarousellite.js was edit) */
	if(jQuery("#carousel_main").is('*')){
		jQuery("#carousel_main").jCarouselLite({
	        btnNext: "#carousel_left_arrow",
	        btnPrev: "#carousel_right_arrow",
			overscroll: true,
			circular: false,
			btnNextSecond: "#carousel_left",
			btnPrevSecond: "#carousel_right"
	    });
		jQuery("#carousel_main").css({
			'visibility': 'visible',
			'overflow': 'hidden',
			'position': 'relative',
			'z-index': '2',
			'left': '8px',
			'width': '940px'
		});
		jQuery("#carousel_list").css({'margin-top':'11.5px','height':'211px'});
		jQuery(".first").css({'padding-left':'0px'});
	}
});
