function kaigyo(){
var left =new Array();
left['0']='<a href="http://www.it-market.tv/all/" id="cimg0"><img src="img/kaigyo-pack/change0.png" alt="オフィス開業パック"/></a>';
left['1']='<a href="http://www.it-market.tv/all/all01.htm" id="cimg1"><img src="img/kaigyo-pack/change1.png" alt="1人用" /></a>';
left['3']='<a href="http://www.it-market.tv/all/all02.htm" id="cimg3"><img src="img/kaigyo-pack/change3.png" alt="3人用" /></a>';
left['5']='<a href="http://www.it-market.tv/all/all03.htm" id="cimg5"><img src="img/kaigyo-pack/change5.png" alt="5人用" /></a>';
left['o']='<a href="http://www.it-market.tv/all/all04.htm" id="cimgo"><img src="img/kaigyo-pack/changeo.png" alt="オプション" /></a>';

var btnfade='fast';
var btnfadeleft='fast';
var toumeido=0.6;
var rotateid=new Array();
rotateid[0]='#change0';
rotateid[1]='#change1';
rotateid[2]='#change3';
rotateid[3]='#change5';
rotateid[4]='#changeo';
var roti=Math.floor(Math.random()*4);

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;
}


	function fade(id){
		$('#change'+id).hover(
			function(){
				$('#changeleft').html(left[id]);
				$(this).fadeTo(btnfade,toumeido);
				$('#cimg'+id).hover
				(
					function(){
						$('#change'+id).fadeTo(btnfadeleft,toumeido);
					},
					function(){
						$('#change'+id).fadeTo(btnfadeleft,1);
					}
				);
				
			},
			function(){
				$(this).fadeTo(btnfade,1);
				$('#cimg'+id).hover
				(
					function(){
						$('#change'+id).fadeTo(btnfadeleft,toumeido);
					},
					function(){
						$('#change'+id).fadeTo(btnfadeleft,1);
					}
				);
			}
		);
	}
	fade('0');
	fade('1');
	fade('3');
	fade('5');
	fade('o');

	
	function rotate(){
		if(roti>4){
			roti=0;
		}
		$("[id^='change']").trigger('mouseleave');
		$(rotateid[roti]).trigger('mouseenter');
		roti+=1;
	}
	rotate();
	var IntID=window.setInterval(rotate,4500);
	$('.changeright').one('mouseenter',function(){
		clearInterval(IntID);
		$("[id^='change']").trigger('mouseleave');
	});
	
}