$(window).load(function() {
	var count = 1;
	$('#slider').nivoSlider({
		effect:'sliceDown', //Specify sets like: 'fold,fade,sliceDown'
		slices:15,
		animSpeed:1500,
		pauseTime:5800,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:false, //Next & Prev
		directionNavHide:false, //Only show on hover
		controlNav:false, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, //Use image rel for thumbs
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav:false, //Use left & right arrows
		pauseOnHover:false, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.8, //Universal caption opacity
		beforeChange: function(){ },
		afterChange: function(){ if(count == 1){ $('#slider').data('nivo:vars').stop = true; window.location = 'http://www.yorkjewellers.com.au/home/'; } },
		slideshowEnd: function(){ } //Triggers after all slides have been shown
	});
});


function loadImg(){
	window.location.href='#';
};


$(document).ready(function() {

	$('#ContentContainer').fadeIn(1000);
	
	$("p:has(img)").css('margin' , '0');
	
    $('#slideshow').cycle({ 
    fx:     'fade', 
    speed:  2000,
	random: 1   
	});
	
$.each( ['0','1','2','3','4','5','7','8','9','10','11','12','13','14'], function(i){
  $('#ds'+i).mouseover(function() {
  	  $('#s'+i).show();
  }).mouseout(function(){
      $('#s'+i).hide();
  });
});

$('#why').tooltip({ 
    track: true, 
    delay: 0, 
    showURL: false, 
    showBody: " - ", 
    fade: 250 
});

$('#did').tooltip({ 
    track: true, 
    delay: 0, 
    showURL: false, 
    showBody: " - ", 
    fade: 250 
});

$('#promotion div:nth-child(2)').attr("id", "pro-pad");

$('#temp').cycle({
	fx:     'fade', 
    speed:  4500,
	timeout: 2000,
	random: 1
});

var isiPad = navigator.userAgent.match(/iPad/i) != null;
var isiPhone = navigator.userAgent.match(/iPhone/i) != null;


if(isiPad || isiPhone){
$('.menu li').click(function(){
	$('.menu li ul').hide();
	$('ul', this).show();						 
});
}

});
