/* GENERAL FUNCTIONS */

var brDir = '/opaque/';

var brIconSrc = '<img src="' + brDir + 'resources_shared/images/icn_popup.gif" alt="" width="9" height="9" class="iconR" />';

/* UA IE6 (work with universal script) */
var nUaIE6=nUa.indexOf("MSIE 6")!=-1;

/* IMG ROLLOVER */
$(document).ready(function(){
	$(".rollover").hover(
		function () { //hover
		var srcOvr=$(this).attr('src').replace('_def.','_ovr.');
			$(this).attr('src',srcOvr);
		},
		function () { //out
		var srcDef=$(this).attr('src').replace('_ovr.','_def.');
			$(this).attr('src',srcDef);
		}
	);
});

/* SUB WINDOW OPEN */
function openSWin(uri,name,w,h) {
	sub=window.open(uri,name,"location=no,directories=no,scrollbars=1,resizable=0,width="+w+",height="+h+",left=5,top=5");
	sub.focus();
}

/* GLOBAL NAVI SUB MENU */
$(document).ready(function(){
	$('#GNAVI .cateLink .blog a').eq(0).mouseover(function(){
		$('body').prepend('<div id="MSKTRANS"></div>');
		if(nUaIE){
			$('#GNAVI .cateLink .blog a').eq(0).addClass('ovr');
			$('#GNAVI .cateLink .blog ul').show();
			$('div#MSKTRANS,#GNAVI .cateLink li.shop,#GNAVI .cateLink li.special').mouseover(function(){
				$('#GNAVI .cateLink .blog ul').hide();
			$('#GNAVI .cateLink .blog a').eq(0).removeClass('ovr');
				$('div#MSKTRANS').remove();
			});
		}else{
			$('#GNAVI .cateLink .blog a').eq(0).addClass('ovr');
			$('#GNAVI .cateLink .blog ul').fadeIn('fast');
			$('div#MSKTRANS,#GNAVI .cateLink li.shop,#GNAVI .cateLink li.special').mouseover(function(){
				$('#GNAVI .cateLink .blog ul').fadeOut('fast');
			$('#GNAVI .cateLink .blog a').eq(0).removeClass('ovr');
				$('div#MSKTRANS').remove();
			});
		}
	});
	$('#GNAVI .cateLink .item a').eq(0).mouseover(function(){
		$('body').prepend('<div id="MSKTRANS"></div>');
		if(nUaIE){
			$('#GNAVI .cateLink .item a').eq(0).addClass('ovr');
			$('#GNAVI .cateLink .item ul').show();
			$('div#MSKTRANS,#GNAVI .cateLink li.style,#GNAVI .cateLink li.concept').mouseover(function(){
				$('#GNAVI .cateLink .item ul').hide();
			$('#GNAVI .cateLink .item a').eq(0).removeClass('ovr');
				$('div#MSKTRANS').remove();
			});
		}else{
			$('#GNAVI .cateLink .item a').eq(0).addClass('ovr');
			$('#GNAVI .cateLink .item ul').fadeIn('fast');
			$('div#MSKTRANS,#GNAVI .cateLink li.style,#GNAVI .cateLink li.concept').mouseover(function(){
				$('#GNAVI .cateLink .item ul').fadeOut('fast');
			$('#GNAVI .cateLink .item a').eq(0).removeClass('ovr');
				$('div#MSKTRANS').remove();
			});
		}
	});
	$('#GNAVI .funcLink .store a').eq(0).mouseover(function(){
		$('body').prepend('<div id="MSKTRANS"></div>');
		if(nUaIE){
			$('#GNAVI .funcLink .store a').eq(0).addClass('ovr');
			$('#GNAVI .funcLink .store ul').show();
			$('div#MSKTRANS,#GNAVI .cateLink li.special,#GNAVI .funcLink li.favorite').mouseover(function(){
				$('#GNAVI .funcLink .store ul').hide();
				$('#GNAVI .funcLink .store a').eq(0).removeClass('ovr');
				$('div#MSKTRANS').remove();
			});
		}else{
			$('#GNAVI .funcLink .store a').eq(0).addClass('ovr');
			$('#GNAVI .funcLink .store ul').fadeIn('fast');
			$('div#MSKTRANS,#GNAVI .cateLink li.special,#GNAVI .funcLink li.favorite').mouseover(function(){
				$('#GNAVI .funcLink .store ul').fadeOut('fast');
				$('#GNAVI .funcLink .store a').eq(0).removeClass('ovr');
				$('div#MSKTRANS').remove();
			});
		}
	});
});

/* FLOAT WINDOW MASK SIZE */
function mskSpread(id){
	var w=$(document).width()+'px';
	if(nUaIE6){
		w=$(document).width()-18+'px';
	}
	$(id).width(w).height($(document).height()+'px');
}

/* GLOBAL NAVI MOBILE QR WINDOW */
$(document).ready(function(){
	$('#Mobile a').click(function(){
		if(nUaIE){
			$('#MOBQR,#MSK').show();
		}else{
			$('#MOBQR,#MSK').fadeIn('fast');
		}
		mskSpread('#MSK,#MOBQR');
	});
	$('#MOBQR .close a').click(function(){
		if(nUaIE){
			$('#MOBQR,#MSK').hide();
		}else{
			$('#MOBQR,#MSK').fadeOut('fast');
		}
	});
});


