﻿/* ---------------------------

	【CSS、HTMLの操作】
		指定要素前 before, 後 after, 要素内の先頭 prepend
		class属性付与 .addClass, 最後 li:last-child

--------------------------- */

jQuery(function(){
	// jQuery("div#wrap").after("<div id=\"bg-light\"></div>");
	jQuery("#nav a").addClass("myButton aButton");
	jQuery("div#main-image ul a").addClass("myButton aButton");
	jQuery("div#subNav a").addClass("myButton aButton");
	jQuery("ul#ft-nav li:last-child").addClass("lastchild");
	jQuery("div#rssPhoto li:last-child").addClass("lastchild");
	jQuery("div#mbSite p:last-child").addClass("lastchild");
	jQuery("ul#tweet li:last-child").addClass("lastchild");
	jQuery("p.twCont [href*='jugem']").remove();
	jQuery("div.column2-630 li:last-child").addClass("lastchild");
	/* index.html */
	jQuery("div#panel01 li").addClass("bLink");
	/* wasai.html */
	jQuery("ul#sewFlow li:last-child").addClass("lastchild");
	/* rental.html */
	jQuery("ul.flow-list li:last-child").addClass("lastchild");
	jQuery("div#rentalInfo div.fr img").remove();
	jQuery("div#rentalInfo div.fr div br").remove();
	jQuery("div#rentalInfo div.sectionIn:last").addClass("lastchild");
	/* ul#weddingPh li */
	jQuery("ul#weddingPh li:last").addClass("lastchild");
});



/* ---------------------------

	要素をフェード

--------------------------- */

(function(jQuery){
	jQuery(function(){
		jQuery('a img, p#logo a, #pagetop a, div#rssPhoto li a, p#submitBt input, .bt')
			.hover(function() {
				jQuery(this).stop(true, false).animate({
							opacity: .5
					}, {
							duration: 200
					})
			}, function() {
					jQuery(this).stop(true, false).animate({
							opacity: 1
					}, {
							duration: 200
					})
		});
	});
})(jQuery);



/* ---------------------------

	jquery.bgFade.min.js（CSSスプライトアニメーション）

--------------------------- */

jQuery(document).ready(function(){
	jQuery('.myButton').hover(function(){
		jQuery(this).bgFade('fadeIn');
	}, function() {
		jQuery(this).bgFade('fadeOut');
	});
});



/* ---------------------------

	jquery.slidescroll.js（スムーズスクローラー）

--------------------------- */

jQuery(function(){
	jQuery("a[href*='#']").filter(function(){
		return !jQuery(this).parent().parent().hasClass("tabs");
	}).slideScroll();
});



/* ---------------------------

	外部リンクにtarget=_blank指定

--------------------------- */

jQuery(document).ready( function () {
    jQuery(".blank").append('&nbsp;<img src="images/loop/externallink.gif" width="15" height="13" alt="外部Webサイトへのリンク" />');
    jQuery(".blank img").css("vertical-align","text-top");
    jQuery(".blank").after('&nbsp;');
    jQuery('.blank').click(function(){
        window.open(this.href, '_blank');
        return false;
    });
});

// 画像なしバージョン
jQuery(document).ready( function () {
    jQuery('.blankNo').click(function(){
        window.open(this.href, '_blank');
        return false;
    });
});



/* ---------------------------

	jquery.colorbox-min（モーダルウィンドウ）

--------------------------- */

jQuery(document).ready(function(){
	jQuery(".rTermsBox").colorbox({iframe:true, innerWidth: 760, height:"85%"});
	jQuery(".repairBox").colorbox({iframe:true, innerWidth: 760, height:"95%"});
	jQuery("a[rel='phSet']").colorbox({transition:"fade"});
	jQuery("a[rel='phSet-nihongami2']").colorbox({transition:"fade"});
	jQuery("a[rel='phSet-about']").colorbox({transition:"fade"});
	jQuery("#click").click(function(){
		jQuery('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}) .text("Open this window again and this message will still be here.");
		return false;
	});
});

/*
$(document).ready(function(){
	$(".rTermsBox").colorbox({iframe:true, innerWidth: 760, height:"95%"});
	$(".repairBox").colorbox({iframe:true, innerWidth: 760, height:"95%"});
	$("a[rel='phSet']").colorbox({transition:"fade"});
	$("a[rel='phSet-nihongami2']").colorbox({transition:"fade"});
	$("#click").click(function(){
		$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}) .text("Open this window again and this message will still be here.");
		return false;
	});
});
*/


/* ---------------------------

	mopTip-2.2.js（ツールチップ）

--------------------------- */

jQuery(document).ready(function(){
	jQuery("#toolTip-products").mopTip({'w':316,'style':"overClick",'get':"#toolTip-products-contents"});
	jQuery("#toolTip-seijin").mopTip({'w':160,'style':"overClick",'get':"#toolTip-seijin-contents"});
});
/*
$(document).ready(function(){
	$("#toolTip-products").mopTip({'w':212,'style':"overClick",'get':"#toolTip-products-contents"});
	$("#toolTip-seijin").mopTip({'w':160,'style':"overClick",'get':"#toolTip-seijin-contents"});
});
*/



/* ---------------------------

	最新のTweetを表示

--------------------------- */
/*
jQuery(function(){
	var tweeturl="http://twitter.com/status/user_timeline/chanajp.json?count=4&callback=?";
	jQuery.getJSON(tweeturl, function(data){
		// JSONデータ読み込み
		jQuery.each(data, function(i, item){
			// URLにテキストがある場合はリンク設置
			var txt = item.text
				.replace(/(https?:\/\/[-a-z0-9._~:\/?#@!$&\'()*+,;=%]+)/ig,'<a href="$1">$1</a>')
				.replace(/@+([_A-Za-z0-9-]+)/ig, '<a href="http://twitter.com/$1">@$1</a>')
				.replace(/#+([_A-Za-z0-9-]+)/ig, '<a href="http://search.twitter.com/search?q=$1">#$1</a>');
			jQuery("<li></li>")
				.addClass(i%2 ? "even" : "odd")
				.html(txt)
				.prependTo("#tweet");
		});
		jQuery("ul#tweet li:last-child").addClass("lastchild");
		jQuery("ul#tweet li a:last-child").css("display","none");
	});
});
*/



/* ---------------------------

	jquery-contained-sticky-scroll.js（追随メニュー）

--------------------------- */
/*
jQuery(document).ready(function(){
	jQuery('#aside').containedStickyScroll({
		duration:1000, //速度
		unstick: true, //追跡モードなし
    closeChar: '',
		// easing: 'linear',
		easing: 'easeOutBack',
		queue: false,
		closeTop: 0,
		closeRight: 0  
	});
});
*/
