// depth제어 스크립트
var depth1 = "";
var depth2 = "";
var depth3 = "";
function setDepthVar(firVar, secVar, thrVar) {
	depth1 = firVar;
	depth2 = secVar;
	depth3 = thrVar;
}

function getHeightForDepth(val){
	switch (val){
		case 1 : return 290; break;
		case 2 : return 260; break;
		case 3 : return 200; break;
		case 4 : return 200; break;
		case 5 : return 200; break;
		case 6 : return 230; break;
		case 7 : return 110; break;
		case 9 : return 48; break;
		default : return 140;	
	}
}
function getHeightForDepth_test(val){
	switch (val){
		case 1 : return 760; break;
		case 2 : return 260; break;
		case 3 : return 200; break;
		case 4 : return 200; break;
		case 5 : return 200; break;
		case 6 : return 230; break;
		case 7 : return 110; break;
		case 9 : return 48; break;
		default : return 140;	
	}
}

function main(no) // 메인플래시메뉴
	{
		var i = no;
		switch(i){

		case 1: targeturl="/id01/"; break;
		case 2: targeturl="/id02/"; break;
		case 3: targeturl="/id03/"; break;
		case 4: targeturl="/id04/index4.html"; break;
		case 5: targeturl="/id05/index5.html"; break;
		case 6: targeturl="/id06/counsel_lst.html"; break;
		case 7: targeturl="/id07/"; break;
		case 9: targeturl="/id09/"; break;
		}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

function main_banner(no) // 메인플래시메뉴
	{
		var i = no;
		switch(i){

		case 1: targeturl="/id07/01.html"; break;
		case 2: targeturl="/id07/02.html"; break;
		case 3: targeturl="/id07/03.html"; break;
		case 4: targeturl="/id07/04.html"; break;
		case 5: targeturl="/id07/05.html"; break;
		case 6: targeturl="/id07/06.html"; break;
		case 7: targeturl="/id07/07.html"; break;
		}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

function blog(no) // 블로그
	{
		var i = no;
		switch(i){

		case 1: targeturl="http://hope.idps.co.kr/kyung/"; break;
		case 2: targeturl="http://hope.idps.co.kr/kwang/"; break;
		case 3: targeturl="http://hope.idps.co.kr/eunji/"; break;
		case 4: targeturl="http://hope.idps.co.kr/young/"; break;
		case 5: targeturl="http://hope.idps.co.kr/hyang/"; break;
		case 6: targeturl="http://hope.idps.co.kr/jiyoung/"; break;
		}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}


function sub1(no) // 병원소개
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id01/"; break;
		case 2: targeturl="/id01/index2.html"; break;
		case 3: targeturl="/id01/index3.html"; break;
		case 4: targeturl="/id01/index6.html"; break;
		case 5: targeturl="/id01/index7.html"; break;
		case 6: targeturl="/id01/index8.html"; break;
		case 7: targeturl="/id06/media.html?code=33"; break;
		case 8: targeturl="/id06/press_lst.html"; break;
		case 9: targeturl="/id06/press_lst2.html"; break;
		}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

function sub12(no) // 병원소개2 서브
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id01/index2.html"; break;
		case 2: targeturl="/id01/index4.html"; break;
		case 3: targeturl="/id01/index5.html"; break;
		}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

function sub2(no) // 턱교정센터
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id02/index.html"; break; 
		case 2: targeturl="/id02/index2.html"; break;
		case 3: targeturl="/id02/index3.html"; break; 
		case 4: targeturl="/id02/index4.html"; break; 
		case 5: targeturl="/id02/index5.html"; break; 
		case 6: targeturl="/id02/index6.html"; break; 
		case 7: targeturl="/id02/index7.html"; break; 
		case 8: targeturl="/id02/index8.html"; break; 
		}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}


function sub3(no) // 안면윤곽센터
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id03/"; break;
		case 2: targeturl="/id03/index2.html"; break;
		case 3: targeturl="/id03/index6.html"; break;
		case 4: targeturl="/id03/index3.html"; break;
		case 5: targeturl="/id03/index4.html"; break;
		case 6: targeturl="/id03/index5.html"; break;
	}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

function sub4(no) // 코성형센터
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id04/"; break;
		case 2: targeturl="/id04/index2.html"; break;
		case 3: targeturl="/id04/index3.html"; break;
		case 4: targeturl="/id04/index4.html"; break;
		}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}


function new_nose(no)
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id04/index4.html"; break;
		case 2: targeturl="/id04/index5.html"; break;
		}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

function sub5(no) // 눈/지방/쁘띠성형
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id05/"; break;
		case 2: targeturl="/id05/index2.html"; break;
		case 3: targeturl="/id05/index3.html"; break;
		case 4: targeturl="/id05/index5.html"; break;
		}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

function new_eye(no)
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id05/index5.html"; break;
		case 2: targeturl="/id05/index6.html"; break;
		}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

function sub6(no) // 게시판
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id06/counsel_lst.html"; break;	//온라인상담
		case 2: targeturl="/id06/vs_lst.html"; break;			//가상성형
		case 3: targeturl="/id06/price_lst.html"; break;		//가격문의
		case 4: targeturl="/id06/rsv/"; break;		//온라인예약
		case 5: targeturl="/id06/clip_04.html"; break;		//성형체험영상
		case 6: targeturl="/id06/index.html"; break;			//아이디병원이용법
		}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

function sub7(no) // 수술전후비교
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id07/07.html"; break;	//수술일기
		case 2: targeturl="/id07/index8.html"; break;			//수술전후사진
		}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

function link(no) // 유형별 코성형 탭메뉴
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id04/"; break;
		case 2: targeturl="/id04/index_2.html"; break;
		case 3: targeturl="/id04/index_3.html"; break;
		case 4: targeturl="/id04/index_4.html"; break;
		case 5: targeturl="/id04/index_5.html"; break;
		case 6: targeturl="/id04/index_6.html"; break;
		case 7: targeturl="/id04/index_7.html"; break;
		case 8: targeturl="/id04/index_8.html"; break;
		case 9: targeturl="/id04/index_9.html"; break;
		case 10: targeturl="/id04/index_10.html"; break;
	}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

function link_01(no) // 콤비네이션코성형 탭메뉴
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id04/index2.html"; break;
		case 2: targeturl="/id04/index2_2.html"; break;
		case 3: targeturl="/id04/index2_3.html"; break;
		case 4: targeturl="/id04/index2_4.html"; break;
	}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

	function link_02(no) // 쁘띠성형 탭메뉴
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id05/index.html"; break;
		case 2: targeturl="/id05/index_2.html"; break;
		case 3: targeturl="/id05/index_3.html"; break;
		case 4: targeturl="/id05/index_4.html"; break;
		case 5: targeturl="/id05/index_5.html"; break;
	}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}


	function link_03(no) // 쁘띠성형 탭메뉴2
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id05/index2.html"; break;
		case 2: targeturl="/id05/index2_2.html"; break;
		case 3: targeturl="/id05/index2_3.html"; break;
		case 4: targeturl="/id05/index2_4.html"; break;
	}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

	function link_jibang(no) // 지방이식 탭메뉴
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id05/index2_4.html"; break;
		case 2: targeturl="/id05/index2_5.html"; break;
		case 3: targeturl="/id05/index2_6.html"; break;
		case 4: targeturl="/id05/index2_7.html"; break;
		case 5: targeturl="/id05/index2_8.html"; break;
		case 6: targeturl="/id05/index2_4.html"; break;
		case 7: targeturl="/id05/index2_42.html"; break;
		case 8: targeturl="/id05/index2_43.html"; break;
		case 9: targeturl="/id05/index2_44.html"; break;
		case 10: targeturl="/id05/index2_45.html"; break;
		case 11: targeturl="/id05/index2_46.html"; break;
	}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}


	function link_04(no) // 눈센타 탭메뉴
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id05/index3.html"; break;
		case 2: targeturl="/id05/index3_2.html"; break;
		case 3: targeturl="/id05/index3_3.html"; break;
		case 4: targeturl="/id05/index3_4.html"; break;
	}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}


	function link_06(no) 
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id06/clip.html"; break;
		case 2: targeturl="/id06/clip_01.html"; break;
		case 3: targeturl="/id06/clip_02.html"; break;
		case 4: targeturl="/id06/clip_03.html"; break;
		case 5: targeturl="/id06/clip_04.html"; break;
		case 6: targeturl="/id06/clip_05.html"; break;
	}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

	function link_eye(no) // 눈센타 탭메뉴2
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id05/index3_2.html"; break;
		case 2: targeturl="/id05/index3_22.html"; break;
		case 3: targeturl="/id05/index3_23.html"; break;
		case 4: targeturl="/id05/index3_24.html"; break;
		case 5: targeturl="/id05/index3_25.html"; break;
		case 6: targeturl="/id05/index3_26.html"; break;
		case 7: targeturl="/id05/index3_27.html"; break;
		case 8: targeturl="/id05/index3_28.html"; break;
	}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

	function link_brow(no) //이마윤곽성형술
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id05/index2_4.html"; break;
		case 2: targeturl="/id05/index2_42.html"; break;
		case 3: targeturl="/id05/index2_43.html"; break;
		case 4: targeturl="/id05/index2_44.html"; break;
		case 5: targeturl="/id05/index2_45.html"; break;
		case 6: targeturl="/id05/index2_46.html"; break;
	}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}

	function link_09(no) // 한국에오는과정
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id09/index.html"; break;
		case 2: targeturl="/id09/index_2.html"; break;
		case 3: targeturl="/id09/index_3.html"; break;
		case 4: targeturl="/id09/index_4.html"; break;
	}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}


	function link_07(no) // 수술전후사진
	{
		var i = no;
		switch(i){
		case 1: targeturl="/id07/index8.html"; break;
		case 2: targeturl="/id07/index8_2.html"; break;
		case 3: targeturl="/id07/index8_3.html"; break;
		case 4: targeturl="/id07/index8_4.html"; break;
		case 5: targeturl="/id07/index8_5.html"; break;
		case 6: targeturl="/id07/index8_6.html"; break;
		case 7: targeturl="/id07/index8_7.html"; break;
		case 8: targeturl="/id07/index8_8.html"; break;
		case 9: targeturl="/id07/index8_9.html"; break;
		case 10: targeturl="/id07/index8_10.html"; break;
		case 11: targeturl="/id07/index8_11.html"; break;
		case 12: targeturl="/id07/index8_12.html"; break;
	}

		if(targeturl.length > 0) {
			location.href = targeturl;
		} else {
			alert('资料更新准备中');
		}
	}




// 플래시 제어 스크립트
function flash(src,w,h){
	jwill = '';
	jwill += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	jwill += '<param name="movie" value="'+src+'">';
	jwill += '<param name="quality" value="high">';
	jwill += '<param name="scale" value="exactfit">';
	jwill += '<param name="wmode" value="transparent">';
	jwill += '<param name="menu" value="false">';
	jwill += '<param name="swliveconnect" value="true">';
	jwill += '<embed src="'+src+'" quality=high wmode="transparent" menu="false" width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
	jwill += '</object>';
	document.write(jwill);
}

function privacy() {
	var px = screen.width / 2;
	window.open('/inc/privacy.htm','','width=600,height=750,left='+px+',top=10,resizable=no,scrollbars=1')
}



function round_table(objID) {
	var obj = document.getElementById(objID);
	var Parent, objTmp, Table, TBody, TR, TD;
	var bdcolor, bgcolor, Space;
	var trIDX, tdIDX, MAX;
	var styleWidth, styleHeight;
	Parent = obj.parentNode;
	objTmp = document.createElement('SPAN');
	Parent.insertBefore(objTmp, obj);
	Parent.removeChild(obj);
	bdcolor = obj.getAttribute('rborder');
	bgcolor = obj.getAttribute('rbgcolor');
	radius = parseInt(obj.getAttribute('radius'));
	if (radius == null || radius < 1) radius = 1;
	else if (radius > 6) radius = 6;
	MAX = radius * 2 + 1;
	Table = document.createElement('TABLE');
	TBody = document.createElement('TBODY');
	Table.cellSpacing = 0;
	Table.cellPadding = 0;
	for (trIDX=0; trIDX < MAX; trIDX++) {
		TR = document.createElement('TR');
		Space = Math.abs(trIDX - parseInt(radius));
		for (tdIDX=0; tdIDX < MAX; tdIDX++) {
			TD = document.createElement('TD'); 
			styleWidth = '1px'; styleHeight = '1px';
			if (tdIDX == 0 || tdIDX == MAX - 1) styleHeight = null;
			else if (trIDX == 0 || trIDX == MAX - 1) styleWidth = null;
			else if (radius > 2) {
				if (Math.abs(tdIDX - radius) == 1) styleWidth = '2px';
				if (Math.abs(trIDX - radius) == 1) styleHeight = '2px';
			}
			if (styleWidth != null) TD.style.width = styleWidth;
			if (styleHeight != null) TD.style.height = styleHeight;

			if (Space == tdIDX || Space == MAX - tdIDX - 1) TD.style.backgroundColor = bdcolor;
			else if (tdIDX > Space && Space < MAX - tdIDX - 1) TD.style.backgroundColor = bgcolor;

			if (Space == 0 && tdIDX == radius) TD.appendChild(obj);
			TR.appendChild(TD);
		}
		TBody.appendChild(TR);
	}
	Table.appendChild(TBody);
	Parent.insertBefore(Table, objTmp);
}

// 스크롤제어 스크립트
function scrollLayer(p_obj_name, p_gap_point)
	{
	var start_point, end_point, timer;
	var obj_layer   = document.getElementById(p_obj_name);  // 레이어 오브젝트
	start_point = parseInt(obj_layer.style.top, 10);
	if ( start_point < p_gap_point )    start_point = p_gap_point;
	end_point   = document.body.scrollTop + p_gap_point;
	limit_point = parseInt(window.document.body.scrollHeight) - parseInt(obj_layer.offsetHeight) - 131;
	if ( end_point > limit_point )  end_point = limit_point;
	if ( start_point != end_point )
	{
		scroll_amount = Math.ceil( Math.abs( end_point - start_point ) / 15 );
		obj_layer.style.top = parseInt(start_point, 10) + ( ( end_point < start_point ) ? -scroll_amount : scroll_amount );
	}
	timer = window.setTimeout ("scrollLayer('" + p_obj_name + "', " + p_gap_point + ");", 1);
}

function isBlank(str) {
	str = str.replace(/\s/g, '');
	return (str.length==0);
}

function resize_left(){

}
function resize_left2(){
	var obj = document.getElementById("left_Td");
	obj.style.height = getHeightForDepth_test(depth1)+"px";
}
