$(function() {

	var cutout = Math.ceil (Math.random() * 4);
	$('#bannerPop').html('<img src = images_Shelter/home/photo'+cutout+'-2.png>');
		if(cutout == 1){
			if($('body').hasClass("msie7PC") == true){
			$('#bannerPop').css({'right':'-54px', 'top': '-84px'});
			}else if($('body').hasClass("msie6PC") == true){
				$('#bannerPop').css({'right':'-54px', 'top': '-84px'});	
			}else if($('body').hasClass("msie8PC") == true){
				$('#bannerPop').css({'right':'-54px', 'top': '-76px'});
			}else{
				$('#bannerPop').css({'right':'-54px', 'top': '-79px'});
			}
		}else if(cutout == 2){
			if($('body').hasClass("msie7PC") == true){
				$('#bannerPop').css({'right':'-22px','top': '-116px'});
			}else if($('body').hasClass("msie6PC") == true){
				$('#bannerPop').css({'right':'-22px','top': '-116px'});
			}else{
				$('#bannerPop').css({'right':'-69px','top': '-116px'});
			}
		}else if(cutout == 3){
			if($('body').hasClass("msie7PC") == true){
				$('#bannerPop').css({'right':'20px', 'top':'-54px' });
			}else if($('body').hasClass("msie6PC") == true){
				$('#bannerPop').css({'right':'20px', 'top':'-54px' });
			}else{
				$('#bannerPop').css({'right':'-51px', 'top':'-54px' });
			}
		}else if(cutout==4){
			if($('body').hasClass("msie7PC") == true){
				$('#bannerPop').css({'right':'-36px', 'top':'-65px'});
			}else if($('body').hasClass("msie6PC") == true){
				$('#bannerPop').css({'right':'-36px', 'top':'-65px'});
			}else if($('body').hasClass("msie8PC") == true){
				$('#bannerPop').css({'right':'-36px', 'top':'-57px'});
			}else{
				$('#bannerPop').css({'right':'-36px', 'top':'-60px'});
			}
		}
		var ssuLi = $('#slideShow > ul li');
		var ssuLiLength = ssuLi.length - 1;
		var theCurrent = 0;
		ssuLi.eq(0).show().addClass('current');
		
		$('#next').click(function() { 
			if(theCurrent == ssuLiLength){
				ssuLi.eq(theCurrent).fadeOut().removeClass('current');
				ssuLi.eq(0).fadeIn().addClass('current');
				theCurrent = 0;
			}else{
				ssuLi.eq(theCurrent).fadeOut().removeClass('current').next().fadeIn().addClass('current');
				theCurrent += 1;
			}
			return false;
		});
		
		$('#prev').click(function() {
			if(theCurrent == 0){
				ssuLi.eq(theCurrent).fadeOut().removeClass('current');
				ssuLi.eq(ssuLiLength).fadeIn().addClass('current');
				theCurrent = ssuLiLength;
			}else{
				ssuLi.eq(theCurrent).fadeOut().removeClass('current').prev().fadeIn().addClass('current');
				theCurrent -= 1;
			}
			return false;
		});
	
});

	

