﻿/* ----------------------------- Les différentes fonctions -------------------------------- */

function affichage_popup(nom_de_la_page, nom_interne_de_la_fenetre){
	window.open (nom_de_la_page, nom_interne_de_la_fenetre, 'height=700, width=1000, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
}

function ouvreAnnonce(){
	$("#ec_annonce_cont").animate({width: 'toggle'});
	$("#ec_client_cont").animate({width: 'toggle'});
}

var req="";
function recupDom()
{
	var domVal = $("#doma").val();
	if(domVal.length>2){
		if(req!=""){
			req.abort();
		}	
		req = $.ajax({
			type: "POST",
			url: "sitesoma2/lespages/ovh.php",
			data: "nom_domaine="+domVal,
			success: function(msg){
				$("#champcache").html(msg)
			}
		});		

		$("#champcache").html("Chargement...");
		$("#champcache").css("display","block");
		$("#champcache").css("border-bottom","1px outset #67ADE3");
		$("#champcache").css("border-left","1px outset #67ADE3");
		$("#champcache").css("border-right","1px outset #67ADE3")	
	}else{
		if(req!=""){
			req.abort();
		}	
		$("#champcache").css("display","none");
	}
}



/* ----------------------------- Les différentes fonctions utilisées pour les diaporamas -------------------------------- */

$(document).ready(function(){	
	/* ---------------- redimentionnement ----------------- */
	
	var hauteurS = $(window).height();
	var newHeuteur = hauteurS-$("#entete").height()-$("#pied_page").height()-2;
	//alert(hauteurS);
	$("#site").height(newHeuteur);
	
	$(window).resize(function() {
		hauteurS = $(window).height();
		newHeuteur = hauteurS-$("#entete").height()-$("#pied_page").height()-2;
		//alert(hauteurS);
		$("#site").height(newHeuteur);
	});
	
	/* Fonction défilement horizontal automatique sans boutons pour les bannières */
	var sudoSlider1 = $("#banniere").sudoSlider({ 
		auto:true,
		pause: '5000',
		speed: '1000',
		prevNext:false
	});
	
	/* Fonction défilement horizontal manuel/automatique avec boutons pour les applications */
	var sudoSlider2 = $("#interieur_applications").sudoSlider({
		customLink:'a.customLink',
		prevNext:false,
		autowidth:false,
		slideCount:3,
		continuous:true,
		pause: '2000',
		speed: '800',
		auto:true
	});

	/* Fonction défilement horizontal automatique sans boutons pour les logos */ 
	var sudoSlider3 = $("#defilement_logo").sudoSlider({ 
		auto:true,
		pause: '3000',
		speed: '1000',
		prevNext:false
	});
	
	/* Fonction défilement en fondu automatique sans boutons pour les realisation */
	var sudoSlider4 = $("#realisations_cont").sudoSlider({ 
        customLink:'a.customLinkRea',
		fade:true,
		continuous:true,
		pause: '3000',
		speed: '1000',
        prevNext:false
      });	
	  /* Fonction défilement en fondu automatique sans boutons pour communication */
	var sudoSlider4 = $("#com_cont").sudoSlider({ 
        customLink:'a.customLinkRea',
		fade:true,
		continuous:true,
		pause: '3000',
		speed: '1000',
        prevNext:false
      });	
	  
	// Add Scroller Object
	$jScroller.add("#ecac_cont","#ecac_text","left",2);

	// Start Autoscroller
	$jScroller.start();
});



