/**
 * 英貴
 *
 * LICENSE
 *
 * このスクリプトソースはPHP(PHP Ver5)にて記述されており、
 * （有）エフ・ディ・エス仕様準拠サイト用としてコーディングさたものです。
 * 本ソースのライセンス・著作権等はGNU GPLに準じます。
 * また、本プログラムによるいかなる損害も制作会社および、制作者はこれを負いません。
 *
 * @package    サテライトサイト用 物件詳細用
 * @copyright  Copyright (c) 2002-2006 FDS Co., Ltd. HayamaCraftice branch (http://www.hayama-terrace.jp)
 * @license    http://www.gnu.org/licenses/gpl.ja.html GNU一般公衆利用許諾契約書
 */

/**
 * 更新履歴
 * 
 * 	Build 000001 2007/09/19 初期コーディング
 */

	var SiteName = '安心安全';
	var SiteCode = '2';

	function ic (im)
	{
		if (document.getElementById("photo") && document.getElementById(im)){
			document.getElementById("photo").src = document.getElementById(im).src;
		}
	}

	function description_markBukken (bukken_no)
	{
		if (description_isMark(bukken_no) == true){
			description_removeSeikyu(bukken_no);
			document.getElementById("mark").src = document.getElementById("out").src;
			alert('資料請求リストから出しました');
		} else {
			description_addSeikyu(bukken_no);
			document.getElementById("mark").src = document.getElementById("in").src;
			alert('資料請求リストに入れました');
		}
	}

	function description_isMark (bukken_no)
	{
		var flg = false;
		cookieData = document.cookie;
		cookieArray = cookieData.split("; ");
		for (i=0; i<cookieArray.length; i++){
			if (cookieArray[i].match(/¥d+¥=¥d+/)){
				dataArray = cookieArray[i].split("=");
				if (dataArray[0] == bukken_no){ flg = true; }
			}
		}
		return flg;
	}

	function description_addSeikyu (bukken_no)
	{
		description_setCoolie(bukken_no, bukken_no, '');
	}

	function description_removeSeikyu (bukken_no)
	{
		xday = new Date;
		xday.setHours(xday.getHours() - 1);
		xday = xday.toGMTString();
		description_setCoolie(bukken_no, bukken_no, xday);
	}

	function description_setCoolie (name, value, expire)
	{
		var cstr = name + "=" + value + ";path=/";
		if (expire != ''){ cstr += ";expires=" + expire; }
		document.cookie = cstr;
	}

	function description_toContact ()
	{
		param = "";
		cookieData = document.cookie;
		cookieArray = cookieData.split("; ");
		for (i=0; i<cookieArray.length; i++){
			if (cookieArray[i].match(/¥d+¥=¥d+/)){
				dataArray = cookieArray[i].split("=");
				param += "&bukken_no[]=" + dataArray[0];
			}
		}
		window.open("https://www2.e-secure.co.jp/eiki-net.co.jp/contact/?request_type=1&site_cd="+SiteCode+param,"");
	}
