$(function() {
	var viewTime = 7000;

	var timerID;
	var nowNum = 0;
	var cnt = 10;

	var len = $('#indexMainPh li').size();

	function phView(num){
		clearTimeout(timerID);
		cnt ++;
		nowNum = num;

		$('#indexMainPh li:eq(' + num + ')').css({'z-index':cnt, opacity:0}).animate({opacity: 1}, 700, 'linear');
		timerID = setTimeout(timerFunc, viewTime);
	}


	function timerFunc(){
		phView((nowNum+1)%len);
	}

	timerID = setTimeout(timerFunc, viewTime);
});


if($.browser.msie && $.browser.version < 7){
	var oldFixPng = DD_belatedPNG.fixPng;
	DD_belatedPNG.fixPng = function (el) {
		oldFixPng(el);
		if (el.vml && el.vml.image.fill.getAttribute("src").match(/_off\./)) {
			el.vml.image.shape.attachEvent('onmouseenter', function() {
				var image = el.vml.image.fill;
				image.setAttribute("src", image.getAttribute("src").replace("_off.", "_on."));
			});
			el.vml.image.shape.attachEvent('onmouseleave', function() {
				var image = el.vml.image.fill;
				image.setAttribute("src", image.getAttribute("src").replace("_on.", "_off."));
			});
		}
	};
    DD_belatedPNG.fix('img, #indexGlobalNavi, #indexMainBottom p');
}
