$(document).ready(function(){
	
	$("#img-gallery > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
	$('#img-gallery .ui-tabs-panel').hover(function(){
		$("#img-gallery .info").stop().animate({top:'335px'}, {queue:false,duration:160});
		}, function() {
		$("#img-gallery .info").stop().animate({top:'395px'}, {queue:false,duration:160});
	});	
	
	//menu section
    $("div.scrollable").scrollable({ 
        size: 2, 
        items: '#thumbs'
    }); 
	
	if($('#thumbs div').length <= 2){
		$('.next').hide();
		$('.prev').hide();
		$('.navi').hide();
	}

	var tabContainers = $('div.rc-bd div.rc-bd-content > div');
	tabContainers.hide().filter(':first').show();
	
	$('div.rc-bd ul.sub-nav a').click(function () {
			tabContainers.hide();
			tabContainers.filter(this.hash).show();
			$('div.rc-bd ul.sub-nav a').removeClass('selected');
			$(this).addClass('selected');
			return false;
	}).filter(':first').click();
	
	
	
	if($('body').hasClass('contact-us')){
		$('.error').hide();
		$('input.text-input').focus(function(){
			$(this).css({background: "transparent url(<?php bloginfo('template_url'); ?>/images/form-field-bg.png) no-repeat scroll 0 -26px"});
		});
		$('input.text-input').blur(function(){
			$(this).css({background: "transparent url(<?php bloginfo('template_url'); ?>/images/form-field-bg.png) no-repeat scroll 0 0"});
		});	
		
		$('.col-mapUsImg').hover(
			function() {
				$(this).css({background: "transparent url(<?php bloginfo('template_url'); ?>/images/map-us.png) no-repeat scroll 0 -163px"});
			},
			function() {
				$(this).css({background: "transparent url(<?php bloginfo('template_url'); ?>/images/map-us.png) no-repeat scroll 0 0"});
			}
		);
		$('.col-mapUsImg').click(function() {
			$('#contact-slides').animate({"left": "-685px"}, "slow");
		});
		
		$('.col-map div.map-back').hover(
			function() {
				$(this).css({background: "transparent url(<?php bloginfo('template_url'); ?>/images/btn-goBack.png) no-repeat scroll 0 -50px"});
			},
			function() {
				$(this).css({background: "transparent url(<?php bloginfo('template_url'); ?>/images/btn-goBack.png) no-repeat scroll 0 0px"});
			}
		);
		
		$('.col-map div.map-back').click(function() {
			$('#contact-slides').animate({"left": "0px"}, "slow");
		});
	}
	
	
});





