var C_LF = "\n";
jQuery.noConflict();

/**
 * @name aulta library
 * @author aulta : http://aulta.net/
 * @copyright aulta
 * @version 0.08
 * @classDescription 汎用関数のクロスブラウザ化 (use jQuery)
 * @support IE5.5+, Firefox2+, Safari, Google Chrome
 */
(function(){
	var _aulta = window.aulta = {}
		, _documentBody = null
		, _cookies = {
				  'fontName' : '0'
				, 'fontSize' : '2'
			}
		, _const = {
				 'fontName' : ['ＭＳ Ｐゴシック', 'メイリオ', 'Meiryo', 'MS UI Gothic', 'ＭＳ Ｐ明朝', 'sans-serif', 'Osaka', 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', 'あくあフォント', 'うずらフォント', 'あずきフォント']
				, 'fontSize' : [10,12,14,16,18]
			}
		, _cookiesDays = 30
		, _ua = ''
		, _isOpera = false
		, _isSafari = false
		, _isGecko = false
		, _isIE = false
		, _isIEold = false
		;
		
	/*
	 * コンストラクタ
	 */
	(function(){
		if (navigator){
			_ua = navigator.userAgent.toLowerCase();
			_isOpera = (_ua.indexOf('opera') > -1);
			_isSafari = (_ua.indexOf('safari') > -1);
			_isGecko = ( ! _isOpera && ! _isSafari && _ua.indexOf('gecko') > -1);
			_isIe = ( ! _isOpera && _ua.indexOf('msie') > -1);
			if (_isIe){
				_isIEold = (_ua.indexOf('msie 6.0') > -1);
			}
		}
	})();
	
	/**
	 * 初期化処理
	 */
	_aulta.init = {_documentBody : document.body};
	var _init = _aulta.init;
	
	
	_aulta.init.cookieDays = function(days){
		_cookiesDays = days;
	};
	
	
	/*
	 *2 外部URLを別ウィンドウで開くようにする
	 */
	_aulta.init.setTargetOutsideLink = function(){
		var arrIncludePath = (	//	ドメイン内でも別ウィンドウ表示するパス
					this.setTargetOutsideLink.arguments.length > 0
					? this.setTargetOutsideLink.arguments[0] : new Array()
				)
			, arrExclusionDomain = (	//	ドメイン外でも同一ウィンドウで表示するドメイン
					this.setTargetOutsideLink.arguments.length > 1
					? this.setTargetOutsideLink.arguments[1] : new Array()
				)
			, a = document.getElementsByTagName('a')
			, i
			, j
			, cnt = a.length
			, cntInc = arrIncludePath.length
			, cntExc = arrExclusionDomain.length
			, flg
			, href
			, func = function(){window.open(this.href); return false;}
			;
		arrExclusionDomain.unshift(document.location.protocol + '//' + document.location.hostname + '/');
		cntExc = arrExclusionDomain.length;
		for (i = 0; i < cnt; i++){
			href = a[i].href;
			flg = true;
			for (j = 0; j < cntInc; j++){
				if (href.indexOf(arrIncludePath[j]) > -1){
					flg = false;
					a[i].onclick = func;
					break;
				}
			}
			if (flg){
				if (href.substr(0, 4) == 'http'){
					for (j = 0; j < cntExc; j++){
						if (href.indexOf(arrExclusionDomain[j]) > -1){
							flg = false;
							break;
						}
					}
					if (flg) a[i].onclick = func;
				}
			}
		}
	}
	
	/*
	 *2	文字列処理
	 */
	_aulta.string = {};
	var _string = _aulta.string;
	
	/*
	 *3	半角カナを全角に
	 */
	_aulta.string.toZenKana = function(a){
		var b = a + ''
			, c = new Array("ｶﾞ","ｷﾞ","ｸﾞ","ｹﾞ","ｺﾞ","ｻﾞ","ｼﾞ","ｽﾞ","ｾﾞ","ｿﾞ","ﾀﾞ","ﾁﾞ","ﾂﾞ","ﾃﾞ","ﾄﾞ","ﾊﾞ","ﾋﾞ","ﾌﾞ","ﾍﾞ","ﾎﾞ","ﾊﾟ","ﾋﾟ","ﾌﾟ","ﾍﾟ","ﾎﾟ","ｦ","ｧ","ｨ","ｩ","ｪ","ｫ","ｬ","ｭ","ｮ","ｯ","ｰ","ｱ","ｲ","ｳ","ｴ","ｵ","ｶ","ｷ","ｸ","ｹ","ｺ","ｻ","ｼ","ｽ","ｾ","ｿ","ﾀ","ﾁ","ﾂ","ﾃ","ﾄ","ﾅ","ﾆ","ﾇ","ﾈ","ﾉ","ﾊ","ﾋ","ﾌ","ﾍ","ﾎ","ﾏ","ﾐ","ﾑ","ﾒ","ﾓ","ﾔ","ﾕ","ﾖ","ﾗ","ﾘ","ﾙ","ﾚ","ﾛ","ﾜ","ﾝ")
			, d = new Array("ガ","ギ","グ","ゲ","ゴ","ザ","ジ","ズ","ゼ","ゾ","ダ","ヂ","ヅ","デ","ド","バ","ビ","ブ","ベ","ボ","パ","ピ","プ","ペ","ポ","ヲ","ァ","ィ","ゥ","ェ","ォ","ャ","ュ","ョ","ッ","ー","ア","イ","ウ","エ","オ","カ","キ","ク","ケ","コ","サ","シ","ス","セ","ソ","タ","チ","ツ","テ","ト","ナ","ニ","ヌ","ネ","ノ","ハ","ヒ","フ","ヘ","ホ","マ","ミ","ム","メ","モ","ヤ","ユ","ヨ","ラ","リ","ル","レ","ロ","ワ","ン")
			;
		while(b.match(/[ｦ-ﾝ]/)){
			for(var i = 0; i < c.length; i++){
				b = b.replace(c[i], d[i]);
			}
		}
		return b;
	};
	/*
	 *3 全角数字を半角数字に
	 */
	_aulta.string.toHarfNumber = function(text){
		var char1 = new Array("１","２","３","４","５","６","７","８","９","０")
			, char2 = new Array(1,2,3,4,5,6,7,8,9,0)
			, count
			, data = text + '';
		while(data.match(/[０-９]/)){
			for(count = 0; count < char1.length; count++){
				data = data.replace(char1[count], char2[count]);
			}
		}
		return data;
	}
	
	/*
	 *3 機種依存文字を置き換える
	 */
	_aulta.string.replaceDependenceChar = function(text){
		return text
			.replace('①', '(1)')
			.replace('②', '(2)')
			.replace('③', '(3)')
			.replace('④', '(4)')
			.replace('⑤', '(5)')
			.replace('⑥', '(6)')
			.replace('⑦', '(7)')
			.replace('⑧', '(8)')
			.replace('⑨', '(9)')
			.replace('⑩', '(10)')
			.replace('⑪', '(11)')
			.replace('⑫', '(12)')
			.replace('⑬', '(13)')
			.replace('⑭', '(14)')
			.replace('⑮', '(15)')
			.replace('⑯', '(16)')
			.replace('⑰', '(17)')
			.replace('⑱', '(18)')
			.replace('⑲', '(19)')
			.replace('⑳', '(20)')
			.replace('Ⅰ', 'I')
			.replace('Ⅱ', 'II')
			.replace('Ⅲ', 'III')
			.replace('Ⅳ', 'IV')
			.replace('Ⅴ', 'V')
			.replace('Ⅵ', 'VI')
			.replace('Ⅶ', 'VII')
			.replace('Ⅷ', 'VIII')
			.replace('Ⅸ', 'IX')
			.replace('Ⅹ', 'X')
			;
	};
	
	/*
	 *3	trim
	 */
	_aulta.string.trim = function(a){
		return (a+'').replace(/^　+|　+$/g, "").replace(/^¥s+|¥s+$/g, "");
	};
	
	/*
	 *3	format
	 */
	_aulta.string.format = function(num){
		return String(num).split('').reverse().join('').match(/\d{1,3}/g).join(',').split('').reverse().join('');
	}
	/*
	_aulta.string.decodeQuot = function(a){
		var r = a.replace('&quot;', '"').replace('&#039', "'");
		return aulta.string.replaceText(r, 2);
	}
	_aulta.string.encodeQuot = function(a){
		var r = aulta.string.replaceText(a, 1);
		return r.replace('"', '&quot;').replace("'", '&#039');
	}
	*/
	/*
	 *3	urlデコード
	 */
	_aulta.string.urldecode = function(a){
		var b;
		b = decodeURI(a);
		b = b.replace(/\+/g,' ');
		b = b.replace(/%26/g,'&');
		b = b.replace(/%3B/g,';');
		b = b.replace(/%23/g,'#');
		b = b.replace(/%24/g,'$');
		b = b.replace(/%3D/g,'=');
		b = b.replace(/%2F/g,'/');
		b = b.replace(/%40/g,'@');
		b = b.replace(/%2B/g,'+');
		b = b.replace(/%3F/g,'?');
		b = b.replace(/%2C/g,',');
		b = b.replace(/%3A/g,':');
		return b;
	};
	/*
	 *3	urlエンコード
	 */
	_aulta.string.urlencode = function(a){
		var i, b, c, d;
		b = '';
		for (i = 0; i < a.length; i++){
			c = a.charCodeAt(i);
			if (c == 0x20){
				b += "%20";
			} else {
				if (((0x30 <= c) && (c <= 0x39)) || ((0x41 <= c) && (c <= 0x5a)) || ((0x61 <= c) && (c <= 0x7a))){
					b += a.charAt(i);
				} else if ((c == 0x2a) || (c == 0x2e) || (c == 0x2d) || (c == 0x5f)) {
					b += a.charAt(i);
				} else {
					// Ref. http://homepage3.nifty.com/aokura/jscript/utf8.html
					// Ref. http://homepage1.nifty.com/nomenclator/unicode/ucs_utf.htm
					if ( c > 0xffff ) {
						b += "%" + ((c >> 18) | 0xf0).toString(16).toUpperCase();
						b += "%" + (((c >> 12) & 0x3f) | 0x80).toString(16).toUpperCase();
						b += "%" + (((c >> 6) & 0x3f) | 0x80).toString(16).toUpperCase();
						b += "%" + ((c & 0x3f) | 0x80).toString(16).toUpperCase();
					} else if ( c > 0x7ff ) {
						b += "%" + ((c >> 12) | 0xe0).toString(16).toUpperCase();
						b += "%" + (((c >> 6) & 0x3f) | 0x80).toString(16).toUpperCase();
						b += "%" + ((c & 0x3f) | 0x80).toString(16).toUpperCase();
					} else if ( c > 0x7f ) {
						b += "%" + (((c >> 6) & 0x1f) | 0xc0).toString(16).toUpperCase();
						b += "%" + ((c & 0x3f) | 0x80).toString(16).toUpperCase();
					} else {
						d = "0" + c.toString(16).toUpperCase();
						b += "%" + d.substr(d.length - 2, 2);
					}
				}
			}
		}
		return b;
	};
	
	/*
	 *3	文字列を***にする
	 */
	_aulta.string.toPassChar = function(a){
		var r = '';
		for(var i=0;i<a.length;i++)r += '*';
		return r;
	};
	
	/*
	 *3	テキストのhttpをリンクタグにする
	 */
	_aulta.string.toWrapATag = function(a){
		a = a.replace(/&amp;/g, '&');
		return a.replace(/(http.?:\/\/[0-9A-Za-z_&\+\-\/\.\%\?\&\=]+)/g,"<a href='/jump.php?url=$1' target='_blank'>$1</a>");
	};
	
	/*
	 *3	正規表現
	 */
	_aulta.string.ereg = function(text, pattern){
		var buf = text + '';
		return buf.match(new RegExp(pattern, 'i'));
	};
	
	/*
	 *3	入力文字の文字列置換え
	 *	a = text
	 *	b	= 置換え動作
	 */
	_aulta.string.replaceText = function(a,b){
		var c = a+'';
		if (b == 0){
			//本文中の、余計な改行と空白を削除、半角カナを全角に
			c = c.replace(/\r\n/g,"\n");
			c = c.replace(/\r/g,"\n");
			c = c.replace(/\r\n/g,"\n");
			c = c.replace(/　{3,}/g,"　");
			c = c.replace(/\x20{3,}/g,"   ");
			c = c.replace(/\n{3,}/g,"\n\n");
			c = c.replace(/\n+$/g,"");
			c = _aulta.string.toZenKana(c);
			c = _aulta.string.trim(c);
		} else if (b == 1){
			//HTMLタグなどの置換え
			c = c.replace(/&/g,"&amp;");
			c = c.replace(/</g,"&lt;");
			c = c.replace(/>/g,"&gt;");
			c = c.replace(/'/g,"&#039;");
			c = c.replace(/\"/g,"&quot;");
			c = c.replace(/\n/g,"<br />");
		} else if (b == 2){
			//HTMLタグなどの置換え
			c = c.replace(/<br \/>/g,"\n");
			c = c.replace(/&quot;/g,"\"");
			c = c.replace(/&#039;/g,"'");
			c = c.replace(/&lt;/g,"<");
			c = c.replace(/&gt;/g,">");
			c = c.replace(/&amp;/g,"&");
			/*
		} else if (b == 2){
			//HTMLタグなどの置換え
			c = c.replace(/<br />/ig,"\n");
			//c = c.replace(/&/g,"&amp;");
			c = c.replace(/</g,"&lt;");
			c = c.replace(/>/g,"&gt;");
			c = c.replace(/\"/g,"&quot;");
			*/
		}
		return c;
	};

	
	/**
	 *2 データに関する関数
	 */
	_aulta.data = {};
	var _data = _aulta.data;
	
	_aulta.data.setValueSetting = function(arrName, value){
		_cookies[arrName] = value;
	};
	_aulta.data.getValueSetting = function(arrName){
		return (_cookies[arrName] ? _cookies[arrName] : '');
	};
	/*
	 *3	Aulta内部データをクッキーに保存する
	 */
	_aulta.data.saveSetting = function(){
		var str = '';
		for (var nm in _cookies) str += nm + '$aulta$' + _cookies[nm] + '|aulta|';
		_data.saveCookie('aultadata', str, _cookiesDays);
	}
	
	/*
	 *3	Aulta内部データをクッキーからロードする
	 */
	_aulta.data.loadSetting = function(){
		var str = _data.loadCookie('aultadata')
		, strs = str.split('|aulta|')
		, cnt = strs.length;
		for (var i = 0; i < cnt; i++){
			var val = strs[i].split('$aulta$');
			if (val.length == 2) _cookies[val[0]] = [val[1]];
		}
	}
	
	/*
	 *3	クッキーを保存する
	 */
	_aulta.data.saveCookie = function(cname, value, days){
	   var ex = new Date();
	   ex = new Date(ex.getTime() + (1000 * 60 * 60 * 24 * days));
	   var y = ex.getYear();
	   if (y < 1900) y += 1900;
	   var hms = ex.getHours() + ':' + ex.getMinutes() + ':' + ex.getSeconds();
	   var p = String(ex).split(' ');
	   ex = p[0] + ', ' + p[2] + '-' + p[1] + '-' + y + ' ' + hms + ' GMT;';
	   document.cookie = cname + '=' + value +'; expires=' + ex + '; path=/';
	}
	
	/*
	 *3	クッキーを読み出す
	 */
	_aulta.data.loadCookie = function(cname) {
		var cookies = new Array();
		var lst = document.cookie.split(';');
		for(var i = 0; i < lst.length; i++){
			var elm = lst[i].split('=');
			elm[0] = elm[0].replace(' ', '');
			cookies[elm[0]] = elm[1];
		}
		if (cookies[cname]) return cookies[cname];
		else return '';
	}
	
	/**
	 * ポジションに関する定義
	 */
	_aulta.pos = {};
	var _pos = _aulta.pos;
	/*
	 *	引数の要素の絶対座標を得る
	 */
	_aulta.pos.getAbsolute = function(el){
		if ( ! document.getElementById(el)) return 0;
		if (typeof(el) == 'string') 
			el = document.getElementById(el);
		var newFunc;
		if (el.getBoundingClientRect) {
			newFunc = function(el){
				if (typeof el == 'string') 
					el = document.getElementById(el);
				if (el.parentNode === null || el.offsetParent === null || el.style.display == 'none') 
					return false;
				var box = el.getBoundingClientRect();
				return new Array(box.left + (document.documentElement.scrollLeft || document.body.scrollLeft) - (_isIe ? 2 : 0), box.top + (document.documentElement.scrollTop || document.body.scrollTop) - (_isIe ? 2 : 0));
			};
		}
		else {
			newFunc = function(el){
				if (typeof el == 'string') 
					el = document.getElementById(el);
				if (el.parentNode === null || el.offsetParent === null || el.style.display == 'none') 
					return false;
				var parentNode = el.offsetParent, pos = [el.offsetLeft, el.offsetTop], adjust = (_isIe ? 2 : 0);
				if (parentNode != el) {
					while (parentNode) {
						pos[0] += parentNode.offsetLeft;
						pos[1] += parentNode.offsetTop;
						parentNode = parentNode.offsetParent;
					}
				}
				if (_isSafari && el.style.position == 'absolute') {
					pos[0] -= document.body.offsetLeft;
					pos[1] -= document.body.offsetTop;
				}
				parentNode = (el.parentNode ? el.parentNode : null);
				while (parentNode && parentNode.tagName.toUpperCase() != 'BODY' && parentNode.tagName.toUpperCase() != 'HTML') {
					if (parentNode.style.display != 'inline') {
						pos[0] -= parentNode.scrollLeft;
						pos[1] -= parentNode.scrollTop;
					}
					parentNode = (parentNode.parentNode ? parentNode.parentNode : null);
				}
				return pos;
			};
		}
		var ret = newFunc(el);
		this.getAbsolutePos = newFunc;
		return ret;
	}

	/*
	 *	マウスカーソルの絶対座標を得る
	 */
	_aulta.pos.getMousePos = function(e){
		if (e){
			return [e.screenX, e.screenY];
		} else {
			var w = window.event;
			return [w.clientX, w.clientY];
		}
	};
	
	/*
	 *	範囲選択の禁止
	 * flg = true = 禁止、false = 解除(デフォルト)
	 */
	_aulta.pos.nonRangeChoice = function(flg){
		if (window.addEventListener){
			if (flg){
				jQuery(document.body).addClass('aulta_nonRangeChoice');
			} else {
				jQuery(document.body).removeClass('aulta_nonRangeChoice');
			}
		} else {
			document.body.onselectstart = function(){return ! flg;};
		}
	}
	
	/*
	 *	イベント
	 */
	_aulta.event = {};
	var _event = _aulta.event;
	
	/*
	 *	イベントリスナーの追加
	 */
	_aulta.event.add = function(el, event, func){
		if (typeof(el) == 'string') el = document.getElementById(el);
		if (el.addEventListener){
			el.addEventListener(event , func , false);
		} else {
			if (el == window){
				eval("el.document.on" + event + " = func;");
			} else {
				eval("el.on" + event + " = func;");
			}
		}
	};
	
	//	スムーススクロール
	//	a = 目的地のY px
	//	b = aの位置からずらす距離 px
	_aulta.event.scroll = function(destination, adjust, target){
		if (typeof(destination) != 'number') destination = _pos.getAbsolute(destination)[1];
		if (_aulta.event.scroll.arguments.length > 1) destination += (adjust - 0);
		
		if (_aulta.event.scroll.arguments.length > 2){
			destination -= _pos.getAbsolute(target)[1];
			target = document.getElementById(target);
			destination +=  _pos.top2(target);
		} else {
			target = (document.body || document.documentElement)
		}
		var t = 300	//	tミリ秒後に完了
		, m = 30		//	mミリ秒間隔で移動
		, max = Math.floor(t / m)	//	この回数内に終らなければ強制終了
		, h = _pos.top2(target)
		, dh = h
		, mov = Math.floor((h < destination ? (destination - h) * -1 : (h - destination)) / max)
		, cnt = 0
		, func = function(){
			h -= mov;
			_pos.top2(target, h);
			if (cnt++ < max){
				setTimeout(func, m);
			} else {
				_pos.top2(target, destination);
			}
		};
		func();
		return false;
	};
	
	_aulta.pos.top = function(val){
		if (_aulta.pos.top.arguments.length == 0){
			var ret = (document.body.scrollTop || document.documentElement.scrollTop) + '';
			return ret.replace('px', '') - 0;
		} else {
			document.body.scrollTop = document.documentElement.scrollTop = val;
		}
	};
	
	_aulta.pos.top2 = function(target, val){
		if (_aulta.pos.top2.arguments.length == 1){
			var ret = target.scrollTop + '';
			return ret.replace('px', '') - 0;
		} else {
			target.scrollTop = val;
		}
	};
	
	/*
	 *	生成
	 */
	_aulta.create = {};
	var _create = _aulta.create;
	
	/*
	 * オブジェクトのコーナー角丸
	 *  this = オブジェクト(幅・高さを偶数にしておく)
	 *  pattern = パターン 0:四隅, 1:上部
	 *  color = 隠す部分の色
	 */
	_aulta.create.cornerCircle = function(target, color, pattern, sizeNo){
		if (typeof(target)  == 'string') target = document.getElementById(target);
		var jTarget = jQuery(target);
		//jTarget.height(jTarget.height() - 0 + 2);
		jTarget.height(jTarget.height() - 0);
		var create = function(placeX, placeY, bgColor){
			var arrSize = new Array(
						new Array(6,4,3,2,1,1)
						, new Array(11,9,8,6,5,4,3,3,2,1,1)
					)
				, size = arrSize[0]
				, cnt = 0
				, arrRet = new Array()
				;
			if (arrSize.length > sizeNo) size = arrSize[sizeNo];
			cnt = size.length;
			for (var i = 0; i < cnt; i++){
				var div = document.createElement('div')
					, divstl = div.style;
				div.width = size[i] + 'px';
				div.height = '1px';
				divstl.position = 'absolute';
				divstl.display = 'block';
				eval('divstl.' + placeX + ' = "0px"');
				eval('divstl.' + placeY + ' = "' + i + 'px"');
				divstl.width = size[i] + 'px';
				divstl.height = '1px';
				divstl.backgroundColor = bgColor;
				divstl.fontSize = '1px';
				arrRet[i] = div;
			}
			return arrRet;
		}
		, append = function(target, arr){
			var i, cnt = arr.length;
			for (i = 0; i < cnt; i++) target.appendChild(arr[i]);
		}
		, lt = create('left', 'top', color)
		, rt = create('right', 'top', color)
		, lb = create('left', 'bottom', color)
		, rb = create('right', 'bottom', color);
		target.style.display = 'block';
		switch (pattern){
			case 0: append(target, lt); append(target, rt); append(target, lb); append(target, rb); break;	//	四隅
			case 1: append(target, lt); append(target, rt); break;	//	上部のみ
			case 2: append(target, lb); append(target, rb); break;	//	下部のみ
			case 3: append(target, lt); append(target, lb); break;	//	左部のみ
			case 4: append(target, rt); append(target, rb); break;	//	右部のみ
			case 5: append(target, lt); break;	//	左上のみ
			case 6: append(target, rt); break;	//	右上のみ
			case 7: append(target, lb); break;	//	左下のみ
			case 8: append(target, rb); break;	//	右下のみ
		}
	};
	
	/*
	 *	フォントサイズ変更ボックスを作成する
	 */
	_aulta.create.boxFontSize = function(place, target, posX, posY){
		if (typeof(target)  == 'string') target = document.getElementById(target);
		var select = document.createElement('select')
			, cnt = _const['fontSize'].length
			, font = 2
			, i
			;
		for (i = 0; i < cnt; i++){
			var opt = document.createElement('option');
			opt.innerHTML = _const['fontSize'][i];
			opt.value = i;
			select.appendChild(opt);
			if (_cookies['fontSize'] == i) font = i;
		}
		select.value = font;
		select.onchange = function(){
			if (target){
				target.style.fontSize = _const['fontSize'][this.value] + 'px';
				var tbl = target.getElementsByTagName('table');
				for (i = 0; i < tbl.length; i++){
					tbl[i].style.fontSize = _const['fontSize'][this.value] + 'px';
				}
			}
			_cookies['fontSize'] = this.value;
			_data.saveSetting();
		}
		select.onchange();
		_create.box(place, select, posX, posY);
	};
	
	/*
	 *	フォント変更ボックスを作成する
	 */
	_aulta.create.boxFont = function(place, target, posX, posY){
		if (typeof(target)  == 'string') target = document.getElementById(target);
		var select = document.createElement('select')
			, cnt = _const['fontName'].length
			, font = 0
			, i
			;
		for (i = 0; i < cnt; i++){
			var opt = document.createElement('option');
			opt.innerHTML = _const['fontName'][i];
			opt.value = i;
			select.appendChild(opt);
			if (_cookies['fontName'] == i) font = i;
		}
		select.value = font;
		select.onchange = function(){
			if (target){
				target.style.fontFamily = _const['fontName'][this.value];
				var tbl = target.getElementsByTagName('table');
				for (i = 0; i < tbl.length; i++){
					tbl[i].style.fontFamily = _const['fontName'][this.value];
				}
			}
			_cookies['fontName'] = this.value;
			_data.saveSetting();
		}
		select.onchange();
		_create.box(place, select, posX, posY);
	};
	
	/*
	 *	ボックスを作成する
	 */
	_aulta.create.box = function(place, obj, posX, posY){
		var objstl = obj.style;
		objstl.position = 'absolute';
		objstl.display = 'block';
		if (posX >= 0) objstl.left = posX + 'px';
			else objstl.right = (posX * -1) + 'px';
		if (posY >= 0) objstl.top = posY + 'px';
			else objstl.bottom = (posY * -1) + 'px';
		document.getElementById(place).appendChild(obj);
	};

	
	/*
	 *	ajax
	 */
	_aulta.ajax = {};
	var _ajax = _aulta.ajax;
	
	/*
	 *	function func = コールバック
	 *	string url = 接続先
	 *	(省略:)string value = url引数
	 *	(省略:true) bool post = POST (or GET)
	 *	(省略:true) bool async = 非同期
	 *	(省略:true) bool superload = 強制ロード（orキャッシュ）
	 */
	_aulta.ajax.request = function(func, url, value, post, async, superload){
		var chkAjaBrowser = function(){var A,B=navigator.userAgent;this.bw={safari:((A=B.split('AppleWebKit/')[1])?A.split("(")[0].split(".")[0]:0)>=124,konqueror:((A=B.split("Konqueror/")[1])?A.split(";")[0]:0)>=3.3,mozes:((A=B.split("Gecko/")[1])?A.split(" ")[0]:0)>=20011128,opera:(!!window.opera)&&((typeof XMLHttpRequest)=="function"),msie:(!!window.ActiveXObject)?(!!createHttpRequest()):false};return(this.bw.safari||this.bw.konqueror||this.bw.mozes||this.bw.opera||this.bw.msie)}
			, createHttpRequest = function(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(B){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(A){return null}}}else{return null}}}
			, sendRequest = function(E,R,C,D,F,G,S,A){
					var Q=C.toUpperCase()=="GET",H=createHttpRequest();if(H==null){return null}if((G)?G:false){D+=((D.indexOf("?")==-1)?"?":"&")+"t="+(new Date()).getTime()}var P=new chkAjaBrowser(),L=P.bw.opera,I=P.bw.safari,N=P.bw.konqueror,M=P.bw.mozes;if(typeof E=="object"){var J=E.onload;var O=E.onbeforsetheader}else{var J=E;var O=null}if(L||I||M){H.onload=function(){J(H);H.abort()}}else{H.onreadystatechange=function(){if(H.readyState==4){J(H);H.abort()}}}R=K(R,D);if(Q){D+=((D.indexOf("?")==-1)?"?":"")+R}H.open(C,D,F,S,A);if(!!O){O(H)}B(H);H.send(R);
					function B(T){if(!L||typeof T.setRequestHeader=="function"){T.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8")}return T}
					function K(X,V){
						var Z=[];if(typeof X=="object"){for(var W in X){Y(W,X[W])}}else{if(typeof X=="string"){if(X==""){return""}if(X.charAt(0)=="&"){X=X.substring(1,X.length)}var T=X.split("&");for(var W=0;W<T.length;W++){var U=T[W].split("=");Y(U[0],U[1])}}}
						function Y(b,a){Z.push(encodeURIComponent(b)+"="+encodeURIComponent(a))}return Z.join("&")
					}return H
				}
			, arg = _aulta.ajax.request.arguments.length
			;
		if (arg < 3) value = '';
		if (arg < 4) post = true;
		if (arg < 5) async = true;
		if (arg < 6) superload = true;
		var type = (post ? 'POST' : 'GET');
		sendRequest(func, value, type, url, async, superload);
	}
	//	受信データを解析
	_aulta.ajax.analyze = function(ret, i){
		var startText = 'ajx_start'
			, endText = 'ajx_end'
			, startLen = startText.length
			, endLen = endText.length
			, err = 0
			, retText = ''
			;
		if (ret){
			err = 1;
			if (ret.responseText){
				err = 2;
				retText = ret.responseText + '';
				if (retText.substr(0, startLen) == startText){
					err = 3;
					if (retText.substr(retText.length - endLen) == endText){
						var ret = retText.substring(startLen, retText.length - endLen);
						ret = ret.replace(/<input ([^>]+) \/>/g, '<input $1>').replace(/<input ([^>]+)>/g, '<input $1 />');
						ret = ret.replace(/<img ([^>]+) \/>/g, '<img $1>').replace(/<img ([^>]+)>/g, '<img $1 />');
						ret = ret.replace(/<br>/g, '<br />');
						return ret;
					}
				}
			}
		}
		alert('データの送受信でエラーが発生しました。(ErrorCode:' + err + ')');
		alert(retText);
		return false;
	};
	//
	_aulta.ajax.simpleRequest = function(url, param, wait, callback){
		setTimeout(function(){
			aulta.ajax.request(function(ret){
				var text = aulta.ajax.analyze(ret);
				if (text == false){
				} else {
					callback(text);
				}
			}, url, param);
		}, wait);
	}
	
	/*
	 *2	subwindow
	 */
	_aulta.subwindow = new function(){
		var windowList = new Array()
			, selectedNo = -1
			, windowSequence = 0
			, property = new Array()
			, dragData = null
			, eventResize = {}
			;
		property = {
			'border-left-width' : 10	//	背景画像 ボーダーの幅（画像サイズを合わせる）
			, 'border-right-width' : 10
			, 'border-top-width' : 10
			, 'border-bottom-width' : 10
			, 'titlebar-height' : 20	//	タイトルバーの高さ（ボーダー幅除く）
			, 'titlebar-top' : 8
			, 'titlebar-left' : 10
			, 'titlebar-font-size' : 12
			, 'titlebar-font-weight' : 'bold'
			, 'titlebar-font-color' : 'white'
		};
		/*
		 *3	create
		 */
		this.create = function(key, parentObj){
		
			if (this.selectTargetWindow(key)) return false;
			
			selectedNo = windowSequence++;
			windowList[selectedNo] = {
				'key' : key
				, 'zIndex' : 1000
			};
			
			if (this.create.arguments.length != 2){
				parentObj = document.body;
			}
			jQuery(parentObj)
			.append(	//	ウィンドウ
				jQuery(document.createElement('div'))
				.attr('id', 'aulta_swin' + selectedNo)
				.addClass('aulta_swin')
				.css('z-index', windowList[selectedNo]['zIndex'])
				.mousedown(function(){
					selectedNo = this.id.replace('aulta_swin', '');
					aulta.subwindow.foreground();
				})
				.append(	//	左上
					jQuery(document.createElement('div'))
					.attr('id', 'aulta_swin_left_top' + selectedNo)
					.addClass('aulta_swin_left_top')
					.width(property['border-left-width'])
					.height(property['border-top-width'] + property['titlebar-height'])
					.mousedown(function(e){aulta.subwindow.mousedown(e, this, 'size_left_top');})
				)
				.append(	//	右上
					jQuery(document.createElement('div'))
					.attr('id', 'aulta_swin_right_top' + selectedNo)
					.addClass('aulta_swin_right_top')
					.width(property['border-right-width'])
					.height(property['border-top-width'] + property['titlebar-height'])
					.mousedown(function(e){aulta.subwindow.mousedown(e, this, 'size_right_top');})
				)
				.append(	//	中上
					jQuery(document.createElement('div'))
					.attr('id', 'aulta_swin_center_top' + selectedNo)
					.addClass('aulta_swin_center_top')
					.css('left', property['border-left-width'])
					.height(property['border-top-width'] + property['titlebar-height'])
					.mousedown(function(e){aulta.subwindow.mousedown(e, this, 'size_center_top');})
				)
				.append(	//	左中
					jQuery(document.createElement('div'))
					.attr('id', 'aulta_swin_center_left' + selectedNo)
					.addClass('aulta_swin_center_left')
					.css('top', property['border-top-width'] + property['titlebar-height'])
					.width(property['border-left-width'])
					.mousedown(function(e){aulta.subwindow.mousedown(e, this, 'size_center_left');})
				)
				.append(	//	右中
					jQuery(document.createElement('div'))
					.attr('id', 'aulta_swin_center_right' + selectedNo)
					.addClass('aulta_swin_center_right')
					.css('top', property['border-top-width'] + property['titlebar-height'])
					.width(property['border-right-width'])
					.mousedown(function(e){aulta.subwindow.mousedown(e, this, 'size_center_right');})
				)
				.append(	//	左下
					jQuery(document.createElement('div'))
					.attr('id', 'aulta_swin_left_bottom' + selectedNo)
					.addClass('aulta_swin_left_bottom')
					.width(property['border-left-width'])
					.height(property['border-bottom-width'])
					.mousedown(function(e){aulta.subwindow.mousedown(e, this, 'size_left_bottom');})
				)
				.append(	//	中下
					jQuery(document.createElement('div'))
					.attr('id', 'aulta_swin_center_bottom' + selectedNo)
					.addClass('aulta_swin_center_bottom')
					.css('left', property['border-left-width'])
					.height(property['border-bottom-width'])
					.mousedown(function(e){aulta.subwindow.mousedown(e, this, 'size_center_bottom');})
				)
				.append(	//	右下
					jQuery(document.createElement('div'))
					.attr('id', 'aulta_swin_right_bottom' + selectedNo)
					.addClass('aulta_swin_right_bottom')
					.width(property['border-right-width'])
					.height(property['border-bottom-width'])
					.mousedown(function(e){aulta.subwindow.mousedown(e, this, 'size_right_bottom');})
				)
				.append(	//	タイトルエリア
					jQuery(document.createElement('div'))
					.attr('id', 'aulta_swin_title' + selectedNo)
					.addClass('aulta_swin_title')
					.html('　')
					.css('left', property['titlebar-left'])
					.css('top', property['titlebar-top'])
					.css('height', 32)
					.css('font-size', property['titlebar-font-size'])
					.css('font-weight', property['titlebar-font-weight'])
					.css('color', property['titlebar-font-color'])
					.mousedown(function(e){aulta.subwindow.mousedown(e, this, 'move');})
				)
				.append(	//	body
					jQuery(document.createElement('div'))
					.attr('id', 'aulta_swin_body' + selectedNo)
					.addClass('aulta_swin_body')
					.css('left', property['border-left-width'])
					.css('top', property['border-top-width'] + property['titlebar-height'])
				)
				.append(	//	close
					jQuery(document.createElement('img'))
					.attr('id', 'aulta_swin_close' + selectedNo)
					.addClass('aulta_swin_close')
					.attr('src', '/aulta/Aulta/subwin/close.gif')
					.css('right', 8)
					.css('top', 6)
					.mouseover(function(){this.style.backgroundColor = 'peachpuff';})
					.mouseout(function(){this.style.backgroundColor = 'transparent';})
					.click(function(){
						aulta.subwindow.close();
					})
				)
			);
			this.foreground();
			//return windowList[selectedNo];
			return true;
		};
		/*
		 *3	selectTargetWindow
		 */
		this.selectTargetWindow = function(key){
			for( var index in windowList ){
				if (windowList[index]){
					if (windowList[index]['key'] == key){
						selectedNo = index;
						return true;
					}
				}
			}
			return false;
		};
		/*
		 *3	close
		 */
		this.close = function(key){
			if (this.close.arguments.length == 1){
				this.selectTargetWindow(key);
			}
			var obj = document.getElementById('aulta_swin' + selectedNo);
			if (obj){
				obj.parentNode.removeChild(obj);
				windowList[selectedNo] = null;
			}
		};
		/*
		 *3	moveScrollBar
		 */
		this.moveScrollBar = function(x, y){
			document.getElementById('aulta_swin_body' + selectedNo).scrollLeft = x;
			document.getElementById('aulta_swin_body' + selectedNo).scrollTop = y;
		}
		/*
		 *3	mousedown
		 */
		this.mousedown = function(e, obj, type){
			_aulta.pos.nonRangeChoice(true);
			selectedNo = obj.parentNode.id.replace('aulta_swin', '');
			dragData = new Array();
			dragData['type'] = type;
			var p = _aulta.pos.getAbsolute('aulta_swin' + selectedNo)
				, m = _aulta.pos.getMousePos(e)
				, j = jQuery('#aulta_swin' + selectedNo);
			switch(type){
				case 'move':
				case 'size_left_top':
				case 'size_right_top':
				case 'size_center_top':
				case 'size_center_left':
				case 'size_left_bottom':
				case 'size_center_right':
				case 'size_center_bottom':
				case 'size_right_bottom':
					dragData['point'] = {
						'ClickPosX' : (m[0] - p[0])
						, 'ClickPosY' : (m[1] - p[1])
						, 'RightPos' : (j.width() + p[0])
						, 'BottomPos' : (j.height() + p[1])
						, 'DiffWidth' : (m[0] - j.width())
						, 'DiffHeight' : (m[1] - j.height())
					}
					break;
				default:
					dragData = null;
			}
		};
		/*
		 *3	mousemove
		 */
		this.mousemove = function(e){
			if (dragData == null) return;
			var m = _aulta.pos.getMousePos(e)
				, jq = jQuery('#aulta_swin' + selectedNo)
				, dp = dragData['point']
				, l = (m[0] - dp['ClickPosX'])
				, t = (m[1] - dp['ClickPosY']);
			switch (dragData['type']){
				case 'move':
					this.move(l, t, jq);
					break;
				case 'size_left_top':
					this.moveResize(l, t, dp['RightPos'] - l, dp['BottomPos'] - t, jq);
					break;
				case 'size_right_top':
					this.moveResize(jq.css('left'), t, m[0] - dp['DiffWidth'], dp['BottomPos'] - t, jq);
					break;
				case 'size_center_top':
					this.moveResize(jq.css('left'), t, jq.width(), dp['BottomPos'] - t, jq);
					break;
				case 'size_center_left':
					this.moveResize(l, jq.css('top'), dp['RightPos'] - l, jq.height(), jq);
					break;
				case 'size_left_bottom':
					this.moveResize(l, jq.css('top'), dp['RightPos'] - l, m[1] - dp['DiffHeight'], jq);
					break;
				case 'size_center_right':
					this.resize(m[0] - dp['DiffWidth'], jq.height(), jq);
					break;
				case 'size_center_bottom':
					this.resize(jq.width(), m[1] - dp['DiffHeight'], jq);
					break;
				case 'size_right_bottom':
					this.resize(m[0] - dp['DiffWidth'], m[1] - dp['DiffHeight'], jq);
					break;
			}
		};
		/*
		 *3	mouseup
		 */
		this.mouseup = function(){
			dragData = null;
			_aulta.pos.nonRangeChoice(false);
		};
		/*
		 *3	moveResize
		 */
		this.moveResize = function(x, y, w, h, jq){
			var j = null;
			if (this.moveResize.arguments == 5){
				j = jq;
			} else {
				j = jQuery('#aulta_swin' + selectedNo);
			}
			if (w >= 100) j.css('left', x);
			if (h >= 100) j.css('top', y);
			this.resize(w, h, j);
		};
		/*
		 *3	move
		 */
		this.move = function(x, y, jq){
			if (this.moveResize.arguments == 3){
				jq.css('left', x).css('top', y);
			} else {
				jQuery('#aulta_swin' + selectedNo).css('left', x).css('top', y);
			}
		};
		/*
		 *3	resize
		 */
		this.resize = function(w, h, jq){
			if (w < 100) w = 100;
			if (h < 100) h = 100;
			
			if (this.moveResize.arguments == 3){
				jq.width(w).height(h);
			} else {
				jQuery('#aulta_swin' + selectedNo).width(w).height(h);
			}
			var bodyHeight = h - property['border-top-width'] - property['border-bottom-width'] - property['titlebar-height']
				, bodyWidth = w - property['border-left-width'] - property['border-right-width'];
			
			jQuery('#aulta_swin_center_left' + selectedNo).height(bodyHeight);
			
			jQuery('#aulta_swin_center_top' + selectedNo).width(bodyWidth);
			
			jQuery('#aulta_swin_center_right' + selectedNo).height(bodyHeight);
			
			jQuery('#aulta_swin_center_bottom' + selectedNo).width(bodyWidth);
			
			jQuery('#aulta_swin_title' + selectedNo).width(bodyWidth);
			
			jQuery('#aulta_swin_body' + selectedNo).width(bodyWidth).height(bodyHeight);
			
			if (typeof(eventResize) == 'function') eventResize(bodyWidth, bodyHeight);
		};
		this.addEventResize = function(func){
			eventResize = func;
		};
		//	タイトルをセット
		this.setTitle = function(text){
			document.getElementById('aulta_swin_title' + selectedNo).innerHTML = text;
		};
		//	bodyをセット
		this.setHtml = function(html){
			document.getElementById('aulta_swin_body' + selectedNo).innerHTML = html;
		};
		this.setHtmlElm = function(elm){
			jQuery(document.getElementById('aulta_swin_body' + selectedNo))
			.html('')
			.append(elm);
		}
		//	選択ウィンドウを最前面に持ってくる
		this.foreground = function(){
			var max = 1000, no = -1;
			for( var index in windowList ){
				var win = windowList[index];
				if (win != null){
					if (win['zIndex'] > max){
						max = win['zIndex'];
						no = index;
					}
				}
			};
			if (selectedNo != no){
				max++;
				windowList[selectedNo]['zIndex'] = max;
				jQuery('#aulta_swin' + selectedNo).css('z-index', max);
			}
		};
		
	}
	jQuery(document.body)
	.mousemove(function(e){
		aulta.subwindow.mousemove(e);
	})
	.mouseup(function(e){
		aulta.subwindow.mouseup(e);
	})
	;
	
})();



/*
 *	session
 */
window.aulta.session = {
	_values : {}
	,
	load : function(callback){
		aulta.ajax.request(function(ret){
			var text = aulta.ajax.analyze(ret);
			if (text == false){
			} else {
				var arr = '';
				eval('arr = ' + text);
				if (typeof(arr) == 'object'){
					aulta.session._values = arr;
				}
			}
			callback();
		}, '/ajax/load.a', '&ajax=ajax');
	}
	,
	save : function(callback){
		aulta.ajax.request(function(ret){
			var text = aulta.ajax.analyze(ret);
			callback((text == 'ok'));
		}, '/ajax/save.a', '&ajax=ajax&data=' + JSON.stringify(aulta.session._values));
	}
	,
	get : function(key){
		if (key in aulta.session._values) return aulta.session._values[key];
		return '';
	}
	,
	set : function(key, value){
		aulta.session._values[key] = value;
	}
};

/*
 *1	const
 */
window.aulta.text = {
	loading : '<img src="/aulta/img/loading.gif" width="220" height="47" alt="読込中・・・" />'
};

/*
 *1	utility
 */
window.aulta.utility = {
	/*
	 *2	download
	 */
	download : {
		post : function(url, params, callback){
			var inputs = '';
			for (var ind in params){
				inputs += '<input type="hidden" name="' + ind + '" value="' + params[ind] + '" />';
			}
			var form = jQuery(
				'<form action="' + url + '?t=' + (new Date()).getTime() + '" method="post">'
				+ inputs
				+ '<input type="submit" value="go" />'
				+ '</form>'
			);
			jQuery('body').append(form);
			form.submit();
			form.remove();
			if (callback) callback();
		}
	}
	,
	/*
	 *2	form
	 */
	form : {
		/*
		 *3 getFieldParamString
		 */
		getFieldParamString : function(formId){
			var param = '';
			jQuery(formId + ' input')
			.each(function(){
				var jq = jQuery(this)
				, val = jq.val()
				, nm = jq.attr('name') + ''
				, tp = jq.attr('type') + '';
				if (nm.length > 0){
					val = aulta.string.trim(val);
					val = aulta.string.urlencode(val);
					if (tp == 'checkbox'){
						if (jq.attr('checked')){
							param += '&' + nm + '=' + val;
						} else {
							param += '&' + nm + '=';
						}
					} else {
						param += '&' + nm + '=' + val;
					}
				}
			});
			jQuery(formId + ' textarea')
			.each(function(){
				var jq = jQuery(this)
				, val = jq.val();
				val = aulta.string.trim(val);
				val = aulta.string.urlencode(val);
				param += '&' + jq.attr('name') + '=' + val;
			});
			jQuery(formId + ' select')
			.each(function(){
				var jq = jQuery(this)
				, val = jq.val();
				val = aulta.string.trim(val);
				val = aulta.string.urlencode(val);
				param += '&' + jq.attr('name') + '=' + val;
			});
			return param;
		}
		/*
		 *3	checkFieldParams
		 */
		,
		checkFieldParams : function(formId){
			var ret = '';
			jQuery(formId + ' input')
			.each(function(){
				var jq = jQuery(this)
				, val = jq.val() + ''
				, pattern = jq.attr('pattern')
				, maxlen = jq.attr('maxlen')
				, minlen = jq.attr('minlen')
				, errmes = jq.attr('errmes')
				, l = val.length
				;
				if (typeof pattern != 'undefined') {
					eval('var r = ( ! val.match(' + pattern + '));');
					if (
						(r)
						|| (l >  maxlen)
						|| (l <  minlen)
					){
						ret += errmes + ' : ' + l + '文字' + "\n";
					}
				}
			});
			return ret;
		}
		/*
		 *3	addEvent
		 */
		,
		addEvent : function(){
			jQuery('form .textbox')
			.focus(function(){
				jQuery(this)
				.css('background-color', '#FFFACD')
				.css('border-color', '#00BFFF')
				;
			})
			.blur(function(){
				jQuery(this)
				.css('background-color', 'white')
				.css('border-color', 'gray')
				;
			})
			;
			jQuery('form .checkbox')
			.each(function(){
				jQuery(this).parent().css('background-color', (this.checked ? '#FF7F50': 'transparent'));
			})
			.click(function(){
				jQuery(this).parent().css('background-color', (this.checked ? '#FF7F50': 'transparent'));
			})
			;
		}
	}
	,
	/*
	 *2	propertyLength
	 */
	propertyLength : function(obj){
		var cnt = 0;
		for (var i in obj) cnt++;
		return cnt;
	}
	,
	/*
	 *2	getPath
	 */
	getPath : function(){
		var d = document.domain
		, h = document.location.href
		, s = h.split(d);
		return s[1];
	}
	,
	/*
	 *2	window.open
	 */
	windowOpen : function(url, target, qs){
		var form = document.createElement('form');
		form.action = url;
		form.target = target;
		form.method = 'post';
		for (var i = 0; i < qs.length; i++) {
			var ol = qs[i];
			var input = document.createElement('input');
			for(var p in ol) {
			  input.setAttribute(p, ol[p]);
			}
			form.appendChild(input);
		}
		var body = document.getElementsByTagName('body')[0];
		body.appendChild(form);
		form.submit();
		body.removeChild(form);
	}
	,
	/*
	 *2	clone
	 * 	http://d.hatena.ne.jp/amachang/20061019/1161201903
	 */
	clone : function(p){
		p = (function(){return this}).apply(p); // objectify if atomic
		switch (typeof p) {
			case 'function':  return function() { return p.apply(this, arguments) };
			case 'undefined': return p;
			case 'object':
			if (p == null) return p;
			else {
				var f = function() {};
				f.prototype = p;
				var o = new f;
				switch (p.constructor) {
					case String: case Number: case Boolean:
						if (o.toSource) o.toSource = function() { return "clone(" + p.toSource.apply(p, arguments) + ")/*require clone function*/" };
						o.toString = function() { return p.toString.apply(p, arguments) };
						o.valueOf = function() { return p.valueOf.apply(p, arguments) };
				}
				return o;
			}
		}
	}
	,
	/*
	 *2	getImageSize
	 */
	getImageSize : function(url, callback, maxWidth, maxHeight){
		var img = new Image()
			, argumentsLength = aulta.utility.getImageSize.arguments.length;
		img.src = url;
		jQuery(img)
		.load(function(){
			var w = img.width
				, h = img.height;
			if (argumentsLength > 2){
				if (w > maxWidth){
					h = h * (maxWidth / w);
					w = maxWidth;
				}
				if (argumentsLength > 3){
					if (h > maxHeight){
						w = w * (maxHeight / h);
						h = maxHeight;
					}
				}
			}
			callback(w, h);
		});
	}
	,
	/*
	 *
	 */
	imageHover : function(){
		jQuery('a.image_hover')
		.hover(
			function(){
				jQuery(this).children('img')
				.each(function(){
					var src = jQuery(this).attr('src');
					jQuery(this).attr('src', src.replace('_normal', '_hover'));
				});
			}
			,
			function(){
				jQuery(this).children('img')
				.each(function(){
					var src = jQuery(this).attr('src');
					jQuery(this).attr('src', src.replace('_hover', '_normal'));
				});
			}
		)
		.each(function(){
			jQuery(this).children('img')
			.each(function(){
				var src = jQuery(this).attr('src');
				aulta.utility.preLoadImage(src.replace('_normal', '_hover'));
			});
		})
		;
	}
};

window.aulta.jQuery = {
	width : function(el){
		if (navigator.appVersion.toLowerCase().indexOf('safari')+1?1:0){
			return el.innerWidth;
		} else {
			return jQuery(el).width();
		}
	}
	,
	height : function(el){
		if (navigator.appVersion.toLowerCase().indexOf('safari')+1?1:0){
			return el.innerHeight;
		} else {
			return jQuery(el).height();
		}
	}
};

window.aulta.page = {};
window.aulta.parts = {};



