/*
 *
 * Copyright equiple Inc.
 * http://www.equiple.com/
 *
 * created : 2009.05.13
 * last modified : 2009.06.12
 *
 * jQuery 1.3.1
 * 
 */


/*
 * ▼フォントサイズ変更
 * クッキーを設定
 *
 */

if($.cookie("textEQSite")){
		$("link.fsize").attr("href",$.cookie("textEQSite"));
}
$(document).ready(function(){	
	$("#header ul.siteNav li#fontsizeBtn span a").click(function(){
		$("link.fsize").attr("href",$(this).attr('rel'));
		$.cookie("textEQSite",$(this).attr('rel'),{expires: 365, path: '/', domain: 'www.equiple.com'});
		return false;
	});
});



/*
 *
 * ▼インデックス用ナビゲーションロールオーバー
 * オーバー画像をデフォルトにする
 *
 */

$(function(){
    $("div.index div.contentNav li a img").each(function() {
        var off = this.src;
		var dot = this.src.lastIndexOf('.');
        var on = this.src.substr(0, dot) + '_over' + this.src.substr(dot, 4);
		$(this).each(function() { this.src = on; });
		$(this).hover(
            function() { this.src = off; },
            function() { this.src = on; });
    });
});



/*
 * 
 * ▼インデックスカレンダー　
 *
 */
 
function run_flash_cal()
{
	document.write('\n<object width="300" height="635" data="/lib/swf/cal.swf" type="application/x-shockwave-flash">\n');
	document.write('<param name="movie" value="/lib/swf/cal.swf" />\n');
	document.write('</object>\n');
}



/*
 *		
 * ▼各コンテンツトップ用
 * ロールオーバーの画像パス調整
 *
 */


/* ■会社案内■ */
$(function(){
	$("div#contentArea #companyTop div#companyNav ul li.firstChild a img").each(function(){
		var myURL=document.URL;
		var urlfind = myURL.match("index.php");
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf('.');
		var imgsrc_over = this.src.substr(0, dot) + '_over' + this.src.substr(dot, 4);
		if(urlfind == null){
			$(this).each(function() { this.src = imgsrc_over; });
			$(this).hover(
				function() { this.src = imgsrc_over; },
				function() { this.src = imgsrc_over; });
		}
	});
});

/* ■事業紹介■ */
$(function(){
	$("div#contentArea #domainTop div#domainNav ul li.firstChild a img").each(function(){
		var myURL=document.URL;
		var urlfind = myURL.match("index.php");
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf('.');
		var imgsrc_over = this.src.substr(0, dot) + '_over' + this.src.substr(dot, 4);
		if(urlfind == null){
			$(this).each(function() { this.src = imgsrc_over; });
			$(this).hover(
				function() { this.src = imgsrc_over; },
				function() { this.src = imgsrc_over; });
		}
	});
});

/* ■サービス■ */
$(function(){
	$("div#contentArea #flapla div#serviceNav ul li.firstChild a img").each(function(){
		//このページのURLを取得
		var myURL=document.URL;
		//URLの中に"index.php"の文字列があるか調べる
		var urlfind = myURL.match("index.php");
		
		//画像のパスを取得
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf('.');
		//オーバー時画像のパスを取得
		var imgsrc_over = this.src.substr(0, dot) + '_over' + this.src.substr(dot, 4);
		
		//URLに"index.php"が含まれていなかったら現在用画像（_over）に設定
		if(urlfind == null){
			$(this).each(function() { this.src = imgsrc_over; });
			//オフ画像に変わらないように… ；
			$(this).hover(
				function() { this.src = imgsrc_over; },
				function() { this.src = imgsrc_over; });
		}
	});
});



/*
 *
 * ▼easySlider1.5.js使用時の設定用
 * 操作ボタンをpで囲む
 *
 */

$(function(){
	$(".slideArea").easySlider({
		controlsBefore:	'<p id="controls">',
		controlsAfter:	'</p>'
	});
});






