/*	
Author:Kyo Ichida
Author URI:http://www.abcjapon.com
Version:0.1
*/

Array.prototype.shuffle=function(){
	var i=this.length;
	while(i){
		var j=Math.floor(Math.random()*i);
		var t=this[--i];
		this[i]=this[j];
		this[j]=t;
	}
	return this;
}
var a=new Array(-10,-5,-3,2,8);
a.shuffle();
//alert(a);

var s='<style type="text/css">';
s+='#twitter_update_list li{\
	z-index:2;\
	-moz-transform:rotate(-2deg);\
	-webkit-transform:rotate(-2deg);\
	-o-transform:rotate(-2deg);\
	transform:rotate(-2deg);\
}';
for(i=0; i<a.length; i++){
	s+='#twitter_update_list li:nth-child('+(i+1)+'){-moz-transform:rotate('+a[i]+'deg);';
	s+='-webkit-transform:rotate('+a[i]+'deg);';
	s+='-o-transform:rotate('+a[i]+'deg);';
	s+='transform:rotate('+a[i]+'deg);}';
}
s+='#twitter_update_list li:hover{\
	-moz-transform:rotate(0deg);\
	-webkit-transform:rotate(0deg);\
	-o-transform:rotate(0deg);\
	transform:rotate(0deg);\
}';
s+='</style>';
//alert(s);
document.write(s);

jQuery(document).ready(function($){
var d=new Array(-36,-22,-8,5,16,24,36);
for(i=0; i<d.length; i++){
	eval('$(".rub li:nth-of-type('+(i+1)+')").transform({"skewX": "'+d[i]+'deg"});');
}

$("#lang .ja").transform({"skewX": '30deg'});
$("#lang .fr").transform({"skewX": '-30deg'});
$("#sns").css({opacity: 0.0});
$("html").hover(function(){
	$("#sns").stop(true, false).animate({opacity: 1.0});
},function(){
	$("#sns").stop(true, false).animate({opacity: 0.0});
});

function slide(a,b,c,d){
var s=500;
eval('$("#japon").stop(true, false).animate({ marginLeft: "' + a + 'px" }, ' + s + ' ); $("#lang").stop(true, false).animate({ marginLeft: "' + b + 'px" }, ' + s + ' ); $("#lang .ja").stop(true, false).animate({"skewX": "' + c + 'deg"}); $("#lang .fr").stop(true, false).animate({"skewX": "' + d + 'deg"});');
}

$(".rub li:nth-of-type(1) a").hover(function(){
	slide(60,180,45,0);
});
$(".rub li:nth-of-type(2) a").hover(function(){
	slide(40,120,42,-12);
});
$(".rub li:nth-of-type(3) a").hover(function(){
	slide(20,60,37,-22);
});
$(".rub li:nth-of-type(4) a").hover(function(){
	slide(0,0,31,-31);
});
$(".rub li:nth-of-type(5) a").hover(function(){
	slide(-20,-60,22,-37);
});
$(".rub li:nth-of-type(6) a").hover(function(){
	slide(-40,-120,12,-42);
});
$(".rub li:nth-of-type(7) a").hover(function(){
	slide(-60,-180,0,-45);
});
});

