
/************************************************************
*
*  JavaScript
*
************************************************************/
// Flash Patch

function swf_include(url,widthNum,hightNum,Access,bgColor,wMode,vars){
	var codeStr = "";
	codeStr += "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96B8-444553540000\"";
	codeStr += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9.0.47.0\" width=\""+widthNum+"\" height=\""+hightNum+"\">";
	codeStr += "<param name=\"allowScriptAccess\" value=\""+Access+"\" />";
	codeStr += "<param name=\"movie\" value=\""+url+"\" />";
	codeStr += "<param name=\"flashvars\" value=\""+vars+"\" />";
	codeStr += "<param name=\"menu\" value=\"false\" />";
	codeStr += "<param name=\"quality\" value=\"high\" />";
	codeStr += "<param name=\"wmode\" value=\""+wMode+"\" />";
	codeStr += "<param name=\"bgcolor\" value=\""+bgColor+"\" />";
	codeStr += "<embed src=\""+url+"\" flashvars=\""+vars+"\" allowScriptAccess=\""+Access+"\" menu=\"false\" quality=\"high\" wmode=\""+wMode+"\"";
	codeStr += "devicefont=\"true\" bgcolor=\""+bgColor+"\"  width=\""+widthNum+"\" height=\""+hightNum+"\" align=\"middle\" type=\"application/x-shockwave-flash\"";
	codeStr += "pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">";
	codeStr += "</embed>";
	codeStr += "</object>";
	document.write(codeStr);
}




// DreamWeaver Script
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_controlShockwave(objStr,x,cmdName,frameNum) { //v3.0
  var obj=MM_findObj(objStr);
  if (obj) eval('obj.'+cmdName+'('+((cmdName=='GotoFrame')?frameNum:'')+')');
}

/************************************************************
* Popup Script ½ÃÀÛ
************************************************************/

// Dreamweaver's Popup Script
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//  È­¸é Á¤Áß¾Ó¿¡ POPUP WINODOW OPEN
function popCwin( url, name, w, h, scroll) {

  var wl = (window.screen.width/2) - ((w/2) + 10);
  var wt = (window.screen.height/2) - ((h/2) + 50);

  var option = "height="+h+",width="+w+",left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars="+scroll + ", status=yes";

  commonPopWin = window.open( url, name, option );
  commonPopWin.focus();
}

// ¿øÇÏ´Â À§Ä¡¿¡ POPUP WINODOW OPEN
function popUwin( url, name, w, h, wl, wt, scroll) {

  var option = "status=no,height="+h+",width="+w+",resizable=no,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars="+scroll;

  commonPopWin = window.open( url, name, option );
  commonPopWin.focus();
}

/************************************************************
* Popup Script ³¡
************************************************************/


/************************************************************
* Link Blur Script ½ÃÀÛ -- ¸µÅ© Á¡¼± Å×µÎ¸® ¾ø¾Ö±â **** Àû¿ëÆäÀÌÁö body ¿¡ onload="allblur()" Ãß°¡.
************************************************************/

/*ÀÌ¹ÌÁö Å¬¸¯½Ã Á¡¼± ¾ø¾Ö±â
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 autoBlur(){
	try{
		if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
	}catch(e) {}
}
document.onfocusin=autoBlur;

function oneblur(e) {
  var evt = e ? e : window.event;
  if(evt.target) evt.target.blur();
  else if(evt.srcElement) evt.srcElement.blur();
}

/************************************************************
* Link Blur Script ³¡
************************************************************/



/************************************************************
* GoTop
************************************************************/
function GoTop() {
	window.scrollTo(0,0);
}

/************************************************************
* Family Site
************************************************************/
function changeUrl(f){
 window.open(url.value);
}


/*************************************************************************
* viewContents
*************************************************************************/

ok=0; old_what="non";
function viewContents(what){
	if (document.getElementById(what) == null){
		return;
	}

	if((old_what != "non") && (what != old_what)){
		ok=1;
		document.getElementById(old_what).style.display="none";

		document.getElementById(what).style.display="";
	}else{
		if(ok){
			ok=0;
			document.getElementById(what).style.display="none";
		}else{
			ok=1;
			document.getElementById(what).style.display="";
		}
	}
	old_what=what;
}



/*************************************************************************
* Tab View			ex) tabView(0);
*************************************************************************/
function tabView(j)
{
	obj = document.all.nowprice;

	for(i=0; i<obj.length ;i++) {
		obj[i].style.display = 'none';
	}

	obj[j].style.display = 'block';
}

function introView(j)
{
	obj = document.all.introBox;

	for(i=0; i<obj.length ;i++) {
		obj[i].style.display = 'none';
	}

	obj[j].style.display = 'block';
}



/*************************************************************************
* Scrolling Top Button				ex) InitializeStaticMenu();
*************************************************************************/
var stmnLEFT = 892; // ½ºÅ©·Ñ¸Þ´ºÀÇ ÁÂÃø À§Ä¡
var stmnGAP1 = 120; // ÆäÀÌÁö Çì´õºÎºÐÀÇ ¿©¹é
var stmnGAP2 = 120; // ½ºÅ©·Ñ½Ã ºê¶ó¿ìÀú »ó´Ü°ú ¾à°£ ¶ç¿ò. ÇÊ¿ä¾øÀ¸¸é 0À¸·Î ¼¼ÆÃ
var stmnBASE = 120; // ½ºÅ©·Ñ¸Þ´º ÃÊ±â ½ÃÀÛÀ§Ä¡ (¾Æ¹«·¸°Ô³ª ÇØµµ »ó°üÀº ¾øÁö¸¸ stmnGAP1°ú ¾à°£ Â÷ÀÌ¸¦ ÁÖ´Â°Ô º¸±â ÁÁÀ½)
var stmnActivateSpeed = 200; // ¿òÁ÷ÀÓÀ» °¨ÁöÇÏ´Â ¼Óµµ (¼ýÀÚ°¡ Å¬¼ö·Ï ´Ê°Ô ¾Ë¾ÆÂ÷¸²)
var stmnScrollSpeed = 2; // ½ºÅ©·ÑµÇ´Â ¼Óµµ (Å¬¼ö·Ï ´Ê°Ô ¿òÁ÷ÀÓ)
var stmnBOTTOMGAP = 200; // Ç²ÅÍ ¿µ¿ª ÁöÁ¤

var stmnTimer;

function RefreshStaticMenu() {

	var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;

	stmnStartPoint = parseInt(topButton.style.top, 10);
	stmnEndPoint = document.body.scrollTop + stmnGAP2;
	stmnLimit = parseInt(window.document.body.scrollHeight) - parseInt(topButton.offsetHeight) - stmnBOTTOMGAP;

	if (stmnEndPoint > stmnLimit) stmnEndPoint = stmnLimit;
	if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;

	stmnRefreshTimer = stmnActivateSpeed;

	if ( stmnStartPoint != stmnEndPoint ) {
		stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
		topButton.style.top = parseInt(topButton.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
		stmnRefreshTimer = stmnScrollSpeed;
	}

	stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
}

function InitializeStaticMenu() {
	topButton.style.left = stmnLEFT;
	topButton.style.top = document.body.scrollTop + stmnBASE;
	RefreshStaticMenu();
}


/* file download ex) fldown('filename') // <iframe name="filedownload" width="0" height="0"></iframe> */
function fldown(URL){
	document.all.filedownload.src=URL;
}



/* image border */
function imgBox_over(obj) {
	var dds = obj.parentNode.getElementsByTagName('div');
	var index=0;
	var i=0;

	if(obj == dds[i]){
		if (twoDepth=='0402')
		{
			dds[i].getElementsByTagName('div')[0].className="thumb_layer0402_on";
		}
		else if (firstDepth=='01' ^ firstDepth=='12' ^ firstDepth=='13' ^ firstDepth=='10')
		{
			dds[i].getElementsByTagName('div')[0].className="thumb_layer01_on";
		}
		else if (firstDepth=='00' ^ dispNum=='0105')
		{
			dds[i].getElementsByTagName('div')[0].className="adPrintList_layer_on";
		}
	}
}

function imgBox_out(obj) {
	var dds = obj.parentNode.getElementsByTagName('div');
	var index=0;
	var i=0;

	if(obj == dds[i]){
		dds[i].getElementsByTagName('div')[0].className="";
	}
}

/* ·¹ÀÌ¾îº¸´õ·Î ÀÎÇØ FF°è¿­ Å¬¸¯¾ÈµÇ´Â°Í ÇØ°áÀ§ÇÑ ÇÔ¼ö */
function goView(src) {
	window.document.location= src;
}


function change_idpassfind1(id)
{
    var idpassfind1_array = new Array('01', '02');
    for(var i = 0; i < 2; i++)
    {
        if(id == 'idpassfind1_'+idpassfind1_array[i]) {
			document.getElementById(id).style.display = 'block';
		} else {
			document.getElementById('idpassfind1_'+idpassfind1_array[i]).style.display = 'none';
		}
    }
}
function change_idpassfind2(id)
{
    var idpassfind2_array = new Array('01', '02');
    for(var i = 0; i < 2; i++)
    {
        if(id == 'idpassfind2_'+idpassfind2_array[i]) {
			document.getElementById(id).style.display = 'block';
		} else {
			document.getElementById('idpassfind2_'+idpassfind2_array[i]).style.display = 'none';
		}
    }
}

function change_joinType(id)
{
    var joinType_array = new Array('01', '02', '03');
    for(var i = 0; i < 3; i++)
    {
        if(id == 'joinType_'+joinType_array[i]) {
			document.getElementById(id).style.display = 'block';
		} else {
			document.getElementById('joinType_'+joinType_array[i]).style.display = 'none';
		}
    }
}

function change_bestFAQ(id)
{
    var bestFAQ_array = new Array('all','skymall', 'product', 'sw','homepage','etc');
    for(var i = 0; i < 6; i++)
    {
        if(id == 'bestFAQ_'+bestFAQ_array[i]) {
			document.getElementById(id).style.display = '';
		} else {
			document.getElementById('bestFAQ_'+bestFAQ_array[i]).style.display = 'none';
		}
    }
}

//Element ID ºÒ·¯¾²±â
function dEI(elementID){
	return document.getElementById(elementID);
}
// Tab Content
function tabCheck(dotabid , tnum){
	var inum=parseInt(tnum)-1;
	var linkTab=dEI(dotabid).getElementsByTagName("a");
	for (i=0;i<linkTab.length;i++) {
		var tabimg = linkTab.item(i).getElementsByTagName("img").item(0);
		var tabContents= dEI(dotabid+(1+i));
		if (i==inum) {
			if(tabContents.style.display!="block"){
			tabimg.src=tabimg.src.replace(".gif", "on.gif");
			tabContents.style.display="block";
			}
		}else{
		tabimg.src=tabimg.src.replace("on.gif", ".gif");
		tabContents.style.display="none";
		}
	}
}

//openDrop Layer
function viewInfo(list,total,num){
var size = total;// list count +1
var id = list;
	for(i=1;i<size;i++){
		var liEI = document.getElementById(id+i);
		if(i==num){
			if(liEI.className == "open"){
				liEI.className = "";
			}else{
				liEI.className = "open";
			}
		}else{
			liEI.className = "";
		}
	}
}


// Á¦Ç°ºñ±³
var viewCount=0;

function expandView(contents,btnID) {
    obj_con = document.getElementById('' + contents + '');
    obj_btn = document.getElementById('' + btnID + '');
    obj_btnAll = document.getElementById('btn_Expand');

    //alert(btnID);
    if (obj_con.style.display=="none" || obj_con.style.display=="") {
        obj_con.style.display="inline-block";
        obj_btn.src="/static/images/product/btn_conClose.gif";
        obj_btnAll.src="/static/images/product/productCompare_btn_close.gif";
        obj_btnAll.setAttribute("alt","°£´ÜÈ÷º¸±â");

        viewCount=viewCount+1;
        //alert(viewCount);
    }
    else    {
        obj_con.style.display="none";
        obj_btn.src="/static/images/product/btn_conOpen.gif";

        viewCount=viewCount-1;
        //alert(viewCount);
        if(viewCount==0)    {
            obj_btnAll.src="/static/images/product/productCompare_btn_expand.gif";
            obj_btnAll.setAttribute("alt","ÆîÃÄº¸±â");
        }
    }
}


function    expandAll(altV) {
    obj_btnAll = document.getElementById('btn_Expand');
    obj_wrap = document.getElementById('expandViewWrap');
    obj_dt = obj_wrap.getElementsByTagName("dt");
    obj_dd = obj_wrap.getElementsByTagName("dd");

    obj_dtimg = obj_dt[0].getElementsByTagName("img");
//    alert(obj_dtimg.length);

        if  (altV=="ÆîÃÄº¸±â")  {
            obj_btnAll.src="/static/images/product/productCompare_btn_close.gif";
            obj_btnAll.setAttribute("alt","°£´ÜÈ÷º¸±â");

			for(var i = 0; i < obj_dd.length ; i++) {
                obj_dd[i].style.display="inline-block";
                obj_dtimg = obj_dt[i].getElementsByTagName("img");
                obj_dtimg[0].src="/static/images/product/btn_conClose.gif";
                viewCount= obj_dd.length;
            }
        }
        else    {
            obj_btnAll.src="/static/images/product/productCompare_btn_expand.gif";
            obj_btnAll.setAttribute("alt","ÆîÃÄº¸±â");

            for(var i = 0; i < obj_dd.length ; i++) {
                obj_dd[i].style.display="none";
                obj_dtimg = obj_dt[i].getElementsByTagName("img");
                obj_dtimg[0].src="/static/images/product/btn_conOpen.gif";
                viewCount= 0;
            }
        }
}

function footerOpen() {
	document.getElementById("footer2").className = "Open";
}

function footerClose() {
	document.getElementById("footer2").className = "";
}

function event_open(){

	popCwin('http://www.isky.co.kr/event/openEvent/eventPop.jsp?mode=list', 'openEvent', '1014', '690', 'no');
}

var writeCookieName = "UserWrite";
var writeCookieValue = "Yes";
var writeCookieSec = 20;
var writeCookieMsg = "ÁË¼ÛÇÕ´Ï´Ù.\n\n20ÃÊ ÈÄ µ¡±Û µî·ÏÀÌ °¡´ÉÇÕ´Ï´Ù.";
var writeCookieDomain = ".isky.co.kr";

function setCookieWrite() {
   var tt = new Date(); 
   tt.setSeconds( tt.getSeconds() + writeCookieSec ); 

//   document.cookie = writeCookieName +"=" + escape(writeCookieValue) + "; path=/; domain=" + writeCookieDomain + "; max-age=" + writeCookieSec + "; expires=" + today.toGMTString() + ";"
   

   document.cookie = writeCookieName +"=" + escape(writeCookieValue) + "; path=/; domain=" + writeCookieDomain + "; expires=" + tt.toGMTString() + ";" 

} 

function getCookieWrite() { 
   var nameOfCookie = writeCookieName + "=";    
   var x = 0;      
   while ( x <= document.cookie.length ) 
   { 
		   var y = (x+nameOfCookie.length); 
		   if ( document.cookie.substring( x, y ) == nameOfCookie ) { 
				   if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) 
						   endOfCookie = document.cookie.length; 
				   return unescape( document.cookie.substring( y, endOfCookie ) ); 
		   } 
		   x = document.cookie.indexOf( " ", x ) + 1; 
		   if ( x == 0 ) 
				   break; 
   } 
   return ""; 
}

function cookieWriteMsg(){
	alert(writeCookieMsg);
}