//ÇÃ·¡½Ã
function viewFlash(URL,mode,wid,hei,text) 
{
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+wid+"' height='"+hei+"' title='"+text+"'>");
	document.write("<param name='movie' value='"+URL+"'/>");
	document.write("<param name='quality' value='high'/>");
	document.write("<param name='WMODE' value='"+mode+"' />");
	document.write("<embed src='"+URL+"' quality='high' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' wmode='transparent' width='"+wid+"' height='"+hei+"'></embed>");
	document.write("</object>");
}

//¸µÅ©
function link(){
	var url = "";
	var depth = arguments.length;
	try {
		if(arguments[0] == "10") {
			viewMap();
		}
		else {
			if(depth==0) url = eval("u"+arguments[0]+"[0]");
			else if(depth==1) url = eval("u"+arguments[0]+"[0]");
			else if(depth==2) url = eval("u"+arguments[0]+"_"+arguments[1]+"[0]");
			else if(depth==3) url = eval("u"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"[0]");
			else if(depth==4) url = eval("u"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"_"+arguments[3]+"[0]");
			else if(depth==5) url = eval("u"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"_"+arguments[3]+"_"+arguments[4]+"[0]");
			else if(depth==6) url = eval("u"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"_"+arguments[3]+"_"+arguments[4]+"[0]");
			else if(depth==7) url = eval("u"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"_"+arguments[3]+"_"+arguments[4]+"[0]");
			else if(depth==8) url = eval("u"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"_"+arguments[3]+"_"+arguments[4]+"[0]");
			if(url=="") alert("ÁØºñÁßÀÔ´Ï´Ù");
			else location.href = url;
		}
	}catch(e) { alert("ÁØºñÁßÀÔ´Ï´Ù"); }
}

u0=new Array("../index.htm","Home");
u1=new Array("/company/company.htm","È¸»ç¼Ò°³");
u1_1=new Array("/company/company.htm","È¸»ç¼Ò°³");
u1_2=new Array("/company/company02.htm","Á¶Á÷µµ");
u1_3=new Array("/company/company03.htm","ÀÌ¸ÞÀÏ¹®ÀÇ");
u1_4=new Array("http://www.ezimg.com/map.htm","¿À½Ã´Â±æ");

u2=new Array("/make/make.htm","Á¦ÀÛ½ÇÀû");
u2_1=new Array("/make/make.htm","È¨ÆäÀÌÁöÁ¦ÀÛ");
u2_2=new Array("/make/make02.htm","À¥Ä«´Ù·Î±×");
u2_3=new Array("/make/make03.htm","CI/BI");

u3=new Array("/site/site.htm","Âü°í»çÀÌÆ®");
u3_1=new Array("/site/site.htm","µðÀÚÀÎ Âü°í»çÀÌÆ®");
u3_2=new Array("/site/site02.htm","À¥Ä«´Ù·Î±×");
u3_3=new Array("/site/site03.htm","CI/BI");

u4=new Array("/marketing/marketing.htm","¿Â¶óÀÎ¸¶ÄÉÆÃ");

u5=new Array("/estimate/estimate.htm","°ßÀû½ÅÃ»");
u5_1=new Array("/estimate/estimate.htm","°ßÀû»ó´ã/½ÅÃ»");
u5_2=new Array("/estimate/estimate02.htm","°ßÀûÇöÈ²");
u5_3=new Array("/estimate/estimate03.htm","ÅÛÇÃ¸´ ½Ã¾È °í¸£±â");

u6=new Array("/customer/customer.htm","°í°´¼¾ÅÍ");
u6_1=new Array("/customer/customer.htm","FAQ");
u6_2=new Array("/customer/customer02.htm","´º½º&°øÁö»çÇ×");
u6_3=new Array("/customer/customer03.htm","Áú¹®°ú ´äº¯");

u7=new Array("/sitemap/sitemap.htm","»çÀÌÆ®¸Ê");

u8=new Array("/partner/partner.htm","ÆÄÆ®³Ê¼Ò°³");
u8_1=new Array("/partner/partner.htm","ÆÄÆ®³Ê¼Ò°³/Àü±¹Áö»ç");
u8_2=new Array("/partner/partner02.htm","Ã¤¿ë°ø°í");

u9=new Array("/consultation/consultation.htm","ÇÁ·ÎÁ§Æ®");
u9_1=new Array("/consultation/consultation.htm","È¨ÆäÀÌÁö ¸®´º¾ó Á¦¾È¼­");
u9_2=new Array("/consultation/consultation02.htm","À¯Áöº¸¼ö Ã³¸®ÇöÈ²");

//Æ÷Æ®Æú¸®¿À ½ºÅ©·Ñ
function textScroll(scroll_el_id) {
    this.objElement = document.getElementById(scroll_el_id);
    this.objElement.style.position = 'relative';
	this.objElement.style.overflow = 'hidden';

    this.objLi = this.objElement.getElementsByTagName('li');
	this.width = 150;
    this.num = this.objLi.length; // li ¿¤¸®¸ÕÆ®ÀÇ ÃÑ °¹¼ö
    this.totalHeight = this.width*this.num; // ÃÑ ³ÏÀÌ
    this.scrollspeed = 1; // ½ºÅ©·ÑµÇ´Â px
    this.objLeft = new Array(); // °¢ liÀÇ left À§Ä¡¸¦ ÀúÀå
    this.timer = null;
	this.movecnt = 25;
	this.targetvalue=0;
	this.jumpcnt=0;
	this.jumpwidth=this.width*6;
    
    for(var i=0; i<this.num; i++){
        this.objLi[i].style.position = 'absolute';
        this.objLeft[i] = this.width*i;
        this.objLi[i].style.left = this.objLeft[i]+"px";
    }
}

//½ºÅ©·Ñ ÁÂ·ÎÀÌµ¿
textScroll.prototype.move = function(){
		for(var i=0; i<this.num; i++) {
			this.objLeft[i] = this.objLeft[i] - this.scrollspeed;
			this.objLi[i].style.left = this.objLeft[i]+"px";
		}
		if(this.objLeft[0]%this.width == 0){
			this.jump();
		}else{
			clearTimeout(this.timer);
			this.timer = setTimeout(this.name+".move()",10);
		}
}

textScroll.prototype.move_jump = function(){
		for(var i=0; i<this.num; i++) {
			this.objLeft[i] = this.objLeft[i] - this.scrollspeed*30;
			this.objLi[i].style.left = this.objLeft[i]+"px";
		}

			if(this.jumpcnt<this.movecnt){
				this.jumpcnt++;
				clearTimeout(this.timer);
				this.timer = setTimeout(this.name+".move_jump()",10);
			}
			else{
				this.jumpcnt=0;
				clearTimeout(this.timer);
				this.timer = setTimeout(this.name+".move()",10);
			}
}

textScroll.prototype.jump = function(){
    for(var i=0; i<this.num; i++){
        if(this.objLeft[i] <= this.width*(-1)){
            this.objLeft[i] = this.objLeft[i] + this.totalHeight;
            this.objLi[i].style.left = this.objLeft[i]+"px";
        }
    }
    clearTimeout(this.timer);
   this.timer = setTimeout(this.name+".move()",3000);
}

//½ºÅ©·Ñ¿ì·ÎÀÌµ¿
textScroll.prototype.move2 = function(){
		for(var i=0; i<this.num; i++) {
			this.objLeft[i] = this.objLeft[i] + this.scrollspeed;
			this.objLi[i].style.left = this.objLeft[i]+"px";
		}
		if(this.objLeft[0]%this.width == 0){
			this.jump2();
		}else{
			clearTimeout(this.timer);
			this.timer = setTimeout(this.name+".move2()",10);
		}
}

textScroll.prototype.move2_jump = function(){
		for(var i=0; i<this.num; i++) {
			this.objLeft[i] = this.objLeft[i] + this.scrollspeed*30;
			this.objLi[i].style.left = this.objLeft[i]+"px";
		}

			if(this.jumpcnt<this.movecnt){
				this.jumpcnt++;
				clearTimeout(this.timer);
				this.timer = setTimeout(this.name+".move2_jump()",10);
			}
			else{
				this.jumpcnt=0;
				clearTimeout(this.timer);
				this.timer = setTimeout(this.name+".move2()",10);
			}
}

textScroll.prototype.jump2 = function(){
    for(var i=0; i<this.num; i++){
        if(this.objLeft[this.num-1-i] >= this.totalHeight){
            this.objLeft[this.num-1-i] = this.objLeft[this.num-1-i] - this.totalHeight;
            this.objLi[this.num-1-i].style.left = this.objLeft[this.num-1-i]+"px";
        }
    }
    clearTimeout(this.timer);
   this.timer = setTimeout(this.name+".move2()",3000);
}

textScroll.prototype.start = function() {
    this.timer = setTimeout(this.name+".move()",3000);
}

//Äü¸Þ´º ½ºÅ©·Ñ
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)
}

//ÄíÅ°°ª ÃßÃâ
//@param cookieName ÄíÅ°¸í

function getCookie( cookieName ){
	var search = cookieName + "=";
	var cookie = document.cookie;

	// ÇöÀç ÄíÅ°°¡ Á¸ÀçÇÒ °æ¿ì
	if( cookie.length > 0 )	{
		// ÇØ´ç ÄíÅ°¸íÀÌ Á¸ÀçÇÏ´ÂÁö °Ë»öÇÑ ÈÄ Á¸ÀçÇÏ¸é À§Ä¡¸¦ ¸®ÅÏ.
		startIndex = cookie.indexOf( cookieName );
		// ¸¸¾à Á¸ÀçÇÑ´Ù¸é
		if( startIndex != -1 ){
			// °ªÀ» ¾ò¾î³»±â À§ÇØ ½ÃÀÛ ÀÎµ¦½º Á¶Àý
			startIndex += cookieName.length;
			// °ªÀ» ¾ò¾î³»±â À§ÇØ Á¾·á ÀÎµ¦½º ÃßÃâ
			endIndex = cookie.indexOf( ";", startIndex );
			// ¸¸¾à Á¾·á ÀÎµ¦½º¸¦ ¸øÃ£°Ô µÇ¸é ÄíÅ° ÀüÃ¼±æÀÌ·Î ¼³Á¤
			if( endIndex == -1) endIndex = cookie.length;
				// ÄíÅ°°ªÀ» ÃßÃâÇÏ¿© ¸®ÅÏ
			return unescape( cookie.substring( startIndex + 1, endIndex ) );
		}else{
			// ÄíÅ° ³»¿¡ ÇØ´ç ÄíÅ°°¡ Á¸ÀçÇÏÁö ¾ÊÀ» °æ¿ì
			return false;
		}
	}else{
		// ÄíÅ° ÀÚÃ¼°¡ ¾øÀ» °æ¿ì
		return false;
	}
}

//ÄíÅ° ¼³Á¤
//@param cookieName ÄíÅ°¸í
//@param cookieValue ÄíÅ°°ª
//@param expireDay ÄíÅ° À¯È¿³¯Â¥
function setCookie( cookieName, cookieValue, expireDate ){
	var today = new Date();
	today.setDate( today.getDate() + expireDate);
	document.cookie = cookieName + "=" + escape( cookieValue ) + "; path=/;";
}

//ÄíÅ° »èÁ¦
//@param cookieName »èÁ¦ÇÒ ÄíÅ°¸í
function deleteCookie( cookieName ){
	var expireDate = new Date();
	//¾îÁ¦ ³¯Â¥¸¦ ÄíÅ° ¼Ò¸ê ³¯Â¥·Î ¼³Á¤ÇÑ´Ù.
	expireDate.setDate( expireDate.getDate() - 1 );
	document.cookie = cookieName + "= " + "; expires=" + expireDate.toGMTString() + "; path=/";
}

/* ±Ý¾×ÄÄ¸¶¼³Á¤ **********************************************************************************/
function priceComma(number) {
		if(number>0){
			number = '' + number;
			var mark="";
		}
		else{
			number=""+(number-(number*2));
			var mark="-";
		}

		if (number.length > 3) {

			var mod = number.length % 3;
			var output = (mod > 0 ? (number.substring(0,mod)) : '');
				for (i=0 ; i < Math.floor(number.length / 3); i++) {
				if ((mod == 0) && (i == 0))
					output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
				else
					output+= ',' + number.substring(mod + 3 * i, mod + 3 * i + 3);
				}
			return (mark+""+output);
		}
		else return number;
	}


//½ºÇÇµå°ßÀû½ÅÃ»
function chkForm(	){
	var f=document.autoForm;

	if(f.e_name.value==""){
		alert("¼º¸íÀº ÇÊ¼öÇ×¸ñÀÔ´Ï´Ù.");
		f.e_name.focus();
		return false;
	}

	if(f.e_telnum1.value=="" || f.e_telnum3.value=="" || f.e_telnum3.value==""){
		alert("ÇÚµåÆù¹øÈ£´Â ÇÊ¼öÇ×¸ñÀÔ´Ï´Ù.");
		f.e_telnum1.focus();
		return false;
	}

	if(f.e_name.value==""){
		alert("¼º¸íÀº ÇÊ¼öÇ×¸ñÀÔ´Ï´Ù.");
		f.e_name.focus();
		return false;
	}

	if(confirm("ÀÚµ¿°ßÀûÀ» ½ÇÇàÇÏ½Ã°Ú½À´Ï±î?")) return true;
	else return false;
}

//Å¬·¡½ºº¯°æ
function changeClassName(idvalue,classname){
	var controlEl=document.getElementById(idvalue);

	if(window.ActiveXObject) {
		controlEl.setAttribute("className",classname);
	}
	else{
		controlEl.setAttribute("class",classname);
	}
}

//ÀÚµ¿°ßÀûÆË¾÷·¹ÀÌ¾î ÄÁÆ®·Ñ
function showEstimate(){
	if(!getCookie("estimatepop")){
		changeClassName("pop","showclass");
	}
	else{
		changeClassName("pop","hiddenclass");
	}
}

//ÀÚµ¿°ßÀûÇÏ·çµ¿¾È¿­Áö¾ÊÀ½ 
function closeEstimate01(){ 
	if (document.getElementById("estimatepop").checked ) setCookie( "estimatepop", "done" , 1); 
	// 1=ÇÏ·íµ¿¾È ¿­Áö ¾ÊÀ½
	changeClassName("pop","hiddenclass");
}


//¸ÞÀÎÆäÀÌÁö ·Îµù½Ã ÄíÅ°Ã¼Å©
window.onload = function(){showEstimate();}

