﻿/* é */ $(document).ready(function(){if($("nav li.lone").length>0){$("nav li.notCurrent").hide();var a=$("nav li.lone");$("a",a).click(function(){if($("body.videos").length==0){$(a).removeClass("lone");$("nav li.notCurrent").show();return false}});$("header h1 a").click(function(){if($("body.videos").length==0){$("nav li.lone").removeClass("lone");$("nav li.notCurrent").show();return false}})}});$(window).load(function(){customFunctions.finishDesign();customFunctions.enhanceBehaviour();customFunctions.handleAjax();customFunctions.jQueryPlugins.initPrettyPhoto()});var customFunctions=function(){function c(){$("html").css("min-height",parseInt($("html").css("min-height"))+($("nav ul li").length-3)*$("nav ul li:first-child").height())}function b(k){var k=typeof k!="undefined"?k:["discreet"],h="",j="",g=0;for(g;g<k.length;g++){h+=j+"form."+k[g];j=", "}$(h).each(function(){$(this).submit(function(){var m=$(this).attr("id"),l=$(this).attr("action"),i=$(this).serialize();$.ajax({type:"POST",url:l,data:i+"&ajax=1",dataType:"json",success:function(n){$("#"+m+" .infoMsg").hide();if(n.etat=="null"){$("#"+m+" .null").show("fast",function(){setTimeout(function(){for(var o in n.url){if(n.url[o]==0){$("#"+o).val("").focus()}}setTimeout(function(){$("#"+m+" .null").fadeOut("slow")},2000)},1000)})}else{if(n.etat=="HS"){$("#"+m+" .hs").show("fast",function(){setTimeout(function(){$("#"+m+" .hs").fadeOut("slow")},3000)})}else{if(n.etat=="err"){$("#"+m+" .err").show("fast",function(){setTimeout(function(){$("#"+m+" .err").fadeOut("slow")},3000)})}else{if(n.etat=="ok"){if(n.url==31){location.href=n.infoAdmin}else{$("#"+m+" .ok").show("fast",function(){$(this).siblings("fieldset").hide()})}}}}}},error:function(n){if(n.status=="404"){$("#"+m+" .err404").show("fast",function(){setTimeout(function(){$("#"+m+" .err404").fadeOut("slow")},5000)})}else{if(n.responseText.indexOf("function.mail")>0){$("#"+m+" .err").show("fast",function(){setTimeout(function(){$("#"+m+" .err").fadeOut("slow")},3000)})}else{$("#"+m+" .errAjax").show("fast",function(){setTimeout(function(){$("#"+m+" .errAjax").fadeOut("slow")},5000)})}}}});return false})})}function e(){$('#index:not(".iphone") header h1 a').click(function(){var k=$(this).attr("href"),g=screen.width,j=screen.height,i=window.open(k,"_blank","status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1,width="+g+",height="+j);i.moveTo(0,0);return false});return true}function d(){return true}function f(){if(typeof $.prettyPhoto!="undefined"){$(".gallery a[rel^='prettyPhoto']").prettyPhoto({theme:"dark_rounded",opacity:0.6,overlay_gallery:false,callback:function(){return true}})}}function a(){if(typeof $.fn.cycle!="undefined"){$(".cycle").cycle({fx:"turnUp",speed:1500,timeout:5000,pause:1})}}return{finishDesign:c,handleAjax:b,enhanceBehaviour:e,jQueryPlugins:{initPrettyPhoto:f,initCycle:a}}}();
