$(document).ready(function() {
	
	//top------------------------------------------------>
    //another setting---->
    $("#topPage #contents .update dt:first").addClass("firstChild");
    $("#topPage #contents .update dt:last").addClass("lastChild");

    //hover setting---->
    //top bnr link
    $(".csGroups dl dt").hover(
		function() {
		    $(this).css("border", "1px solid #999");
		},
		function() {
		    $(this).css("border", "1px solid #ff006c");
		}
	);
    //top bnr button
    $(".csGroups dl dd").hover(
		function() {
		    $(this).css("background-position", "0 -26px");
		},
		function() {
		    $(this).css("background-position", "0 0");
		}
	);

    //pickup link setting---->
    /*$(".csWrapper .csGroups:not(:first)").hide();
    
	var maxCs =  $(".csWrapper .csGroups").length ;
	var maxIndex = maxCs - 1;
	var minCs = maxCs - maxIndex ;
	var minIndex = minCs - 1 ;
	var pager = minCs ;
	
	//button control->
	//next button
	$(".csWrapper .next").css("background-position", "-26px 0");
	$(".csWrapper .next").hover(
		function() {
			$(this).css("background-position", "-26px -26px");
		},
		function() {
			$(this).css("background-position", "-26px 0");
		}
	);
	//prev button
	$(".csWrapper .prev").css("background-position", "0 0");
	$(".csWrapper .prev").hover(
		function() {
			$(this).css("background-position", "0 -26px");
		},
		function() {
			$(this).css("background-position", "0 0");
		}
	);
	//slider event set->
	//next event
	$(".csWrapper .next").click(
		function() {
			if(minIndex < maxIndex){
				$(".csWrapper .csGroups").eq(minIndex).slideUp(0).next().fadeIn(300);
				minIndex += 1 ;
			}
		}
	);
	//prev event
	$(".csWrapper .prev").click(
		function() {
			if(minIndex > 0){
				$(".csWrapper .csGroups").eq(minIndex).slideUp(0).prev().fadeIn(300);
				minIndex -= 1 ;
			}
	});*/

    //bottomPage Setting------------------------------------------------>

	
	$("#contentsMenu .wrapper .menu:last").css("padding","0");
	$("#contentsMenu .wrapper .menu dd:last").css("margin-bottom","0");
	$(".csTemp #aside #contentsMenu").hide();

    //link menu
	$(".linkList ul.listBox li.linkcat h2:first").addClass("firstChild");
	$(".linkList ul.listBox li.linkcat h2").addClass("plus").removeClass("minus");
	$("li.linkcat a").attr("target","_blank");
	
    $(".linkList ul.listBox li.linkcat .blogroll li").hide();

    $(".linkList ul.listBox li.linkcat h2").hover(function() {
        $(this).css("background-color", "#CCFFFF");
    }, function() {
        $(this).css("background-color", "#f4f4f4");
    });
	
	$(".linkList ul.listBox li.linkcat h2").toggle(
		function() {
			var index = $(this).index(this);
			$(this).eq(index).next(".blogroll").children("li").show(250);
			$(this).addClass("minus");
			$(this).removeClass("plus");
		},
		function() {
			var index = $(this).index(this);
			$(this).eq(index).next(".blogroll").children("li").hide(250);
			$(this).addClass("plus");
			$(this).removeClass("minus");
		}
	);
	
	//bottomPage Setting------------------------------------------------>
	
	$("#commentBox .commentClm .section:last").css("border","none");
	$(".bottomIndex #article .clmSection:last").css("margin","0");
	
	$("#galleryPage .cautionBox .ok").hover(
		function(){
			$(this).css("background","#e4e4e4");
		},
		function(){
			$(this).css("background","#F3F3F3");
		}
	);
	$("#galleryPage .cautionBox .ok").click(
		function(){
			$("#galleryPage .cautionBox").hide(250);
		}
	);
	
	//img wordpress fix
	$(".singlePage .clmSection p a img").removeAttr("height");
	$(".singlePage .clmSection p a img").parent("a").addClass("thickbox");
	$(".singlePage .clmSection p a.thickbox").parent("p").addClass("photoBox");
	$(".singlePage .clmSection p a.thickbox img.alignleft").parents("p").addClass("left");
	$(".singlePage .clmSection p a.thickbox img.alignright").parents("p").addClass("right");
	$(".singlePage .clmSection p a.thickbox img.aligncenter").parents("p").addClass("center");
	
	var imgLfn = $("p a img");

	for(var i = 0, j = imgLfn.length; i < j; i++){
	if(imgLfn[i].width > 350) { imgLfn[i].width = 350; }
	}
	
	/* mail form */
	$(".submitBtn input").removeAttr("value").attr("value","");
			
    //plugins------------------------------------------------>

    //-------> curvyCorners Setting <---------
    //cBox is allways sux
    var bi = new BrowserInfo();
	
	if(bi.safari) {
	} else {
	var settings = {
        tl: { radius: 5 },
        tr: { radius: 5 },
        bl: { radius: 5 },
        br: { radius: 5 },
        antiAlias: true
    };
    curvyCorners(settings, '.cBox');
    //rBox is read text
    var settings = {
        tl: { radius: 5 },
        tr: { radius: 5 },
        bl: { radius: 0 },
        br: { radius: 0 },
        antiAlias: true
    };
    curvyCorners(settings, '.rBox');
	};


});