
/*
** ºÙ¿©³Ö±â
*****************************/
function copyThis(_id) {
	try {
		document.getElementById(_id).select();
		document.selection.createRange().execCommand("copy");
		alert('Å¬¸³º¸µå¿¡ URLÀÌ º¹»çµÇ¾ú½À´Ï´Ù.\n\nCtrl+V (ºÙ¿©³Ö±â) ´ÜÃàÅ°¸¦ ÀÌ¿ëÇÏ½Ã¸é,\nURLÀ» ºÙ¿© ³ÖÀ¸½Ç ¼ö ÀÖ½À´Ï´Ù.');
	} catch(e) {
		alert("¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù.\n´Ù½Ã ½ÃµµÇØ ÁÖ½Ê½Ã¿À.");
	}
}



/*¼¿·º¹Ú½º*/
function goToThisLink(obj) {
	if (obj) {
		var index = (obj.selectedIndex==-1) ? 0 : obj.selectedIndex;
		var option = obj.options[index];
		var url = option.value;
		var target = option.getAttribute("target");
		if (target==undefined||target=="") target = "_self";
		if (url!="") open(url, target, "");
	}
}

/*input default*/
function ClearText(obj){
		obj.value = "";
}

/*·¹ÀÌ¾î ¿Â¿ÀÇÁ*/
function Show_Layer(obj,total,num) {

	if (document.getElementById(obj.name + num).style.display != "none"){
		document.getElementById(obj.name + num).style.display = "none";
	}
	
	else {
	
		for (i=1;i<total+1;i++) {
			document.getElementById(obj.name + i).style.display = "none";
		}
		document.getElementById(obj.name + num).style.display = "block";
	}
}	

/*ÀÌ¹ÌÁö ¿Â¿ÀÇÁ*/
var ex_on = '';

function Img_OnOff(obj,name) {

	if ( name == '' ) {
		imgElement = obj.name;
	}
	else {
		imgElement = name;  
	}
	
		imgPath = obj.src; 
		imgPathLen = imgPath.length;
		imgPathFlag = imgPath.lastIndexOf("/");
		imgName = imgPath.substring(0,imgPathFlag+1);
		
		obj.src =  imgName + imgElement + "_on.gif";  
	
	
		if ( ex_on != '' && ex_on != imgName + imgElement){
		ex_imgPath.src = ex_on + "_off.gif";
		}

		ex_imgPath = obj
		ex_on = imgName + imgElement
	
}

function Img_OverOut(obj, flag){

	imgPath = obj.src; 
	imgPathLen = imgPath.length;
	imgPathFlag = imgPath.lastIndexOf("-");
	imgName = imgPath.substring(0,imgPathFlag+1);
	
	obj.src = imgName + flag +".gif";		
}

/*¸µÅ©¿¡ Á¡¼±¾ø¾Ú*/	
function allblur() {
  for (i = 0; i < document.links.length; i++) {
    var obj = document.links[i];
    if(obj.addEventListener) obj.addEventListener("focus", oneblur, false);
    else if(obj.attachEvent) obj.attachEvent("onfocus", oneblur);
  }
}
 
function oneblur(e) {
  var evt = e ? e : window.event;

  if(evt.target) evt.target.blur();
  else if(evt.srcElement) evt.srcElement.blur();
}


function setPng24(obj) { 
	if ((navigator.userAgent.toUpperCase().indexOf('MSIE 7')>-1) || (navigator.userAgent.toUpperCase().indexOf('MSIE 8')>-1)) { return; }
    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 ''; 
} 



function activxObj(fileName,width,height,show,auto) 
{
  str="<embed src='"+fileName+"' width='"+width+"' height='"+height+"' ShowControls='"+show+"' autostart='"+auto+"' >";
  str=str+"</embed>";
document.write(""+str+"");
}

/********************************************************************************************************
	ÇÃ·¡½Ã
********************************************************************************************************/
function Flash_display(sFName, nWidth, nHeight, sVName, BGColor, Wmode ){	
	document.writeln ('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http:// fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ nWidth + '" height="'+ nHeight + '" id="'+ sVName +'" align="middle">');
	document.writeln ('<param name="allowScriptAccess" value="sameDomain" />');
	document.writeln ('<param name="movie" value="'+ sFName + '" />');
	document.writeln ('<param name="quality" value="high" />');
	document.writeln ('<param name="bgcolor" value="' + BGColor + '" />');
	document.writeln ('<param name="wmode" value="' + Wmode + '" />');
	document.writeln ('<embed src="'+ sFName + '" quality="high" bgcolor="#ffffff" width="'+ nWidth + '" height="'+ nHeight + '" name="'+ sVName +'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http:// www.macromedia.com/go/getflashplayer" /> ');
	document.writeln ('</object>');	
}

/********************************************************************************************************
	ÆË¾÷Ã¢ ¿ÀÇÂ
********************************************************************************************************/
function uf_popOpen(_url, _target) {
	var positionX = 0;
	var positionY = 0;
//	var positionX = (screen.width-450)/2;
//	var positionY = (screen.height-250)/2;
	if (_target==null) _target = "_blank";
	window.open(_url,_target,"left="+positionX+",top="+positionY+",width=622,height=500,toolbar=no,scrollbars=no,status=yes" );
}

/****** ÆË¾÷Ã¢ ¸®»çÀÌÁî **************************************************************/
function uf_popResize() {

	// FireFoxÀÏ °æ¿ì
	if ( window.navigator.userAgent.indexOf("Firefox") != -1 ) {
		popFF();
	}
	
	// IE 6, 7 ÀÏ °æ¿ì
	if ( window.navigator.userAgent.indexOf("MSIE 6") != -1 || window.navigator.userAgent.indexOf("MSIE 7") != -1 ) {
		popIE();
	}
}

function popFF() {
	var thisX = document.getElementById("offsetTable").offsetWidth;
	var thisY = document.getElementById("offsetTable").offsetHeight;
	
	var maxThisX = screen.width - 50;
	var maxThisY = screen.height - 80;
	
	// Å¬¶óÀÌ¾ðÆ® width, height¸¦ Á¦¿ÜÇÑ FrameÀÇ °ªÀ» Ãß°¡ÇØÁà¾ß Á¦´ë·Î Ç¥ÇöµÊ.
	var marginY = 50;
	var marginX = 18;

/*	°¡·Î·Î ±æ¾îÁú °æ¿ì
	if( thisX > maxThisX ) {
		window.scrollbars.visible = true;
		thisX = maxThisX;
	} else {
		window.scrollbars.visible = false;
//		document.getElementsByTagName("body")[0].style.overflow = "hidden";
	}
*/
	
	if( thisY > maxThisY - marginY ) {
		window.scrollbars.visible = true;
		
		thisX += 16;
		thisY = maxThisY - marginY;
	} else {
		window.scrollbars.visible = false;
	}
	
	window.resizeTo( thisX+marginX, thisY+marginY );
}

function popIE() {
	var thisX = document.getElementById("offsetTable").offsetWidth;
	var thisY = document.getElementById("offsetTable").offsetHeight;
	
	var maxThisX = screen.width - 50;
	var maxThisY = screen.height - 80;
	
	var xScroll = 16;

	if ( window.navigator.userAgent.indexOf("MSIE 6") != -1 ) { // 6.0
		var marginY = 58; //
		var marginX = 22;

	} else if ( window.navigator.userAgent.indexOf("MSIE 7") != -1 ) {	// 7.0
		var marginY = 71;	//
		var marginX = 22;
	}
	
/*	°¡·Î·Î ±æ¾îÁú °æ¿ì
	if( thisX > maxThisX ) {
		window.document.body.scroll = "yes";
		thisX = maxThisX;
	} else {
		window.document.body.scroll = "no";
	}
*/

	if( thisY > maxThisY - marginY ) {
		window.document.body.scroll = "yes";
		thisX += xScroll;
		thisY = maxThisY - marginY;
		isScroll = true;
	} else {
		window.document.body.scroll = "no";
	}
	
	window.resizeTo( thisX+marginX, thisY+marginY );
}

/****** ÆË¾÷Ã¢ ¸®»çÀÌÁî **************************************************************/





try {
	$E.addAction("onLoad", "allBlur", "allblur()");
} catch(e) {
	//window.onload = allblur;
}




function resetImageSize(_id) {
	try {
		if (_id==null) _id = "imageResizeArea";
		var area = $(_id);
		var imgs = area.getElementsByTagName("IMG");
		var maxWidth = area.getW()-56;
		for (var i=0; i<imgs.length; i++) {
			if (parseInt(imgs[i].offsetWidth)>maxWidth) {
				imgs[i].style.width = maxWidth + "px";
			}
		}
	} catch(e) {
	
	}
}



// Ã¢ÀüÃ¼ÆË¾÷
function openFullSizePopup(_url) {
	var posX = 0;
	var posY = 0;
	var posW = screen.width;
	var posH = screen.height;

	open(_url, "BrosureWindow","left="+posX+",top="+posY+",width="+posW+",height="+posH+",toolbar=no,scrollbars=auto,status=no,resizable=yes" );
}


// °³ÀÎÁ¤º¸º¸È£Á¤Ã¥
function openFooterPolicy() {
	goPage('private');
}

// ÀÌ¿ë¾à°ü
function openFooterArticle() {
	window.open("http://www.lottetown.com/customer/customer_agreement.jsp", "_blank", "");
}



// µµ¿ò¸»ÆË¾÷
function uf_popHelp() {
	window.open("/common/jsp/popup/p_help.jsp","help","width=725,height=410,toolbar=no,scrollbars=no,status=no");
}
