//---------------------------------------------------------------
// ++common.js++
//---------------------------------------------------------------


//POPUP ############

//汎用POPUP
//<a href="javascript:popUp('url','タイトル','toolbar=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=no,width=678,height=750')" >開く</a>
function popUp(theURL,winName,features) {
	window.open(theURL,winName,features);
}

function popUp01(){
	window.open('url','','toolbar=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=no,width=620,height=570');
}


function switchNavi(selId,selIdNavi){
	if(document.getElementById(selId).style.display == "block"){
		document.getElementById(selId).style.display = "none";
		document.getElementById(selIdNavi).className = "close";
	}
	else{
		document.getElementById(selId).style.display = "block";
		document.getElementById(selIdNavi).className = "open";
	}
}


function switchNaviAll(){
	if( $("div#faqAll").attr("class") == "allOpen"){
		$("div#faqAll dd").css("display", "none");
		$("div#faqAll dt").removeClass("open").addClass("close");
		$("div#faqAll").removeClass("allOpen").addClass("allClose");
		$("a#faqAllBtns").removeClass("openBtn").addClass("closeBtn");
	}
	else if( $("div#faqAll").attr("class") == "allClose"){
		$("div#faqAll dd").css("display", "block");
		$("div#faqAll dt").removeClass("close").addClass("open");
		$("div#faqAll").removeClass("allClose").addClass("allOpen");
		$("a#faqAllBtns").removeClass("closeBtn").addClass("openBtn");
	}
	else{
		$("div#faqAll dd").css("display", "block");
		$("div#faqAll dt").addClass("open");
		$("div#faqAll").addClass("allOpen");
		$("a#faqAllBtns").addClass("openBtn");
	}
}


function pdNavi(selId){
	if(document.getElementById(selId).style.display == "block"){
		document.getElementById(selId).style.display = "none";
	}
	else{
		document.getElementById(selId).style.display = "block";
	}
}


//PAGETOP ############
jQuery.easing.quart = function (x, t, b, c, d) {
    return -c * ((t=t/d-1)*t*t*t - 1) + b;
};
jQuery(document).ready(function(){
    jQuery('a[href*=#]').click(function() {
        if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
            var $target = jQuery(this.hash);
            $target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                jQuery('html,body').animate({ scrollTop: targetOffset }, 1200, 'quart');
                return false;
            }
        }
    });
 
});




//entryArea ############
jQuery(document).ready(function(){

	jQuery('.entryArea table').each(function (i) {
		var borNum = jQuery(this).attr("border");
		if ( borNum >= 1){
			 jQuery(this).addClass("border");
			 jQuery(this).attr("cellspacing","0");
		}
	});

});
