// JavaScript Document

var tgPhotoUtil = {
	
	//トップページ用
	embedMvPhotoThmbs : function() {
		
		$.get(this.topXmlPath, null, function(data){
			
			var e = '<ul>';
			$("photo", data ).each( function(){
				
				var img = tgPhotoUtil.imgPath + $(this).attr("id") + "s.jpg";
				var url = "/entertainment/photo/?" + $(this).attr("id");
				e += '<li><a href="' + url + '"><img src="' + img + '" width="69" height="46" alt="" /></a></li>';
				
			});
			
			e += '<li><a href="/entertainment/photo/"><img src="img/top/mv/photo/bt_other_photo.gif" width="69" height="46" alt="他の写真を見る" class="over" /></a></li>';
			
			e += '</ul>';
			$("#mv_photo_thumbs").append( e );
			
		});
		
	},
	
	//エンタメトップ用
	embed2ndTopThmbs : function() {
		
		$.get(this.topXmlPath, null, function(data){
			
			var e = '<table>';
			
			for ( var i = 0 ; i < 3 ; i++ ) {
				
				var $photo = $("photo:eq(" + i + ")", data )
				
				var img = tgPhotoUtil.imgPath + $photo.attr("id") + "s.jpg";
				var url = "/entertainment/photo/?" + $photo.attr("id");
				e += "<tr>";
				e += '<th><a href="' + url + '"><img src="' + img + '" width="69" height="46" alt="" /></a></th>';
				e += '<td><a href="' + url + '">' + $("cap", $photo).text() + '</a></td>';
				e += "</tr>"
				
			}
			
			e += '</table>';
			
			$("#ev-photo .thumbs").append( e );
			
		});
		
	},
	
	imgPath: "/photo/img/",
	
	xmlPath: "/photo/xml/photo.xml",
	
	topXmlPath: "/photo/xml/photoTop.xml"
	
	
}

