//テキストを画像に置換
j$(function(){
	j$("h2 a").html("<img src='img/parts.jpg' alt='一栄株式会社' />");
	j$("#hom a").html("<img src='img/parts.jpg' alt='ホーム' />");
	j$("#wap a").html("<img src='img/parts.jpg' alt='ワッポン' />");
	j$("#nov a").html("<img src='img/parts.jpg' alt='ノベルティ・販促品・記念品' />");
	j$("#pac a").html("<img src='img/parts.jpg' alt='パッケージ・包装資材' />");
	j$("#com a").html("<img src='img/parts.jpg' alt='会社案内' />");
	j$("#con a").html("<img src='img/parts.jpg' alt='お問い合わせ' />");
	j$("#bwap a").html("<img src='img/parts.jpg' alt='ワッポン' />");
	j$("#bnov a").html("<img src='img/parts.jpg' alt='ノベルティ・販促品・記念品' />");
	j$("#bpac a").html("<img src='img/parts.jpg' alt='パッケージ・包装資材' />");
	j$("#bcon a").html("<img src='img/parts.jpg' alt='お問い合わせ' />");
	j$("h3").wrap("<div id='h3wrap'></div>");
	j$("#h3news").html("<p><img src='img/parts.jpg' alt='NEWS & Information-お知らせ' /></p>");
	j$("#h3sitemap").html("<p><img src='img/parts.jpg' alt='Sitemap-サイトマップ' /></p>");
	j$("#h3contact").html("<p><img src='img/parts.jpg' alt='Contact-お問い合わせ' /></p>");
	j$("#h3mailform").html("<p><img src='img/parts.jpg' alt='Mailform-メールでのお問い合わせ' /></p>");
	j$("#h3tel").html("<p><img src='img/parts.jpg' alt='Tel-お電話でのお問い合わせ' /></p>");
	j$("#h3thanks").html("<p><img src='img/parts.jpg' alt='Thanks!-有難うございます' /></p>");
	j$("#h3privacy").html("<p><img src='img/parts.jpg' alt='Privacy Policy-プライバシポリシー' /></p>");
	j$("#h3company").html("<p><img src='img/parts.jpg' alt='Company-会社概要' /></p>");
	j$("#h3commitment").html("<p><img src='img/parts.jpg' alt='Commitment-当社の取り組み' /></p>");
	j$("#h3introduction").html("<p><img src='img/parts.jpg' alt='Introduction-事業のご紹介' /></p>");
	j$("#h3404error").html("<p><img src='img/parts.jpg' alt='404error!-ページが見つかりません' /></p>");
	j$("#siteMap dt").wrapInner("<span></span>");
	j$(".mailform dd").wrapInner("<p></p>");
	j$("#contactTel").html("<span><img src='img/parts.jpg' alt='Tel:052-501-2171 営業時間 9:00～18:00 不定休' /></span>");
	j$("#comName").html("<img src='img/parts.jpg' alt='名称-company name' />");
	j$("#comDate").html("<img src='img/parts.jpg' alt='会社設立-date of establishment' />");
	j$("#comCapital").html("<img src='img/parts.jpg' alt='資本金-capital' />");
	j$("#comPresident").html("<img src='img/parts.jpg' alt='代表者-president' />");
	j$("#comAddress").html("<img src='img/parts.jpg' alt='所在地-address of head office' />");
	j$("#comTel").html("<img src='img/parts.jpg' alt='電話-tel' />");
	j$("#comOffice").html("<img src='img/parts.jpg' alt='営業時間-office hours' />");
	j$("#comRegular").html("<img src='img/parts.jpg' alt='定休日-regular holiday' />");
	j$("#comAvailable").html("<img src='img/parts.jpg' alt='営業品目-available services' />");
	j$("#company dd").wrapInner("<p></p>");
	j$("#wappon_1").html("<img src='img/product_parts.jpg' alt='ワッポンとは？- ポスターに必須の強力ツール！' />");
	j$("#wappon_2").html("<img src='img/product_parts.jpg' alt='ワッポンにも名入れやロゴ入れが可能です' />");
	j$("#wappon_3").html("<img src='img/product_parts.jpg' alt='ワッポン誕生秘話' />");
	j$("#novelty_1").html("<img src='img/product_parts.jpg' alt='ノベルティ・販促品・記念品 - いらっしゃいませ！安多問屋へようこそ！' />");
	j$("#novelty_2").html("<img src='img/product_parts.jpg' alt='名入れでオリジナルのノベルティグッズに' />");
	j$("#package_1").html("<img src='img/product_parts.jpg' alt='パッケージ・包装資材 - 安多問屋 e-packにて多数取り揃えております！' />");
	j$("#package_2").html("<img src='img/product_parts.jpg' alt='名入れを始めオークションなど様々な使い方ができます！小ロット対応！' />");
	j$(".productBanner").wrap("<div id='productBannerWrap'></div>");
});

//現在開いているページに合わせてtopnavの表示を変える
j$(function(){
	if(j$("title").is(":contains('ホーム')")){
		j$("#hom").addClass("here");
	}
	if(j$("title").is(":contains('ワッポン')")){
		j$("#wap").addClass("here");
	}
	if(j$("title").is(":contains('ノベルティ')")){
		j$("#nov").addClass("here");
	}
	if(j$("title").is(":contains('パッケージ')")){
		j$("#pac").addClass("here");
	}
	if(j$("title").is(":contains('会社案内')")){
		j$("#com").addClass("here");
	}
	if(j$("title").is(":contains('お問い合わせ')")){
		j$("#con").addClass("here");
	}
	//ロールオーバー
	j$("h2").hover(function(){
		j$("h2 img:not(:animated)").fadeOut("fast");
		},function(){
		j$("h2 img").fadeIn("slow");
	});
	j$("#nav a").hover(function(){
		j$(this).children("img").fadeOut(150);
		},function(){
			if(j$(this).parent().attr("class")=="here"){
			return false;
		}
		j$(this).children("img").fadeIn("slow");
	});
	j$("#bannerArea a").hover(function(){
		j$(this).children("img").fadeOut(1);
		},function(){
		j$(this).children("img").fadeIn();
	});
});

//ページ内リンク
// Copyright c 2008 George McGinley Smith
// All rights reserved.
j$.easing.quart=function(x,t,b,c,d){
	return -c*((t=t/d-1)*t*t*t-1)+b;
};

j$(function () {
	j$("#ftop a").click(function(){
		j$("html,body").animate({scrollTop:0},200,'quart');
		return false;
	});
});

/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example j$.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example j$.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example j$.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example j$.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name j$.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example j$.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name j$.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

j$(function(){
	j$("#ftop a").click(function(){
		j$("body").css("font-size",j$.cookie('fsize'));
	});
});
function font(size){
	j$("div").not("#header").css("font-size",size);
	j$.cookie("fsize",size,{expires:30,path:'/'});
}

