jQuery().ready(function() {
	$('#redSlider').loopedSlider({autoStart: 5000});
	$('#smallSlider').loopedSlider({autoStart: 5000});
	
	$('.hint').bind("focus", function(e) {
      if(this.value==this.title){this.value='';}
    });
  
    $('.hint').bind("blur", function(e) {
      if(this.value==''){this.value=this.title;}
    });
	
	$('.gallery li').bind("click", function(e) {
      t = $(this).attr('id').replace('_link',"");
	  $('.popup').hide('fast');
	  $('#'+t).show('fast');
    });
	
	$('.gallery2 li').bind("click", function(e) {
      t = $(this).attr('id').replace('_link',"");
	  $('.popup').hide('fast');
	  $('#'+t).show('fast');
    });
	
	$('.popup_close').bind("click", function(e) {
	  $(this).parent().hide('fast');
	});
	
	$('.pink_box_left a.title_button').bind("click", function(e) {
		if ($(this).attr('id').lastIndexOf('unwrap_link')>-1)
		{
			t = $(this).attr('id').replace('_link',"_content");
			if ($('#'+t).css('display')=='block')
			{
				$(this).find('img').attr('src','images/arrow_b.jpg');
				$(this).find('span').html('D&eacute;plier');
				$('#'+t).hide('fast');
			}
			else
			{
				$(this).find('img').attr('src','images/arrow_u.jpg');
				$(this).find('span').html('Replier');
				$('#'+t).show('fast');
			}
		}
    });


    // KANGOUROUGE
    $.prettyLoader();
    openBlankLink();

    /*
    $.browser.msie6 = $.browser.msie &&/MSIE 6\.0/i.test(window.navigator.userAgent) &&!/MSIE 8\.0/i.test(window.navigator.userAgent) &&!/MSIE 7\.0/i.test(window.navigator.userAgent);
    if($.browser.msie6) {
        var left_position = ($(window).width()/2)-($('#ie6').width()/2);
        $('#ie6').css('left', left_position+'px');
        $('#ie6').css('display', 'block');
    }*/

    $("a.ajaxLink").bind("click", function(e) {
          var rel_elem = $(this).attr('rel');
          $.prettyLoader.show('fast', e);
          jQuery.ajax({
              url : $(this).attr('href'),
              type : 'get',
              dataType   : 'html',
              cache : false,
              success    : function(data, textStatus){
                  jQuery(rel_elem).html(data);
                  $(rel_elem).show('fast');
              },
              beforeSend : function(XMLHttpRequest){
                $(rel_elem).hide('fast');
                //$(rel_elem).html('<img src="/images/ajax-loader.gif" />')

              }
          });

          return false;
      });

});



function openBlankLink() {

    var liens = $('a.blank');
        for (var i = 0 ; i < liens.length ; i++)  {
                liens[i].onclick = function()  {
                        window.open(this.href);
                        return false;
                };
        }
}
