$(document).ready(function() 
{ 

//  Cufon.replace($('.copyright2'), { hover: true });

  $.swapImage(".swapImage", true, true, "mouseenter", "mouseleave");

  if($("a.gallery").length != 0)
    $("a.gallery").fancybox({'overlayOpacity': 0.5, 'overlayShow' : true, 'titleShow' : false});
  if($("a.video").length != 0)
    $("a.video").fancybox({'overlayOpacity': 0.5, 'overlayShow' : true, 'titleShow' : false});
  if($("a.textall").length != 0)
    $("a.textall").fancybox({'overlayOpacity': 0.5, 'overlayShow' : true, 'titleShow' : true});

  if ($("#secImage").length != 0) 
    $("#secImage").click(function(){
      $("#secImage").attr('src', 'include/script_generate_code.php?id=' + Math.random());
    });

	$('#btnSend').formValidator({
		onSuccess	: function() {
      $("#errorDiv").hide();
      $("#btnSend").hide();
      $("#sending").show(); 
      $("#frmBeAModel").submit(); 
    },
		scope		  : '#frmBeAModel',
		errorDiv	: '#errorDiv'
	});
	$('#btnSend2').formValidator({
		onSuccess	: function() {
      $("#errorDiv").hide();
      $("#btnSend2").hide();
      $("#sending").show(); 
      $("#frmContact").submit(); 
    },
		scope		  : '#frmContact',
		errorDiv	: '#errorDiv'
	});  
	
});