/* ---------------------------------------------------------------		FUNCTION.JS -- 4digit Javascript BASE FUNCTIONS	Copyright (c) fourdigit Co., Ltd. All Rights Reserved.		--------------------------------------------------------------- *//*	EXTEND LIBRARY*/$.extend();$.fn.extend();/*	AUTOMATION*///FUNCTION initRollOversfunction initRollOvers(){	if(!document.getElementById) return;	$('img.ahover').each(function(){		var src = $(this).attr('src');		var isov = src.substring(0,src.lastIndexOf('.'));		if( isov.substring(isov.length-3, isov.length) != "_ov"		 && isov.substring(isov.length-3, isov.length) != "_on"		 && isov.substring(isov.length-4, isov.length) != "_off"		){			var ftype = src.substring(src.lastIndexOf('.'), src.length);			var hsrc = src.replace(ftype, '_ov'+ftype);			var dsrc = src;			$(this).attr('hsrc', hsrc);			$(this).attr('dsrc', dsrc);			var preImage = new Image();			preImage.src = hsrc;			preImage.src = dsrc;			$(this).bind('mouseover', function(e){				$(this).attr('src', $(this).attr('hsrc'));				enablePNG (this);			});			$(this).bind('mouseout', function(e){				$(this).attr('src', $(this).attr('dsrc'));				enablePNG (this);			});			if ($.browser.webkit) {					$(this).bind('click', function(e){					$(this).attr('src', $(this).attr('dsrc'));					enablePNG (this);				});			}		}	});}//FUNCTION enablePNGvar filePath = function(){	return $('script#core')[0].src.split('script/js')[0];}function enablePNG (i) {	if ($.browser.msie && /png/.test(i.src)) {		i.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + i.src + '", sizingMethod=scale)';		i.src = filePath()+'share_imgs/space.gif';	}}//FUNCTION enableFlash (for IE6.5+ on winXP SP2 KB912945)function enableFlash(){	if($.browser.msie) {		$('object, applet, embed').each(function () {			this.removeAttribute('data');			this.outerHTML += "";		});	}}//FUNCTION spaceCleanerfunction spaceCleaner(){$('#logtag img').css('display', 'none');}//FUNCTION cssBrowserSelector var cssBrowserSelector = function() {	var	ua = navigator.userAgent.toLowerCase(),	is = function(t){ return ua.indexOf(t) != -1; },	h = $('body')[0],	b =	(!(/opera|webtv/i.test(ua)) && /msie (\d)/.test(ua)) ? ('ie ie'+RegExp.$1)			: is('gecko/') ? 'gecko'			: is('opera/9') ? 'opera opera9'			: /opera (\d)/.test(ua) ? 'opera opera'+RegExp.$1			: is('konqueror') ? 'konqueror'			: is('applewebkit/') ? 'webkit safari'			: is('mozilla/') ? 'gecko'			: '',	o= (is('x11')||is('linux')) ?' linux'			:is('mac') ? ' mac'			:is('win') ? ' win'			:'';	var c = b+o+' js';	h.className += h.className? ' '+c : c;};var actX;var actY;var tarY = 0;var tarX = 0;var scrollInt;var smoothScroll = function () {	$('a').each(function(){		var anc = this.href.split('#header')[1];		if( /#/.test(this.href)  && this.href.match(location.href) && $('#header'+anc)[0] ){			this.href="javascript:void(0);";			$(this).bind('click', function  (){				tarX = ($(document).width() > $('#header'+anc).position().left + $(window).width())					? $('#header'+anc).position().left					: $(document).width() - $(window).width();				tarY = ($(document).height() > $('#header'+anc).position().top + $(window).height())					? $('#header'+anc).position().top					: $(document).height() - $(window).height();			  actX = $(document).scrollLeft();			  actY = $(document).scrollTop();				clearInterval(scrollInt);				scrollInt = setInterval('setScroll()', 20);			});		}	});}function setScroll(){	actY += (tarY - actY) / 6;	actX += (tarX - actX) / 6;	if(Math.abs(tarX - actX) < 2 && Math.abs(tarY - actY) < 2){		clearInterval(scrollInt);	}	scrollTo( Math.round(actX), Math.round(actY));}/*	USER FUNCTION*///FUNCTION commonPop//pFile = popup File//pWidth = popup Width [optional]//pHeight = popup Height [optional]//pStatus = popup Features[optional]function commonPop(pFile, pWidth, pHeight,pStatus){	//var fName = pFile.substring(pFile.lastIndexOf('/')+1, pFile.length);	var wName = "";	if(pWidth == null){ pWidth = 700}	if(pHeight == null){ pHeight = 600}	if(pStatus == null){ pStatus = 'yes';}	if(pWidth > screen.availWidth){		pWidth = screen.availWidth;		pStatus = 'yes';	}	if(pHeight > screen.availHeight-50){		pHeight = screen.availHeight-50;		pStatus = 'yes';	}	var wFeatures= 'menubar=no,scrollbars='+pStatus+',resizable='+pStatus+',width='+pWidth+',height='+pHeight;	void(window.open(pFile, wName, wFeatures));}//FUNCTION moveOpener//pFile = filefunction moveOpener(pFile){	if(opener){		void(opener.location.href = pFile);	}else{		void(document.location.href = pFile);	}}