/***** cufon ******/
Cufon.replace('div#sidebar ul#menu li a', {
	hover: true	
});
/***** jquery *****/
$(document).ready(function(){
 	$.preloadCssImages();
 				
	if ($.browser.mozilla) {
	   $('input.s').addClass('s_ff');
	   $('ul#menu li a').addClass('menu_ff');
	   $('span.your-message').addClass('text_ff');
	 }
	 			
	$("dt.gallery-icon a").fancybox({
		'titleShow'			: false,
		'centerOnScroll'	: true,
		'padding'			: '0',
		'cyclic'			: true,
		'hideOnContentClick': true,
		'showCloseButton'	: true
	});
	
	$('dt.gallery-icon a').attr('rel', 'gallery1');
	$('dt.gallery-icon a img').attr('title', 'Click outside the photo to close');
	
	$('.linne, .bottom_right, ul#menu, ul.collapse, a.title').disableTextSelect();
	$('a.title').click(function() {
		var theID = $(this).attr("id");
		$("ul." + theID).slideToggle('fast');
	});
			
	$('span.your-name input').val('Your Name');
	$('span.your-email input').val('Your E-mail');
	$('span.your-message textarea').val('Your Message');
	$("#content form input, #content form textarea").focus(function(){
		if (!$(this).data("placeholder"))
			$(this).data("placeholder", $(this).val());
		if ($(this).val() === $(this).data("placeholder"))
			$(this).val("");
	}).blur(function(){
		if ($(this).val() === "")
			$(this).val($(this).data("placeholder"))
	})
	
	$('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
		&& location.hostname == this.hostname) {
			var $target = $(this.hash);
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				$('html,body').animate({scrollTop: targetOffset}, 500);
				return false;
			}
		}
	});
});
