$(function() {
	if (($.browser.msie) && ($.browser.version <= 6)) {
		$('#brands li, .brands li').hover(function(){$(this).addClass('bover')},function(){$(this).removeClass('bover')})
	}
	$('.showContent').click(function() { $(this).parent().find('.show_content').fadeIn(); });
	$('.closeButton').click(function() { $(this).parent('.show_content').fadeOut(); });

	$.each(jQuery.browser, function(i, val) {
	  if(i=="mozilla" && jQuery.browser.version.substr(0,3)=="1.8")
		$('h1 span').css('margin-bottom','0')
	});
	/*MINI DRAG AND DROP*/
	/*$('#TB_window').live('mousedown',function(ini) {
		var ini= ini || window.event,tag=ini.target.tagName
		var	actualTop=$.browser.msie&&$.browser.version==6?parseInt($(this).css('top')):parseInt($(this).offset().top)-parseInt($(this).css('margin-top')),
			actualLeft=$.browser.msie&&$.browser.version==6?parseInt($(this).css('left')):parseInt($(this).offset().left)-parseInt($(this).css('margin-left')),
			actualhor=ini.pageX? ini.pageX : ini.clientX,
			actualver=ini.pageY? ini.pageY : ini.clientY
		$(this).bind('mousemove',function(e) {
			var e=e || window.event,
				hor=e.pageX? e.pageX : e.clientX,
				ver=e.pageY? e.pageY : e.clientY,
				horDif=parseInt(hor)-parseInt(actualhor),verDif=parseInt(ver)-parseInt(actualver),
				left=parseInt(horDif)+actualLeft,top=parseInt(verDif)+parseInt(actualTop);
				if(tag!=='INPUT'&&tag!=='TEXTAREA') $(this).css({'top':top,'left':left});
		});
	});
	$('#TB_window').live('mouseup',function() {
		$(this).unbind('mousemove');
	});*/


	$(function() {
		$(".box-t").draggable();
	});


	$('.submenu > ul > li').hover(function(){$(this).addClass('hover')},function(){$(this).removeClass('hover')})
	$('#footerBig ul, #footerBig dl').hover(function(){$(this).addClass('fover')},function(){$(this).removeClass('fover')})
	$('.paragraph').hover(function(){$(this).attr('id','pover')},function(){$(this).attr('id','')})
	Cufon.replace('.submenu > ul > li > i > a', { hover:true, fontFamily:'DINMittelschrift-Alternate' });
	Cufon.replace('h1', { fontFamily:'Futura Md BT' });
	Cufon.replace('#content h3', { hover:true, fontFamily:'DINMittelschrift-Alternate' });
	Cufon.replace('#footer li', { hover:true, fontFamily:'Franklin Gothic Book'});
	$('.presse > li > a').hover(function(){$(this).addClass('pover')},function(){$(this).removeClass('pover')})

	//$('.msg-over a').click(function(){ $('.over-form').show(); $('#overlay').show(); });
	$('.over-form').find('.close').click(function(){ $('.over-form').hide(); $('#overlay').hide(); });

	$(".datepicker1").datepicker()
	//$(".datepicker").formatDate('yy-mm-dd', new Date(2007, 1 - 1, 26));
	//$('.datepicker').datepicker({ altFormat: 'yy-mm-dd' });
});

function submit_veraFrom(){
	var prenom 		= $("#prenom").val();
	var nom 		= $("#nom").val();
	var phone 		= $("#phone").val();
	var date_m 		= $("#date_m").val();
	var email 		= $("#email").val();
	var date_s 		= $("#date_s").val();
	var heure_s 	= $("#heure").val();
//  var heure_ideale_y 	= document.getElementById("heure_ideale_y").checked;
//	var heure_ideale_n 	= document.getElementById("heure_ideale_n").checked;
//	var accompagnee_y 	= document.getElementById("accompagnee_y").checked;
//	var accompagnee_n 	= document.getElementById("accompagnee_n").checked;

	$.ajax({
		type: "POST",
		url: 'vera-wang-form.php',
		data: "prenom="+prenom+"&nom="+nom+"&submit=1"+"&phone="+phone+"&date_m="+date_m+"&email="+email+ "&date_s="+date_s +"&heure="+heure_s ,
//		"&heure_ideale_y="+heure_ideale_y+"&heure_ideale_n="+heure_ideale_n+"&accompagnee_y="+accompagnee_y +"&accompagnee_n="+accompagnee_n

		cache: false,
		async: false,
		success: function(result) {
			$("#formlaire").html(result)
		},
		error: function(result) {
			alert("some error occured, please try again later");
		}
	});
}
function submitFrom(){
	var prenom 	= $("#prenom").val();
	var nom 	= $("#nom").val();
	var phone 	= $("#phone").val();
	var date_m 	= $("#date_m").val();
	var date_s 	= $("#date_s").val();
	var email 	= $("#email").val();
	var message = $("#message").val();
	var heure 	= $("#heure").val();
	$.ajax({
		type: "POST",
		url: 'form.php',
		data: "prenom="+prenom+"&nom="+nom+"&submit=1" +"&phone="+phone+"&date_m="+date_m +"&date_s="+date_s +"&email="+email +"&message="+message +"&heure="+heure,
		cache: false,
		async: false,
		success: function(result) {
			$("#formlaire").html(result)
		},
		error: function(result) {
			alert("some error occured, please try again later");
		}
	});
}
function submit_jennyFrom(){
	var prenom 	= $("#prenom").val();
	var nom 	= $("#nom").val();
	var phone 	= $("#phone").val();
	var date_m 	= $("#date_m").val();
	var date_s 	= $("#date_s").val();
	var email 	= $("#email").val();
	var message = $("#message").val();
	var heure 	= $("#heure").val();
	var defileoui = $("#defileoui").val();
	var defilenon = $("#defilenon").val();
	$.ajax({
		type: "POST",
		url: 'jenny-packham-form.php',
		data: "prenom="+prenom+"&nom="+nom+"&submit=1" +"&phone="+phone+"&defileoui="+defileoui +"&defilenon="+defilenon +"&date_m="+date_m +"&date_s="+date_s +"&email="+email +"&message="+message +"&heure="+heure,
		cache: false,
		async: false,
		success: function(result) {
			$("#formlaire").html(result)
		},
		error: function(result) {
			alert("some error occured, please try again later");
		}
	});
}
function submitFromIndex(){
	var prenom 	= $("#prenom").val();
	var nom 	= $("#nom").val();

	var email 	= $("#email").val();

	$.ajax({
		type: "POST",
		url: 'indexform.php',
		data: "prenom="+prenom+"&nom="+nom+"&submit=1" +"&email="+email ,
		cache: false,
		async: false,
		success: function(result) {
			$("#formlaire").html(result)
		},
		error: function(result) {
			alert("some error occured, please try again later");
		}
	});
}