
//*****************************************************************************
//Description : Image RollOver
//*****************************************************************************
function ImageOver(imgEL){
	imgEL.src = imgEL.src.replace("_off.gif", "_on.gif");
}
function ImageOut(imgEL){
	imgEL.src = imgEL.src.replace("_on.gif", "_off.gif");
}

//*****************************************************************************
//popup
//*****************************************************************************
function pop(url,name,w,h) { window.open(url,name,'width='+w+',height='+h+',scrollbars=auto') } // Popup(��ũ�ѹپ���)
function pops(url,name,w,h) { window.open(url,name,'width='+w+',height='+h+',scrollbars=yes') } // Popup(��ũ�ѹ�����)

//*****************************************************************************
//image blur
//*****************************************************************************
function autoBlur(){ // link image auto blur
	try{
		if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
	}catch(e) {}
}
document.onfocusin=autoBlur;
function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;

//*****************************************************************************
// open popup : User Click
//*****************************************************************************
function openPopup(url, winW, winH, scroll, winName)
{
	var setup = "width="+ winW +",height="+winH+",toolbar=no,location=no,status=no,menubar=no,top=10,left=50,scrollbars=" + scroll +",resizable=no";
	if (!winName) winName = "";
	window.open(url, winName, setup);
}

//*****************************************************************************
//move a Page top : User Click
//*****************************************************************************
function moveTop(Name) { 
  var objs = document.getElementsByName(Name); 

  if (Name == "" || Name == "top") document.body.scrollTop = 0; 
  if (objs == null || objs.length == 0) return false; 
  if (typeof moveTop.obj == "undefined") { 
  	moveTop.obj = document.createElement("A"); 
  	moveTop.obj.href = "#"; 
      document.body.appendChild(moveTop.obj); 
  } 

  // focus on the bottom of the page 
  moveTop.obj.style.display = ""; 
  moveTop.obj.focus(); 
  moveTop.obj.style.display = "none"; 

  if (objs[0].tagName.toLowerCase() == "a") { // for IE 
      var ref = objs[0].href; 
      objs[0].href = "#"; 
      objs[0].focus(); 
      if (ref == "") objs[0].removeAttribute("href"); 
      else objs[0].href = ref; 
  } else { 
      objs[0].focus(); 
  } 
  objs[0].blur(); 

  return false; 
}

//*****************************************************************************
//Flash init()
//*****************************************************************************
function flashCM(URL,width,height,vars,bgColor,winmode, id) {
	var id=URL.split("/")[URL.split("/").length-1].split(".")[0];
	if(vars==null) vars='';
	if(bgColor==null) bgColor='transparent';
	if(winmode==null) winmode='opaque';
	document.write("	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' ");
	document.write("		width='"+width+"' height='"+height+"' id='"+id+"' align='middle'> ");
	document.write("	<param name='allowScriptAccess' value='always' /> ");
	document.write("	<param name='movie' 						value='"+URL+"' /> ");
	document.write("	<param name='FlashVars' 				value='"+vars+"' /> ");
	document.write("	<param name='wmode' 						value='"+winmode+"' /> ");
	document.write("	<param name='menu' 							value='false' /> ");
	document.write("	<param name='quality'						value='high' /> ");
	document.write("	<param name='bgcolor'						value='"+bgColor+"' /> ");
	document.write("	<embed src='"+URL+"' flashVars='"+vars+"' wmode='"+winmode+"' menu='false' quality='high' ");
	document.write("		bgcolor='"+bgColor+"' width='"+width+"' height='"+height+"' name='"+id+"' align='middle' ");
	document.write("		allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /> ");
	document.write("	</object> ");
}

//*****************************************************************************
//��ī�̽�ũ����
//*****************************************************************************
function initMoving(target, position, topLimit, btmLimit) {
	if (!target)
		return false;
	var obj = target;
	obj.initTop = position;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;
	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;
	if (typeof(window.pageYOffset) == "number") {
		obj.getTop = function() {
			return window.pageYOffset;
		}
	} else if (typeof(document.documentElement.scrollTop) == "number") {
		obj.getTop = function() {
			return document.documentElement.scrollTop;
		}
	} else {
		obj.getTop = function() {
			return 0;
		}
	}
	if (self.innerHeight) {
		obj.getHeight = function() {
			return self.innerHeight;
		}
	} else if(document.documentElement.clientHeight) {
		obj.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	} else {
		obj.getHeight = function() {
			return 500;
		}
	}
	obj.move = setInterval(function() {
		if (obj.initTop > 0) {
			pos = obj.getTop() + obj.initTop;
		} else {
			pos = obj.getTop() + obj.getHeight() + obj.initTop;
			//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		}
		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit;
		if (pos < obj.topLimit)
			pos = obj.topLimit;
		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 30)
}

//*****************************************************************************
//image �ѿ���
//*****************************************************************************
function chgImg(id, sc) {
	var img = eval("document.getElementById('" + id + "')");
	img.src = sc;
}

//*****************************************************************************
//png24
//*****************************************************************************
function setPng24(obj) {
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bpng24\b/i,'');
	obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+obj.src+"',sizingMethod='image');"
	obj.src='';
	return '';
}

//*****************************************************************************
//tab memu
//*****************************************************************************
function tab_mnu02(no,total,lname) {
	if (no == "") no = "01";
	for(var i=1;i <= total;i++) {
		var tlayer = eval("document.getElementById('"+lname+"0"+i+"')");
		tlayer.style.display = 'none';
	}
	eval("document.getElementById('"+lname+no+"').style.display = 'block';");
}

//*****************************************************************************
//��ī�̽�ũ���� show & hide ���̾�
//*****************************************************************************
function msgOpen() {
	eval("document.getElementById('passport_zone').style.display = 'block';");
	eval("document.getElementById('laybtn01').style.display = 'none';");
	eval("document.getElementById('laybtn02').style.display = 'block';");
}
function msgClose() {
	eval("document.getElementById('passport_zone').style.display = 'none';");
	eval("document.getElementById('laybtn01').style.display = 'block';");
	eval("document.getElementById('laybtn02').style.display = 'none';");
}

//*****************************************************************************
//input
//*****************************************************************************
function
    clrImg(obj){
        obj.value="";obj.onkeydown=obj.onmousedown=null;
    }

//*****************************************************************************
//layer onMouseOver
//*****************************************************************************
function mylotte(num) {
	var myLotte = document.getElementById('mylotteSub' + num);
	if(myLotte.style.display == 'none') {
		myLotte.style.display = 'block';
	} else {
		myLotte.style.display = 'none';
	}
}
function mylotte_main(num) {
	var myLotteMain = document.getElementById('main_mylotteSub'+num);
	if(myLotteMain.style.display == 'none') {
		myLotteMain.style.display = 'block';
	} else {
		myLotteMain.style.display = 'none'
	}
}

//*****************************************************************************
//���̾� ���� ���߱�
//*****************************************************************************
function lotte_layer(num) {
	if(document.getElementById('lottelayerSub' + num).style.display == "none") {
		document.getElementById('lottelayerSub' + num).style.display = "";
	} else {
		document.getElementById('lottelayerSub' + num).style.display = "none";
	}
}

//*****************************************************************************
//�˻� ���̾� ���� ���߱�
//*****************************************************************************
function layerdown(num) {
	if(document.getElementById('layerdown' + num).style.display == "none") {
		document.getElementById('layerdown' + num).style.display = "";
	} else {
		document.getElementById('layerdown' + num).style.display = "none";
	}
}

//*****************************************************************************
//��ī�װ? ���� �޴�
//*****************************************************************************
function soca_menu(no,total,lname) {
	if (no == "") no = "1";
	for(var i=1;i <= total;i++){
	var tlayer = eval("document.getElementById('"+lname+i+"')");
	tlayer.style.display = 'none';
	}

	eval("document.getElementById('"+lname+no+"').style.display = 'block';");
}
function soca_clear_all(total,lname) {
	for(var i=1;i <= total;i++){
		var tlayer = eval("document.getElementById('"+lname+i+"')");
		if( tlayer ) {
			tlayer.style.display = 'none';
		}
	}
}
function soca_clear(no) {
	eval("document.getElementById('brand_sub_menu"+no+"').style.display = 'none';");
}

//*****************************************************************************
//�˻� ���̾� ��
//*****************************************************************************
function tab_menu(no,total,lname) {
	if (no == "") no = "1";
	for(var i=1;i <= total;i++){
	var tlayer = eval("document.getElementById('"+lname+i+"')");
	tlayer.style.display = 'none';
	}

	eval("document.getElementById('"+lname+no+"').style.display = 'block';");
}
function open_lotte_members() {
	document.getElementById('main_members').style.display = "block";
}
function close_lotte_members() {
	document.getElementById('main_members').style.display = "none";
}

function viewSPL() {
	document.getElementById("SPL").style.display = "inline";
}

function hideSPL() {
	document.getElementById("SPL").style.display = "none";
}

//*****************************************************************************
// ����Ʈ�� ���� ��ġ���� �˾�  ADD ���̼�
//*****************************************************************************
function smartPickLocOpen(_goodsNo, refer) {
	if(refer == 'top') {
		temp_url = "/lotte/sitemap/map/LCSmartPickMap.jsp?goodsNo=" + _goodsNo + "#spinfo";
	} else {
		temp_url = "/lotte/sitemap/map/LCSmartPickMap.jsp?goodsNo=" + _goodsNo + "&localShopCode=" + refer;
	}
	var newwindow = window.open(temp_url, "location", "height=665,width=670,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no");
}

//*****************************************************************************
// Jung Eun �߰�
//*****************************************************************************
function viewLayer(id){
	document.getElementById(id).style.display="block";
}
function hideLayer(id){
	document.getElementById(id).style.display="none";
}
function imgOver(imgEL){
 imgEL.src = imgEL.src.replace("off.gif", "on.gif");
}
function imgOut(imgEL){
 imgEL.src = imgEL.src.replace("on.gif", "off.gif");
}
function imgChg(no,total,imgName,btnName) {
	for(var i=1;i<=total;i++) {
		var img = eval("document.getElementById('"+imgName+i+"')");
		var btn = eval("document.getElementById('"+btnName+i+"')");
		img.style.display = 'none';
		btn.src = 'http://image.lotte.com/lotte/images/renewal/main/icon_dot.gif';
	}
	eval("document.getElementById('"+imgName+no+"').style.display = 'block';");
	eval("document.getElementById('"+btnName+no+"').src = 'http://image.lotte.com/lotte/images/renewal/main/icon_doton.gif';");
}

$(document).ready(function () {
//*****************************************************************************
// foot layer
//*****************************************************************************
// foot layer 1
	$("#foot_txt2").hover(

	function () {
		$(".footLayer1").show();
	}, function () {
		$(".footLayer1").hide();
	});
	$(".footLayer1").hover(

	function () {
		$(".footLayer1").show();
	}, function () {
		$(".footLayer1").hide();
	});
	$("#foot_txt2").click(function () {
		return false;
	});
	// foot layer 2
	$(".fLayBtn").hover(

	function () {
		$(".footLayer2").show();
	}, function () {
		$(".footLayer2").hide();
	});
	$(".footLayer2").hover(

	function () {
		$(".footLayer2").show();
	}, function () {
		$(".footLayer2").hide();
	});
	$(".fLayBtn").click(function () {
		return false;
	});

//*****************************************************************************
// history
//*****************************************************************************
	
	$("#history .itemList").jCarouselLite({
		btnNext: ".next",
		btnPrev: ".prev",
		visible: 5,
		scroll: 5,
		circular: false
	});

//*****************************************************************************
// big_view
//*****************************************************************************
	$(".big_view .item_list4").jCarouselLite({
		btnNext: ".next_v",
		btnPrev: ".prev_v",
		visible: 1,
		circular: false
	});

//*****************************************************************************
// comment_view
//*****************************************************************************
	$(".viewer_area .item_list3").jCarouselLite1({
		btnNext: ".next_p",
		btnPrev: ".prev_p",
		visible: 1,
		circular: false
	});

//*****************************************************************************
// small_view
//*****************************************************************************
	$(".small_view .item_list5").jCarouselLite({
		btnNext: ".next_s",
		btnPrev: ".prev_s",
		visible: 4,
		circular: false
	});

});

function goDetailCashMain() {
	//임시 하드코딩
	var url = "<lecs:urlPrefix/>html/pop_service_info.html";
	//url 인코딩
	showWindowsPopup(url, 680, 725);
}



