$(document).ready(function() {

/* External links Start */
$('#content a').filter(function() {
	return this.hostname && this.hostname !== location.hostname;
}).attr('target','_blank');
/* External links End */

/* Sliding anchors Start */
$('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}, 800);
		return false;
		}
	}
});
/* Sliding anchors End */


/**/
  $('input.clear').each(function() {
    $(this)
      .data('default', $(this).val())
      .addClass('inactive')
      .focus(function() {
        $(this).removeClass('inactive');
        if($(this).val() == $(this).data('default') || '') {
          $(this).val('');
        }
      })
      .blur(function() {
        var default_val = $(this).data('default');
        if($(this).val() == '') {
          $(this).addClass('inactive');
          $(this).val($(this).data('default'));
        }
      });
  });
/**/

$('#form1 input').focus(function(){
		$(this).addClass('focus');	
});
$('#form1 input').blur(function(){
		$(this).removeClass('focus');	
});

$("#form1").validate({
		errorElement: "em",

		rules: {
			name: "required",
			tel1: "required",
			email: {
				required: true,
				email: true
			}
		},
		messages: {
			name: "",
			tel1: "",
			email: ""
		}
	});




});



Cufon.replace('h1', {textShadow: '#000 0px -1px'}); 
Cufon.replace('.aller2', {
			  	hover: true,
				textShadow: '#1AA5B4 0px -1px'
			});
Cufon.replace('h2, h3, h4, #tel span.blue, #footer .backtotop, #nav a, .aller', {
			  	hover: true,
				textShadow: '#fff 0px 1px'
			});
Cufon.replace('#slider h2', {textShadow: '#000 0px -1px'}); 
