﻿<!--

function onSearch_facilityList(thisForm, target){
	
	var subject = thisForm.subject.value;	
	var facilityName = thisForm.facilityName.value;
	
	subject = subject.replace(/(^\s*)/, ""); //좌공백
	subject = subject.replace(/(\s*$)/, ""); //우공백   
	
	facilityName = facilityName.replace(/(^\s*)/, ""); //좌공백
	facilityName = facilityName.replace(/(\s*$)/, ""); //우공백 

	if(facilityName == ""){
		
		alert("검색할 단어를 입력하세요.");
		thisForm.facilityName.value = "";
		thisForm.facilityName.focus();
		return false;
	
	} else {
		
		for(var i = 0; i < facilityName.length; i++) { 
			if(facilityName.charAt(i) == '\'' ||  facilityName.charAt(i) == '"' ||  facilityName.charAt(i) == '%' || facilityName.charAt(i) == ';'){
				alert("', \", %, ; 는 입력할 수 없습니다");
				return false;
			}
		}
		
	}

    if(subject == "offices") {
    
    	thisForm.action = 'usefulInfo_facility_officesList.asp?facilityName='+ facilityName;
    
   } else if(subject == "C02") {
    
        thisForm.action = 'usefulInfo_facility_cultureList.asp?facilityName='+ facilityName + '&type=' + subject;
        
    } else if(subject == "C04") {
    
        thisForm.action = 'usefulInfo_facility_cultureList.asp?facilityName='+ facilityName + '&type=' + subject;
        
    } else {
    
        alert("검색실패");
        return false;
    }
    
	thisForm.target = target; //iframe name
    return true;	
}


function onSearch_lineList(thisForm, target){
	
	setLocation_resetMap();
	top.leftFrame.document.lineList.location.replace('../commonness/blank.asp');
	top.leftFrame.document.lineInfo.location.replace('../commonness/blank.asp');
	var lineNumber = thisForm.lineNumber.value;		
	
	lineNumber = lineNumber.replace(/(^\s*)/, ""); //좌공백
	lineNumber = lineNumber.replace(/(\s*$)/, ""); //우공백   

	if(lineNumber == ""){
		
		alert("검색할 단어를 입력하세요.");
		thisForm.lineNumber.value = "";
		thisForm.lineNumber.focus();
		return false;
	
	} else {
		
		for(var i = 0; i < lineNumber.length; i++) { 
			if(lineNumber.charAt(i) == '\'' ||  lineNumber.charAt(i) == '"' ||  lineNumber.charAt(i) == '%' || lineNumber.charAt(i) == ';'){
				alert("', \", %, ; 는 입력할 수 없습니다");
				return false;
			}
		}
		
	}
    
	thisForm.action = '../commonness/lineList.asp?lineNumber='+ lineNumber;
	thisForm.target = target; //iframe name
    return true;	
}


function onSearch_boundary(thisForm, target){
	
	var gu_index = thisForm.subject.value;	
	var dong_index = thisForm.contents.value;	
	
	gu_index = gu_index.replace(/(^\s*)/, ""); //좌공백
	gu_index = gu_index.replace(/(\s*$)/, ""); //우공백   
	
	dong_index = dong_index.replace(/(^\s*)/, ""); //좌공백
	dong_index = dong_index.replace(/(\s*$)/, ""); //우공백
 
	thisForm.action = '../commonness/lineList_boundary.asp?gu_index='+ gu_index + '&dong_index=' + dong_index;
	thisForm.target = target; //iframe name
    return true;	
}


function onSearch_myLocation_inputBox(thisForm, target){

	var inputBox = thisForm.inputBox.value;		
	
	inputBox = inputBox.replace(/(^\s*)/, ""); //좌공백
	inputBox = inputBox.replace(/(\s*$)/, ""); //우공백   

	if(inputBox == ""){
		
		alert("검색할 단어를 입력하세요.");
		thisForm.inputBox.value = "";
		thisForm.inputBox.focus();
		return false;
	
	} else {
		
		for(var i = 0; i < inputBox.length; i++) { 
			if(inputBox.charAt(i) == '\'' ||  inputBox.charAt(i) == '"' ||  inputBox.charAt(i) == '%' || inputBox.charAt(i) == ';'){
				alert("', \", %, ; 는 입력할 수 없습니다");
				return false;
			}
		}
		
	}

	thisForm.action = 'lineInfo_myLocation_busstopResult.asp?inputBox='+ inputBox;
	thisForm.target = target; //iframe name
	setLocation_resetMap();
	top.leftFrame.document.lineList.location.replace('../commonness/blank.asp');

    return true;	
}


function onSearch_mapBoundary(subject, contents, components){

	var sigun_index = subject.value;	
	var gu_index = contents.value;
	var dong_index = components.value;
	
	sigun_index = sigun_index.replace(/(^\s*)/, ""); //좌공백
	sigun_index = sigun_index.replace(/(\s*$)/, ""); //우공백 
	
	gu_index = gu_index.replace(/(^\s*)/, ""); //좌공백
	gu_index = gu_index.replace(/(\s*$)/, ""); //우공백   
	
	dong_index = dong_index.replace(/(^\s*)/, ""); //좌공백
	dong_index = dong_index.replace(/(\s*$)/, ""); //우공백
	
    if (dong_index != "") {

        var split_var  = dong_index.split('^');

        minx = split_var[0];
        miny = split_var[1];
        maxx = split_var[2];
        maxy = split_var[3];

    } else if (gu_index != "") {
    
        var split_var  = gu_index.split('^');

        minx = split_var[0];
        miny = split_var[1];
        maxx = split_var[2];
        maxy = split_var[3];
    
    }else {
    
        var split_var  = sigun_index.split('^');

        minx = split_var[0];
        miny = split_var[1];
        maxx = split_var[2];
        maxy = split_var[3];
    
    }
    
    setLocation_boundary(minx, miny, maxx, maxy);
}


function onSearch_subwayStopList(thisForm, target){
	
	var subwayStop_index = thisForm.subject.value;	
	
	subwayStop_index = subwayStop_index.replace(/(^\s*)/, ""); //좌공백
	subwayStop_index = subwayStop_index.replace(/(\s*$)/, ""); //우공백   
 
	thisForm.action = '../subwayInfo/subwayStopList.asp?subwayStop_index='+ subwayStop_index;
	thisForm.target = target; //iframe name
    return true;	
}


function onSearch_subwayStopList_fromStationName(thisForm, target){
	
	var stationName = thisForm.stationName.value;	
	
	stationName = stationName.replace(/(^\s*)/, ""); //좌공백
	stationName = stationName.replace(/(\s*$)/, ""); //우공백   
 
	thisForm.action = '../subwayInfo/subwayStopList_fromStationName.asp?stationName='+ stationName;
	thisForm.target = target; //iframe name
    return true;	
}


function onSearch_lineList_midnight(target){
	
    document.getElementById(target).src = '../commonness/lineList_midnight.asp';

}


function onSearch_lineList_airport(target){
	
    document.getElementById(target).src = '../commonness/lineList_airport.asp';

}


function onSearch_lineInfo(lineID, lineNumber) {
    
    var line = lineID + "^" + lineNumber;
    
	setLocation_DeleteAllBusPath();
	setLocation_AddBusPathFit(lineID, lineNumber);
	top.leftFrame.document.lineInfo.location.replace('lineInfo.asp?lineID=' + lineID);
	
}

function onSearch_lineInfo_myLocation(lineID, lineNumber) {
    
    var line = lineID + "^" + lineNumber;
    
	setLocation_DeleteAllBusPath();
	setLocation_AddBusPathFit(lineID, lineNumber);
	
}


function onSearch_busstop(thisForm, target){
	
	var busstop = thisForm.busstop.value;		
	
	busstop = busstop.replace(/(^\s*)/, ""); //좌공백
	busstop = busstop.replace(/(\s*$)/, ""); //우공백   

	if(busstop == ""){
		
		alert("검색할 단어를 입력하세요.");
		thisForm.busstop.value = "";
		thisForm.busstop.focus();
		return false;
	
	} else {
		
		for(var i = 0; i < busstop.length; i++) { 
			if(busstop.charAt(i) == '\'' ||  busstop.charAt(i) == '"' ||  busstop.charAt(i) == '%' || busstop.charAt(i) == ';'){
				alert("', \", %, ; 는 입력할 수 없습니다");
				return false;
			}
		}
		
	}

	thisForm.action = 'busstopResult.asp?busstop='+ busstop;
	thisForm.target = target; //iframe name
	setLocation_resetMap();
	top.leftFrame.document.lineList.location.replace('../commonness/blank.asp');
	top.leftFrame.document.lineInfo.location.replace('../commonness/blank.asp');
    return true;	
}


function onSearch_busstop_lineList(pointX, pointY, busstopID){

	setLocation_busstop(pointX, pointY);
	setLocation_DeleteAllBusPath();
	top.leftFrame.document.lineInfo.location.replace('../commonness/blank.asp');
	top.leftFrame.document.lineList.location.replace('../commonness/lineList_busstop.asp?busstopID='+ busstopID);

}


function onSearch_busstop_boundary(pointX, pointY){

	setLocation_resetMap();
	setLocation_DrawBufferCircle(pointX, pointY);
	top.leftFrame.document.lineList.location.replace('../commonness/blank.asp');
	top.leftFrame.document.lineInfo.location.replace('../commonness/blank.asp');
	document.location.href ='../commonness/busstopList.asp?pointX='+ pointX + '&pointY=' + pointY;

}

function onSearch_myLocation_busstop(pointX, pointY){

	setLocation_resetMap();
	setLocation_DrawBufferCircle(pointX, pointY);
	top.leftFrame.document.lineList.location.replace('../commonness/blank.asp');
	document.location.href ='../commonness/busstopList_myLocation.asp?pointX='+ pointX + '&pointY=' + pointY;

}

function onSearch_myLocation_selectMap(){

	setLocation_resetMap();
	var strData = setLocation_getDisplayScale();
    
	if (strData > 20) 
	{
		alert("지도를 좀더 확대하십시오.");
	} 
	else 
	{
		alert("지도상에서 원하는 지점을 선택하여 주십시오.");
		setLocation_SetUserClickMode();
		
		
	}

}

function onSearch_myLocation_busline(busstopID, pointX, pointY){

	setLocation_DeleteAllBusPath();
	setLocation_busstop(pointX, pointY);
	top.leftFrame.document.lineList.location.replace('../lineInfo/lineInfo_myLocation_lineList.asp?busstopID=' + busstopID);

}


function onSearch_routeStart(thisForm, target){
	
	var routeStart = thisForm.routeStart.value;		
	routeStart = routeStart.replace(/(^\s*)/, ""); //좌공백
	routeStart = routeStart.replace(/(\s*$)/, ""); //우공백   

	if(routeStart == ""){
		
		alert("검색할 단어를 입력하세요.");
		thisForm.routeStart.value = "";
		thisForm.routeStart.focus();
		return false;
	
	} else {
		
		for(var i = 0; i < routeStart.length; i++) { 
			if(routeStart.charAt(i) == '\'' ||  routeStart.charAt(i) == '"' ||  routeStart.charAt(i) == '%' || routeStart.charAt(i) == ';'){
				alert("', \", %, ; 는 입력할 수 없습니다");
				return false;
			}
		}
		
	}
    
	thisForm.action = 'routeStartList.asp?routeStart='+ routeStart;
	thisForm.target = target; //iframe name
    return true;	
}


function onSearch_routeEnd(thisForm, target){
	
	var routeEnd = thisForm.routeEnd.value;		
	routeEnd = routeEnd.replace(/(^\s*)/, ""); //좌공백
	routeEnd = routeEnd.replace(/(\s*$)/, ""); //우공백   

	if(routeEnd == ""){
		
		alert("검색할 단어를 입력하세요.");
		thisForm.routeEnd.value = "";
		thisForm.routeEnd.focus();
		return false;
	
	} else {
		
		for(var i = 0; i < routeEnd.length; i++) { 
			if(routeEnd.charAt(i) == '\'' ||  routeEnd.charAt(i) == '"' ||  routeEnd.charAt(i) == '%' || routeEnd.charAt(i) == ';'){
				alert("', \", %, ; 는 입력할 수 없습니다");
				return false;
			}
		}
		
	}
    
	thisForm.action = 'routeEndList.asp?routeEnd='+ routeEnd;
	thisForm.target = target; //iframe name
    return true;	
}


function onSearch_routeStartSelect(name, x, y){
	
	parent.startField.innerHTML = name;
	parent.startButton.innerHTML = "";
	parent.startSelectMap.innerHTML = "<img src='/image/MapService/map_bu009.gif' width='55' height='18' border='0' align='left' onClick='routeRestart();' style='cursor:hand'>";

	parent.routeSearch.start_x.value = x;
	parent.routeSearch.start_y.value = y;

	setLocation_busstop(x, y);
}


function onSearch_routeEndSelect(name, x, y){
	
	parent.endField.innerHTML = name;
	parent.endButton.innerHTML = "";
	parent.endSelectMap.innerHTML = "<img src='/image/MapService/map_bu009.gif' width='55' height='18' border='0' align='left' onClick='routeReEnd();' style='cursor:hand'>";

	parent.routeSearch.arrival_x.value = x;
	parent.routeSearch.arrival_y.value = y;

	setLocation_busstop(x, y);
}


function routeRestart() {		//출발지 선택
//	parent.main.document.IntraMap2DXSeBIS.Resetmap();
	
    startField.innerHTML = "<input name='routeStart' type='text' class='formStyleSearch' size='15' onkeydown=' if(event.keyCode == 13) {this.form.onSubmit;}'>"
    startButton.innerHTML = "<input type='image' src='/image/MapService/map_bu001.gif' alt='검색' width='46' height='18' border='0'>"
    startSelectMap.innerHTML = "<a href='#' onclick='onSearch_route_selectStartMap()';><img src='/image/MapService/map_bu003.gif' width='125' height='18' border='0'></a>"
                            
}

function routeReEnd() {		//목적지 선택
//	parent.main.document.IntraMap2DXSeBIS.Resetmap();
	
    endField.innerHTML = "<input name='routeEnd' type='text' class='formStyleSearch' size='15' onkeydown=' if(event.keyCode == 13) {this.form.onSubmit;}'>"
    endButton.innerHTML = "<input type='image' src='/image/MapService/map_bu001.gif' alt='검색' width='46' height='18' border='0'>"
    endSelectMap.innerHTML = "<a href='#' onclick='onSearch_route_selectEndMap()';><img src='/image/MapService/map_bu003.gif' width='125' height='18' border='0'></a>"
                            
}


function onSearch_route_selectStartMap(){

	setLocation_resetMap();
	setLocation_SetStartFlagMode();


}


function onSearch_route_selectEndMap(){

	var strData = setLocation_getDisplayScale();
	setLocation_SetEndFlagMode();


}


function onSearch_offices_busstop(name, pointX, pointY){
	setLocation_resetMap();
	setLocation_DrawBufferCircle(pointX, pointY);
	top.leftFrame.document.lineList.location.replace('../commonness/blank.asp');
	document.location.href ='usefulInfo_facility_busstopList.asp?pointX='+ pointX + '&pointY=' + pointY + '&name=' + name;

}


function onSearch_facility_busline(busstopID, pointX, pointY){

	setLocation_DeleteAllBusPath();
	setLocation_busstop(pointX, pointY);
	top.leftFrame.document.lineList.location.replace('usefulInfo_facility_lineList.asp?busstopID=' + busstopID);

}


function onSearch_parking(thisForm, target){
	
	setLocation_resetMap();
	top.leftFrame.document.parkingInfo.location.replace('../commonness/blank.asp');
	top.leftFrame.document.lineList.location.replace('../commonness/blank.asp');
	var gu_index = thisForm.subject.value;		
	
	gu_index = gu_index.replace(/(^\s*)/, ""); //좌공백
	gu_index = gu_index.replace(/(\s*$)/, ""); //우공백   
 
	thisForm.action = 'usefulInfo_parking_list.asp?gu_index='+ gu_index;
	thisForm.target = target; //iframe name
    return true;	
}


function onSearch_facility_parkingInfo(parkname, pointX, pointY){

	setLocation_resetMap();
	setLocation_DrawBufferCircle(pointX, pointY);
	top.leftFrame.document.parkingInfo.location.replace('usefulInfo_parkingInfo.asp?parkname=' + parkname);
	document.location.href ='usefulInfo_parking_busstopList.asp?parkname=' + parkname + '&pointX='+ pointX + '&pointY=' + pointY;


}

function printLinelist(lineID){

     var targeturl="../commonness/printLine.asp?lineID=" + lineID;

     newwin=window.open("","printLine","resizable, status, scrollbars=yes");

     newwin.moveTo(0,0);
     newwin.resizeTo(750,screen.height);
     newwin.location=targeturl;

}
// -->
