/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Filename: herout.js
 * Website: Cidrerie Herout
 * Author: CH1.fr
 * Description: javascript
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

var i = 1
function Horloge() {
	i = i +1;
	if(i==8){i=1};
	//var i = parseInt(Math.random()*4+1);
	// $(".visuel_accueil").html('<img src="http://ns201310.ovh.net/~herout/wp-content/themes/default/images/accueil-' + i +'.png" alt="Cidrerie cidre Manche Normandie Cotentin">');
	//$(".visuel_accueil img").fadeOut('fast');
	$(".visuel_accueil img").attr('src', 'http://ns201310.ovh.net/~herout/wp-content/themes/default/images/accueil-' + i +'.png');
}


jQuery(document).ready(function() {

/* Spans sur le menu ___________________________________________________ */
$('#header #menu li a').append("<span></span>");
/* Class current_page_item sur l'accueil ___________________________________________________ */
if ($('#content h2').text() == 'Cidrerie et caves HEROUT' ){$('#menu li:first').addClass('current_page_item');}

$('#menu li ul').hover(
function () {$(this).parent('li').addClass("current_page_item");},
function () {$(this).parent('li').removeClass("current_page_item");}
);

/* Hover sur les short product pour IE 6 ___________________________________________________ */
$('.short_product').hover(
      function () {$(this).addClass("iehover");}, 
      function () {$(this).removeClass("iehover");}
);

/* image aleatoire en page accueil___________________________________________________ */


if(jQuery.browser.msie && parseInt(jQuery.browser.version) == 6) { }
else {
setInterval("Horloge()", 5000);
};


/* Ajax liste des produits dans les fiches ___________________________________________________ */
$(".entry #menu_fiche").load("http://www.herout-caves.com/list #liste_produits",function(){$(this).css("background","none");} );

/* fin Jquery */
});





/* Sous menu pour IE6 ___________________________________________________ */

navHover = function() {
	var lis = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
			
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", navHover);
