/*
 * yuga.js 0.7.1 
 * Copyright (c) 2009 Kyosuke Nakamura (kyosuke.jp)
 * Licensed under the MIT License:
 * Since:     2006-10-30
 * Modified:  2010-12-27
 * jQuery 1.3.1 and ThickBox 3.1
 */


(function($) {

	$(function() {
		$.yuga.selflink();
		$.yuga.rollover();
		$.yuga.externalLink();
		//$.yuga.thickbox();
		$.yuga.scroll();
		//$.yuga.tab();
		//$.yuga.stripe();
		//$.yuga.css3class();
	});

	//---------------------------------------------------------------------

	$.yuga = {
		// URIを解析したオブジェクトを返すfunction
		Uri: function(path){
			var self = this;
			this.originalPath = path;
			//絶対パスを取得
			this.absolutePath = (function(){
				var e = document.createElement('span');
				e.innerHTML = '<a href="' + path + '" />';
				return e.firstChild.href;
			})();
			//絶対パスを分解
			var fields = {'schema' : 2, 'username' : 5, 'password' : 6, 'host' : 7, 'path' : 9, 'query' : 10, 'fragment' : 11};
			var r = /^((\w+):)?(\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/.exec(this.absolutePath);
			for (var field in fields) {
				this[field] = r[fields[field]];
			}
			this.querys = {};
			if(this.query){
				$.each(self.query.split('&'), function(){
					var a = this.split('=');
					if (a.length == 2) self.querys[a[0]] = a[1];
				});
			}
		},
		//現在のページと親ディレクトリへのリンク
		selflink: function (options) {
			var c = $.extend({
				selfLinkAreaSelector:'.cur',
				selfLinkClass:'current',
				parentsLinkClass:'parentsLink',
				postfix:'_cr',
				changeImgSelf:false,
				changeImgParents:false,
				selfLinkFlg:true,
				localHref:location.href,
				hrefRule:[]
			}, options);
			if(c.localHref.indexOf('#') > -1){ c.localHref = c.localHref.substr(0,c.localHref.indexOf('#'));}




/*	-----------------------------	*/
/*	▼▼▼ルール外URLの対応▼▼▼	*/
/*	-----------------------------	*/


c.hrefRule = {
	/* 企業サイト */
	'/saiyou/career2/field/01_project/' : '/saiyou/career2/field/01/',
	'/saiyou/career2/field/02_project/' : '/saiyou/career2/field/02/',
	'/ir/archive/' : 'none',
	'/company/whatsnew/' : 'none'
};



/*	-----------------------------	*/
/*	▲▲▲ルール外URLの対応▲▲▲	*/
/*	-----------------------------	*/





			for(var i in c.hrefRule){
			//	console.log(i +' -> '+ c.hrefRule[i]);
				if(c.localHref.indexOf(i) > -1){
					c.localHref = c.localHref.replace(i,c.hrefRule[i]);
//					console.log('hit !! ->' + i);
				}
			}
			$('#lNavi ul ul').hide();
			$('.cur #lNavi > li').find('> ul li').addClass('cur0')
							.find('> ul li').addClass('cur0-0')
							.find('> ul li').addClass('cur0-0-0');
			$('.cur0-0-0').find('> p > a[href]').each(function(){
				var href = new $.yuga.Uri(this.getAttribute('href'));
				var abHrefFix = href.absolutePath;
				if(href.absolutePath.indexOf('#') > -1){ abHrefFix = href.absolutePath.substr(0,href.absolutePath.indexOf('#'));}

				if ((abHrefFix == c.localHref) && !href.fragment) {
					if(c.selfLinkFlg == true){
						$(this).addClass(c.selfLinkClass);
						$(this).parent().parent().parent().show();
						$(this).parent().parent().parent().parent().parent().addClass('cur_parents');
						c.selfLinkFlg =false;
					}
				}//	console.log($(this).text()+'\r\n'+	'localHref -> '+ c.localHref	+'\r\n'+	'abHrefFix -> '+ abHrefFix		+'\r\n'+	c.selfLinkFlg);
			});
			$('.cur0-0').find('> p > a[href]').each(function(){
				var href = new $.yuga.Uri(this.getAttribute('href'));
				var abHrefFix = href.absolutePath;
				if(href.absolutePath.indexOf('#') > -1){ abHrefFix = href.absolutePath.substr(0,href.absolutePath.indexOf('#'));}

				if ((abHrefFix == c.localHref) && !href.fragment) {
					if(c.selfLinkFlg == true){
						$(this).addClass(c.selfLinkClass);
						$(this).parent().next().show();
						$(this).parent().parent().parent().addClass('cur_parents');
						c.selfLinkFlg =false;
					}
				}//	console.log($(this).text()+'\r\n'+	'localHref -> '+ c.localHref	+'\r\n'+	'abHrefFix -> '+ abHrefFix		+'\r\n'+	c.selfLinkFlg);
			});
			$('.cur0').find('> p > a[href]').each(function(){
				var href = new $.yuga.Uri(this.getAttribute('href'));
				var abHrefFix = href.absolutePath;
				if(href.absolutePath.indexOf('#') > -1){ abHrefFix = href.absolutePath.substr(0,href.absolutePath.indexOf('#'));}

				if ((abHrefFix == c.localHref) && !href.fragment) {
					if(c.selfLinkFlg == true){
						$(this).addClass(c.selfLinkClass);
						$(this).parent().next().show();
						c.selfLinkFlg =false;
					}
				}//	console.log($(this).text()+'\r\n'+	'localHref -> '+ c.localHref	+'\r\n'+	'abHrefFix -> '+ abHrefFix		+'\r\n'+	c.selfLinkFlg);
			});
			$('.cur0-0-0').find('> p > a[href]').each(function(){
				var href = new $.yuga.Uri(this.getAttribute('href'));
				var abHrefFix = href.absolutePath;

				if (0 <= c.localHref.search(abHrefFix)) {
					if(c.selfLinkFlg){
						$(this).addClass(c.selfLinkClass);
						$(this).parent().parent().parent().show();
						$(this).parent().parent().parent().parent().parent().addClass('cur_parents');
						c.selfLinkFlg =false;
					}
				}//	console.log($(this).text()+'\r\n'+	'localHref -> '+ c.localHref	+'\r\n'+	'abHrefFix -> '+ abHrefFix		+'\r\n'+	c.selfLinkFlg);
			});
			$('.cur0-0').find('> p > a[href]').each(function(){
				var href = new $.yuga.Uri(this.getAttribute('href'));
				var abHrefFix = href.absolutePath;

				if(href.absolutePath.indexOf('#') > -1){ abHrefFix = href.absolutePath.substr(0,href.absolutePath.indexOf('#'));}
				if (0 <= c.localHref.search(abHrefFix)) {
					if(c.selfLinkFlg){
						$(this).addClass(c.selfLinkClass);
						$(this).parent().next().show();
						$(this).parent().parent().parent().addClass('cur_parents');
						c.selfLinkFlg =false;
					}
				}//	console.log($(this).text()+'\r\n'+	'localHref -> '+ c.localHref	+'\r\n'+	'abHrefFix -> '+ abHrefFix		+'\r\n'+	c.selfLinkFlg);
			});
			$('.cur0').find('> p > a[href]').each(function(){
				var href = new $.yuga.Uri(this.getAttribute('href'));
				var abHrefFix = href.absolutePath;
				if (0 <= c.localHref.search(abHrefFix)) {
					if(c.selfLinkFlg){
						$('.cur0 > p > a[href]').removeClass(c.selfLinkClass);
						$(this).addClass(c.selfLinkClass);
						$(this).parent().next().show();
//						c.selfLinkFlg =false;
					}
				}//	console.log($(this).text()+'\r\n'+	'localHref -> '+ c.localHref	+'\r\n'+	'abHrefFix -> '+ abHrefFix		+'\r\n'+	c.selfLinkFlg);
			});


		},
		//ロールオーバー
		rollover: function(options) {
			var c = $.extend({
				hoverSelector: '.over',
				groupSelector: '.overgroup',
				postfix: '_ov'
			}, options);
			//ロールオーバーするノードの初期化
			var rolloverImgs = $(c.hoverSelector).filter(isNotCurrent);
			rolloverImgs.each(function(){
				this.originalSrc = $(this).attr('src');
				this.rolloverSrc = this.originalSrc.replace(new RegExp('('+c.postfix+')?(\.gif|\.jpg|\.png)$'), c.postfix+"$2");
				this.rolloverImg = new Image;
				this.rolloverImg.src = this.rolloverSrc;
			});
			//グループ内のimg要素を指定するセレクタ生成
			var groupingImgs = $(c.groupSelector).find('img').filter(isRolloverImg);

			//通常ロールオーバー
			rolloverImgs.not(groupingImgs).hover(function(){
				$(this).attr('src',this.rolloverSrc);
			},function(){
				$(this).attr('src',this.originalSrc);
			});
			//グループ化されたロールオーバー
			$(c.groupSelector).hover(function(){
				$(this).find('img').filter(isRolloverImg).each(function(){
					$(this).attr('src',this.rolloverSrc);
				});
			},function(){
				$(this).find('img').filter(isRolloverImg).each(function(){
					$(this).attr('src',this.originalSrc);
				});
			});
			//フィルタ用function
			function isNotCurrent(i){
				return Boolean(!this.currentSrc);
			}
			function isRolloverImg(i){
				return Boolean(this.rolloverSrc);
			}

		},
		//外部リンクは別ウインドウを設定
		externalLink: function(options) {
			var c = $.extend({
				windowOpen:true,
				externalClass: 'externalLink',
				addIconSrc: ''
			}, options);
			var uri = new $.yuga.Uri(location.href);
			var e = $('a[href^="http://"]').not('a[href^="' + uri.schema + '://' + uri.host + '/' + '"]').not('a[class!="js_window_open"]').not('a[class!="js_print_open"]');

			if (c.windowOpen) {
				e.click(function(){
					window.open(this.href, '_blank');
					return false;
				});
			}
		},
		//画像へ直リンクするとthickboxで表示(thickbox.js利用)
		thickbox: function() {
		},
		//ページ内リンクはするするスクロール
		scroll: function(options) {
			//ドキュメントのスクロールを制御するオブジェクト
			var scroller = (function() {
				var c = $.extend({
					easing:100,
					step:30,
					fps:60,
					fragment:''
				}, options);
				c.ms = Math.floor(1000/c.fps);
				var timerId;
				var param = {
					stepCount:0,
					startY:0,
					endY:0,
					lastY:0
				};
				//スクロール中に実行されるfunction
				function move() {
					if (param.stepCount == c.step) {
						//スクロール終了時
						setFragment(param.hrefdata.absolutePath);
						window.scrollTo(getCurrentX(), param.endY);
					} else if (param.lastY == getCurrentY()) {
						//通常スクロール時
						param.stepCount++;
						window.scrollTo(getCurrentX(), getEasingY());
						param.lastY = getEasingY();
						timerId = setTimeout(move, c.ms); 
					} else {
						//キャンセル発生
						if (getCurrentY()+getViewportHeight() == getDocumentHeight()) {
							//画面下のためスクロール終了
							setFragment(param.hrefdata.absolutePath);
						}
					}
				}
				function setFragment(path){
					location.href = path
				}
				function getCurrentY() {
					return document.body.scrollTop  || document.documentElement.scrollTop;
				}
				function getCurrentX() {
					return document.body.scrollLeft  || document.documentElement.scrollLeft;
				}
				function getDocumentHeight(){
					return document.documentElement.scrollHeight || document.body.scrollHeight;
				}
				function getViewportHeight(){
					return (!$.browser.safari && !$.browser.opera) ? document.documentElement.clientHeight || document.body.clientHeight || document.body.scrollHeight : window.innerHeight;
				}
				function getEasingY() {
					return Math.floor(getEasing(param.startY, param.endY, param.stepCount, c.step, c.easing));
				}
				function getEasing(start, end, stepCount, step, easing) {
					var s = stepCount / step;
					return (end - start) * (s + easing / (100 * Math.PI) * Math.sin(Math.PI * s)) + start;
				}
				return {
					set: function(options) {
						this.stop();
						if (options.startY == undefined) options.startY = getCurrentY();
						param = $.extend(param, options);
						param.lastY = param.startY;
						timerId = setTimeout(move, c.ms); 
					},
					stop: function(){
						clearTimeout(timerId);
						param.stepCount = 0;
					}
				};
			})();
			$('a[href^=#], area[href^=#]').not('a[href=#], area[href=#]').each(function(){
				this.hrefdata = new $.yuga.Uri(this.getAttribute('href'));
			}).click(function(){
				var target = $('#'+this.hrefdata.fragment);
				if (target.length == 0) target = $('a[name='+this.hrefdata.fragment+']');
				if (target.length) {
					scroller.set({
						endY: target.offset().top,
						hrefdata: this.hrefdata
					});
					return false;
				}
			});
		},
		//タブ機能
		tab: function(options) {
			var c = $.extend({
				tabNavSelector:'.tabNav',
				activeTabClass:'active'
			}, options);
		},
		//奇数、偶数を自動追加
		stripe: function(options) {
			var c = $.extend({
				oddClass:'odd',
				evenClass:'even'
			}, options);
		},
		//css3のクラスを追加
		css3class: function() {}
	};
})(jQuery);

/* 
-----------------------------------------------------------------------------------------------------------------*/
jQuery(document).ready(function($) {

	var postfix = '_ov';
	$('.over').not('[src*="'+ postfix +'."]').each(function() {

		var img = $(this);
		var src = img.attr('src');
		var src_on = src.substr(0, src.lastIndexOf('.'))
		           + postfix
		           + src.substring(src.lastIndexOf('.'));
		$('<img>').attr('src', src_on);
		img.hover(
			function() {
				img.attr('src', src_on);
			},
			function() {
				img.attr('src', src);
			}
		);
	});


	jQuery.easing.quart = function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	};  


	/* PAGESETUP
	-----------------------------------------------------------------------------------------------------------------*/
	js_lNavi_visual();
	js_window_open();
	js_link_icon();
	js_pNavi_visual();
	js_bNavi_visual();

});

/*	//	PAGE PRINT
-----------------------------------------------------------------------------------------------------------------*/
function js_page_print(){
	window.print();
	return false
}
/*	//	
-----------------------------------------------------------------------------------------------------------------*/
function js_window_close(){
	window.close();
	return false;
}
/*	//	
-----------------------------------------------------------------------------------------------------------------*/
function js_window_open(){
	var js_para = null;
	// js_para[0] = width
	// js_para[1] = height
	// js_para[2] = window.name
	$('a[class^="js_window_open"], area[class^="js_window_open"]').each(function(index){
		$(this).click(function(){
			var wo = null;
			// get window width & height
			js_para = $(this).attr('class').match(/[0-9]+/g);
			// get window.name
			window.name ? js_para[2] = window.name+'_' : js_para[2] = ('');
			wo = window.open(this.href, js_para[2]+'popup'+index,'width='+js_para[0]+',height='+js_para[1]+',scrollbars=yes');
			wo.focus();
			return false;
		});
	});
}
/* lNavi visual SETUP 091224/
-----------------------------------------------------------------------------------------------------------------*/
function js_lNavi_visual(){
	var _root_elm = $('#sub > div:first').attr('class');
	$('#lNavi ul li:first-child').addClass('firstChild');
	$('#lNavi ul li:last-child').addClass('lastChild');
	$('#lNavi .cName').each(function(){
		$(this).click(function(){
			$(this).next().toggle();
		});
		$(this).hover(function(){ $(this).addClass('p_hover');},function(){ $(this).removeClass('p_hover')});
	});
	$('#lNavi .cName + ul').addClass('cList');
	$('#lNavi .icon > p a').each(function(){
		$(this).append('&nbsp;<img src="/image/common/images/ico/ico_lnavi_blank.gif" width="8" height="10" alt="" />');
		$(this).click(function(){
			window.open(this.href,'extarnal');
			return false;
		});
	});
	$('#lNavi .icon_p > p a').each(function(){
		$(this).append('&nbsp;<img src="/image/common/images/ico/ico_lnavi_blank.gif" width="8" height="10" alt="" />');
	});
	if(_root_elm){
		_routing = new Array;
		_routing[0] = _root_elm.match(/l[\dA-Z]+_[\d]+cr/);
		_routing[1] = _root_elm.match(/l[\dA-Z]+_[\d]+/);
		_routing[2] = _root_elm.match(/n[\d]+_[\d]+cr/);
		_routing[3] = _root_elm.match(/n[\d]+cr/);
		if(_routing[0]){ _routing[0].push(_routing[0][0].match(/[\dA-Z]+/g))}
		if(_routing[1]){ _routing[1].push(_routing[1][0].match(/[\dA-Z]+/g))}
		if(_routing[2]){ _routing[2].push(_routing[2][0].match(/[\d]+/g))}
		if(_routing[3]){ _routing[3].push(_routing[3][0].match(/[\d]+/g))}
		if(_routing[0] != null){
			$('.lNav'+_routing[0][1][0]+'_'+_routing[0][1][1]+' > p a,'+
			  '.lNav'+_routing[0][1][0]+'_'+_routing[0][1][1]+' > p strong').addClass('current').parent().next().show();
		}else if(_routing[1] != null){
			$('.lNav'+_routing[1][1][0]+'_'+_routing[1][1][1]+' > ul').show();
		}else{
		}
		if(_routing[1] != null && _routing[2] != null){
			$('.lNav'+_routing[1][1][0]+'_'+_routing[1][1][1]+' .nav'+_routing[2][1][0]+'_'+_routing[2][1][1]+' > p a,'+
			  '.lNav'+_routing[1][1][0]+'_'+_routing[1][1][1]+' .nav'+_routing[2][1][0]+'_'+_routing[2][1][1]+' > p strong').addClass('current').parent().parent().parent().show();
		}else if(_routing[1] != null && _routing[3] != null){
			$('.lNav'+_routing[1][1][0]+'_'+_routing[1][1][1]+' .nav'+_routing[3][1]+' > p a').addClass('current').parent().next().show();
		}else{
		}
	}
}
/* lNavi visual SETUP 091224/
-----------------------------------------------------------------------------------------------------------------*/
function js_bNavi_visual(){
	var _root_elm = $('.bNavi').parent().attr('class');
	$('.bNaviIn ul ul').hide();
	if(_root_elm){
		$('.bNavi').each(function(){
			_root_elm = $(this).parent().attr('class');
			_routing = new Array;
			_routing[0] = _root_elm.match(/bN[\d]+_[\d]+cr/);
			_routing[1] = _root_elm.match(/bN[\d]+cr/);
			if(_routing[0]){ _routing[0].push(_routing[0][0].match(/[\d]+/g))}
			if(_routing[1]){ _routing[1].push(_routing[1][0].match(/[\d]+/g))}
			if(_routing[0] != null){
				$('.'+_routing[0][0]+' a.bNav'+_routing[0][1][0]+'_'+_routing[0][1][1]).addClass('current').parent().parent().show();
			}else if(_routing[1] != null){
				$('.'+_routing[1][0]+' a.bNav'+_routing[1][1]).addClass('current');
			}else{
			}
		});
	}
}
/* js_pNavi_visual 100112/
-----------------------------------------------------------------------------------------------------------------*/
function js_pNavi_visual(){
	$('.pNavi li a span, .pNavi4 li a span, .pNavi3 li a span, .pNavi2 li a span, .pNaviW li a span, .pNaviW4 li a span, .pNaviW3 li a span, .pNaviW2 li a span').each(function(){
		$(this).css('display','inline-block');
		//console.log($(this).innerWidth() +' - '+ $(this).parent().innerWidth());
		if(($(this).innerWidth() + 18) > $(this).parent().innerWidth() || $(this).innerHeight() > 50){
			$(this).css('display','block').css('width',($(this).parent().innerWidth()-11)+'px').css('margin-left','11px')
			.parent().parent().addClass('line2');
		}
		if($(this).css('display') == 'inline-block'){
			$(this).css('width',($(this).innerWidth()+2)+'px').css('display','block').css('margin','0 auto');
		}
		if($(this).css('display') == 'inline'){
			$(this).css('width',($(this).innerWidth()+2)+'px').css('display','block').css('margin','0 auto');
		}
		if($(this).css('display') == 'block' && $(this).innerHeight() < 35){
			$(this).parent().parent().removeClass('line2');
		}
		$(this).prepend('<img src="/image/common/images/ico/ico_arrR02.png" class="pNaviArr" alt="" />');
	});
	
	//pNavi_childが存在するときの処理
	$('.pNavi_child').each(function(){
		$('.pNavi, .pNavi4, .pNavi3, .pNavi2, .pNavi, .pNaviW, .pNaviW4, .pNaviW3, .pNaviW2').css('margin-bottom','0');
	});
	
	//ico_blankが存在するときの処理
	$('.ico_blank').each(function(){
		$('.ico_blank').css({'position':'absolute', 'top':'19px', 'left':''+ ($(this).parent().innerWidth()+5) +'px'});
	});
}
/* link_type icon SETUP 091213/
-----------------------------------------------------------------------------------------------------------------*/
function js_link_icon(){
	var icons = {
		'type08' : '<img src="/image/common/images/ico/option_ico_email.gif" width="12" height="9" alt="" />',
		'ico_news_prod' : '<img src="/image/common/images/ico/ico_news_prod.gif" width="36" height="13" style="position:absolute;top:2px;left:0px;" alt="製品" />',
		'ico_news_com' : '<img src="/image/common/images/ico/ico_news_com.gif" width="36" height="13" style="position:absolute;top:2px;left:0px;" alt="企業" />',
		'ico_news_ir' : '<img src="/image/common/images/ico/ico_news_ir.gif" width="36" height="13" style="position:absolute;top:2px;left:0px;" alt="IR" />'
	};
	$('.ul_news dd.ico_news_prod,'+
	  ' .ul_news02 dd.ico_news_prod,'+
	  ' .ul_news dd.ico_news_com,'+
	  ' .ul_news02 dd.ico_news_com,'+
	  ' .ul_news dd.ico_news_ir,'+
	  ' .ul_news02 dd.ico_news_ir,'+
	  ' a[href*="mailto"]').each(function(){
		if($(this).attr('href')){
			if($(this).attr('href').match(/mailto/)){
				if($(this).text().length != 0){ $(this).prepend(icons['type08']+'&nbsp;');}
			}
		}else if($(this).attr('class').match(/ico_news_prod/)){ $(this).prepend(icons['ico_news_prod']);
		}else if($(this).attr('class').match(/ico_news_com/)){ $(this).prepend(icons['ico_news_com']);
		}else if($(this).attr('class').match(/ico_news_ir/)){ $(this).prepend(icons['ico_news_ir']);
		}else{}
	});
}

/*	//	Firefox Print CSS
-----------------------------------------------------------------------------------------------------------------*/
var firefox = (navigator.userAgent.indexOf("Firefox") != -1)? true : false; 
if(firefox) document.write('');

/* cookie operation 091208
-----------------------------------------------------------------------------------------------------------------*/
function class_cookielib(){
	this.getCookie = getCookie;
	this.setCookie = setCookie;
	this.removeCookie = removeCookie;
	var expireDate = new Date();
	expireDate.setFullYear(expireDate.getFullYear()+1);
	expireStr = "expires=" + expireDate.toUTCString();
	function getCookie(name){
		var gc=name+"=";
		var Cookie=document.cookie;
		if (Cookie.length>0) {
			var start=Cookie.indexOf(gc);
			if (start!=-1) {
				start+=gc.length;
				terminus=Cookie.indexOf(";",start);
				if (terminus==-1) terminus=Cookie.length;
				return unescape(Cookie.substring(start,terminus));
			}
		}
		return '';
	}
	function setCookie() {
		var key = arguments[0];
		var val = arguments[1];
		var path = (typeof(arguments[2]) != 'undefined' ? arguments[2] : '/');
		
		var exp = (typeof(arguments[3]) != 'undefined'  ? arguments[3] : expireStr);
		var sc = key + "=" + escape(val) + "; path=" + path + "; " + exp;
		document.cookie = sc;
	}
	function removeCookie(key,path) {
		if(!path){
			path = '/';
		}
		var rc = key + "=; path=" + path + "; expires=Thu, 28 Jun 2001 00:00:00 UTC";
		document.cookie = rc;
	}
}
var cookieObj = new class_cookielib();


/* footer fix
-----------------------------------------------------------------------------------------------------------------*/
jQuery(document).ready(function($) {
	var footer_next = $('div#printSec').next().attr("id");

	if ($('p#ft_close').length) {
		} else if (footer_next && footer_next != 'footer_wrap') {
			$('div#printSec,div#'+footer_next+',div#footer_wrap').wrapAll('<div id="footer_fix"></div>');
			footer_fix_css(3);
		} else if ($('div#printSec').length) {
			$('div#printSec,div#footer_wrap').wrapAll('<div id="footer_fix"></div>');
			footer_fix_css(2);
		} else {
			$('div#footer_wrap').wrapAll('<div id="footer_fix"></div>');
			footer_fix_css(1);
		}

	function footer_fix_css(num){
		var footer_fix_height1 = $('#footer_fix').height();
		var footer_fix_height2 = footer_fix_height1 * (-1) - 30;
		var footer_fix_height3 = footer_fix_height1 * (-1);
		var footer_fix_height4 = footer_fix_height1 * (-1) + 15;

		$('html,body').css('height','100%');
		$('#wrapper').css({'min-height':'100%','height':'auto'});
		if ($.browser.msie && $.browser.version.substr(0,1)<7){
			$('#wrapper').css({'min-height':'100%','height':'100%'});
		}
		$('#contents').css('padding-bottom',footer_fix_height1+'px');
		$('#footer_fix').css({'clear':'both','position':'relative','width':'960px','margin':footer_fix_height2+'px auto 0','padding-top':'20px','background-color':'#ffffff','text-align':'left'});
		if ($.browser.webkit ||($.browser.msie && $.browser.version.substr(0,1)<8)){
			$('div#footer_fix').css('margin',footer_fix_height3+'px auto 0');
		}
		if (num == 3){
			$('div#footer_fix').css('margin',footer_fix_height4+'px auto 0');
		}
		if (num == 1){
			if ($.browser.msie && $.browser.version.substr(0,1)<8){
				$('div#footer_fix').css({'margin':footer_fix_height2+'px auto 0','padding-top':'30px'});				
			}
			if ($.browser.webkit){
				$('div#footer_fix').css({'margin':footer_fix_height2+'px auto 0','padding-top':'20px'});				
			}
		}
	}

})

/* facebook share button
-----------------------------------------------------------------------------------------------------------------*/
function fb_share(){
	document.getElementById("fb_s").innerHTML = '<a href="http://www.facebook.com/sharer.php?u='+ location.href +'&amp;t='+ document.title +'" rel="nofollow" class="js_window_open-625-435"><img src="/image/common/images/ico/ico_facebook.gif" alt="facebook" width="26" height="26" /></a>';
	}
	
	

