

var movieAry = [
				
				'<object width="300" height="198"><param name="movie" value="http://www.youtube.com/v/EG_G2xklK1A?fs=1&amp;hl=ja_JP&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/EG_G2xklK1A?fs=1&amp;hl=ja_JP&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="300" height="198"></embed></object>',
				
				'<object width="300" height="198"><param name="movie" value="http://www.youtube.com/v/RnRJr6yyNvw?fs=1&amp;hl=ja_JP&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/RnRJr6yyNvw?fs=1&amp;hl=ja_JP&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="300" height="198"></embed></object>'	
				
				
				]


$(document).ready(function(){
	
	$('#youtubeVideo').empty();
	$('div#youtubeVideo').prepend(movieAry[1]);
	
	
	$('#videoList li a').click(function(){
								   
								   
		$('#youtubeVideo').empty();
		
		
		
		$('#videoList li').removeClass("selected");
		
		
		$(this).parents("li").addClass("selected");
		
		if ( $(this).parents("li").hasClass('yt01') ) {
			$('div#youtubeVideo').prepend(movieAry[0]);
		}
		
		if ( $(this).parents("li").hasClass('yt02') ) {
			$('div#youtubeVideo	').prepend(movieAry[1]);
		}
		
	});
	
	$('#videoList li').hover(
    function(){ $(this).text('kH'); },
    function(){ $(this).text('k['); }
  );
	
	$(".hov").hover(function(){ 
		$(this).fadeTo(200,0.6); 
	},function() {
		$(this).fadeTo(200,1); 
	});
	
	$(".pager a").hover(function(){ 
		$(this).fadeTo(200,0.6); 
	},function() {
		$(this).fadeTo(200,1); 
	});
	
	
	
	
// smooth scroller
	$("a[href^=#]").click(function() {
		var hash = this.hash;
		if(!hash || hash == "#")
			return false;
		$($.browser.safari ? 'body' : 'html')
			.animate({scrollTop: $(hash).offset().top}, 500, "swing");
		return false;
	});	
  
  
});

$(function(){
    $('.mainBG img:gt(0)').hide();
    setInterval(function(){
      $('.mainBG :first-child').fadeOut(1600)
         .next('img').fadeIn(1600)
         .end().appendTo('.mainBG');},
      8000);
});



/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
*/

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_o'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;

