
$(document).ready(function() {   	
	
   $("#global").append('<div class="clearfooter"></div>');        
   $("ul.menu-bas li:first").css('border-width',0);
   $("ul.menu-bas li:first").css('padding-left',0);
      
   
	$(".menuhaut li").hover(function(){    	
		$(".menuhaut li.current").addClass('excurrent');
		$(".menuhaut li.current").removeClass('current');
	},function(){
		$(".menuhaut li.excurrent").addClass('current');
		$(".menuhaut li.excurrent").removeClass('excurrent');
	});
	
	
	var so = new SWFObject('../anims/carousel.swf', 'carousel', '590', '320', '9.0', '#333333');
		so.addParam("scale", "noscale");
		so.addParam("salign","lt");
		so.addParam("wmode","transparent");
		so.addParam('allowfullscreen', 'true');
		so.addParam('flashvars', 'XmlPath=../xml/car-logiciel.xml');
		so.write("logiciel-demo");	   


	$('a[rev="demande essai"]').click(function(){
		return false;
	});
	$('a[rev="demande essai"]').qtip({
       content: {
          // Set the text to an image HTML string with the correct src URL to the loading image you want to use
          text: '<div style="margin:30px auto;width:32px;text-align:center;"><img src="../img/loader.gif" alt="Loading..." /></div>',
          url: '../phps/ajax.php?mod=form-hektor', // Use the rel attribute of each element for the url to load
          title: {
             text: 'Essayez sans engagement Hektor le plus modulable des logiciels de transaction', // Give the tooltip a title using each elements text
             button: 'Close' // Show a close link in the title
          }
       },
       position: {
          corner: {
             target: 'bottomMiddle', // Position the tooltip above the link
             tooltip: 'topMiddle'
          },
          adjust: {
             screen: true // Keep the tooltip on-screen at all times
          }
       },
       show: { 
          when: 'click', 
          solo: true // Only show one tooltip at a time
       },
       hide: 'unfocus',
       style: {
          tip: true, // Apply a speech bubble tip to the tooltip at the designated tooltip corner
          border: {
             width: 0,
             radius: 4
          },
          name: 'light', // Use the default light style
          width: 620 // Set the tooltip width
       }

	});
	
	 $("#demande-essai-hektor").livequery('submit',function() { 
	    // submit the form 
	    var flag = true;
	    $("#demande-essai-hektor input").each(
		    function(){
		    	if($(this).val() == ""){
		    		flag = false;
		    	}
		    }
	    );
	    if(flag){
		    $(this).ajaxSubmit({
		    	target: '#dde-essai'
		  	}); 
		  } else {
		  	alert('Veuillez noter que tous le champs sont obligatoires. Merci');
		  }
	    // return false to prevent normal browser submit and page navigation 
	    return false; 
		});
         
});