function fnCheckFlashVersion()
{
    var isInstalled = false;
    var version = 0;
    var agent = navigator.userAgent;
    
    // check client
	var user_app_name = '';
	if(new RegExp(/Firefox/).test(agent)){ 
		user_app_name = "FF";
	}else if(new RegExp(/Netscape/).test(agent)){ 
		user_app_name = "NS";
	}else if(new RegExp(/MSIE/).test(agent)){ 
		user_app_name = "IE"; 
	}else if(new RegExp(/Opera/).test(agent)){ 
		user_app_name = "OP"; 
	}else if(new RegExp(/AppleWebKit/).test(agent)){ 
		user_app_name = "AS"; 
	}
    
    if(user_app_name == 'IE')
    {
        if (window.ActiveXObject) {
            var control = null;
            try {
                control = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
            } catch (e) {
                return;
            }
            
            if (control) {
                isInstalled = true;
                version = control.GetVariable('$version').substring(4);
                version = version.split(',');
                version = parseFloat(version[0]);
            }
        } else {
                // Check navigator.plugins for "Shockwave Flash"
        }
    }
    else
    {
        if (window.navigator.plugins != null && window.navigator.plugins.length > 0) {
            var flashPlugin = navigator.plugins['Shockwave Flash']; 
            if (typeof flashPlugin == 'object') {
                for (i=25;i>0;i--) {
                    if (flashPlugin.description.indexOf(i+'.') != -1){ 
                        version = i;
                    }
                }
            }
        }
    }
    
    return version;
}

function viewFlash(sURL, sName, sFeatures)
{
    var FLASHCAB = "https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab";
    var FLASHCID = "CLSID:D27CDB6E-AE6D-11CF-96B8-444553540000";
    var FLASHVER = "10.2.154.25";

    var sFeature;
    var sWidth  = "100%";
    var sHeight  = "100%";
    var pmBoolean = "false";
    var sTempArray;
    var sParamTag = "";

    sFeature = sFeatures.split(/\s*,\s*/);
    for (var i=0; i< sFeature.length ; i++)
    { 
        sTempArray = sFeature[i].split(/\s*=\s*/);
        if (sTempArray[0].toLowerCase() == "width")
        { 
            sWidth = sTempArray[1]; 
        }
        else if (sTempArray[0].toLowerCase() == "height")
        {
            sHeight = sTempArray[1]; 
        }
        else
        {
            if (sTempArray[1].toLowerCase() == "yes" || sTempArray[1] == "1" || sTempArray[1].toLowerCase() == "true")
            {
                pmBoolean = "true";
            }
            else if (sTempArray[1].toLowerCase() == "no" || sTempArray[1] == "0" || sTempArray[1].toLowerCase() == "false")
            {
                pmBoolean = "false";
            }
            else
            {
                pmBoolean = sTempArray[1];
            } 
            sParamTag = "<param name='" + sTempArray[0] + "'value='" + pmBoolean + "'>\n" + sParamTag;
        } 
    } 
        
    if(fnCheckFlashVersion() >= 9)
    { 
        document.write("<object vmode='transparent' id='" + sName + "' name='" + sName + "' classid='" + FLASHCID + "' codebase='" + FLASHCAB + "#version=" + FLASHVER + "' width='" + sWidth + "' height='" + sHeight+"'>");
        document.write("<param name='movie' value='" + sURL + "'>"); 
        document.write("<param name='wmode' value='transparent'>"); 
        document.write(sParamTag); 
        document.write("<embed wmode='transparent' src='" + sURL + "' menu='false' width='" + sWidth + "' height='" + sHeight + "' id='" + sName + "' name='" + sName + "' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />") 
        document.write("</object>"); 
    }
    else
    {
        document.write("<div style='width:" + sWidth + ";height:" + sHeight + ";vertical-align:middle;text-align:center'>");
        document.write("<a href='http://www.adobe.com/support/flashplayer/downloads.html' target='_blank'>Install a different version of adobe flash player</a>");
        document.write("</div>");
    }
   
}

function viewFlashNoneTransParent(sURL, sName, sFeatures)
{
    var FLASHCAB = "https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab";
    var FLASHCID = "CLSID:D27CDB6E-AE6D-11CF-96B8-444553540000";
    var FLASHVER = "10.2.154.25";

    var sFeature;
    var sWidth  = "100%";
    var sHeight  = "100%";
    var pmBoolean = "false";
    var sTempArray;
    var sParamTag = "";

    sFeature = sFeatures.split(/\s*,\s*/);
    for (var i=0; i< sFeature.length ; i++)
    { 
        sTempArray = sFeature[i].split(/\s*=\s*/);
        if (sTempArray[0].toLowerCase() == "width")
        { 
            sWidth = sTempArray[1]; 
        }
        else if (sTempArray[0].toLowerCase() == "height")
        {
            sHeight = sTempArray[1]; 
        }
        else
        {
            if (sTempArray[1].toLowerCase() == "yes" || sTempArray[1] == "1" || sTempArray[1].toLowerCase() == "true")
            {
                pmBoolean = "true";
            }
            else if (sTempArray[1].toLowerCase() == "no" || sTempArray[1] == "0" || sTempArray[1].toLowerCase() == "false")
            {
                pmBoolean = "false";
            }
            else
            {
                pmBoolean = sTempArray[1];
            } 
            sParamTag = "<param name='" + sTempArray[0] + "'value='" + pmBoolean + "'>\n" + sParamTag;
        } 
    } 
    
    if(fnCheckFlashVersion() >= 9)
    {
        document.write("<object id='" + sName + "' name='" + sName + "' classid='" + FLASHCID + "' codebase='" + FLASHCAB + "#version=" + FLASHVER + "' width='" + sWidth + "' height='" + sHeight+"'>");
        document.write("<param name='movie' value='" + sURL + "'>"); 
        document.write(sParamTag); 
        document.write("<embed wmode='transparent' src='" + sURL + "' menu='false' width='" + sWidth + "' height='" + sHeight + "' id='" + sName + "' name='" + sName + "' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />") 
        document.write("</object>"); 
    }
    else
    {
        document.write("<div style='width:" + sWidth + ";height:" + sHeight + ";vertical-align:middle;text-align:center'>");
        document.write("<a href='http://www.adobe.com/support/flashplayer/downloads.html' target='_blank'>Install a different version of adobe flash player</a>");
        document.write("</div>");
    }
}  

function PopUp(Title, Url, Width, Height, Left, Top, CenterYN)
{
   var X = ((document.body.clientWidth) / 2) - (Width / 2);
   var Y = ((document.body.clientHeight) / 2) - (Height / 2) + 100;
   if (CenterYN == "N")
   {
      X = Left;
      Y = Top;
   }
   config = "toolbar=no,directories=no,menubar=no,titlebar=no,status=no,scrollbars=yes,width=" + Width + ",height=" + Height + ",left=" + X + ",top=" + Y;
   window.open(Url, Title, config);
}

function PopUpViewImg(Title, Url, Width, Height, Left, Top, CenterYN) {
    var X = ((document.body.clientWidth) / 2) - (Width / 2);
    var Y = ((document.body.clientHeight) / 2) - (Height / 2) + 100;
    if (CenterYN == "N") {
        X = Left;
        Y = Top;
    }
    config = "toolbar=no,directories=yes,menubar=no,titlebar=yes,status=no,scrollbars=yes,width=" + Width + ",height=" + Height + ",left=" + X + ",top=" + Y;
    window.open(Url, Title, config);
}

function WishListPopUp(Title, Url, Width, Height, Left, Top, CenterYN)
{
   var X = ((document.body.clientWidth) / 2) - (Width / 2);
   var Y = ((document.body.clientHeight) / 2) - (Height / 2) + 100;
   if (CenterYN == "N")
   {
      X = Left;
      Y = Top;
   }
   config = "toolbar=no,directories=no,menubar=no,titlebar=no,status=no,scrollbars=yes,width=" + Width + ",height=" + Height + ",left=" + X + ",top=" + Y;
   parent.parent.window.open(Url, Title, config);
}



function CheckNumber(val)
{
    for(i=0;i<val.length;i++)
    {
        if(val.charCodeAt(i) <= 47 || val.charCodeAt(i) >= 58)
            return false;                    
    }
    return true;
}
function CheckInch(val)
{
    for(i=0;i<val.length;i++)
    {
        if((val.charCodeAt(i) != 46) && (val.charCodeAt(i) <= 47 || val.charCodeAt(i) >= 58))
            return false;
    }
    return true;
}
function ConvertCm()
{
   var tInch = document.getElementById("txtinch");
   var tCm = document.getElementById("txtcm");
   
   if(!CheckInch(tInch.value))
   {
      alert("¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.");
      tInch.focus();
      tInch.select();
      return false;
   }
   else
   {
      var num = tInch.value * 2.54;
      num.toFixed(1);
      tCm.value = num.toFixed(1);
      return true;
   }
}
  
//Added by Taeil Lee, 12/08/2009
//OrderStatus.aspx, OrderReturnList.aspx, orderCancelList.aspx
function yycheck(type)
{
    var mmonth;
    if (type == "T")
    {
        mmonth=document.getElementById("tomonth").value;           
    }
    else
    {
        mmonth=document.getElementById("frommonth").value;           
    }
    
    ddcheck(mmonth ,type, '');
}

function ddcheck(valu, type, n_day)
{
    var yyear;
    var mmonth;
    var dday;
    var select_day;
    
    if (type == "T")
    {
        yyear=document.getElementById("toyear").value; 
        mmonth=document.getElementById("tomonth").value;
        dday=document.getElementById("today");
    }
    else
    {
        yyear=document.getElementById("fromyear").value; 
        mmonth=document.getElementById("frommonth").value;
        dday=document.getElementById("fromday");
    }
    select_day = dday.value;
    
    //³¯Â¥(ÀÏ) ÃÊ±âÈ­      
    for( var i=dday.length-1; i>0; i-- )                    
    {
        dday.options[i] = null;                             
    }

    //¿ùº° ¸¶Áö¸·ÀÏ¼ö Á¤ÀÇ 
    var dayArray=new Array(31,28,31,30,31,30,31,31,30,31,30,31);  
    
    //¸¶Áö¸· ÀÏ¼ö ±¸ÇÏ±â
    var daylength=dayArray[valu-1];          

    // ³âÀ¸·Î À±´Þ ±¸ÇÏ±â
    if(((Number(yyear) % 4 == 0) && (Number(yyear) % 100 != 0)) || (Number(yyear) % 400 == 0)) 
    {  
        if(Number(mmonth) == 2)
        {
            // À±´ÞÀÏ°æ¿ì 2¿ù 28ÀÏÀ» 29ÀÏ·Î ¼öÁ¤
            daylength=dayArray[valu-1]+1;                    
        }
    }
    
    for(i=0;i<daylength;i++)
    {
        dday.options[i] = new Option(i+1,i+1,true); 
    }      

    if(n_day == "")
    {
        var sToDay =new Date();
        dday.value = sToDay.getDate();
        //dday.value = select_day;
    }
    else
    {
        dday.value = n_day;
    }
    
}



