// JavaScript Document
/*
function change_option(number,index){
	for (var i = 1; i <= number; i++){
		document.getElementById('products' + i).style.display = 'none';
	}
	document.getElementById('products' + index).style.display = 'block';
}

*/

function showLeft(nowLeft){
		for(var i = 0; i < 6; i++){
			document.getElementById('L'+i).className = i == nowLeft ? 'nowLeft':'otherLeft';
		}
	}
function showRight(nowRight){
		for(var j = 6; j < 12; j++){
			document.getElementById( 'R'+j).className =j == nowRight ? 'nowRight':'otherRight';
		}
	}
function showLeft1(nowLeft){
		for(var i = 0; i < 3; i++){
			document.getElementById('L'+i).className = i == nowLeft ? 'nowLeft':'otherLeft';
		}
	}
function showRight1(nowRight){
		for(var j = 6; j < 9; j++){
			document.getElementById( 'R'+j).className =j == nowRight ? 'nowRight':'otherRight';
		}
	}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

$(document).ready(function(){
	var container = $('div.sliderGallery');
	var ul = $('ul', container);
	var itemsWidth = ul.innerWidth() - container.outerWidth();
	$('.slider', container).slider({
		minValue: 0,
		maxValue: itemsWidth,
		handle: '.handle',
		stop: function (event, ui) {
			ul.animate({'left' : ui.value * -1}, 500);
		},
		slide: function (event, ui) {
			ul.css('left', ui.value * -1);
		}
	});

	var autoPhoto = ['0','-970','-1940','-2910','-1940','-970'];
	var autoSlider = ['0','135','270','405','270','135'];
	var s = 0;
	setInterval(function(){
		s -= 0;
		$('.sliderGallery ul').animate({left:autoPhoto[s]},3000);
		$('.handle').css('left',autoSlider[s]-0);
		s++;
		if (s == 6){s = 0;}
	},6000);

});


/*

function showTable(one){
		for(var j = 0; j < 6; j++){
			document.getElementById('products'+j).style.display= j == one ? '':'none'; 
		}
}

function getPars(qs)
	{
		var s = location.href;
		s = s.replace("?","?&").split("&");
		var re = "";
		for(i=1;i<s.length;i++)
			if(s[i].indexOf(qs+"=")==0)
				re = s[i].replace(qs+"=","");
		return re;
	}
$(document).ready(function(){
			var i = getPars('show');
			if (i == '') i = 0;
			showTable(getPars('show'));
	});
*/