<!--
// ¿øº» ¼Ò½º : steelheart
// »çÀÌÆ® : http://steelheart.pe.kr/

// ÀÚ½º ºÎºÐÀÇ ÁÖ¼®Àº steelheart´ÔÀÇ ÁÖ¼®À» ±×´ë·Î »ç¿ëÇß½À´Ï´Ù.

var stmnLEFT = 0; // ½ºÅ©·Ñ¸Þ´ºÀÇ ÁÂÃø À§Ä¡
var stmnGAP1 = 0; // ÆäÀÌÁö Çì´õºÎºÐÀÇ ¿©¹é
var stmnGAP2 = 0; // ½ºÅ©·Ñ½Ã ºê¶ó¿ìÀú »ó´Ü°ú ¾à°£ ¶ç¿ò. ÇÊ¿ä¾øÀ¸¸é 0À¸·Î ¼¼ÆÃ
var stmnBASE = 50; // ½ºÅ©·Ñ¸Þ´º ÃÊ±â ½ÃÀÛÀ§Ä¡ (¾Æ¹«·¸°Ô³ª ÇØµµ »ó°üÀº ¾øÁö¸¸ stmnGAP1°ú ¾à°£ Â÷ÀÌ¸¦ ÁÖ´Â°Ô º¸±â ÁÁÀ½)
var stmnActivateSpeed = 100; // ¿òÁ÷ÀÓÀ» °¨ÁöÇÏ´Â ¼Óµµ (¼ýÀÚ°¡ Å¬¼ö·Ï ´Ê°Ô ¾Ë¾ÆÂ÷¸²)
var stmnScrollSpeed = 10; // ½ºÅ©·ÑµÇ´Â ¼Óµµ (Å¬¼ö·Ï ´Ê°Ô ¿òÁ÷ÀÓ)

var stmnTimer;

function ReadCookie(name) {
var label = name + "=";
var labelLen = label.length;
var cLen = document.cookie.length;
var i = 0;

while (i < cLen) {
        var j = i + labelLen;

        if (document.cookie.substring(i, j) == label) {
                var cEnd = document.cookie.indexOf(";", j);
                if (cEnd == -1) cEnd = document.cookie.length;
		return unescape(document.cookie.substring(j, cEnd));
        }
		i++;
    }
  return "";
}

function SaveCookie(name, value, expire) {
var eDate = new Date();
eDate.setDate(eDate.getDate() + expire);
document.cookie = name + "=" + value + "; expires=" +  eDate.toGMTString()+ "; path=/";
}

function RefreshStaticMenu() {
var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;

stmnStartPoint = parseInt(STATICMENU.style.top, 10);
stmnEndPoint = document.body.scrollTop + stmnGAP2;
if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;

stmnRefreshTimer = stmnActivateSpeed;

if ( stmnStartPoint != stmnEndPoint ) {
        stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
        STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
        stmnRefreshTimer = stmnScrollSpeed;
        }
        stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
}

function ToggleAnimate() {
	if (!ANIMATE.checked) {
		RefreshStaticMenu();
                SaveCookie("ANIMATE", "true", 300);
                } else {
                clearTimeout(stmnTimer);
                STATICMENU.style.top = stmnGAP1;
                SaveCookie("ANIMATE", "false", 300);
        }
}

function InitializeStaticMenu() {
STATICMENU.style.left = "0";
	if (ReadCookie("ANIMATE") == "false") {
                ANIMATE.checked = true;
                STATICMENU.style.top = document.body.scrollTop + stmnGAP1;
                } else {
                ANIMATE.checked = false;
                STATICMENU.style.top = document.body.scrollTop + stmnBASE;
                RefreshStaticMenu();
        }
}
//-->


function openwin(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);


}


	
	function fnImgSize(name,width,limit){
		if (width > limit){
			document.all[""+name+""].width=limit;
		}
	}
	
	
	
	function fnSMS(tel){
		openwin('SMS','../sms/phone/index.asp?tel='+tel,300,100,160,430,0,0,0,0,0)
	}
	function fnSMSNTXT(tel,txt){
		//openwin('SMS','../sms/phone/index.asp?txt='+txt+'&tel='+tel,300,100,160,430,0,0,0,0,0)
		document.formSMS.phone_num.value=tel;
		document.formSMS.phone_msg.value=txt;
		document.formSMS.submit();	
	}
	
	function fnOpenSet(){
		openwin('set_info', '../main/main_38.asp', 5, 5, 676, 600, 0, 0, 0, 1, 0)
	}
	
	
	function fnCJ(dil_no){
		//document.cjForm.slipno.value=dil_no;
		//document.cjForm.submit();
		openwin('cjwin', 'http://www.cjgls.co.kr/kor/service/service02_02.asp?slipno='+dil_no, 0, 0, 555, 550, 0, 0, 0, 1, 0)
	}
	function fnHyundai(dil_no){
		openwin('HYDEXwin', 'http://www.hydex.net/ehydex/jsp/home/distribution/tracking/tracingNView.jsp?param1='+dil_no, 0, 0, 580, 550, 0, 0, 0, 1, 0)
	}
	function fnEPOST(dil_no){
		openwin('posttrace', 'http://service.epost.go.kr/iservice/trace/Trace_ok.jsp?sid1='+dil_no, 0, 0, 580, 550, 0, 0, 0, 1, 0)
	}
	function fnYellow(dil_no)
	{
		window.open ('http://www.yellowcap.co.kr/branch/chase/listbody.html?a_gb=branch&a_cd=5&a_item=0&f_slipno='+dil_no,"sign1","left=0,top=0,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=635,height=700");
	}





function fnUserlogin(){
		
		openwin('user_login', 'https://www.gvg.co.kr/user/user_06.asp', 5, 5, 400, 300, 0, 0, 0, 0, 0)
		//openwin('user_login', '../user/user_06.asp', 5, 5, 400, 300, 0, 0, 0, 0, 0)
		
	}
function fnSurveyOpen(){
		
		openwin('survey', 'http://www.gvg.co.kr/plza/svy_list.asp', 5, 5, 600, 700, 0, 0, 0, 1, 0);
		
		
	}
	
function resizeIF(Id)
{
        var obj = document.getElementById(Id);
        var Body;
        var H, Min;
		
        // ÃÖ¼Ò ³ôÀÌ ¼³Á¤ (³Ê¹« ÀÛ¾ÆÁö´Â °ÍÀ» ¹æÁö)
        Min = 200;

        // DOM °´Ã¼ ÇÒ´ç
        try
        {
        	
                if (!document.all && obj.contentWindow.document.location.href 

                        == 'about:blank') {
                        setTimeout("resizeIF('"+Id+"')", 10);
                        return;
                }

                Body = obj.contentWindow.document.getElementsByTagName('BODY');
                Body = Body[0];

                if (this.Location != obj.contentWindow.document.location.href) {
                       obj.style.height='1000px';//µ¿½ÄÃß°¡-¸®ÇÁ·¹½ÃÇÒ¶§ ´Ù½Ã ÀÛ¾Æ º´Ù »õÅ©±â·ÎÁöÁ¤ÇÏ°ÔÇÏ±âÀ§ÇØ
                        H = Body.scrollHeight + 5;
                        
                        obj.style.height =  (H<Min?Min:H) + 'px';

                        this.Location = obj.contentWindow.document.location.href;
                }
        }
        catch(e)
        {
                setTimeout("resizeIF('"+Id+"')", 10);
                return;
        }

        setTimeout("resizeIF('"+Id+"')", 100);
}



	
function resizeIF222(Id)
{
        var obj = document.getElementById(Id);
        obj.setExpression('height','100px'); 
        obj.setExpression('height',obj.document.body.scrollHeight); 
}



