jQuery.noConflict();
var jq$ = jQuery;

jq$(function(){
	jq$("#usa").mouseover(
		function() {
			jq$("#usa:visible").hide();
			jq$("#usen:visible").hide();
			jq$("#usa2:hidden").show();
			jq$("#usen2:hidden").show();
		}
	);
	jq$("#usa2").mouseout(
		function() {
			jq$("#usa:hidden").show();
			jq$("#usen:hidden").show();
			jq$("#usa2:visible").hide();
			jq$("#usen2").hide();
		}
	);
});

jq$(function(){
	jq$("#usen").mouseover(
		function() {
			jq$("#usa:visible").hide();
			jq$("#usen:visible").hide();
			jq$("#usa2:hidden").show();
			jq$("#usen2:hidden").show();
		}
	);
	jq$("#usen2").mouseout(
		function() {
			jq$("#usa:hidden").show();
			jq$("#usen:hidden").show();
			jq$("#usa2:visible").hide();
			jq$("#usen2").hide();
		}
	);
});


jq$(function(){
	jq$("#uscn").mouseover(
		function() {
			jq$("#usa:visible").hide();
			jq$("#uscn:visible").hide();
			jq$("#usa2:hidden").show();
			jq$("#uscn2:hidden").show();
		}
	);
	jq$("#uscn2").mouseout(
		function() {
			jq$("#usa:hidden").show();
			jq$("#uscn:hidden").show();
			jq$("#usa2:visible").hide();
			jq$("#uscn2").hide();
		}
	);
});

jq$(function(){
	jq$("#uskr").mouseover(
		function() {
			jq$("#usa:visible").hide();
			jq$("#uskr:visible").hide();
			jq$("#usa2:hidden").show();
			jq$("#uskr2:hidden").show();
		}
	);
	jq$("#uskr2").mouseout(
		function() {
			jq$("#usa:hidden").show();
			jq$("#uskr:hidden").show();
			jq$("#usa2:visible").hide();
			jq$("#uskr2").hide();
		}
	);
});

jq$(function(){
	jq$("#hk").mouseover(
		function() {
			jq$("#hk:visible").hide();
			jq$("#hken:visible").hide();
			jq$("#hk2:hidden").show();
			jq$("#hken2:hidden").show();
		}
	);
	jq$("#hk2").mouseout(
		function() {
			jq$("#hk:hidden").show();
			jq$("#hken:hidden").show();
			jq$("#hk2:visible").hide();
			jq$("#hken2").hide();
		}
	);
});

jq$(function(){
	jq$("#hken").mouseover(
		function() {
			jq$("#hk:visible").hide();
			jq$("#hken:visible").hide();
			jq$("#hk2:hidden").show();
			jq$("#hken2:hidden").show();
		}
	);
	jq$("#hken2").mouseout(
		function() {
			jq$("#hk:hidden").show();
			jq$("#hken:hidden").show();
			jq$("#hk2:visible").hide();
			jq$("#hken2").hide();
		}
	);
});

jq$(function(){
	jq$("#hkcn").mouseover(
		function() {
			jq$("#hk:visible").hide();
			jq$("#hkcn:visible").hide();
			jq$("#hk2:hidden").show();
			jq$("#hkcn2:hidden").show();
		}
	);
	jq$("#hkcn2").mouseout(
		function() {
			jq$("#hk:hidden").show();
			jq$("#hkcn:hidden").show();
			jq$("#hk2:visible").hide();
			jq$("#hkcn2").hide();
		}
	);
});

jq$(function(){
	jq$("#ko").mouseover(
		function() {
			jq$("#ko:visible").hide();
			jq$("#ko2:hidden").show();
		}
	);
	jq$("#ko2").mouseout(
		function() {
			jq$("#ko:hidden").show();
			jq$("#ko2:visible").hide();
		}
	);
});

jq$(function(){
	jq$("#ot").mouseover(
		function() {
			jq$("#ot:visible").hide();
			jq$("#ot2:hidden").show();
		}
	);
	jq$("#ot2").mouseout(
		function() {
			jq$("#ot:hidden").show();
			jq$("#ot2:visible").hide();
		}
	);
});

function delURL() {
	jq$.cookie('URL', '', {expires:-1,path:'/'}); // cookie削除
}

function delCCL() {
	jq$.cookie('CCL', '', {expires:-1,path:'/'}); // cookie削除
	var url = jq$.cookie('URL');
	if(url == "store#") {
		var targetURL = url.split('#').join('');
		jq$.cookie('URL', targetURL, {expires:0,path:'/'}); // cookie削除
	}
	//alert(targetURL);
}

function setURL() {
	var pageURL = location.href;
	var fileName = pageURL.split('/');
	var targetURL =fileName[fileName.length-1].split('.htm').join('');
	var url = jq$.cookie('URL', targetURL, {expires:0,path:'/'}); // cookie設定
}

function checkItem() {
	var ccl = jq$.cookie('CCL');
	var url = jq$.cookie('URL');
	if(url != null) {
	location.href = url+'.htm';
	}
//	alert (url);
}

function checkStates() {
	var ccl = jq$.cookie('CCL');
	var url = jq$.cookie('URL');
	var pageURL = location.href;
	var fileName = pageURL.split('/');
	var targetURL =fileName[fileName.length-1].split('.htm').join('');
	if ((ccl != null) && (url != null)) {
		jq$.cookie('URL', '', {expires:-1,path:'/'}); // cookie削除
	}
}

function goRegion() {
jq$(function(){
	var ccl = jq$.cookie('CCL');
	var url = jq$.cookie('URL');
	if ((ccl == 'usen') && (url == null)) {
		//alert('AAAAA');
		location.href = 'us/en/';
	} else if ((ccl == 'uszh') && (url == null)) {
		//alert('BBBBB');
		location.href = 'us/zh/';
	} else if ((ccl == 'usko') && (url == null)) {
		//alert('CCCCC');
		location.href = 'us/ko/';
	} else if ((ccl == 'hken') && (url == null)) {
		//alert('DDDDD');
		location.href = 'hk/en/';
	} else if ((ccl == 'hkzh') && (url == null)) {
		//alert('DDDDD');
		location.href = 'hk/zh/';
	} else if ((ccl == 'twzh') && (url == null)) {
		//alert('EEEEE');
		location.href = 'tw/zh/';
	} else if ((ccl == 'krko') && (url == null)) {
		//alert('FFFFF');
		location.href = 'kr/ko/';
	}
});
}

function goUSEN() {
	var ccl = jq$.cookie('CCL', 'usen', {expires:365,path:'/'}); // cookie設定
	var url = jq$.cookie('URL');
	if (url == null) {
	location.href="us/en/";
	} else if (url != null) {
	location.href="us/en/"+url+".htm";
	}
}

function goUSZH() {
	var ccl = jq$.cookie('CCL', 'uszh', {expires:365,path:'/'}); // cookie設定
	var url = jq$.cookie('URL');
	if (url == null) {
	location.href="us/zh/";
	} else if (url != null) {
	location.href="us/zh/"+url+".htm";
	}
}

function goUSKR() {
	var ccl = jq$.cookie('CCL', 'usko', {expires:365,path:'/'}); // cookie設定
	var url = jq$.cookie('URL');
	if (url == null) {
	location.href="us/ko/";
	} else if (url != null) {
	location.href="us/ko/"+url+".htm";
	}
}

function goHKEN() {
	var ccl = jq$.cookie('CCL', 'hken', {expires:365,path:'/'}); // cookie設定
	var url = jq$.cookie('URL');
	if (url == null) {
	location.href="hk/en/";
	} else if (url != null) {
	location.href="hk/en/"+url+".htm";
	}
}

function goHKZH() {
	var ccl = jq$.cookie('CCL', 'hkzh', {expires:365,path:'/'}); // cookie設定
	var url = jq$.cookie('URL');
	if (url == null) {
	location.href="hk/zh/";
	} else if (url != null) {
	location.href="hk/zh/"+url+".htm";
	}
}

function goTWZH() {
	var ccl = jq$.cookie('CCL', 'twzh', {expires:365,path:'/'}); // cookie設定
	var url = jq$.cookie('URL');
	if (url == null) {
	location.href="tw/zh/";
	} else if (url != null) {
	location.href="tw/zh/"+url+".htm";
	}
}

function goKRKO() {
	var ccl = jq$.cookie('CCL', 'krko', {expires:365,path:'/'}); // cookie設定
	var url = jq$.cookie('URL');
	if (url == null) {
	location.href="kr/ko/";
	} else if (url != null) {
	location.href="kr/ko/"+url+".htm";
	}
}

function goOTEN() {
	var ccl = jq$.cookie('CCL', 'oten', {expires:365,path:'/'}); // cookie設定
	var url = jq$.cookie('URL');
	if (url == null) {
	location.href="others/en/";
	} else if (url != null) {
	location.href="others/en/"+url+".htm";
	}
}