function getCtrtLsit(cityCode, type) {
	var ObjSel = null;
	if (type=='POL'){
	   	ObjSel = document.form1.POL_CODE;
	} else {
	  	ObjSel = document.form1.POD_CODE;
	}

	if(cityCode != "") {
		var xmlHttp = getHttpRequest();
		if (xmlHttp != null){
			var sURL = "/eshipping/eshipping.ysc";			
			var msg = "_method=getPolLsit&POI_CTRY="+cityCode;
			xmlHttp.open("POST", sURL, false);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
			xmlHttp.send(msg);
			if (xmlHttp.readyState == 4) {
				if(xmlHttp.status == 200){
					msg = xmlHttp.responseText;
					if (msg =="<><>"){
						ObjSel.options[0] = new Option("데이터가없습니다.","");
					} else {
						
					    var ObjSel = getObjSel(type);
						viewPolList(msg,ObjSel);
					}
				} else {
					alert("서버와의 통신에 장애가 있습니다![status:" + xmlHttp.status +"]");
				}
			} else {
				alert("서버와의 통신에 장애가 있습니다![readyState:"+ xmlHttp.readyState+"]");
			}	
		} else {
			selText(ObjSel);
			chgPort();
		}
	} else {
		fnSetSubAreaRemove(ObjSel);
		ObjSel.options[0] = new Option("선택하세요.","");
	}
}


function viewPolList(msg, ObjSel){
	
    var response = msg.split("<><>");
    var code = response[0].split("^-^");
    var name = response[1].split("^-^");
    
    fnSetSubAreaRemove(ObjSel);
    
    if(code.length-1 != 0){  
    	ObjSel.options[0] = new Option("선택하세요.","");
        for(i=0; i < code.length-1 ; i++){
        	//alert(name[i]+"====="+code[i]);
        	ObjSel.options[i+1] = new Option(name[i],code[i]); 
        }
    } else {
    	if(ObjSel.length<1) {
			ObjSel.options[0] = new Option("선택하세요.","");
		}
    }
}

function fnSetSubAreaRemove(ObjSel){           
    for(i=ObjSel.length; i>-1; i--){
        ObjSel.remove(i); 
    }    
}




function getHttpRequest(){
	var xmlCall = null;
	try {
		// IE 7 or none IE 
		xmlCall = new XMLHttpRequest();  
	} catch (e) {
		// IE 5, 6
		try {
			xmlCall = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlCall = new ActiveXObject("Microsoft.XMLHTTP");
			}catch (e) {	
				xmlCall = null; // can't instantiate caller
			}
		}
	}
	return xmlCall;
}

function getObjSel(type){
    var ObjSel = null;
	if (type=='POL'){
    	ObjSel = document.form1.POL_CODE;
    } else if (type=='POD'){
    	ObjSel = document.form1.POD_CODE;
    } else if (type=='FRPORT'){
    	ObjSel = document.form1.FR_PORT;
    } else if (type=='TOPORT'){
    	ObjSel = document.form1.TO_PORT;
    }
	
	return ObjSel;

}

function getPickUpPlaceList(polCode, pickUpPlaceCode)
{
	var ObjSel = null;
	ObjSel = document.form1.PICKUP_CY_CODE1;

	if(polCode != "") {
		var xmlHttp = getHttpRequest();
		if (xmlHttp != null){
			var sURL = "/eshipping/eshipping.ysc";			
			var msg = "_method=getPickUpPlaceList&POL_CODE="+polCode;
			xmlHttp.open("POST", sURL, false);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
			xmlHttp.send(msg);
			if (xmlHttp.readyState == 4) {
				if(xmlHttp.status == 200){
						msg = xmlHttp.responseText;
					// 2010.07.16 삭제
					if (msg =="<><>")
					{
						ObjSel.options[0] = new Option("데이터가없습니다.","");
					}
					else
					{
						viewPickUpPlaceList(msg, ObjSel, pickUpPlaceCode);
					}
				} else {
					alert("서버와의 통신에 장애가 있습니다![status:" + xmlHttp.status +"]");
				}
			} else {
				alert("서버와의 통신에 장애가 있습니다![readyState:"+ xmlHttp.readyState+"]");
			}
		} else {
		alert("서버와의 통신에 장애가 있습니다!");
		}
	}
	// 2010.07.16 삭제
	else
	{
		resetPickUpPlaceList(ObjSel);
		ObjSel.options[0] = new Option("선택하세요.","");
	}
}

function viewPickUpPlaceList(msg, ObjSel, pickUpPlaceCode)
{
    var response = msg.split("<><>");
    var code = response[0].split("^-^");
    var name = response[1].split("^-^");
    var sameSeq = 0;
	// 2010.07.16 삭제
    resetPickUpPlaceList(ObjSel);

    if(code.length-1 != 0)
    {
    	// 2010.07.16 삭제
    	ObjSel.options[0] = new Option("선택하세요.","");

        for (i = 0; i < code.length-1 ; i++)
        {
        	//alert(name[i]+"====="+code[i]);
        	// 2010.07.16 삭제
        	ObjSel.options[i+1] = new Option(name[i],code[i]); 

        	if (code[i] == pickUpPlaceCode)
        	{
        		sameSeq = i + 1;
        	}
        }
    }
    // 2010.07.16 삭제
    else
    {
    	if (ObjSel.length < 1)
    	{
			ObjSel.options[0] = new Option("선택하세요.","");
		}
    }
    ObjSel.options[sameSeq].selected = true;
}

function resetPickUpPlaceList(ObjSel)
{
    for (i = ObjSel.length; i > -1; i--)
    {
        ObjSel.remove(i);
    }    
}

//////////////////////////////////////////////////////////////////////////////////////////////////////
//  컨테이너 타입 리스트 받아오기 Ajax Start
function getContrTypeList(contrSeq, typeCode) {
	realSeq = contrSeq - 1;
	var objSelList = document.getElementsByName("CONTAINER_TYPE");
	var ObjSel = null;
	ObjSel = objSelList[realSeq];
	
	var xmlHttp = getHttpRequest();
	if (xmlHttp != null){
		var sURL = "/eshipping/eshipping.ysc";			
		var msg = "_method=getContrTypeList";
		xmlHttp.open("POST", sURL, false);
		xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
		xmlHttp.send(msg);
		if (xmlHttp.readyState == 4) {
			if(xmlHttp.status == 200){
				msg = xmlHttp.responseText;

				if (msg =="<><>")
				{
					ObjSel.options[0] = new Option("데이터가없습니다.","");
				}
				else
				{
					viewContrTypeList(msg, typeCode, ObjSel);
				}
			} else {
				alert("서버와의 통신에 장애가 있습니다![status:" + xmlHttp.status +"]");
			}
		} else {
			alert("서버와의 통신에 장애가 있습니다![readyState:"+ xmlHttp.readyState+"]");
		}	
	} else {
		alert("서버와의 통신에 장애가 있습니다!");
	}
}

function viewContrTypeList(msg, typeCode, ObjSel)
{
	var response = msg.split("<><>");
    var code = response[0].split("^-^");
    var name = response[1].split("^-^");
    var sameSeq = 0;
    
    resetContrTypeList(ObjSel);
    
    if(code.length-1 != 0)
    {  
    	ObjSel.options[0] = new Option("선택하세요.","");

        for (i = 0; i < code.length-1 ; i++)
        {
        	ObjSel.options[i+1] = new Option(name[i],code[i]);

        	if (code[i] == typeCode)
        	{
        		sameSeq = i + 1;
        	}
        }
    }
    else
    {
    	if (ObjSel.length < 1)
    	{
			ObjSel.options[0] = new Option("선택하세요.","");
		}
    }
    ObjSel.options[sameSeq].selected = true;
}

function resetContrTypeList(ObjSel)
{           
    for (i = ObjSel.length; i > -1; i--)
    {
        ObjSel.remove(i);
    }    
}
//컨테이너 타입 리스트 받아오기 Ajax End
//////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////
//컨테이너 사이즈 리스트 받아오기 Ajax Start
function getContrSizeList(contrSeq, typeCode, sizeCode)
{
	realSeq = contrSeq - 1;
	var objSelList = document.getElementsByName("CONTAINER_SIZE");
	var ObjSel = null;
	ObjSel = objSelList[realSeq];
	
	if (typeCode != "")
	{
		var xmlHttp = getHttpRequest();

		if (xmlHttp != null)
		{
			var sURL = "/eshipping/eshipping.ysc";			
			var msg = "_method=getContrSizeList&TYPE_CODE="+typeCode;
			xmlHttp.open("POST", sURL, false);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
			xmlHttp.send(msg);

			if (xmlHttp.readyState == 4)
			{
				if (xmlHttp.status == 200)
				{
					msg = xmlHttp.responseText;

					if (msg == "<><>")
					{
						ObjSel.options[0] = new Option("데이터가없습니다.","");
					}
					else
					{
						viewRefContrSizeList(msg, sizeCode, ObjSel);
					}
				} else {
					alert("서버와의 통신에 장애가 있습니다![status:" + xmlHttp.status +"]");
				}
			} else {
				alert("서버와의 통신에 장애가 있습니다![readyState:"+ xmlHttp.readyState+"]");
			}	
		}
		else
		{
		alert("서버와의 통신에 장애가 있습니다!");
		}
	}
	else
	{
		resetContrSizeList(ObjSel);
		ObjSel.options[0] = new Option("선택하세요.","");
	}
}

function viewRefContrSizeList(msg, sizeCode, ObjSel)
{
	var response = msg.split("<><>");
    var code = response[0].split("^-^");
    var name = response[1].split("^-^");
    var sameSeq = 0;

    resetContrSizeList(ObjSel);
    
    if (code.length-1 != 0)
    {
 		ObjSel.options[0] = new Option("선택하세요.","");

        for (i = 0; i < code.length-1 ; i++)
        {
        	ObjSel.options[i+1] = new Option(name[i],code[i]);

        	if (code[i] == sizeCode)
        	{
        		sameSeq = i + 1;
        	} 
        }
    }
    else
    {
    	if (ObjSel.length < 1)
    	{
			ObjSel.options[0] = new Option("선택하세요.","");
		}
    }
    ObjSel.options[sameSeq].selected = true;
}

function resetContrSizeList(ObjSel)
{
	// 2010.07.16 추가
	if (ObjSel)
	{
    	for (i = ObjSel.length; i > -1; i--)
		{
        	ObjSel.remove(i);
    	}
    }
}
//컨테이너 사이즈 리스트 받아오기 Ajax End
//////////////////////////////////////////////////////////////////////////////////////////////////////


function getPickUpDateList(contrSeq, vslCode, voy, bound, polCode, otChk, dangerChk, oogChk, refDate) {
	realSeq = contrSeq - 1;
	var objSelList = document.getElementsByName("PICKUP_DATE_YMD");
	var ObjSel = null;
	// 2010.07.23 추가
	var strPickUpDate = "";
	
	ObjSel = objSelList[realSeq];

	if (contrSeq != "")
	{
		var xmlHttp = getHttpRequest();

		if (xmlHttp != null)
		{
			var sURL = "/eshipping/eshipping.ysc";			
			var msg = "_method=getPickUpDateList&VSL_CODE="+vslCode+"&VOY="+voy+"&BOUND="+bound+"&POL_CODE="+polCode+"&OT_CHK="+otChk+"&DANGER_CHK="+dangerChk+"&OOG_CHK="+oogChk;

			xmlHttp.open("POST", sURL, false);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
			xmlHttp.send(msg);

			if (xmlHttp.readyState == 4)
			{
				if (xmlHttp.status == 200)
				{
					msg = xmlHttp.responseText;

					if (msg =="<><>" && refDate == "")
					{
						ObjSel.options[0] = new Option("데이터가없습니다.","");
					}
					else
					{
						// 2010.07.23 변경
//						viewPickUpDateList(msg, refDate, ObjSel);
						strPickUpDate = viewPickUpDateList(msg, refDate, ObjSel);
					}
				}
				else
				{
					alert("서버와의 통신에 장애가 있습니다!");
				}
			}
			else
			{
				alert("서버와의 통신에 장애가 있습니다!");
			}	
		}
		else
		{
			alert("서버와의 통신에 장애가 있습니다!");
		}
	}
	else
	{
		resetContrSizeList(ObjSel);
		ObjSel.options[0] = new Option("선택하세요.","");
	}
	// 2010.07.23 추가
	return strPickUpDate;
}

function viewPickUpDateList(msg, refDate, ObjSel)
{
    var response = msg.split("<><>");
    var code = response[0].split("^-^");
    var name = response[1].split("^-^");
    var sameSeq = 0;

    resetContrSizeList(ObjSel);
    
    if(code.length-1 != 0)
    {  
    	// 2010.07.16 추가
    	if (ObjSel)
    	{
    		ObjSel.options[0] = new Option("선택하세요.","");
    	
        	for (i = 0; i < code.length-1; i++)
       	{
        		ObjSel.options[i+1] = new Option(name[i],code[i]); 

        		if (code[i] == refDate)
        		{
        			sameSeq = i + 1;
        		} 
        	}
        }
    }
    else
    {
    	if (ObjSel.length < 1)
    	{
			ObjSel.options[0] = new Option("선택하세요.","");
		}
    }
    // 2010.07.16 추가
    if (ObjSel) {
		if (sameSeq == 0 && refDate.length != 0)
		{
			if(code.length == 0)
            {
				ObjSel.options[1] = new Option(refDate.substring(0,4)+"."+refDate.substring(4,6)+"."+refDate.substring(6,8),refDate);
				ObjSel.options[1].selected = true;
            }
			else
            {
				ObjSel.options[code.length] = new Option(refDate.substring(0,4)+"."+refDate.substring(4,6)+"."+refDate.substring(6,8),refDate); 
				ObjSel.options[code.length].selected = true;
			}	
		}
		else
		{ 
			ObjSel.options[sameSeq].selected = true;
		}
	}
	// 2010.07.23 추가
    return name;
}

function resetPickUpDateList(ObjSel){           
    for(i=ObjSel.length; i>-1; i--){
        ObjSel.remove(i);
    }    
}

function ajaxGetDgApplication(contrSeq, refNo) {
	realSeq = contrSeq - 1;
	var objSelList = document.getElementsByName("dginfo00_0" + contrSeq);
	
	if(contrSeq != "" && refNo != "") {
		var xmlHttp = getHttpRequest();
		if (xmlHttp != null){
			var sURL = "/eshipping/eshipping.ysc";			
			var msg = "_method=ajaxGetDgApplication&REF_NO="+refNo;
			xmlHttp.open("POST", sURL, false);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
			xmlHttp.send(msg);
			if (xmlHttp.readyState == 4) {
				if(xmlHttp.status == 200){
					msg = xmlHttp.responseText;
					if (msg =="<><>"){
						alert("DG 데이터 오류입니다.");
					} else {
						var response = msg.split("<><>");
						var header = response[0].split("^_^");
						var details = response[1].split("[-]");

						addDGHeader("dginfo00_0" + contrSeq, header[0], header[1], contrSeq);
						
						for(i=0; i < details.length-1 ; i++){
							var detail = details[i].split("^_^");
							//jhlee 2010.08.29
							addDG("dginfo00_0" + contrSeq, detail[0], detail[1], detail[2], detail[3], detail[4], detail[5], detail[6], detail[7], detail[8], contrSeq);
						}
					}
				} else {
					alert("서버와의 통신에 장애가 있습니다!");
				}
			} else {
				alert("서버와의 통신에 장애가 있습니다!");
			}	
		} else {
		alert("서버와의 통신에 장애가 있습니다!");
		}
	}
}

//jhlee 2010.08.29 작업중
function ajaxGetDgDetail(contrSeq, refNo) {
	realSeq = contrSeq - 1;
	var objSelList = document.getElementsByName("dginfo00_0" + contrSeq);
	
	if(contrSeq != "" && refNo != "") {
		var xmlHttp = getHttpRequest();
		if (xmlHttp != null){
			var sURL = "/eshipping/eshipping.ysc";			
			var msg = "_method=ajaxGetDgApplication&REF_NO="+refNo;
			xmlHttp.open("POST", sURL, false);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
			xmlHttp.send(msg);
			if (xmlHttp.readyState == 4) {
				if(xmlHttp.status == 200){
					msg = xmlHttp.responseText;
					if (msg =="<><>"){
						alert("DG 데이터 오류입니다.");
					} else {
						var response = msg.split("<><>");
						var header = response[0].split("^_^");
						var details = response[1].split("[-]");
						
						addDGHeader("dginfo00_0" + contrSeq, header[0], header[1], contrSeq);
						
						for(i=0; i < details.length-1 ; i++){
							var detail = details[i].split("^_^");
							//jhlee 2010.08.29
							addDG("dginfo00_0" + contrSeq, detail[0], detail[1], detail[2], detail[3], detail[4], detail[5], detail[6], detail[7], detail[8], contrSeq);
						}
					}
				} else {
					alert("서버와의 통신에 장애가 있습니다!");
				}
			} else {
				alert("서버와의 통신에 장애가 있습니다!");
			}	
		} else {
		alert("서버와의 통신에 장애가 있습니다!");
		}
	}
}

function ajaxGetOogApplication(contrSeq, refNo) {
	realSeq = contrSeq - 1;
	var objSelList = document.getElementsByName("ooginfo00_0" + contrSeq);
	
	if(contrSeq != "" && refNo != "") {
		var xmlHttp = getHttpRequest();
		if (xmlHttp != null){
			var sURL = "/eshipping/eshipping.ysc";			
			var msg = "_method=ajaxGetOogApplication&REF_NO="+refNo;
			xmlHttp.open("POST", sURL, false);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
			xmlHttp.send(msg);
			if (xmlHttp.readyState == 4) {
				if(xmlHttp.status == 200){
					msg = xmlHttp.responseText;
					if (msg =="<><>"){
						alert("OOG 데이터 오류입니다.");
					} else {
						var response = msg.split("<><>");
						var header = response[0].split("^_^");
						var details = response[1].split("[-]");
						
						//alert(header);
						addOOGHeader("ooginfo00_0" + contrSeq, header[0], header[1], header[2], header[3], contrSeq);
						
						for(i=0; i < details.length-1 ; i++){
							var detail = details[i].split("^_^");
							addOOG("ooginfo00_0" + contrSeq, detail[0], detail[1], detail[2], detail[3], detail[4], detail[5], detail[6], detail[7], detail[8], detail[9], detail[10], contrSeq);
						}
					}
				} else {
					alert("서버와의 통신에 장애가 있습니다![status:" + xmlHttp.status +"]");
				}
			} else {
				alert("서버와의 통신에 장애가 있습니다![readyState:"+ xmlHttp.readyState+"]");
			}	
		} else {
		alert("서버와의 통신에 장애가 있습니다!");
		}
	}
}

function ajaxGetTracingContrInfo(blNo, contrNo) {
	if(blNo != "" && contrNo != "") {
		var xmlHttp = getHttpRequest();
		if (xmlHttp != null){
			var sURL = "/eshipping/eshipping.ysc";			
			var msg = "_method=ajaxGetTracingContrInfo&BL_NO=" + blNo + "&CONTR_NO=" + contrNo;
			xmlHttp.open("POST", sURL, false);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
			xmlHttp.send(msg);
			if (xmlHttp.readyState == 4) {
				if(xmlHttp.status == 200){
					msg = xmlHttp.responseText;
					var response = msg.split("<><>");
					
					document.getElementById("contrDiv").style.display = "";
					allDelRow();
					if(msg != ""){
						for(i=0; i < response.length-1 ; i++){
							var contrInfo = response[i].split("^_^");
							showContrInfo(contrInfo[0], contrInfo[1], contrInfo[2]);
						}
					} else {
						showContrInfoEmpty();
					}
				} else {
					alert("서버와의 통신에 장애가 있습니다!");
				}
			} else {
				alert("서버와의 통신에 장애가 있습니다!");
			}	
		} else {
		alert("서버와의 통신에 장애가 있습니다!");
		}
	}
}

function ajaxGetSRInfo(blNo, divFlag) {
	if(blNo != "" && divFlag != "") {
		var xmlHttp = getHttpRequest();
		if (xmlHttp != null){
			var sURL = "/eshipping/eshipping.ysc";			
			var msg = "_method=ajaxGetSRInfo&BL_NO=" + blNo + "&DIV_FLAG=" + divFlag;
			xmlHttp.open("POST", sURL, false);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
			xmlHttp.send(msg);
			if (xmlHttp.readyState == 4) {
				if(xmlHttp.status == 200){
					msg = xmlHttp.responseText;
					var response = msg.split("^_^");
						
					if(msg != ""){
						var f = document.form1;
						
						f.SHIPPER.value			= response[0];
						f.CONSIGNEE.value		= response[1];
						f.NOTIFY_PARTY.value	= response[2];
						if(response[3] == "Y"){
							f.FRWD_CONSOLE[0].checked;
						}
						if(response[3] == "N"){
							f.FRWD_CONSOLE[1].checked;
						}
						f.ITEM_CODE_TOT.value	= response[4];
						f.ITEM_NAME_TOT.value	= response[5];
						f.SHIP_MARK.value		= response[6];
						f.DESCRIPTION.value		= response[7];
						f.RIDER.value			= response[8];
						f.DESCRIPTION_t.value	= response[7];
						if(response[8] != null && response[8] != ""){
							f.DESCRIPTION_t.value	= f.DESCRIPTION_t.value	+ "\r\n" + response[8];
						}
						if(response[9] == "O"){
							f.BL_TYPE[0].checked;
						}
						if(response[9] == "S"){
							f.BL_TYPE[1].checked;
						}
						if(response[9] == "W"){
							f.BL_TYPE[2].checked;
						}
						if(response[10] == "PP"){
							f.FRT_TERM_FLAG[0].checked;
						}
						if(response[10] == "CC"){
							f.FRT_TERM_FLAG[1].checked;
						}
						
						//2010.10.16
						f.PKG_CONTR_TOTAL.value	= response[11];
						f.PKG_UNIT_CONTR_TOTAL.value	= response[12];
						f.WGT_CONTR_TOTAL.value	= response[13];
						f.MSR_TOTAL.value	= response[14];
						resetContrInfo();
						
					} else {
						alert("검색된 정보가 없습니다.");
					}
				} else {
					alert("서버와의 통신에 장애가 있습니다!");
				}
			} else {
				alert("서버와의 통신에 장애가 있습니다!");
			}	
		} else {
		alert("서버와의 통신에 장애가 있습니다!");
		}
	}
}

/////////////



function ajaxGetWHList(blNo, ocCode){
	var ObjSel = null;
  	ObjSel = document.form1.WH_CODE;

	if(ocCode != "" && ocCode != "A" && ocCode != "S" && ocCode != "Z") {
		var xmlHttp = getHttpRequest();
		if (xmlHttp != null){
			var sURL = "/eshipping/eshipping.ysc";			
			var msg = "_method=getWHList&BL_NO="+blNo+"&WH_ALLOC_CODE="+ocCode;
			xmlHttp.open("POST", sURL, false);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
			xmlHttp.send(msg);
			if (xmlHttp.readyState == 4) {
				if(xmlHttp.status == 200){
					msg = xmlHttp.responseText;
					if (msg =="<><>"){
						fnSetSubAreaRemove(ObjSel);
						ObjSel.options[0] = new Option("데이터가없습니다.","");
					} else {
					    viewWHList(msg,ObjSel);
					}
				} else {
					alert("서버와의 통신에 장애가 있습니다!");
				}
			} else {
				alert("서버와의 통신에 장애가 있습니다!");
			}	
		} else {
			fnSetSubAreaRemove(ObjSel);
			ObjSel.options[0] = new Option("선택하세요.","");
		}
	} else {
		fnSetSubAreaRemove(ObjSel);
		ObjSel.options[0] = new Option("선택하세요.","");
	}
}


function viewWHList(msg, ObjSel){
	
	var response = msg.split("<><>");
    var code = response[0].split("^-^");
    var name = response[1].split("^-^");
    
    fnSetSubAreaRemove(ObjSel);
    
    if(code.length-1 != 0){  
    	ObjSel.options[0] = new Option("선택하세요.","");
        for(i=0; i < code.length-1 ; i++){
        	ObjSel.options[i+1] = new Option(name[i],code[i]); 
        }
    } else {
    	if(ObjSel.length<1) {
			ObjSel.options[0] = new Option("선택하세요.","");
		}
    }
}
/*
//jhlee 2010.09.08 packing type list
function ajaxGetPackingTypeList(packing_instruction) {
	//var objSelList = document.getElementsByName("ooginfo00_0" + contrSeq);
	
	if(packing_instruction != "") {
		var xmlHttp = getHttpRequest();
		if (xmlHttp != null){
			var sURL = "/eshipping/eshipping.ysc";			
			var msg = "_method=ajaxGetPackingTypeList&PK_IN="+packing_instruction;
			xmlHttp.open("POST", sURL, false);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
			xmlHttp.send(msg);
			if (xmlHttp.readyState == 4) {
				if(xmlHttp.status == 200){
					msg = xmlHttp.responseText;
					if (msg =="<><>"){
						alert("데이터가 없습니다.");
					} else {
						var response = msg.split("<><>");
						
						for(i=0; i < response.length-1 ; i++){
							var details = response[i].split("^_^");
							if ( i == 0 ) 	alert(details[0]);
							//addPackingType("ooginfo00_0" + contrSeq, detail[0], detail[1], detail[2], detail[3], detail[4], detail[5], detail[6], detail[7], detail[8], detail[9], detail[10], contrSeq);
						}						
					}
				} else {
					alert("서버와의 통신에 장애가 있습니다![status:" + xmlHttp.status +"]");
				}
			} else {
				alert("서버와의 통신에 장애가 있습니다![readyState:"+ xmlHttp.readyState+"]");
			}	
		} else {
		alert("서버와의 통신에 장애가 있습니다!");
		}
	}
}
*/

//컨테이너 번호 유효성 확인 2010.10.16
function ajaxCheckContrNo(cntrno, bookingno) {
	
	var retMsg = "<><>";
	if(cntrno != "") {
		var xmlHttp = getHttpRequest();
		if (xmlHttp != null){
			var sURL = "/eshipping/eshipping.ysc";			
			var msg = "_method=ajaxCheckContrNo&CONTR_NO="+cntrno+"&BOOK_NO="+bookingno;
			xmlHttp.open("POST", sURL, false);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
			xmlHttp.send(msg);
			if (xmlHttp.readyState == 4) {
				if(xmlHttp.status == 200){
					retMsg = xmlHttp.responseText;
					return retMsg;

				} else {
					alert("서버와의 통신에 장애가 있습니다![status:" + xmlHttp.status +"]");
				}
			} else {
				alert("서버와의 통신에 장애가 있습니다![readyState:"+ xmlHttp.readyState+"]");
			}	
		} else {
			alert("서버와의 통신에 장애가 있습니다!");
		}
	}
	return retMsg;
}

// SR AGENT 추가(DESCRIPTION에 PORT명 + AGENT 주소추가). 
function ajaxAddAgent(blNo, bookingNo) {
	
	var retMsg = "";
	if(blNo != "") {
		var xmlHttp = getHttpRequest();
		if (xmlHttp != null){
			var sURL = "/eshipping/eshipping.ysc";			
			var msg = "_method=ajaxAddAgent&BL_NO="+blNo+"&BOOK_NO="+bookingNo;
			xmlHttp.open("POST", sURL, false);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
			xmlHttp.send(msg);
			if (xmlHttp.readyState == 4) {
				if(xmlHttp.status == 200){
					retMsg = xmlHttp.responseText;
					return retMsg;

				} else {
					alert("서버와의 통신에 장애가 있습니다![status:" + xmlHttp.status +"]");
				}
			} else {
				alert("서버와의 통신에 장애가 있습니다![readyState:"+ xmlHttp.readyState+"]");
			}	
		} else {
			alert("서버와의 통신에 장애가 있습니다!");
		}
	}
	return retMsg;
}

//2010.10.28 DEM/DET List 
function ajaxGetDemDetPerBL(BL_NO) {
	var retMsg = "";
	if(BL_NO != "") {
		var xmlHttp = getHttpRequest();
		if (xmlHttp != null){
			var sURL = "/eshipping/eshipping.ysc";			
			var msg = "_method=ajaxGetDemDetPerBL&BL_NO="+BL_NO;
			xmlHttp.open("POST", sURL, false);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
			xmlHttp.send(msg);
			if (xmlHttp.readyState == 4) {
				if(xmlHttp.status == 200){
					retMsg = xmlHttp.responseText;
				} else {
					alert("서버와의 통신에 장애가 있습니다![status:" + xmlHttp.status +"]");
				}
			} else {
				alert("서버와의 통신에 장애가 있습니다![readyState:"+ xmlHttp.readyState+"]");
			}	
		} else {
			alert("서버와의 통신에 장애가 있습니다!");
		}
	}
	return retMsg;
}
