<!--
  function verifform()
  {


if(document.formulaire.userpro_login.value == "")
    {
     alert("Veuillez entrer un login");
     document.formulaire.userpro_login.focus();
     return false;
    }

if(document.formulaire.userpro_login.value == " ")
    {
     alert("Veuillez entrer un login");
     document.formulaire.userpro_login.focus();
     return false;
    }

if(document.formulaire.userpro_password.value == "")
    {
     alert("Veuillez entrer un mot de passe");
     document.formulaire.userpro_password.focus();
     return false;
    }

if(document.formulaire.userpro_password.value == " ")
    {
     alert("Veuillez entrer un mot de passe");
     document.formulaire.userpro_password.focus();
     return false;
    }

}

function oWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->

function xhr(mlist_email, portal_code)
{
  var OAjax;
  if (window.XMLHttpRequest) OAjax = new XMLHttpRequest();
  else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP');
  OAjax.open('POST',"/ooprint/content/newsletter/suscribe_check.avent",true);
  OAjax.onreadystatechange = function()
  {
      if (OAjax.readyState == 4 && OAjax.status==200)
      {
          if (document.getElementById)
          {   
              if (OAjax.responseText =='OK') {
				   document.getElementById('mlist_msg').innerHTML='';
				   window.open("/ooprint/content/newsletter/suscribe.avent?contact_email="+mlist_email+'&portal_code='+portal_code,"",'scrollbars=yes, width=600,height=700');
				  /*var url = "/ooprint/content/newsletter/suscribe.shtml";
				  xmlReq.open("POST",url,true);
				  xmlReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
				  xmlReq.send(mlist_email);*/
              }else{
                    document.getElementById('mlist_msg').innerHTML=OAjax.responseText;
              }
          }     
      }
  }
  OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded');
  OAjax.send('mlist_email='+mlist_email+'&portal_code='+portal_code);
}

$(document).ready(function(){
	if (/MSIE 6/i.test(navigator.userAgent)) {
		var ooprint_arrow1 ="&nbsp;<img src=\"http://www.ooprint.fr/ooprint/images/v7/allzones/spacer.gif\" width=\"6\" height=\"12\" style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://www.ooprint.fr/ooprint/images/v9/tools/arrow1.png', sizingMethod='scale');\" >";
		
		var ooprint_arrow2 ="&nbsp;<img src=\"http://www.ooprint.fr/ooprint/images/v7/allzones/spacer.gif\" width=\"6\" height=\"12\" style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://www.ooprint.fr/ooprint/images/v9/tools/arrow2.png', sizingMethod='scale');\" >";
		
	} else {
		
		var ooprint_arrow1 ="&nbsp;<img src='http://www.ooprint.fr/ooprint/images/v9/tools/arrow1.png' />";
		var ooprint_arrow2 ="&nbsp;<img src='http://www.ooprint.fr/ooprint/images/v9/tools/arrow2.png' />";
	};
	
	$("#sub_menu a").after(ooprint_arrow1);
	$("#sub_menu2 a").after(ooprint_arrow2);
	$(".country_box a").after(ooprint_arrow2);
	$(".footer a").after(ooprint_arrow1);
	$(".cat_header_menu a").after(ooprint_arrow1);
	
	$("a.button").append(ooprint_arrow2);
	$("a.info_button").append(ooprint_arrow2);
	
	$("a.bottom_button").append(ooprint_arrow2);
	
	$("#free_cards_frame p").append(ooprint_arrow1);
	
	$('a#tt_1').hover(function() {
		$("p.tt_1").show();
	}).mouseleave(function(){
		$("p.tt_1").hide();
	});
	$('a#tt_2').hover(function() {
		$("p.tt_2").show();
	}).mouseleave(function(){
		$("p.tt_2").hide();
	});
	$('a#tt_3').hover(function() {
		$("p.tt_3").show();
	}).mouseleave(function(){
		$("p.tt_3").hide();
	});
	
	$('#country_box a').click(function() {
		if ( $('#country_list').hasClass("show_country_list") ) {
			$('#country_list').fadeOut('fast',function() {
				$('#country_list').removeClass('show_country_list');
			});
		} else {
			$('#country_list').fadeIn('fast',function() {
				$('#country_list').addClass('show_country_list');
			});
			}
	});

	$('#auth_button').click(function() {
		if ( $(this).hasClass("button_clicked") ) {
			$(this).removeClass('button_clicked');
			$(this).addClass('button');
			$('#auth_frame').fadeOut('fast',function() {
				$(this).removeClass('clicked');
			});
		} else {
			$(this).removeClass('button');
			$(this).addClass('button_clicked');
			$('#auth_frame').fadeIn('fast',function() {
				$(this).addClass('clicked');
			});
			}
	});

	$('ul#top_menu a').hover(function() {
		var curChildIndex = $(this).parent().prevAll().length + 1;
		$(this).parent().parent().children('.current').removeClass('current');
		$(this).parent().addClass('current');
		$(this).parent().parent().next('#sub_menu').children('.current').fadeIn('fast',function() {
			$(this).removeClass('current');
			$(this).parent().children('ul:nth-child('+curChildIndex+')').fadeOut('fast',function() {
				$(this).addClass('current');
			});
		});
		return false;
	});
});



//HOME CAROUSEL
(function () {
    $.fn.infiniteCarousel = function () {
        function repeat(str, n) {
            return new Array( n + 1 ).join(str);
        }
        
        return this.each(function () {
            // magic!
            var $wrapper = $('> div', this).css('overflow', 'hidden'),
                $slider = $wrapper.find('> ul').width(9999),
                $items = $slider.find('> li'),
                $single = $items.filter(':first')
                
                singleWidth = $single.outerWidth(),
                visible = Math.ceil($wrapper.innerWidth() / singleWidth),
                currentPage = 1,
                pages = Math.ceil($items.length / visible);
                
            /* TASKS */
            
            // 1. pad the pages with empty element if required
            if ($items.length % visible != 0) {
                // pad
                $slider.append(repeat('<li class="empty" />', visible - ($items.length % visible)));
                $items = $slider.find('> li');
            }
            
            // 2. create the carousel padding on left and right (cloned)
            $items.filter(':first').before($items.slice(-visible).clone().addClass('cloned'));
            $items.filter(':last').after($items.slice(0, visible).clone().addClass('cloned'));
            $items = $slider.find('> li');
            
            // 3. reset scroll
            $wrapper.scrollLeft(singleWidth * visible);
            
            // 4. paging function
            function gotoPage(page) {
                var dir = page < currentPage ? -1 : 1,
                    n = Math.abs(currentPage - page),
                    left = singleWidth * dir * visible * n;
                
                $wrapper.filter(':not(:animated)').animate({
                    scrollLeft : '+=' + left
                }, 2000, function () {
                    // if page == last page - then reset position
                    if (page > pages) {
                        $wrapper.scrollLeft(singleWidth * visible);
                        page = 1;
                    } else if (page == 0) {
                        page = pages;
                        $wrapper.scrollLeft(singleWidth * visible * pages);
                    }
                    
                    currentPage = page;
                });
            }
            
            // 5. insert the back and forward link
            $wrapper.after('<a href="#" class="arrow back" title="Précédent"></a><a href="#" class="arrow forward" title="Suivant"></a>');
            
            // 6. bind the back and forward links
            $('a.back', this).click(function () {
                gotoPage(currentPage - 1);
                return false;
            });
            
            $('a.forward', this).click(function () {
                gotoPage(currentPage + 1);
                return false;
            });
            
            $(this).bind('goto', function (event, page) {
                gotoPage(page);
            });
            
            // THIS IS NEW CODE FOR THE AUTOMATIC INFINITE CAROUSEL
            $(this).bind('next', function () {
                gotoPage(currentPage + 1);
            });
        });
    };
})(jQuery);

$(document).ready(function () {
    // THIS IS NEW CODE FOR THE AUTOMATIC INFINITE CAROUSEL
    var autoscrolling = true;
    
    $('.infiniteCarousel').infiniteCarousel().mouseover(function () {
        autoscrolling = false;
    }).mouseout(function () {
        autoscrolling = true;
    });
    
    setInterval(function () {
        if (autoscrolling) {
            $('.infiniteCarousel').trigger('next');
        }
    }, 4000);
});
