_hoverGNav = '';
$(function(){
		$('#headerArea ul li._subNav').hover(
			function(){
				hov = $(this).attr("name");
				if(_hoverGNav != hov){
  				var tgt = '#headerArea ul li.' + _hoverGNav + ' ul.subNav';
						$(tgt).fadeOut('fast');
					$(this).children('ul.subNav').fadeIn('fast');
				_hoverGNav = $(this).attr("name");
				}
			});

		$('#headerArea ul li.topCat').hover(
			function(){
					hov = $(this).attr("name");
					if(_hoverGNav != hov){
						var tgt = '#headerArea ul li.' + _hoverGNav + ' ul.subNav';
						$(tgt).fadeOut('fast');
						_hoverGNav = hov;
					}
			},
			function(){
			});
		
		$('#headerArea h1').hover(
			function(){
  				var tgt = '#headerArea ul li.' + _hoverGNav + ' ul.subNav';
						$(tgt).fadeOut('fast');
					}
);
		
		$('._hover').hover(
			function(){
				$(this).fadeTo(10, 0.7);
			},
			function(){
				$(this).fadeTo(500, 1.0);
			}
		);
		
		if ( $('#mainLeftArea').height() > $('#mainRightArea').height() ){
			var hh = $('#mainLeftArea').height() + 20 + 'px';
			 $('#mainRightArea').css({"height":hh});
		}
		chkSelect();
});


function chkSelect(){
	var itemSelect = $('#selectItemType').val();
	var genderSelect = $('#selectItemGender').val();
	if(itemSelect != 'none' && genderSelect != 'none'){
		$('#submitSearch').fadeIn();
		$('#submitSearchOff').hide();
 }
	else {
		$('#submitSearch').hide();
		$('#submitSearchOff').fadeIn();
	}
}



function wrhiteGTopMvSWF(param){
 var rnd = '?r=' + Math.random();
	var movSwfSrc  = '';
	    movSwfSrc += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="600" height="700" id="mv_01" align="middle">';
	    movSwfSrc += '<param name="allowScriptAccess" value="sameDomain" />';
	    movSwfSrc += '<param name="allowFullScreen" value="false" />';
	    movSwfSrc += '<param name="movie" value="/_common_new/swf/mv_01.swf' + rnd + '" />';
	    movSwfSrc += '<param name="quality" value="high" />';
	    movSwfSrc += '<param name="scale" value="noscale" />';
	    movSwfSrc += '<param name="salign" value="lt" />';
	    movSwfSrc += '<param name="wmode" value="transparent" />';
	    movSwfSrc += '<param name="bgcolor" value="#ffffff" />';
	    movSwfSrc += '<param name="FlashVars" value="' + param + '" />';
	    movSwfSrc += '<embed src="/_common_new/swf/mv_01.swf' + rnd + '" FlashVars="' + param +'" quality="high" scale="noscale" salign="lt" wmode="transparent" bgcolor="#ffffff" width="600" height="700" name="mv_01" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer_jp" />';
	    movSwfSrc += '</object>';
	$('#gTopMvModule').html(movSwfSrc);
 	
}

function showSP1(){
 	window.open(
			'/japanese/collection/battue_surpass/sp.php',
			'special01',
			'width=950, height=610, menubar=no, toolbar=no, scrollbars=no'
		);
}

function showSP2(){
//   window.location.href = '/japanese/news/donate_one_dollar1.php';
 	window.open(
			'/japanese/collection/charity_goods/sp/',
			'special03',
			'width=760, height=600, menubar=no, toolbar=no, scrollbars=yes'
		);
}

function showSP4(lang){
	if(lang == 'english'){
		swf = 'sp_en.php';
	}
	else if(lang == 'chinese'){
		swf = 'sp_ch.php';
	}
	else if(lang == 'korean'){
		swf = 'sp_kr.php';
	}
  else {
		swf = 'sp.php';
	}
	window.open(
	'/' + lang + '/collection/battue_surpass/'+swf,
	'special01',
	'width=950, height=610, menubar=no, toolbar=no, scrollbars=no'
	);
}

function launch(URL,i,w,h) {
	window.open(URL, i, 'width='+ w + ', height=' + h + ', menubar=no, toolbar=no, scrollbars=yes');
}

function launch2008(URL,i,w,h) {
	window.open(URL, i, 'width='+ w + ', height=' + h + ', menubar=no, toolbar=no, scrollbars=yes');
}

function launchJOB(URL,i,w,h) {
	window.open(URL, i, 'width='+ w + ', height=' + h + ', menubar=no, toolbar=no, scrollbars=yes');
}

function launch20080201(URL,i,w,h) {
	window.open(URL, i, 'width='+ w + ', height=' + h + ', menubar=no, toolbar=no, scrollbars=yes');
}


function launch2(URL,i,w,h) {
	window.open(URL, i, 'width='+ w + ', height=' + h + ', menubar=no, toolbar=no, scrollbars=yes');
}

function launch2_20080201(URL,i,w,h) {
	window.open(URL, i, 'width='+ w + ', height=' + h + ', menubar=no, toolbar=no, scrollbars=yes');
}

function launchPrintAll(URL,i,w,h) {
	window.open(URL, i, 'width='+ w + ', height=' + h + ', menubar=no, toolbar=no, scrollbars=yes');
}

function launch3(URL,i,w,h) {
	window.open(URL, i, 'width='+ w + ', height=' + h + ', menubar=no, toolbar=no, scrollbars=yes');
}

function launch4(URL,i,w,h) {
	window.open(URL, i, 'width='+ w + ', height=' + h + ', menubar=no, toolbar=no, scrollbars=no');
}

function launchPost(URL,i,w,h) {
	window.open(URL, i, 'width='+ w + ', height=' + h + ', menubar=no, toolbar=no, scrollbars=yes');
	window.document.searchdata.target = i;
	window.document.searchdata.submit();
}

function launchPrint(URL,i,w,h) {
	window.open(URL, i, 'width='+ w + ', height=' + h + ', menubar=no, toolbar=no, scrollbars=yes');
	window.document.searchdata.target = i;
	window.document.searchdata.submit();
}

//collectionTitleArea
function collectionTitle (src){
	var	swfSrc		= '<object ';
					swfSrc	+= 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
					swfSrc	+= 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ';
					swfSrc	+= 'width="762" ';
					swfSrc	+= 'height="29" ';
					swfSrc	+= 'id="collection_body_title_001" ';
					swfSrc	+= 'align="middle">';
					swfSrc	+= '<param name="allowScriptAccess" value="sameDomain" />';
					swfSrc	+= '<param name="movie" value="' + src + '" />';
					swfSrc	+= '<param name="quality" value="high" />';
					swfSrc	+= '<param name="salign" value="lt" />';
					swfSrc	+= '<param name="wmode" value="transparent" />';
					swfSrc	+= '<param name="bgcolor" value="#ffffff" />';
					swfSrc	+= '<embed src="' + src + '" ';
					swfSrc	+= 'quality="high" ';
					swfSrc	+= 'salign="lt" ';
					swfSrc	+= 'wmode="transparent" ';
					swfSrc	+= 'bgcolor="#ffffff" ';
					swfSrc	+= 'width="762" ';
					swfSrc	+= 'height="29" ';
					swfSrc	+= 'name="collection_body_title_001" ';
					swfSrc	+= 'align="middle" ';
					swfSrc	+= 'allowScriptAccess="sameDomain" ';
					swfSrc	+= 'type="application/x-shockwave-flash" ';
					swfSrc	+= 'pluginspage="http://www.macromedia.com/go/getflashplayer" />';
					swfSrc	+= '</object>';

	document.write(swfSrc);
	
}


(function(){ var easing = 0.25; var interval = 20; var d = document; var targetX = 0; var targetY = 0; var targetHash = ''; var scrolling = false; var splitHref = location.href.split('#'); var currentHref_WOHash = splitHref[0]; var incomingHash = splitHref[1]; var prevX = null; var prevY = null; addEvent(window, 'load', init); function init(){ setOnClickHandler(); if(incomingHash){ if(window.attachEvent && !window.opera){ setTimeout(function(){scrollTo(0,0);setScroll('#'+incomingHash);},50); }else{ scrollTo(0, 0); setScroll('#'+incomingHash); } } } function addEvent(eventTarget, eventName, func){ if(eventTarget.addEventListener){ eventTarget.addEventListener(eventName, func, false); }else if(window.attachEvent){ eventTarget.attachEvent('on'+eventName, function(){func.apply(eventTarget);}); } }  function setOnClickHandler(){ var links = d.links; for(var i=0; i<links.length; i++){ var link = links[i]; var splitLinkHref = link.href.split('#'); if(currentHref_WOHash == splitLinkHref[0] && d.getElementById(splitLinkHref[1])){ addEvent(link, 'click', startScroll); } } }  function startScroll(event){ if(event){ event.preventDefault(); }else if(window.event){ window.event.returnValue = false; } setScroll(this.hash); }  function setScroll(hash){ var targetEle = d.getElementById(hash.substr(1)); if(!targetEle)return; var ele = targetEle; var x = 0; var y = 0; while(ele){ x += ele.offsetLeft; y += ele.offsetTop; ele = ele.offsetParent; } targetX = x; targetY = y; targetHash = hash; if(!scrolling){ scrolling = true; scroll(); } }  function scroll(){ var currentX = d.documentElement.scrollLeft||d.body.scrollLeft; var currentY = d.documentElement.scrollTop||d.body.scrollTop; var vx = (targetX - currentX) * easing; var vy = (targetY - currentY) * easing; var nextX = currentX + vx; var nextY = currentY + vy; if((Math.abs(vx) < 1 && Math.abs(vy) < 1) || (prevX === currentX && prevY === currentY)){ scrollTo(targetX, targetY); scrolling = false; location.hash = targetHash; prevX = prevY = null; return; }else{ scrollTo(parseInt(nextX), parseInt(nextY)); prevX = currentX; prevY = currentY; var scope = this; setTimeout(function(){scroll.apply(scope)},interval); } }  }());
