//---------------------------------------------------------------------------------//
//----------문자열에서 일부분을 변경하는 함수------------------------------------//
//---------------------------------------------------------------------------------//
String.prototype.replaceAll = function( searchStr, replaceStr )
{
	var temp = this;
	
	while( temp.indexOf( searchStr ) != -1 )
	{
		temp = temp.replace( searchStr, replaceStr );
	}
	
	return temp;
}

String.prototype.trim = function() {
	return this.replace(new RegExp("(^\\s*)|(\\s*$)", "g"), ""); 
}



//---------------------------------------------------------------------------------//
//----------체크박스에서 모두 체크 함수-------------------------------------------//
//---------------------------------------------------------------------------------//
function AllChk() {

    var chk = document.getElementsByName("eachCheckBox");
    if(chk != null){
	     for(var i=0; i < chk.length;i++) {
		       if(isAllCheck == true){
		      	  	  chk[i].checked = false;
		       }else{
		      		  chk[i].checked = true;
		       }      
	     }
	     if(isAllCheck == true){
	     	 isAllCheck = false;
	     }else{
	       	 isAllCheck = true;
	     }  
    }
 }     
 
  //--------------------------------------------------------------------------------//
 //----------윈도우 팝업 함수------------------------------------------------------//
  //--------------------------------------------------------------------------------//
function openPop(menu)
{
	
	var url  ;
	var wd ;
	var he  ;
	
	switch(menu) {

		case "findEmpCd":
			url="set_group.do?command=getAdminGroupList";
			//document.frmRegister.adminAuth.value = "";
			wd="500";
			he= "500";
			break;
		
				
		default :
			break;
	}

	window.open(url,"popWin","width=" + wd +",height=" + he + ",left=400,top=100,status=yes,scrolling=auto;")
}

function openPopWithParam(menu, param)
{
	
	var url  ;
	var wd ;
	var he  ;
	
	switch(menu) {
		
		case "setPrize":
			url="pop/setPrize.do?command=getPrizeList&num=" + param;
			//document.frmRegister.adminAuth.value = "";
			wd="500";
			he= "550";
			break;
				
		default :
			break;
	}

	window.open(url,"popWin","width=" + wd +",height=" + he + ",left=400,top=100,scrolling=auto;")
}


function openPopWithParams(menu, params1, params2)
{
	
	var url  ;
	var wd ;
	var he  ;

	
	switch(menu) {


		
		default :
			break;
	}

	window.open(url,"popWin","width=" + wd +",height=" + he + ",left=400,top=100,scrolling=auto;")
}
 


 //-------------------------------------------------------------------------------//
 //----------로그인 처리부분-----------------------------------------------------//
 //-------------------------------------------------------------------------------//
function login(){
	if (!validateAdminLogin()) return false;
//	document.adminLogin.submit();
}
 
function validateAdminLogin(){
	var adminID  = document.getElementById('adminId');
	var adminPWD = document.getElementById('password');
	
	if (!adminID.value.trim())
	{
		alert('아이디를 입력해 주십시오.');
		adminID.focus();
		return false;
	}
	if (!adminPWD.value.trim())
	{
		alert('비밀번호를 입력해 주십시오.');
		adminPWD.focus();
		return false;
	}
	return true;
}

function ulogin(){
	if (!validateUserLogin()) return false;
//	document.adminLogin.submit();
}
 
function validateUserLogin(){
	var userId  = document.getElementById('userId');
	var userPw = document.getElementById('userPw');
	
	if (!userId.value.trim())
	{
		alert('아이디를 입력해 주십시오.');
		userId.focus();
		return false;
	}
	if (!userPw.value.trim())
	{
		alert('비밀번호를 입력해 주십시오.');
		userPw.focus();
		return false;
	}
	return true;
}


//-------------------------------------------------------------------------------//
//----------어드민 공통 처리함수------------------------------------------------//
//-------------------------------------------------------------------------------//
var checkflag = "false";

function check(field) {
    if (checkflag == "false") {
        for (i = 0; i < field.length; i++) {
            field[i].checked = true;}
            checkflag = "true";
        return "Uncheck All"; }
    else {
        for (i = 0; i < field.length; i++) {
            field[i].checked = false; }
            checkflag = "false";
        return "Check All"; }
}



function blankCheck(eleName, message)
{
	var fValue = eleName + ".value";

	if(!eval(fValue))
	{
		alert(message);
		eval(eleName).focus();
		return false ;
	}
}


function numberCheck(eleName, message)
{
	var fValue = eleName + ".value";

	if(isNaN(fValue))
	{
		alert(message);
		eval(eleName).focus();
		return false ;
	}
}


function selectBlankCheck(form, name, message)
{
	var fValue = form + name;
	var fIndex = form + name + ".selectedIndex" ;

	if (eval(fValue)[eval(fIndex)].value == "")
	{
		alert(message);
		eval(fValue).focus();
		return false;
	}

}

function radioBlankCheck(eleName, message)
{
	var flag = false;
	var radios = eval(eleName);

	for(var i=0; i< radios.length; i++){
		
		if(radios[i].checked){
			flag=true;
		}

	}

	if(flag == false){
		alert(message);
		radios[0].focus();
	}

	return flag;

}

function emailCheck(eleName){
	
	var email = eval(eleName).value.toLowerCase();
	var atcnt = 0;
	var dotcnt =0;
	for (var i=0; i < email.length; i++) {

		var digit = email.charAt(i);
		if (digit == "@")
			{
				atcnt = atcnt+1 ;
			 }
		else if(digit == ".")
			{
				dotcnt = dotcnt +1 ;
			}
		else
			{
				atcnt =atcnt ;
				dotcnt =dotcnt ;
			}	 	
		
	} //for 끝

	if(atcnt != 1){
		alert("e-mail 형식이 잘못되었습니다. (예: lee@fursys.com )  ");
		eval(eleName).focus();
		return false;
	}
	else if(dotcnt > 2){
		alert("e-mail 형식이 잘못되었습니다. (예: lee@fursys.com )  ");
		eval(eleName).select();
		return false;
	}	
	else if(email.indexOf("@hanmail.net") > -1 || email.indexOf("@daum.net") > -1 || email.indexOf("@empal.com") > -1)
	{
		alert("다음(한메일)과 엠파스 메일외에 다른 메일을 적어주십시오.");
		eval(eleName).focus();
		return false;
	}

}
 
 
 
//-------------------------------------------------------------------------------//
//----------USER AJAX 처리-------------------------------------------------------//
//-------------------------------------------------------------------------------//

//XMLHTTPRequest 생성
function createXMLHttpRequest() {
    if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    else if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();                
    }
}




function flashApplyConfirm(empCd){
	
	createXMLHttpRequest();
	var params = "retType=checkApply&empCd=" + empCd;
	var url = "/EmployAjaxServlet";
    xmlHttp.open("POST", url, true);
    xmlHttp.onreadystatechange = callBackFlashApplyConfirm;
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    xmlHttp.send(params);
}

function callBackFlashApplyConfirm() {
    if (xmlHttp.readyState == 4) {
        if (xmlHttp.status == 200) {

        	var result = xmlHttp.responseXML.getElementsByTagName("finishYn")[0].firstChild.data;
			
			if(result == "Y"){
				alert("최종제출 하신 상태입니다.");
			}else{
				alert("지원서를 최종제출 하지 않으셨습니다.");
			}
			
			/* 
			if( confirm("작성하신 지원서를 보시겠습니까?") ){				
				goMySheetThroughStatusBar();
			}
			*/
			
			
        }
    }
}

function goFlashDelete (empCd){
	
	if (confirm("지원서 삭제를 요청하시겠습니까?")) {
	
		createXMLHttpRequest();
		var params = "retType=deleteApply&empCd=" + empCd;
		var url = "/EmployAjaxServlet";
		xmlHttp.open("POST", url, true);
		xmlHttp.onreadystatechange = callBackFlashDelete;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(params);
	}
}

function callBackFlashDelete() {
    if (xmlHttp.readyState == 4) {
        if (xmlHttp.status == 200) {

        	var result = xmlHttp.responseXML.getElementsByTagName("successYn")[0].firstChild.data;
			
			if(result == "Y"){
				alert("삭제요청이 완료되었습니다. 채용프로세스 종료이후, 약 5일 이후에 삭제됩니다.");
			}else{
				alert("예상치 못한 오류입니다. 삭제요청이 완료되지 않았습니다.");
			}
        }
    }
}






//초기화
function clear(val) {
	var obj = document.getElementById(val);
	
	while(obj.childNodes.length > 0) {
    	obj.removeChild(obj.childNodes[0]);
	}
	option = document.createElement("option");
   	option.text = "대리점 선택";
	option.value = "";
	obj.add(option);
}



function updateChart(chartSWF){
	//Create another instance of the chart.
	var chart1 = new FusionCharts(chartSWF, "chart1Id", "756", "400", "0", "0"); 
	chart1.setDataXML(strXML);
	chart1.render("irChart");
}


function loadChart(){
	if (xmlHttp.readyState == 4) {
		if (xmlHttp.status == 200) {
		
			//clearCategory();
			var result = xmlHttp.responseXML.getElementsByTagName("value");
			var obj = document.getElementById("chart");
			var type = xmlHttp.responseXML.getElementsByTagName("type")[0].firstChild.data;
			//alert(type);

			tabSet(type);


			
			var xmlData = "";

			var suffix = "";
			var precision = "";

			switch(type) {
				case "1": suffix = "억원" ; precision = "0" ; break;
				case "2": suffix = "억원" ; precision = "0" ; break;
				case "3": suffix = "원" ; precision = "0" ; break;
				case "4": suffix = "배" ; precision = "1" ; break;
				case "5": suffix = "％" ; precision = "1" ; break;
				default :
					break;
			}

			xmlData += "<graph showNames='1' numberSuffix='" + suffix  + "' bgColor='ffffff' decimalPrecision='"+ precision+ "' formatNumberScale='0' basefontsize='11' outCnvbasefontsize='12' >";
			
			for(var i=0;i<result.length;i++) {
				var value = xmlHttp.responseXML.getElementsByTagName("value")[i].firstChild.data;
				var years = xmlHttp.responseXML.getElementsByTagName("years")[i].firstChild.data;
				

				if(i != (result.length -1)){
					xmlData += "<set name='" + years +"년' value='" + value +"' color='FFFFFF'  alpha='70' />" ;
				}else{
					xmlData += "<set name='" + years +"년' value='" + value +"' color='FF0000' alpha='90' />" ;
				}
				
				
				

			}

			xmlData += "</graph>";

			//alert(xmlData);

			var chart1 = new FusionCharts("/invest/swf/FCF_Column3D.swf", "chart1Id", "756", "400", "0", "0"); 
			chart1.setDataXML(xmlData);
			chart1.render("irChart");

			


			

		

		}
	}


}


function tabSet(sel){
	
	var sel = sel + "";
	var thisSrc = document.getElementById("tab" + sel).src;
	
	if(thisSrc.indexOf("_over") != -1){
		thisSrc = thisSrc.replaceAll("_over.gif", "");
	}else{
		thisSrc = thisSrc.replaceAll(".gif", "");
	}

	var temp;
	for(i=1; i<6;i++){
		
		temp = i + "";
		
		//alert(sel + "<--->" + temp);
		
		if(sel == temp){
			//alert("same");
			//alert(thisSrc + "_over.gif");
			document.getElementById("tab" + temp).src =thisSrc + "_over.gif" ;
		}else{

			var tempSrc = document.getElementById("tab" + temp).src;
	
			if(tempSrc.indexOf("_over") != -1){
				tempSrc = tempSrc.replaceAll("_over.gif", "");
			}else{
				tempSrc = tempSrc.replaceAll(".gif", "");
			}

			document.getElementById("tab" + temp).src =tempSrc + ".gif" ;
			//alert("diff");
		}


	}

}


function tabSet6(sel){
	
	var sel = sel + "";
	var thisSrc = document.getElementById("tab" + sel).src;
	
	if(thisSrc.indexOf("_over") != -1){
		thisSrc = thisSrc.replaceAll("_over.gif", "");
	}else{
		thisSrc = thisSrc.replaceAll(".gif", "");
	}

	var temp;
	for(i=1; i<7;i++){
		
		temp = i + "";
		
		//alert(sel + "<--->" + temp);
		
		if(sel == temp){
			//alert("same");
			//alert(thisSrc + "_over.gif");
			document.getElementById("tab" + temp).src =thisSrc + "_over.gif" ;
		}else{

			var tempSrc = document.getElementById("tab" + temp).src;
	
			if(tempSrc.indexOf("_over") != -1){
				tempSrc = tempSrc.replaceAll("_over.gif", "");
			}else{
				tempSrc = tempSrc.replaceAll(".gif", "");
			}

			document.getElementById("tab" + temp).src =tempSrc + ".gif" ;
			//alert("diff");
		}


	}

}


/*
	메뉴3개 제품소개 -  Ajax 버튼
*/
function tabSet3(sel){
	
	var sel = sel + "";
	var thisSrc = document.getElementById("tab" + sel).src;
	
	if(thisSrc.indexOf("_over") != -1){
		thisSrc = thisSrc.replaceAll("_over.gif", "");
	}else{
		thisSrc = thisSrc.replaceAll(".gif", "");
	}

	var temp;
	for(i=1; i<4;i++){
		
		temp = i + "";
		
		//alert(sel + "<--->" + temp);
		
		if(sel == temp){
			//alert("same");
			//alert(thisSrc + "_over.gif");
			document.getElementById("tab" + temp).src =thisSrc + "_over.gif" ;
		}else{

			var tempSrc = document.getElementById("tab" + temp).src;
	
			if(tempSrc.indexOf("_over") != -1){
				tempSrc = tempSrc.replaceAll("_over.gif", "");
			}else{
				tempSrc = tempSrc.replaceAll(".gif", "");
			}

			document.getElementById("tab" + temp).src =tempSrc + ".gif" ;
			//alert("diff");
		}


	}

}

/*
	메뉴2개 제품소개 -  Ajax 버튼
*/
function tabSet2(sel){
	
	var sel = sel + "";
	var thisSrc = document.getElementById("tab" + sel).src;
	
	if(thisSrc.indexOf("_over") != -1){
		thisSrc = thisSrc.replaceAll("_over.gif", "");
	}else{
		thisSrc = thisSrc.replaceAll(".gif", "");
	}

	var temp;
	for(i=1; i<3;i++){
		
		temp = i + "";
		
		//alert(sel + "<--->" + temp);
		
		if(sel == temp){
			//alert("same");
			//alert(thisSrc + "_over.gif");
			document.getElementById("tab" + temp).src =thisSrc + "_over.gif" ;
		}else{

			var tempSrc = document.getElementById("tab" + temp).src;
	
			if(tempSrc.indexOf("_over") != -1){
				tempSrc = tempSrc.replaceAll("_over.gif", "");
			}else{
				tempSrc = tempSrc.replaceAll(".gif", "");
			}

			document.getElementById("tab" + temp).src =tempSrc + ".gif" ;
			//alert("diff");
		}


	}

}


function loadAgency(){
	if (xmlHttp.readyState == 4) {
		if (xmlHttp.status == 200) {
		
			//clearCategory();
			var result = xmlHttp.responseXML.getElementsByTagName("agencySeq");
			var obj = document.getElementById("agencyInfo");
			
			//alert(goodsExp);
			
	
			var subText = ""; 
			subText  += "<table cellpadding=0 cellspacing=0 border=0 class=\"table_3\" summary=\"대리점 목록\">";
			subText  += "<caption style=\"text-align:right;\"><img src=\"/img/naverApi.gif\" width=\"135\" height=\"5\" alt=\"NAVER OPENAPI\" class=\"mB10\"></caption>";
			subText  += "<colgroup>" ;
			subText  += "	<col width=\"60\">";
			subText  += "	<col width=\"90\">";
			subText  += "	<col width=\"300\">";
			subText  += "	<col width=\"170\">";
			subText  += "	<col width=\"90\">";
			subText  += "	<col width=\"50\">";
			subText  += "</colgroup>";
			subText  += "<tr>";
			subText  += "    <th class=\"head\">지역</th>               ";
			subText  += "	 <th>대리점명</th>";
			subText  += "	 <th>주소</th>";
			subText  += "	 <th>이메일</th>";
			subText  += "	 <th>전화번호</th>";
			subText  += "	 <th class=\"tail\">약도</th>";
			subText  += "</tr>";

			if(result.length == 0){

					subText  += "<tr><td colspan=6>해당지역에 대리점이 없습니다.</td></tr>";

			}else{

				for(var i=0;i<result.length;i++) {
					var area = xmlHttp.responseXML.getElementsByTagName("area")[i].firstChild.data;
					var agencyNm = xmlHttp.responseXML.getElementsByTagName("agencyNm")[i].firstChild.data;
					var post = xmlHttp.responseXML.getElementsByTagName("post")[i].firstChild.data;
					var address1 = xmlHttp.responseXML.getElementsByTagName("address1")[i].firstChild.data;
					var naveraddr = xmlHttp.responseXML.getElementsByTagName("naveraddr")[i].firstChild.data;
					var tel1 = xmlHttp.responseXML.getElementsByTagName("tel1")[i].firstChild.data;
					var fax = xmlHttp.responseXML.getElementsByTagName("fax")[i].firstChild.data;
					var email = xmlHttp.responseXML.getElementsByTagName("email")[i].firstChild.data;
					
					
					subText  += "<tr>";
					subText  += "<td>" + area  + "</td>";
					subText  += "<td class='tL2'>" + agencyNm + "</td>";
					subText  += "<td class='tL2'>" + address1 + "</td>";
					subText  += "<td class='tL2'>" + email + "</td>";
					subText  += "<td class='tL2'>" + tel1 + "</td>";
					subText  += "<td><a href=\"javascript:goMap('" + address1 + "' , '" + agencyNm  +"');\"><img src=\"/img/btn_larger.gif\" width=\"23\" height=\"19\"></a></td>";
					subText  += "</tr>";
					
				}

			}
			

			subText  += "</table>" ;
			//alert(subText);
			
			
			obj.innerHTML = subText;

		}
	}


}

function loadBookContent(){
	if (xmlHttp.readyState == 4) {
		if (xmlHttp.status == 200) {

			//alert(xmlHttp.responseText);

			var subject = xmlHttp.responseXML.getElementsByTagName("subject")[0].firstChild.data;
			var writer = xmlHttp.responseXML.getElementsByTagName("writer")[0].firstChild.data;
			var translator = xmlHttp.responseXML.getElementsByTagName("translator")[0].firstChild.data;
			var writeDate = xmlHttp.responseXML.getElementsByTagName("writeDate")[0].firstChild.data;
			var panSize = xmlHttp.responseXML.getElementsByTagName("panSize")[0].firstChild.data;
			var thumb = xmlHttp.responseXML.getElementsByTagName("thumb")[0].firstChild.data;
			var pdfNm = xmlHttp.responseXML.getElementsByTagName("pdfNm")[0].firstChild.data;
			var pdfReal = xmlHttp.responseXML.getElementsByTagName("pdfReal")[0].firstChild.data;
			var contents = xmlHttp.responseXML.getElementsByTagName("contents")[0].firstChild.data;
			var intro = xmlHttp.responseXML.getElementsByTagName("intro")[0].firstChild.data;
			var preface = xmlHttp.responseXML.getElementsByTagName("preface")[0].firstChild.data;
			var body = xmlHttp.responseXML.getElementsByTagName("body")[0].firstChild.data;

			var obj = document.getElementById("bookContent");
			
			//alert(subject);
			//return;
	
			var subText = ""; 
			subText  += "<div id=\"bookDetail\" class=\"uline\">";
			subText  += "<p>" ;
			subText  += "   <img src=\"/upload/research/book/" + thumb +"\" width=\"100\" height=\"120\" alt=\""+ subject +"\"><br />";
			subText  += "	<b>" + subject + "</b><br /><br />";
			subText  += "	펴낸날 : " + writeDate + "<br />";
			subText  += "	지은이 : " + writer + "<br />";
			subText  += "	옮긴이 : " + translator + "<br />";
			subText  += "	판형 : " + panSize  + "<br />";
			subText  += "   판매처 : ";
			

			var stores = xmlHttp.responseXML.getElementsByTagName("stores")[0]  ;
			var ppp = stores.getElementsByTagName("storeNm") ;
			
			//alert(ppp.length);
			var storeList ="";


			for(var j=0; j<ppp.length; j++){
				
					var storeNm = stores.getElementsByTagName("storeNm")[j].firstChild.data;
					var storeLink = stores.getElementsByTagName("storeLink")[j].firstChild.data;
					
					if(j==0){ 
						storeList += "";
					}else{
						storeList += ", "
					}

					storeList += "<a href=\"javascript:goStore('"+ storeLink +"');\">" + storeNm +"</a>&nbsp;&nbsp;";


			}

			subText  += storeList;

			subText  += "</p>";
			subText  += "</div> ";

			subText  += "<div><p><img src=\"/img/px.gif\" width=\"760\" height=\"1\" alt=\"가로선\"></p></div>";

			subText  += "<div id=\"bookIntro\" class=\"mB80\">";
			subText  += "<div class=\"bookIntroin\">";
			subText  += "	<dl><dt>목차</dt>";
			subText  += "	    <dd>" + contents + "</dd>";
			subText  += "   </dl>";
			subText  += "</div>";
			
			subText  += "<div class=\"clear mT5\"><p><img src=\"/img/px.gif\" width=\"760\" height=\"1\" alt=\"가로선\"></p></div>";
			

			subText  += "<div class=\"bookIntroin\">";
			subText  += "	<dl><dt>소개글</dt>";
			subText  += "	    <dd>" + intro +"</dd>";
			subText  += "   </dl>";
			subText  += "</div>";
			
			subText  += "<div class=\"clear mT5\"><p><img src=\"/img/px.gif\" width=\"760\" height=\"1\" alt=\"가로선\"></p></div>";


			subText  += "<div class=\"bookIntroin\">";
			subText  += "	<dl><dt>서문</dt>";
			subText  += "	    <dd>" + preface + "</dd>";
			subText  += "   </dl>";
			subText  += "</div>";
			
			subText  += "<div class=\"clear mT5\"><p><img src=\"/img/px.gif\" width=\"760\" height=\"1\" alt=\"가로선\"></p></div>";


			subText  += "<div class=\"bookIntroin\">";
			subText  += "	<dl><dt>본문</dt>";
			subText  += "	    <dd>" + body + "</dd>";
			subText  += "   </dl>";
			subText  += "</div>";
			
			subText  += "<div class=\"gotop\"><p><a href=\"#subHeader\"><img src=\"/research/img/btn_gotop.gif\" width=\"48\" height=\"19\" alt=\"top\"></a></p></div>";



			subText  += "<div></div>";
			subText  += "</div>";
			subText  += "</div>";
	


			
			//alert(subText);
			
			
			obj.innerHTML = subText;

		}
	}


}

/************************************************************************************************
	Naver Map Api
************************************************************************************************/


function goOutlineMap(type){
					
	var x ;
	var y ;

	var typ = type + "";

	switch(typ) {
		
		case "1":

			x= "322980"  ;
			y= "544857"  ;
			break;

		case "2":

			x= "455673"  ;  
			y= "367832"  ;
			break;

		case "3":

			x= "344311"  ;  
			y= "416416"  ;
			break;

		case "4":

			x= "489241"  ;  
			y= "286478"  ;
			break;

		case "5":

			x= "322930"  ;
			y= "544827"  ;
			break;
		
				
		default :
			x= "322930"  ;
			y= "544827"  ;
			break;
	}

	window.open("/common/map.jsp?type=" + typ +"&x=" + x + "&y=" + y ,"outlineMap","width=500,height=500")

}


 
/************************************************************************************************
	eCatalog link
************************************************************************************************/
function goCatalog(url){

	//window.open(url,"catalog","width=1000 ,height=768,left=0,top=0,status=no,scrolling=auto;");
	//javascript:ecatalog('http://www.fursys.co.kr/ebook/','fixed','2&start=14')
	//alert(url);
	ecatalog("http://www.fursys.co.kr/ebook","fixed","3&start=" + url);

}

function readyCatalog(){

	alert("준비중입니다.");
	return;
}



/************************************************************************************************
	product link
************************************************************************************************/

function goProduct(goodsSeq){

	//alert(">" + goodsSeq+  "<");
	//return;

	var itemSeq = "," + goodsSeq + "," ;
	
	var deskSeqs =",1,2,3,4,5,6,10,11,12,13,14,15,16,17,18,19,20,21";
	var chairSeqs =",22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60";
	var sofaSeqs =",61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,91";
	var sofatableSeqs = ",92,93,81,82,83,84,85,86,87,88,89,90";
	var confSeqs = ",94,95,96,97,98,99,100,101";
	var worktoolSeqs = ",102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125"
	var resiSeqs = ",127,128,129,130,131,132,133"

	if(deskSeqs.indexOf(itemSeq) != -1){
		goDesk(goodsSeq);
	}
	if(chairSeqs.indexOf(itemSeq) != -1){
		goChair(goodsSeq);
	}
	if(sofaSeqs.indexOf(itemSeq) != -1){
		goSofa(goodsSeq);
	}
	if(sofatableSeqs.indexOf(itemSeq) != -1){
		goSofatable(goodsSeq);
	}

	if(confSeqs.indexOf(itemSeq) != -1){
		goConference(goodsSeq);
	}
	if(worktoolSeqs.indexOf(itemSeq) != -1){
		goWorkTools(goodsSeq);
	}

	if(resiSeqs.indexOf(itemSeq) != -1){
		goResidence(goodsSeq);
	}

}


function goDesk(goodsSeq){
	document.location.href= "/product/desk/main.do?command=getDeskDetail&goods_seq=" + goodsSeq ; 
}

function goSofa(goodsSeq){
	document.location.href= "/product/sofa/main.do?command=getSofaDetail&goods_seq=" + goodsSeq ; 
}

function goChair(goodsSeq){
	document.location.href= "/product/chair/main.do?command=getChairDetail&goods_seq=" + goodsSeq ; 
}

function goConference(goodsSeq){
	document.location.href= "/product/conference/main.do?command=getConfDetail&goods_seq=" + goodsSeq ; 
}

function goResidence(goodsSeq){
	document.location.href= "/product/residence/main.do?command=getResidenceDetail&goods_seq=" + goodsSeq ; 
}


function goSofatable(goodsSeq){
	document.location.href= "/product/sofatable/list.do?command=getSofaTableList" ; 
}

function goWorkTools(goodsSeq){
	document.location.href= "/product/worktools/list.do?command=getWorkToolsList" ; 
}

function goChairWithMenuLoca(goodsSeq, subType){
	document.location.href= "/product/chair/main.do?command=getChairDetail&goods_seq=" + goodsSeq + "&subType=" + subType ; 
}




/************************************************************************************************
	Etc link 모든페이지와 연결되는 링크
************************************************************************************************/

function goPrize(prizeSeq){
	document.location.href= "/design/story/award_view.do?command=getAwardDetail&prizeSeq=" + prizeSeq ; 
}

function goCase(caseSeq){
	document.location.href= "/research/case_view.do?command=getCaseDetail&caseSeq=" + caseSeq ; 
}

function goExternalNews(boardSeq){
	document.location.href= "/news/external_view.do?command=getExternalDetail&boardSeq=" + boardSeq ; 
}

function goInternalNews(boardSeq){
	document.location.href= "/news/internal_view.do?command=getInternalDetail&boardSeq=" + boardSeq ; 
}

function goResult(val){
	document.location.href= "/result/result_list.do?command=getResultList&itemSeq=" + val;
}


function goWidgetResult(val){
	document.location.href= "/result/result_view.do?command=getResultDetail&resultSeq=" + val;
}


function goPopLink(val){
	
	var NewWin = window.open(val,"fursysGroup");
	if(NewWin){

      NewWin.focus();
	  
	}


}






/************************************************************************************************
	FlashObject
************************************************************************************************/

function setEmbed()
{
  var obj = new String;
  var parameter = new String;
  var embed = new String;
  var html = new String;
  var allParameter = new String;
  var clsid = new String;
  var codebase = new String;
  var pluginspace = new String;
  var embedType = new String;
  var src = new String;
  var width = new String;
  var height = new String;

  this.init = function( getType , s ,w , h, oId ) {
      if ( getType == "flash")
      {
        clsid = "D27CDB6E-AE6D-11cf-96B8-444553540000";       
        codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0";
        pluginspage = "http://www.macromedia.com/go/getflashplayer";
        embedType = "application/x-shockwave-flash";
      }

      else if (getType == "movie" )
      {
        clsid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ;
        codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" ;
        embedType="application/x-oleobject" ;
        //embedType="application/x-mplayer2";
        pluginspage="http://www.microsoft.com/windows/mediaplayer/download/default.asp"
      }

      /* type 추가
      else if ( )
      {
      }
      */    

      parameter += "<param name='movie' value='"+ s + "'>\n"; 
      parameter += "<param name='quality' value='high'>\n";       

      src = s;
      width = w;
      height = h;
      objId= oId;
  }

  this.parameter = function( parm , value ) {     
      parameter += "<param name='"+parm +"' value='"+ value + "'>\n";       
      allParameter += " "+parm + "='"+ value+"'";
  } 

  this.show = function() {
      if ( clsid )
      {
        obj = "<object id=" + objId + " classid=\"clsid:"+ clsid +"\" codebase=\""+ codebase +"\" width='"+ width +"' height='"+ height +"' value='" + objId + "'>\n";
      }
       embed = "<embed src='" + src + "' pluginspage='"+ pluginspage + "' type='"+ embedType + "' width='"+ width + "' height='"+ height +"'"+ allParameter +" ></embed>\n";

      if ( obj )
      {
        embed += "</object>\n";
      }

	  
      html = obj + parameter + embed;
      document.write( html ); 

  }
}





/* 목록에서 내용 바로 펼치기 - 개인정보취급방침 */
function blcclick(lvw1,onof1,lvw2,lvw3,onof2) {
	document.getElementById(lvw1).style.display=onof1;
	document.getElementById(lvw2).style.display=onof2;
	document.getElementById(lvw3).style.display=onof2;
}




/************************************************************************************************
	주민번호 체크 로직
************************************************************************************************/

function JuminCheck(jumin1, jumin2){
	 check = false;
	 total = 0;
	 temp = new Array(13);
	
	 for(i=1; i<=6; i++) temp[i] = jumin1.charAt(i-1);
	 for(i=7; i<=13; i++) temp[i] = jumin2.charAt(i-7);
	 
	 for(i=1; i<=12; i++){
		  k = i + 1;
		  if(k >= 10)
		   k = k % 10 + 2;
		  total = total + temp[i] * k;
	 }

	 mm = temp[3] + temp[4];
	 dd = temp[5] + temp[6];
	
	 totalmod = total % 11;

	 chd = 11 - totalmod;

	 if(chd == 11){
		 chd = 1;
	 }
	 else if(chd == 10){
		 chd = 0;
	 }
	 
	 if(chd == temp[13] && mm < 13 && dd < 32 && (temp[7]==1 || temp[7]==2))  check=true;

	 return check;
}



function setAddr(postname, addrname){
	window.open("/common/search_zipcode.jsp?mode=w&postname=" + postname + "&addrname=" + addrname, "setPost", "width=420,height=400, scrollbars=yes ");
}




// -------------------------------------------그룹 채용에서 쓰는 것 -------------------------------------------//

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



//----------숫자만 입력받는 자바스크립트-------------------------------------------//
function checkNumber(){
    var objEv = event.srcElement;
    var numPattern = /([^0-9])/;
    numPattern = objEv.value.match(numPattern);
    if(numPattern != null){
        alert("숫자만 입력해 주세요!");
        objEv.value="";
        objEv.focus();
        return ;
    }else{
		
		//alert(objEv.value);
		
		var str = objEv.value;
		var len = str.length;
		
		if(len==1){
			objEv.value = "0" + str;
		}
		
	}
}

function checkNumberWithoutZero(){
    var objEv = event.srcElement;
    var numPattern = /([^0-9])/;
    numPattern = objEv.value.match(numPattern);
    if(numPattern != null){
        alert("숫자만 입력해 주세요!");
        objEv.value="";
        objEv.focus();
        return ;
    }else{
		
		//alert(objEv.value);
		
		var str = objEv.value;
		var len = str.length;
		
		objEv.value = str;
		
	}
}

function checkYear(){
    var objEv = event.srcElement;
    var numPattern = /([^0-9])/;
    numPattern = objEv.value.match(numPattern);
    if(numPattern != null){
        alert("숫자만 입력해 주세요!");
        objEv.value="";
        objEv.focus();
        return ;
    }else{
		
		//alert(objEv.value);
		
		var str = objEv.value;
		var len = str.length;
		
		if(len != 4){
			alert("년도는 4자리(YYYY) 로 입력해 주세요!");
        	objEv.value="";
        	objEv.focus();
		}
		
	}
}


function checkHakJum(){
	
    var obj = event.srcElement.value;
	
	if ( !(!isNaN( parseFloat(obj) ) && isFinite( obj )) ) {
    	alert("숫자와 .만 입력해 주세요!");
        objEv.value="";
        objEv.focus();
        return ;
	};

}




//----------문자숫자 체크-------------------------------------------//




//----------나의지원현황 div 높이 리사이즈-------------------------------------------//
function flashResize(id,wid,hei){
	var flashEl = 	document.getElementById(id);
	if (id == "shopProduct") {
		flashEl.style.width = wid + "px";
		flashEl.style.height = hei + "px";
	} else if (id == "subNavi") {
		flashEl.style.width = wid + "px";
	} else {	
		flashEl.style.height = hei + "px";
	}
}




function statusAlert( msg ){
	
	alert(msg);
	return;
}


function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName]
	}
	else {
		return document[movieName]
	}
}


function open_search(){
	
	//dalert("adf__"+thisMovie("ria_search"));
    thisMovie("mstatus").toggle_ria_search();
}


function getMyNotice(){
	
	openDialogBox('cscenterGuide', 'center');
}





