var vars = {};
var params = { scale:'noScale', salign:'lt', menu:'false', bgcolor:'#ffffff'};
var attributes = { id:'movieflash', name:'movieflash' };
swfobject.embedSWF("share/swf/player.swf", "movieflash", "265", "188", "8.0.0", "share/js/expressInstall.swf", vars, params, attributes );
var vars = {domain:'http://www2.life-x.jp'};
var params = { scale:'exactFit ', salign:'lt', menu:'false', bgcolor:'#ffffff'};
var attributes = { id:'smallarea', name:'smallarea' };
swfobject.embedSWF("http://www2.life-x.jp/html/swf/bp_l.swf?album_id=m2GHlBIhdh52V4unhPqrGg==", "smallarea", "370", "228", "8.0.0", "../share/js/expressInstall.swf", vars, params, attributes );

var vars = {};
var params = { scale:'noScale', salign:'lt', menu:'false', bgcolor:'#ffffff'};
var attributes = { id:'newsload', name:'newsload' };
swfobject.embedSWF("share/swf/fifareader.swf", "newsload", "177", "13", "8.0.0", "share/js/expressInstall.swf", vars, params, attributes );

function fifanewsreader(str){
	$('#boxcontainer2').append(str);
}
function fifanewsreaderfinish(){
	$("#boxcontainer2 div").eq(0).css("cursor","pointer");
	$("#boxcontainer2 div").eq(1).css("cursor","pointer");
	$("#boxcontainer2 div").eq(2).css("cursor","pointer");
	$("#boxcontainer2 div").eq(3).css("cursor","pointer");
	$("#boxcontainer2 div").eq(4).css("cursor","pointer");
	$("#boxcontainer2 div").eq(5).css("cursor","pointer");
	$("#boxcontainer2 div").eq(6).css("cursor","pointer");
	$("#boxcontainer2 div").eq(7).css("cursor","pointer");
	$("#boxcontainer2 div").eq(8).css("cursor","pointer");
	$("#boxcontainer2 div").eq(9).css("cursor","pointer");
	$("#boxcontainer2 div").eq(0).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer2 div").eq(1).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer2 div").eq(2).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer2 div").eq(3).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer2 div").eq(4).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer2 div").eq(5).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer2 div").eq(6).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer2 div").eq(7).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer2 div").eq(8).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer2 div").eq(9).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
}
 $(document).ready(function(){
							$.easing.easeOutQuint = function (x, t, b, c, d) {
      	return c*((t=t/d-1)*t*t*t*t + 1) + b;
	};
	$("#next1").click(function(){
		$("#boxcontainer").scrollTo( '+=60px', 100 , { easing:'easeOutQuint' } );
	});
	$("#prev1").click(function(){
		$("#boxcontainer").scrollTo( '-=60px', 100 , { easing:'easeOutQuint' } );
	});

	$('#topbnrleft').bind('mousewheel', function(event, delta) {
				var dir = delta > 0 ? 'Up' : 'Down';
				var vel = Math.abs(delta);
				if(dir=="Up"){
					$("#boxcontainer").scrollTo( '-=10px', 0 , { easing:'easeOutQuint' } );
				}else{
					$("#boxcontainer").scrollTo( '+=10px', 0 , { easing:'easeOutQuint' } );
				}
				return false;
	})
	$("#next2").click(function(){
		$("#boxcontainer2").scrollTo( '+=60px', 100 , { easing:'easeOutQuint' } );
	});
	$("#prev2").click(function(){
		$("#boxcontainer2").scrollTo( '-=60px', 100 , { easing:'easeOutQuint' } );
	});

	$('#centerbottomright').bind('mousewheel', function(event, delta) {
				var dir = delta > 0 ? 'Up' : 'Down';
				var vel = Math.abs(delta);
				if(dir=="Up"){
					$("#boxcontainer2").scrollTo( '-=10px', 0 , { easing:'easeOutQuint' } );
				}else{
					$("#boxcontainer2").scrollTo( '+=10px', 0 , { easing:'easeOutQuint' } );
				}
				return false;
	})
	var _num=0
	$.ajax({
		url: 'share/xml/sonyfootballtopics.xml',
		async: true,
		cache: false,
		dataType: "xml",
		success: function(xml){
			$(xml).find('item').each(function(i){
				var title = $(this).find('title').text();
				var date = $(this).find('date').text();
				var url = $(this).find('link').text();
				var img = $(this).find('img').text();
				_num = _num +1;
				if(_num==1 || _num==3 ||_num == 5 || _num ==7|| _num ==9|| _num ==11|| _num ==13|| _num ==15|| _num ==17|| _num ==19){
					$('#boxcontainer').append('<li class="clearfix topicbox1 box"><div class="thumbnail"><a href="'+url+'" target ="_blank"><img src="'+img+'" alt="" ><\/a><\/div><div class="desc"><h4>'+title+'<\/h4><\/div><\/li>');
				}else{
					$('#boxcontainer').append('<li class="clearfix topicbox2 box"><div class="thumbnail"><a href="'+url+'" target ="_blank"><img src="'+img+'" alt="" ><\/a><\/div><div class="desc"><h4>'+title+'<\/h4><\/div><\/li>');
				}
			});
			jhoverset();
		},error: function(xml){
			$('#boxcontainer').append('<li>---<\/li>');
		}
	});
	$("img.rollover,input.rollover").each(function(){
		var imgSrc = this.src;
		var sep = imgSrc.lastIndexOf('.');
		var onSrc = imgSrc.substr(0, sep) + '_ovr' + imgSrc.substr(sep, 4);
		preLoadImg[imgSrc] = new Image();
		preLoadImg[imgSrc].src = onSrc;
		$(this).hover(
			function() { this.src = onSrc; },
			function() { this.src = imgSrc; }
		);
	});

})
 var preLoadImg = new Object();
window.onunload = function(){}
function jhoverset(){
	
	$("#boxcontainer li").eq(0).css("cursor","pointer");
	$("#boxcontainer li").eq(1).css("cursor","pointer");
	$("#boxcontainer li").eq(2).css("cursor","pointer");
	$("#boxcontainer li").eq(3).css("cursor","pointer");
	$("#boxcontainer li").eq(4).css("cursor","pointer");
	$("#boxcontainer li").eq(5).css("cursor","pointer");
	$("#boxcontainer li").eq(6).css("cursor","pointer");
	$("#boxcontainer li").eq(7).css("cursor","pointer");
	$("#boxcontainer li").eq(8).css("cursor","pointer");
	$("#boxcontainer li").eq(9).css("cursor","pointer");
	$("#boxcontainer li").eq(0).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer li").eq(1).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer li").eq(2).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer li").eq(3).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer li").eq(4).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer li").eq(5).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer li").eq(6).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer li").eq(7).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer li").eq(8).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
	$("#boxcontainer li").eq(9).hover(function(){
		$(this).addClass("jhover");
		$(this).find("img").css("opacity",0.7);
	},function(){
		$(this).removeClass("jhover");
		$(this).find("img").css("opacity",1);
	}).click(function(){
		window.open($(this).find("a").attr("href"));
		return false
	});
}
