//POP UP Window
function popup(url,wnm,pram)
{
	w = window.open(url, wnm, pram);
	w.focus();
}
//Smooth Scroll
jQuery.easing.quart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};
function smoothScroll()
{
	$('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 }, 1200, 'quart');
				return false;
			}
		}
	});
}
//RollOver Effect
function hover()
{
	$('.over').hover(
		function(){
			var src = $(this).attr('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			if(src.search('_on') == -1){
				src = src.replace(ftype, '_on'+ftype);
				$(this).attr({src:src});
			}
		},
		function(){
			var src = $(this).attr('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			if(src.search('_on') != -1){
				src = src.replace('_on'+ftype, ftype);
				$(this).attr({src:src});
			}
		}
	);
}
function secchBox()
{
	var sb = document.getElementById('srchBox');
	if (sb && sb.className == 'watermark') {
	  var si = document.getElementById('srchInput');
	  var f = function() { si.className = 'nomark'; };
	  var b = function() {
		if (si.value == '') {
		  si.className = '';
		}
	  };
	  si.onfocus = f;
	  si.onblur = b;

	  if (!/[&?]p=[^&]/.test(location.search)) {
		b();
	  } else {
		f();
	  }
	}

	if($("#srchInput").val() !="") {
		$("#srchInput").css("background-image","none");
	}
	$("#srchInput")
		.blur(function(){
			$v = $(this).val();
			if($v == "") {
				$(this).css("background-image","url(http://i.yimg.jp/images/search/customsearch/yjlogo/yjlogo_type4.gif)");
			}
		})
		.focus(function(){
			$(this).css("background-image","none");
	});
}
