$jQ(document).ready(function() {

$jQ(".detail-button a").click (
  function () {
    $jQ(this).addClass("selected");
	$jQ(".description-button a").removeClass("selected");
	$jQ(".product-details .description").addClass("item-hidden");
	$jQ(".product-details .details").removeClass("item-hidden");
  }
);

$jQ(".description-button a").click (
  function () {
    $jQ(this).addClass("selected");
	$jQ(".detail-button a").removeClass("selected");
	$jQ(".product-details .details").addClass("item-hidden");
	$jQ(".product-details .description").removeClass("item-hidden");
  }
);

$jQ(".back-button").click (function () {
    history.go(-1);
    return false;
});

//$jQ('#txt_newsletter').val($jQ('#txt_newsletter').attr('title'));
$jQ('#txt_newsletter').focus(function() {
    if ($jQ(this).val() == $jQ(this).attr('title')) {
        $jQ(this).val('')
    }
});
$jQ('#txt_newsletter').blur(function() {
    if ($jQ.trim($jQ(this).val()) == '') {
        $jQ(this).val($jQ(this).attr('title'));
    }
});

$jQ('#txt_newsletter').blur();


});

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

  $jQ(document).ready(function() {
    Gallery = {
      setup: function(container, prev, next, interval) {
        this.container = $jQ(container);
        $jQ(prev).click(this.prev);
        $jQ(next).click(this.next);
        this.interval = interval;
		Gallery.active = this.container.children('div').first();
		Gallery.play();
      },

      play: function() {
        Gallery.timer = setInterval(function(){
//		  alert(Gallery.active.attr('class'));
          Gallery.active = Gallery.active.next();
//		  alert(Gallery.active.attr('class'));
          if ( Gallery.active.length === 0) { //If paging reaches the end...
              Gallery.active = Gallery.container.children('div').first();
          }
          Gallery.rotate();
        }, Gallery.interval);
      },


      rotate: function() {
        Gallery.container.children(':visible').fadeOut('slow', function() {
			Gallery.active.fadeIn('slow');
		});
      },

	  prev: function() {
        clearInterval(Gallery.timer);
        Gallery.active = Gallery.active.prev('div');
        if ( Gallery.active.length === 0) { //If paging reaches the end...
          Gallery.active = Gallery.container.children('div').last();
        }
        Gallery.rotate();
		Gallery.play();
		return false;
	  },

	  next: function() {
        clearInterval(Gallery.timer);
        Gallery.active = Gallery.active.next();
        if ( Gallery.active.length === 0) { //If paging reaches the end...
          Gallery.active = Gallery.container.children('div').first();
        }
        Gallery.rotate();
		Gallery.play();
		return false;
	  }
    };

    Gallery.setup('#home_header1', '.navleft', '.navright', 3500);

		$jQ("#home_header").hover(function() {
	    $jQ('.innernav').fadeIn('slow');
		}, function() {
			$jQ('.innernav').fadeOut('slow');
		});

  });


$jQ(document).ready(function() {

$jQ('.whiteout').delay(2000)
.fadeIn(1, function(){
	$jQ('.ss12_shoes').animate({top:0, left:-800}, 8000, function(){
		$jQ('.whiteout').delay(1000)
		.fadeIn(1, function(){
			$jQ('.ss12_shoes').animate({top:0, left:200}, 1)
			.animate({top:0, left:-800}, 8000, function(){
					$jQ('.whiteout').delay(1000)
					.fadeIn(1, function(){
						$jQ('.ss12_shoes').animate({top:0, left:200}, 1)
						.animate({top:0, left:-200}, 4000)
						})
					.fadeOut(1000)
				})
			})
		.fadeOut(1000)
		.delay(6000)
		.fadeIn(1000)
	})
	})
.fadeOut(1000)
.delay(6000)
.fadeIn(1000)

});


