// popup open
function popup(page_code, code, language){
	if (page_code == "P")
	{
		var x = 337;
		var y = 247;
		var h = 548;

		if (language == "kor")
		{
			page_name = "pop.asp";
		}
		else if (language =="eng")
		{
			page_name = "pop_eng.asp";
		}		
	}
	else if (page_code == "W")
	{
		var x = 305;
		var y = 333;
		var h = 636;

		if (language == "kor")
		{
			page_name = "pop_w.asp";
		}
		else if (language =="eng")
		{
			page_name = "pop_w_eng.asp";
		}
	}

	window.open("/common/"+page_name+"?page_code="+page_code+"&code="+code,"POPUP","top="+y+",left="+x+",width=550,height="+h+",scrollbars=no,resize=no,toolbar=no,directories=no,menubar=no")
}

function pop_img_display(obj,e){
	if (e == 4)
	{
		if (obj==1)
		{
			document.all.pop_img1_area.style.display = "";
			document.all.pop_img2_area.style.display = "none";
			document.all.pop_img3_area.style.display = "none";
			document.all.pop_img4_area.style.display = "none";

			document.all.pop_img_icon1.src = "/images/port_pop_box_01.jpg";
			document.all.pop_img_icon2.src = "/images/port_pop_box_02.jpg";
			document.all.pop_img_icon3.src = "/images/port_pop_box_02.jpg";
			document.all.pop_img_icon4.src = "/images/port_pop_box_02.jpg";
		}
		else if (obj==2)
		{
			document.all.pop_img1_area.style.display = "none";
			document.all.pop_img2_area.style.display = "";
			document.all.pop_img3_area.style.display = "none";
			document.all.pop_img4_area.style.display = "none";

			document.all.pop_img_icon1.src = "/images/port_pop_box_02.jpg";
			document.all.pop_img_icon2.src = "/images/port_pop_box_01.jpg";
			document.all.pop_img_icon3.src = "/images/port_pop_box_02.jpg";
			document.all.pop_img_icon4.src = "/images/port_pop_box_02.jpg";
		}
		else if (obj==3)
		{
			document.all.pop_img1_area.style.display = "none";
			document.all.pop_img2_area.style.display = "none";
			document.all.pop_img3_area.style.display = "";
			document.all.pop_img4_area.style.display = "none";

			document.all.pop_img_icon1.src = "/images/port_pop_box_02.jpg";
			document.all.pop_img_icon2.src = "/images/port_pop_box_02.jpg";
			document.all.pop_img_icon3.src = "/images/port_pop_box_01.jpg";
			document.all.pop_img_icon4.src = "/images/port_pop_box_02.jpg";
		}
		else if (obj==4)
		{
			document.all.pop_img1_area.style.display = "none";
			document.all.pop_img2_area.style.display = "none";
			document.all.pop_img3_area.style.display = "none";
			document.all.pop_img4_area.style.display = "";

			document.all.pop_img_icon1.src = "/images/port_pop_box_02.jpg";
			document.all.pop_img_icon2.src = "/images/port_pop_box_02.jpg";
			document.all.pop_img_icon3.src = "/images/port_pop_box_02.jpg";
			document.all.pop_img_icon4.src = "/images/port_pop_box_01.jpg";
		}
	}
	else if (e == 3)
	{
		if (obj==1)
		{
			document.all.pop_img1_area.style.display = "";
			document.all.pop_img2_area.style.display = "none";
			document.all.pop_img3_area.style.display = "none";

			document.all.pop_img_icon1.src = "/images/port_pop_box_01.jpg";
			document.all.pop_img_icon2.src = "/images/port_pop_box_02.jpg";
			document.all.pop_img_icon3.src = "/images/port_pop_box_02.jpg";
		}
		else if (obj==2)
		{
			document.all.pop_img1_area.style.display = "none";
			document.all.pop_img2_area.style.display = "";
			document.all.pop_img3_area.style.display = "none";

			document.all.pop_img_icon1.src = "/images/port_pop_box_02.jpg";
			document.all.pop_img_icon2.src = "/images/port_pop_box_01.jpg";
			document.all.pop_img_icon3.src = "/images/port_pop_box_02.jpg";
		}
		else if (obj==3)
		{
			document.all.pop_img1_area.style.display = "none";
			document.all.pop_img2_area.style.display = "none";
			document.all.pop_img3_area.style.display = "";

			document.all.pop_img_icon1.src = "/images/port_pop_box_02.jpg";
			document.all.pop_img_icon2.src = "/images/port_pop_box_02.jpg";
			document.all.pop_img_icon3.src = "/images/port_pop_box_01.jpg";
		}
	}
	else if (e == 2)
	{
		if (obj==1)
		{
			document.all.pop_img1_area.style.display = "";
			document.all.pop_img2_area.style.display = "none";

			document.all.pop_img_icon1.src = "/images/port_pop_box_01.jpg";
			document.all.pop_img_icon2.src = "/images/port_pop_box_02.jpg";
		}
		else if (obj==2)
		{
			document.all.pop_img1_area.style.display = "none";
			document.all.pop_img2_area.style.display = "";

			document.all.pop_img_icon1.src = "/images/port_pop_box_02.jpg";
			document.all.pop_img_icon2.src = "/images/port_pop_box_01.jpg";
		}
	}
	else if (e == 1)
	{
		if (obj==1)
		{
			document.all.pop_img1_area.style.display = "";
			document.all.pop_img_icon1.src = "/images/port_pop_box_01.jpg";
		}
	}
}

function go_type1(p_year){
	location.href="/portfolio/portfolio_type1.asp?p_year="+p_year;
}

function go_type1_eng(p_year){
	location.href="/eng/portfolio/portfolio_type1.asp?p_year="+p_year;
}

function go_portfolio(p_type, p_year){
	if (p_type == "A" || p_type == "B")
	{
		location.href="/portfolio/portfolio_type1.asp";
	}
	else if (p_type == "C" || p_type == "D")
	{
		location.href="/portfolio/portfolio_type2_2.asp";
	}
}

function go_portfolio_eng(p_type, p_year){
	if (p_type == "A" || p_type == "B")
	{
		location.href="/eng/portfolio/portfolio_type1.asp";
	}
	else if (p_type == "C" || p_type == "D")
	{
		location.href="/eng/portfolio/portfolio_type2_2.asp";
	}
}

function recruit_apply_chk(){
	var f = document.r_apply_form;

	if (f.a_type.value == "")
	{
		alert("Áö¿øºÐ¾ß¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä.");
		f.a_type.focus();
		return false;
	}

	if (f.a_name.value == "")
	{
		alert("ÀÌ¸§À» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.a_name.focus();
		return false;
	}

	if (f.a_ssn.value == "")
	{
		alert("ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.a_ssn.focus();
		return false;
	}

	if (isNaN(f.a_ssn.value))
	{
		alert("ÁÖ¹Îµî·Ï¹øÈ£´Â ¼ýÀÚ·Î¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.a_ssn.focus();
		return false;
	}

	if (f.a_post_1.value == "" || f.a_post_2.value =="" || f.a_addr.value == "")
	{
		alert("¿ìÆí¹øÈ£¿Í ÁÖ¼Ò¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.a_addr.focus();
		return false;
	}

	if (f.a_phone_1.value == "" || f.a_phone_2.value =="" || f.a_phone_2.value == "")
	{
		alert("¿¬¶ôÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.a_phone_1.focus();
		return false;
	}

	if (f.a_email.value == "")
	{
		alert("E-MailÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.a_email.focus();
		return false;
	}

	/*
	if (f.a_homepage.value == "")
	{
		alert("È¨ÆäÀÌÁö¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.a_homepage.focus();
		return false;
	}

	if (f.a_picture.value == "")
	{
		alert("»çÁøÀ» Ã·ºÎÇØÁÖ¼¼¿ä.");
		f.a_picture.focus();
		return false;
	}

	if (f.a_school_1_1.value == "" || f.a_school_1_3.value == "")
	{
		alert("°íµîÇÐ±³ ÇÐ·Â»çÇ×À» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.a_school_1_1.focus();
		return false;
	}

	if (f.a_experience.value == "")
	{
		alert("°æ·Â»çÇ×À» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.a_experience.focus();
		return false;
	}

	if (f.a_experience2.value == "")
	{
		alert("ÀÚ°Ý»çÇ×À» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.a_experience2.focus();
		return false;
	}

	if (f.a_intro.value == "")
	{
		alert("ÀÚ±â¼Ò°³¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.a_intro.focus();
		return false;
	}

	if (f.a_portfolio.value == "")
	{
		alert("Æ÷Æ®Æú¸®¿À¸¦ Ã·ºÎÇØÁÖ¼¼¿ä.");
		f.a_portfolio.focus();
		return false;
	}
	*/
}

// ¿µ¹®Áö¿ø
function recruit_apply_chk_eng(){
	var f = document.r_apply_form;

	if (f.a_type.value == "")
	{
		alert("Please input application");
		f.a_type.focus();
		return false;
	}

	if (f.a_name.value == "")
	{
		alert("Please input your name");
		f.a_name.focus();
		return false;
	}

	if (f.a_ssn.value == "")
	{
		alert("Please input resident registration number(only number)");
		f.a_ssn.focus();
		return false;
	}

	if (isNaN(f.a_ssn.value))
	{
		alert("Please input resident registration number(only number)");
		f.a_ssn.focus();
		return false;
	}

	if (f.a_post_1.value == "" || f.a_post_2.value =="" || f.a_addr.value == "")
	{
		alert("Please input postcode and address");
		f.a_addr.focus();
		return false;
	}

	if (f.a_phone_1.value == "" || f.a_phone_2.value =="" || f.a_phone_2.value == "")
	{
		alert("Please input phone number");
		f.a_phone_1.focus();
		return false;
	}

	if (f.a_email.value == "")
	{
		alert("Please input E-mail address");
		f.a_email.focus();
		return false;
	}
	/*
	if (f.a_homepage.value == "")
	{
		alert("Please input homepage");
		f.a_homepage.focus();
		return false;
	}

	if (f.a_picture.value == "")
	{
		alert("Please submit picture");
		f.a_picture.focus();
		return false;
	}

	if (f.a_school_1_1.value == "" || f.a_school_1_3.value == "")
	{
		alert("Please input academic background");
		f.a_school_1_1.focus();
		return false;
	}

	if (f.a_experience.value == "")
	{
		alert("Please input jop experience record");
		f.a_experience.focus();
		return false;
	}

	if (f.a_experience2.value == "")
	{
		alert("Please input qualification detail");
		f.a_experience2.focus();
		return false;
	}

	if (f.a_intro.value == "")
	{
		alert("Please input self-introduction");
		f.a_intro.focus();
		return false;
	}

	if (f.a_portfolio.value == "")
	{
		alert("Please submit portfolio file");
		f.a_portfolio.focus();
		return false;
	}
	*/
}

function fileSizeChk(){

	var fso, f, s, hapsu = 0;
	
	fso = new ActiveXObject("Scripting.FileSystemObject");
	
	filespec = eval("document.r_apply_form.a_porffolio.value");
	
	if (filespec != "")
	{
		f = fso.GetFile(filespec);
		hapsu = hapsu + f.size;
	}

	alert(hapsu);

}

function postcode_chk(){
	var f = document.post_search_form;
	if (f.a_post_area.value == "")
	{
		alert("°Ë»öÇÒ Áö¿ªÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		f.a_post_area.focus();
		return false;
	}
}

function postcode_chk_eng(){
	var f = document.post_search_form;
	if (f.a_post_area.value == "")
	{
		alert("Please input address");
		f.a_post_area.focus();
		return false;
	}
}

function post_popup(){
	window.open("/recruit/recruit_postcode_pop.asp","POST_POPUP","top=100,left=100,width=392,height=260,scrollbars=no,resize=no,toolbar=no,directories=no,menubar=no");
}

function post_popup_eng(){
	window.open("/eng/recruit/recruit_postcode_pop.asp","POST_POPUP","top=100,left=100,width=392,height=260,scrollbars=no,resize=no,toolbar=no,directories=no,menubar=no");
}

function get_media_object(media_url,width,height){
	document.write("<object id='flash_player' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" + width + "' height='" + height + "' style='z-index:3;'>");
	document.write("<param name='movie' value='" + media_url + "'>");
	document.write("<param name='quality' value='high'>");
	document.write("<param name='wmode' value='transparent'>");
	document.write("<param name='FlashVars' value=''>");
	document.write("</object>");
}

function change(){
	document.r_apply_form.a_picture_file.value = document.r_apply_form.a_picture.value;
}

function change1(){
	document.r_apply_form.a_portfolio_file.value = document.r_apply_form.a_portfolio.value;
}