﻿/* search  */
function goSearch() {

}

/* 제품 리스트 Icon View */
function showIconType(num) {
		for (var i = 1; i < 8; i++) {
			var tip = document.getElementById('tip0'+i);

			if (num == i) {
				tip.style.display = 'block'
			}
		}
	}
function closeIconType(num) {
	for (var i = 1; i < 8; i++) {
		var tip = document.getElementById('tip0'+i);
		if (num == i) {
			tip.style.display = 'none'
		}
	}
}


/* 화면 확대 축소 시작 IE 전용 */
/*
 var nowZoom = 100; // 현재비율
 var maxZoom = 200; // 최대비율(500으로하면 5배 커진다)
 var minZoom = 80; // 최소비율



 //화면 키운다.
 function zoomIn() {
  if (nowZoom < maxZoom) {
   nowZoom += 10; //25%씩 커진다.
  } else {
   return;
  }

  document.body.style.zoom = nowZoom + "%";
 }


 //화면 줄인다.
 function zoomOut() {
  if (nowZoom > minZoom) {
   nowZoom -= 10; //25%씩 작아진다.
  } else {
   return;
  }

  document.body.style.zoom = nowZoom + "%";
 }
 */

var nowZoom = 11;
var maxZoom = 28;
var minZoom = 1;

function zoomIn() {
	if (nowZoom < maxZoom)
	{
		nowZoom++;
		var strTagTable = document.getElementsByTagName("table");
		for (var i = 0; i < strTagTable.length; i++)
		{
			if (strTagTable[i].className == "list")
			{
				var strTableList = "strTableList"+i;
				var setTableId = strTagTable[i].setAttribute("id",strTableList);
				var tableId = document.getElementById(strTableList);
				var tdStyle = tableId.getElementsByTagName("td");
				var aStyle = tableId.getElementsByTagName("a");


				for (var j = 0; j < tdStyle.length; j++)
				{
					if (!tdStyle[j].className) {
						tdStyle[j].style.fontSize = parseInt(nowZoom) + "px";
						tdStyle[j].style.lineHeight = parseInt(nowZoom + minZoom) + "px";
					}
				}

				for (var k = 0; k < aStyle.length; k++)
				{
					aStyle[k].style.fontSize = parseInt(nowZoom) + "px";
					aStyle[k].style.lineHeight = parseInt(nowZoom + minZoom) + "px";
				}
			}
		}
	}
}
function zoomOut() {

	//축소 하기 함수 짜세요
	if (nowZoom > minZoom)
	{
		--nowZoom;
		var strTagTable = document.getElementsByTagName("table");
		for (var i = 0; i < strTagTable.length; i++)
		{
			if (strTagTable[i].className == "list")
			{
				var strTableList = "strTableList"+i;
				var setTableId = strTagTable[i].setAttribute("id",strTableList);
				var tableId = document.getElementById(strTableList);
				var tdStyle = tableId.getElementsByTagName("td");
				var aStyle = tableId.getElementsByTagName("a");

				for (var j = 0; j < tdStyle.length; j++)
				{
					if (!tdStyle[j].className)
					{
						tdStyle[j].style.fontSize = parseInt(nowZoom) + "px";
						tdStyle[j].style.lineHeight = parseInt(nowZoom + minZoom) + "px";
					}
				}

				for (var k = 0; k < aStyle.length; k++)
				{
					aStyle[k].style.fontSize = parseInt(nowZoom) + "px";
					aStyle[k].style.lineHeight = parseInt(nowZoom + minZoom) + "px";
				}
			}
		}
	}
}

/* 화면 확대 축소 끝 */

// 제품 출력
function printPop() {
	window.open("../product/print.asp","print_win","width=518,height=658,scrollbars=no");
}

function mailToPrd(prdType) {
	window.open("../product/popMailPrd.asp?prdType="+prdType,"mail_win","width=518,height=658,scrollbars=no");
}

/*
IE, Firefox, Safari 확인한 스크립트 입니다.

글씨크기<a href=javascript:SetFontSize('B')>+</a><a href=javascript:SetFontSize( 'S')>-</a>
*/

var CurrentFontSize = 10

var CurrentLineHeight = 10

function SetFontSize(SizeFlag) {

	obj = document.getElementById("table-wrap")


	if (SizeFlag == 'B') {

		CurrentFontSize = CurrentFontSize + 1

		CurrentLineHeight = parseInt(CurrentFontSize*1.6)

		obj.style.fontSize = CurrentFontSize + "pt"

		obj.style.lineHeight = CurrentLineHeight + "pt"
	}

	else {

		if (CurrentFontSize>0) {

		CurrentFontSize = CurrentFontSize - 1

		CurrentLineHeight = parseInt(CurrentFontSize*1.6)}

		obj.style.fontSize = CurrentFontSize + "pt"

		obj.style.lineHeight = CurrentLineHeight + "pt"
	}
alert(CurrentFontSize);
}


function open_pop(path, width, height) {
	window.open(path, "led_pop", 'width='+width+',height='+height+',top=300,left=300,scrollbars=no,resizable=no');
}

/* getCookie */
function getCookie( name ){
	var nameOfCookie = name + "=";
	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 "";
}

/* setCookie */
function setCookie( name, value, expiredays )
{
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

// 전기료 절감 체험하기
function gotoGarden(){
	top.moveAction();
	top.lightMenu=[0,3];
}
