﻿/* flashload*/
function VF(width,height,file) {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+width+"' height='"+height+"'>");
	document.write("<param name='movie' value='"+file+"'>");
	document.write("<param name='quality' value='high'>");
	document.write("<embed src='"+file+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'></embed>");
	document.write("</object>");
}
/*flashload배경투명*/
function VFTrans(width,height,file) {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+width+"' height='"+height+"'>");
	document.write("<param name='movie' value='"+file+"'>");
	document.write("<param name='quality' value='high'>");
	document.write("<param name='wmode' value='transparent'>");
	document.write("<embed src='"+file+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'  wmode='transparent'></embed>");
	document.write("</object>");
}
/* flashload변수전달용*/
function VFNum(width,height,file,thisPage) {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+width+"' height='"+height+"'>");
	document.write("<param name='movie' value='"+file+"'>");
	document.write("<param name='quality' value='high'>");
	document.write("<param name='flashVars' value='pageNum="+thisPage+"'>");
	document.write("<embed src='"+file+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"' flashVars='pageNum="+thisPage+"'></embed>");
	document.write("</object>");
}
/* flashload배경투명 변수전달용*/
function VFTransNum(width,height,file,thisPage) {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+width+"' height='"+height+"'>");
	document.write("<param name='movie' value='"+file+"'>");
	document.write("<param name='quality' value='high'>");
	document.write("<param name='wmode' value='transparent'>");
	document.write("<param name='flashVars' value='pageNum="+thisPage+"'>");
	document.write("<embed src='"+file+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"' flashVars='pageNum="+thisPage+"' wmode='transparent'></embed>");
	document.write("</object>");
}


/////ie6용 png이미치 처리/////
function setPng24(obj)
	{
			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 bookmark() {
window.external.AddFavorite('http://www.naver.com','naver')
}	

/////팝업 open/////
var win= null;
function NewWindow(mypage,myname,w,h,scroll){
   var winl = (screen.width-w)/2;
   var wint = (screen.height-h)/2;
   var settings ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable=yes';
   win=window.open(mypage,myname,settings);
   if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}



/////제품정보/////
function goPro(n) {
	max=document.getElementById("area_pro").getElementsByTagName("DIV").length;
	for(i=1;i<=max;i++){
		document.getElementById("pro0"+i).style.display = "none";
	}
	document.getElementById("pro0"+n).style.display = "block";
}

////팝업레이어/////
function openLayer(n){
	document.getElementById("pop_layer"+n).style.display = "block";
}

function closeLayer(n) {
	document.getElementById('pop_layer'+n).style.display = 'none';
}





/* 퀵메뉴 스크롤링 //
* 사용방법 : 홈페이지 하단에 new quickMove(object 이동할레이어,integer 이동시 브라우져상단관의 offset 값);
* 주의사항 
* - 반드시 레이어의 position 값은 absolute 값이어야 합니다
* - 레이어의 초기위치는 left,top 스타일로 정의되어 있어야 합니다. (보이는 위치에서 슬라이딩 됩니다)
* - DOM BASE 로 제작되었기 때문에 올바르지 않은 html 페이지에서 에러가 날 수 있습니다 (예: 이런경우는 드물지만 body 태그가 존재하지 않거나 한개이상 존재할경우 등..)
* - 슬라이딩 레이어에 background:url 로 배경을 이미지로 사용하지 마시기 바랍니다. 슬라이딩시 IE 브라우져에서 지속적으로 파일을 엑세스 합니다 


function initMoving(target, topPosition, topLimit, btmLimit) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = topPosition;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;
	obj.style.top = obj.top + "px";

	obj.getTop = function() {
		if (document.documentElement.scrollTop) {
			return document.documentElement.scrollTop;
		} else if (window.pageYOffset) {
			return window.pageYOffset;
		} else {
			return 0;
		}
	}
	obj.getHeight = function() {
		if (self.innerHeight) {
			return self.innerHeight;
		} else if(document.documentElement.clientHeight) {
			return document.documentElement.clientHeight;
		} else {
			return 620;
		}
	}
	obj.move = setInterval(function() {
		//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		pos = obj.getTop() + topPosition;

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit
		if (pos < obj.topLimit)
			pos = obj.topLimit

		interval = obj.top - pos;
		obj.top = obj.top - interval / 5;
		obj.style.top = obj.top + "px";
	}, 30)
	}
퀵메뉴 스크롤링 */
