jQuery.easing.quart = function (x, t, b, c, d) {
	return -c * ((t = t / d - 1) * t * t * t - 1) + b;
};


$(function () {
	// GlobalNavi
	var gNavObj = '#' + $('body').attr('id') + 'Nav';
	if ($('#nav li').filter(gNavObj).size() == 1) {
		$gNavObj = $(gNavObj).find('a:first img');
		var imgsrc = $gNavObj.attr('src');
		var imgsrc_on = imgsrc.replace(/^(.+)(\.[a-z]+)$/, "$1_on$2");
		$gNavObj.attr('src', imgsrc_on);
	}

	// Link focus
	$('a,area,input[type=image]').focus(function () {
		$(this).blur();
	})

	// Rollover
	var image_cache = new Object();
	$('.over').not("[src*='_on.']").each(function(i) {
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf('.');
		var imgsrc_on = this.src.substr(0, dot) + '_ov' + this.src.substr(dot, 4);
		image_cache[this.src] = new Image();
		image_cache[this.src].src = imgsrc_on;
		$(this).hover(function () {
			this.src = imgsrc_on;
		}, function () {
			this.src = imgsrc;
		});
	});
	
	// PageTop	
	$('a[href^=#], area[href^=#]').not('a[href=#], area[href=#]').click(function () {
		if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
			var $target = $(this.hash);
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				$('html,body').animate({
					scrollTop: targetOffset
				}, 500, 'quart');
				return false;
			}
		}
	});
	
	// Fade
    $("img.fade").hover(function () { 
        $(this).stop().fadeTo("slow", 0.7); 
    }, function () { 
        $(this).stop().fadeTo("slow", 1.0); 
    }); 



	// BackgroundImage
	if ($.browser.msie && $.browser.version == 6) {
		try {
			document.execCommand('BackgroundImageCache', false, true);
		} catch (e) {}
	}

});

//Pop Up
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


/*
CSS Browser Selector v0.3.5 (Feb 05, 2010)
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/

function css_browser_selector(u) {
	var ua = u.toLowerCase(),
		is = function (t) {
			return ua.indexOf(t) > -1;
		},
		g = 'gecko',
		w = 'webkit',
		s = 'safari',
		o = 'opera',
		h = document.documentElement,
		b = [(!(/opera|webtv/i.test(ua)) && /msie\s(\d)/.test(ua)) ? ('ie ie' + RegExp.$1) : is('firefox/2') ? g + ' ff2' : is('firefox/3.5') ? g + ' ff3 ff3_5' : is('firefox/3') ? g + ' ff3' : is('gecko/') ? g : is('opera') ? o + (/version\/(\d+)/.test(ua) ? ' ' + o + RegExp.$1 : (/opera(\s|\/)(\d+)/.test(ua) ? ' ' + o + RegExp.$2 : '')) : is('konqueror') ? 'konqueror' : is('chrome') ? w + ' chrome' : is('iron') ? w + ' iron' : is('applewebkit/') ? w + ' ' + s + (/version\/(\d+)/.test(ua) ? ' ' + s + RegExp.$1 : '') : is('mozilla/') ? g : '', is('j2me') ? 'mobile' : is('iphone') ? 'iphone' : is('ipod') ? 'ipod' : is('ipad') ? 'ipad' : is('mac') ? 'mac' : is('darwin') ? 'mac' : is('webtv') ? 'webtv' : is('win') ? 'win' : is('freebsd') ? 'freebsd' : (is('x11') || is('linux')) ? 'linux' : '', 'js'];
	c = b.join(' ');
	h.className += ' ' + c;
	return c;
};
css_browser_selector(navigator.userAgent);
