$(document).ready(function(){
	 $('#history').hide();
 	 $('.search-text, .saddr').focus(function(){ $(this).attr('value', ''); });
	 $("#content a.overlay").fancybox({
			'padding'		: 2,
			'overlayColor'	: '#000000',
			'overlayOpacity' : 0.8,
			'margin' : 2,
			'titlePosition'	:	'over',
			'onComplete'	:	function() {
				$("#fancybox-wrap").hover(function() {
					$("#fancybox-title").fadeIn();
				}, function() {
					$("#fancybox-title").fadeOut();
				});
			}
		});
	//the contact links
	$('a.ajax').click(function(e){
		e.preventDefault();
		$.fancybox({
			overlayColor: '#000000',
			overlayOpacity: 0.6,
			href: '/layout/set/ajax' + $(this).attr('href'),
			hideOnContentClick: true,
			onComplete: function(currentArray, currentIndex, currentOpts){
				$('#ajax_content a[href*="layout/set/ajax"]').click(function(){
					e.preventDefault();
					$.fancybox.close();
					return false;
				});
			}
		});
		return false;
	});
	//for the tabs on loactionspage
	$('.tab a').click(function() {
		var id = $(this).attr('rel')
		if($(this).attr('class') == 'photo') {
		   $('.scroller_'+id).scrollTo($('#photo_'+id), {duration: 500});
		} else {
			$('.scroller_'+id).scrollTo($('#approach_'+id), {duration: 500});   
		}
		$(this).parent().children('a').removeClass('current');
		$(this).addClass('current');
	});
		
    $("ul#ticker").liScroll({travelocity: 0.10});  
	$('.submit-form').click(function() { $('#form-'+ $(this).attr('rel')).submit(); });
	$('.print').click(function() { window.print(); return false; });

});

function _log(msg) {
    if (window.console && window.console.log)
        window.console.log(msg);
} 
 
