$(function() {
    $('#slideshowFrench').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav_french',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav_french li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowFbasic').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav_f_basic',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav_f_basic li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowFchef').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav_f_chef',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav_f_chef li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowFsuperior').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav_f_superior',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav_f_superior li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowCbasic').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav_c_basic',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav_c_basic li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowCchef').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav_c_chef',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav_c_chef li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowCsuperior').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav_c_superior',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav_c_superior li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowChinese').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav_chinese',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav_chinese li:eq(' + (idx) + ') a';
        }
    });
});
$(function() {
    $('#slideshowcake').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '.nav_cake',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.nav_cake li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowImpression').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '.nav_impression',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.nav_impression li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowJapanese').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav_Japanese',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav_Japanese li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowPink').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav_pink',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav_pink li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowChapel').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '.nav_chapel',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.nav_chapel li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowGod').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '.nav_god',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.nav_god li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowHall').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '.nav_hall',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.nav_hall li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowGarden').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '.nav_garden',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.nav_garden li:eq(' + (idx) + ') a';
        }
    });
});


$(function() {
    $('#slideshowSaron').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '.nav_saron',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.nav_saron li:eq(' + (idx) + ') a';
        }
    });
});


$(function() {
    $('#slideshowRose').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav_rose',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav_rose li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowWhite').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav_white',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav_white li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowGreen').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav_green',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav_green li:eq(' + (idx) + ') a';
        }
    });
});

$(function() {
    $('#slideshowBright').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav_bright',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav_bright li:eq(' + (idx) + ') a';
        }
    });
});



// =============================================
// TabContents with jQuery
// by Takazudo http://gyauza.egoism.jp/clip/
// =============================================
$(function(){
	$(".TabAreaSet").each(function(){
		var TabAreaAmount = $(this).find(".TabAreaChgMenu").children("li").length;
		var ActiveTabNo;
		for(i=0;i<TabAreaAmount;i++){
			if($(this).find(".TabAreaChgMenu li").eq(i).attr("class") == "On"){
				ActiveTabNo = i;
			}
		}
		for(i=0;i<TabAreaAmount;i++){
			if(i!=ActiveTabNo){
				$(this).find(".TabAreaContents").eq(i).hide();
			}
		}
		$(this).find(".TabAreaChgMenu li a").click(function(){
			$(this).parents("li").eq(0).addClass("Clicked");
			var ClickedTabNo;
			for(i=0;i<TabAreaAmount;i++){
				if(
					$(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgMenu li").eq(i).attr("class")!=null
					&& $(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgMenu li").eq(i).attr("class").indexOf("Clicked")!=-1
				){
					ClickedTabNo = i;
					$(this).parents("li").eq(0).removeClass("Clicked");
					$(this).parents("li").eq(0).addClass("On");
				}else if($(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgMenu li").eq(i).attr("class")!=null){
					$(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgMenu li").eq(i).removeClass("On");
				}
			}
			for(i=0;i<TabAreaAmount;i++){
				if(i!=ClickedTabNo){
					$(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgContents").eq(0).find(".TabAreaContents").eq(i).hide();
				}
			}
			$(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgContents").eq(0).find(".TabAreaContents").eq(ClickedTabNo).show();
			return false;
		});
	});
});

