/* 
* Kath.fr 2009 - JS
* @version 1.0
* @creation date 2009-04-26
* @update date 2009-05-03
* @author CUT HERE
* Description : global js
*/
$(document).ready(function (){

	// ROLLOVER NAVIGATION						
	$(".navigation li:not(.active) img").hover(
		function(){
			if($(this).attr("src").indexOf("-on") == -1) {
				var newSrc = $(this).attr("src").replace(".gif","-on.gif");
				$(this).attr("src",newSrc);
			}
		},
		function(){
			if($(this).attr("src").indexOf("-on.gif") != -1) {
				var oldSrc = $(this).attr("src").replace("-on.gif",".gif");
				$(this).attr("src",oldSrc);
			}
		}
	);
	
	// SCROLL NAVIGATION
	$('.btn-ref a').click(
	function(){
	$.scrollTo( '#references-nav', 800 );
	return false;
	});
	$('.btn-folio a').click(
	function(){
	$.scrollTo( '#portfolio-nav', 800 );
	return false;
	});
	$('.btn-about a').click(
	function(){
	$.scrollTo( '#apropos-nav', 800 );
	return false;
	});
	
	// Reset Champs de formulaires
	$("input[type=text]").bind("focus", function () {
		initFocus = $(this).val();
		$(this).val("");
	})
	.bind("blur", function () {
		if ( $(this).val() == initFocus || $(this).val() == '' ){
			$(this).val(initFocus);
		}
	});
	$("textarea").bind("focus", function () {
		initFocus = $(this).val();
		$(this).val("");
	})
	.bind("blur", function () {
		if ( $(this).val() == initFocus || $(this).val() == '' ){
			$(this).val(initFocus);
		}
	});

	$("#portfolio a").fancybox();
	
	// PNG FIX
	$(document).pngFix(); 
	
});


