//
//
// iframe 内のドキュメントに親ドキュメントの文字色を適用するための関数
//
//
(
	function()
	{
		// .insertBefore() 必須
		var $obj = document.createElement('a');
		$obj.style.display = 'none';
		document.body.insertBefore($obj, document.body.firstChild)
		// 文字色の取得
		var $col1 = $getColor($getComputedStyle(document.body));
		var $col2 = $getColor($getComputedStyle($obj));
		// Cookie に保存
		document.cookie = 'style=' + $col1 + '.' + $col2 + ';path=/;domain=.mmaaxx.com';
		// スタイルオブジェクト取得関数
		function $getComputedStyle($obj)
		{
			return $obj.currentStyle || document.defaultView.getComputedStyle($obj, '')
		}
		// 色取得関数
		function $getColor($obj)
		{
			// Opera のダブルクォートを除去
			return $obj ? $obj.color.replace(new RegExp('"', 'g'), '') : '';
		}
	}
)();
