$(function(){
	var cute = jQuery('div[id="cute"]');
	var start = new Array();
	for(var i = 0;i < cute.length;i ++) {
		start.push(1);
		img = jQuery(cute[i]).find('img');
		if(img.length >= 1) {
			jQuery(cute[i]).css('width','815px');
			jQuery(cute[i]).css('height','208px');
		}
		if(img.length > 1) {
			for(var j = 1;j < img.length;j ++) {
				img.eq(j).animate({opacity:0},1);
			}
		}
	}
	
	jQuery.extend({
		photo_switch: function() {
			var cute = jQuery('div[id="cute"]');
			for(var i = 0;i < cute.length;i ++) {
				sub_num = jQuery(cute[i]).find('img').length;

				if(sub_num > 0) {
					if(sub_num > 1) {
						if(start[i] == sub_num) {
							start[i] = 0;
							jQuery(cute[i]).find("img:not(" + start[i] + ")").animate({opacity:0},1000);
							jQuery(cute[i]).find("img:eq(" + start[i] + ")").animate({opacity:1},400);
						} else {
							start[i] == 0 ? ++start[i] : '';
							jQuery(cute[i]).find("img:not(" + start[i] + ")").animate({opacity:0},1000);
							jQuery(cute[i]).find("img:eq(" + start[i] + ")").animate({opacity:1},400);
							
							start[i] ++;
						}
					}
				}
			}
		}
	}); 
});