function setCookie(c_name,value,expires)
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );
if ( expires )
expires = expires * 1000;
var expires_date = new Date( today.getTime() + (expires) );
expires_date.setTime(expires_date.getTime()+expires);
document.cookie=c_name+ "=" +escape(value)+
((expires==null) ? "" : ";expires="+expires_date.toGMTString());
}
function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1)
{
c_start=c_start + c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return "";
}
$.fn.vAlign = function() {
return this.each(function(i) {
var h = $(this).height();
var oh = $(this).outerHeight();
var mt = (h + (oh - h)) / 2;
$(this).css("margin-top", "-" + mt + "px");
$(this).css("top", "50%");
$(this).css("position", "absolute");
$(this).css("display", 'block');
});
};
$.fn.vBottomAlign = function() {
return this.each(function(i) {
$(this).css("bottom", "0%");
$(this).css("position", "absolute");
$(this).css("display", 'block');
});
};
$.fn.vAll = function() {
return this.each(function(i) {
var h = $(this).height();
var oh = $(document).height();
//alert(h+' '+oh)
if (oh > h)
{
$(this).css("height", oh);
}
// var mt = (h + (oh - h)) / 2;
});
};
$(document).ready(function() {
$('.logo1').vAlign();
$('.slogan').vBottomAlign();
$('.div_principal').vAll();
$('#defile1').cycle(
{
next: '#defile1',
fx: 'fade',
speed: 'fast',
timeout: 3000,
pager: '#nav1',
allowPagerClickBubble: true,
pagerAnchorBuilder: function(index, el) {
return ' '; // whatever markup you want
}
});
$('#defile2').cycle(
{
fx: 'scrollHorz',
speed: 'fast',
timeout: 4000,
pager: '#nav5',
allowPagerClickBubble: true,
pagerAnchorBuilder: function(index, el) {
return ' '; // whatever markup you want
}
});
$('#slider').cycle({
fx: 'fade',
next: '#slider',
speed: 700,
timeout: 5000,
allowPagerClickBubble: true,
pager: '#nav3'
});
$("a[rel^='prettyPhoto']").prettyPhoto({
animation_speed: 'fast', /* fast/slow/normal */
opacity: 0.80, /* Value between 0 and 1 */
show_title: false, /* true/false */
allow_resize: false, /* Resize the photos bigger than viewport. true/false */
theme: 'facebook', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
horizontal_padding: 19, /* The padding on each side of the picture */
hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
wmode: 'opaque', /* Set the flash wmode attribute */
modal: false, /* If set to true, only the close button will close the window */
ie6_fallback: true
});
/*
if (typeof(Storage) !== "undefined")
{
var cookie_d = new Date();
var cookie_t = cookie_d.getTime();
// alert(cookie_t+' - '+localStorage.getItem("musique_intro_lasttime"));
// localStorage.setItem("musique_intro_lasttime", cookie_t);
if (
(localStorage.getItem("musique_intro") != 'intro_deja_affichee')
||
(cookie_t > (parseInt(localStorage.getItem("musique_intro_lasttime"))+1000*900) ) // au bout de 15 minutes, il affiche l'intro à nouveau
)
{
localStorage.setItem("musique_intro", "intro_deja_affichee");
localStorage.setItem("musique_intro_lasttime", cookie_t);
$.prettyPhoto.open('intro.swf?width=650&height=342','','');
}
}
else
{
if (getCookie('musique_intro') != 'intro_deja_affichee')
{
setCookie('musique_intro','intro_deja_affichee',900); // au bout de 15 minutes, il affiche l'intro à nouveau
$.prettyPhoto.open('intro.swf?width=650&height=342','','');
}
}
*/
});
$(function() {
$("#2").lavaLamp({
fx: "backout",
speed: 700,
click: function(event, menuItem) {
return true;
}
});
// no conflict -> remove jquery.easing.min.js and put this code
jQuery.extend( jQuery.easing,
{
bouncein: function(x, t, b, c, d) {
return c - jQuery.easing["bounceout"](x, d - t, 0, c, d) + b;
},
backout: function(x, t, b, c, d) {
var s = 1.70158;
return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
}
});
/*var autoscrolling = true;
$('.infiniteCarousel_1').infiniteCarousel().mouseover(function () {
autoscrolling = false;
}).mouseout(function () {
autoscrolling = true;
});
setInterval(function () {
if (autoscrolling) {
$('.infiniteCarousel_1').trigger('next');
}
}, 4000);*/
});