﻿

<!-- //새창
        var win = null; 
        function NewWindow(mypage,myname,w,h,scroll){ 
        LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; 
        TopPosition = (screen.height) ? (screen.height-h)/2 : 0; 
        settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll ;
        win = window.open(mypage,myname,settings) ;
        } 
//-->
<!-- //새창
        var win = null; 
        function NewWindow_login(mypage,myname,w,h,scroll){ 
        LeftPosition = (screen.width); 
        TopPosition = (screen.height); 
        settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll ;
        win = window.open(mypage,myname,settings) ;
        } 
//-->
<!--//입력폼 선택시 테두리 색상 변경
function overInput(f) {
    f.className = "onInput";
}

function outInput(f) {
    f.className = "offInput";
}
//-->
<!--//라운딩테이블
function roundTable(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 Check(x,y) {
    for(i=0;i<y;i++) { // 라디오 버튼의 갯수
        
		if(x == "y")	z = "n"; // name 부분
		else	z = "y";
            document.all[z].src = "/admin/images/radiobutton.gif" ; // 라디오 버튼off
    }
        document.all[x].src = "/admin/images/radiobutton_checked.gif" // 라디오 버튼 on
        document.good_form.p_used.value = x;
}
//-->
<!--//숫자입력만 받기
function onlyNum(){
	var key = event.keyCode;
	var messageArea = document.getElementById("ssnMessage");
	if(!(key==8||key==9||key==13||key==46||key==144||(key>=48&&key<=57)||key==110||key==190)){
		alert("숫자만 입력 가능합니다");
		event.returnValue = false;
	}
}
//-->
<!--//한글입력받기
function chk_Hangul() {

     if ((event.keyCode >= 32) && (event.keyCode <= 126)) {
        alert("한글만 입력이 가능합니다.");
        event.returnValue = false;
     }

  }
//-->
<!--//로그인시 이전 url
function logInUrl(){
	var curUrl = escape(document.URL);
	location.href='/login/?returnUrl='+curUrl;
}
//-->
<!-- // 로그아웃시 이전 url
function logOutUrl(){
	var curUrl = escape(document.URL);
	location.href='/login/login_chk.php?mode=logout&returnUrl='+curUrl;
}
//-->
<!-- // 패키지 서브 url
function packUrl(num){
	if(num == 1)	var curUrl = escape("http://c17147s002.travelservice.co.kr/main/main01.asp?area=A&etc_code=P");
	else if(num == 2)	var curUrl = escape("http://c17147s002.travelservice.co.kr/main/main01.asp?area=B&etc_code=P");
	else if(num == 3)	var curUrl = escape("http://c17147s002.travelservice.co.kr/main/main01.asp?area=J&etc_code=P");
	else if(num == 4)	var curUrl = escape("http://c17147s002.travelservice.co.kr/main/main01.asp?area=E&etc_code=P");
	else if(num == 5)	var curUrl = escape("http://c17147s002.travelservice.co.kr/main/main01.asp?area=D&etc_code=P");
	else if(num == 6)	var curUrl = escape("http://c17147s002.travelservice.co.kr/main/main01.asp?area=G&etc_code=P");
	else if(num == 7)	var curUrl = escape("http://c17147s002.travelservice.co.kr/main/main01.asp?area=A&etc_code=P&start_city=PUS");
	else if(num == 8)	var curUrl = escape("http://c17147s002.travelservice.co.kr/main/main01.asp?etc_code=W");
	else if(num == 9)	var curUrl = escape("http://c17147s002.travelservice.co.kr/main/main01.asp?etc_code=G");

	location.href='/package/?reurl='+curUrl;
}
//-->
<!-- // 롤오버시/아웃시 이미지 변경
function imgover(imgname, imgurl){
     imgname.src = imgurl;
}

function imgout(imgname, imgurl){
     imgname.src = imgurl;
}
//-->
<!-- //이미지 새창 소스
function imgResize(img){ 
  img1= new Image(); 
  img1.src=(img); 
  imgControll(img); 
} 

function imgControll(img){ 
  if((img1.width!=0)&&(img1.height!=0)){ 
    viewImage(img); 
  } 
  else{ 
    controller="imgControll('"+img+"')"; 
    intervalID=setTimeout(controller,20); 
  } 
} 

function viewImage(img){ 
    W=img1.width; 
    H=img1.height; 
	LeftPosition = (screen.width) ? (screen.width-W)/2 : 0; 
    TopPosition = (screen.height) ? (screen.height-H)/2 : 0; 
    O="width="+W+",height="+H+",top="+TopPosition+",left="+LeftPosition; 
    imgWin=window.open("","",O); 
    imgWin.document.write("<html><head><title>상품 이미지 미리보기</title></head>");
    imgWin.document.write("<body topmargin=0 leftmargin=0>");
    imgWin.document.write("<img src="+img+" onclick='self.close()' style=cursor:hand>");
    imgWin.document.close();
} 
//  --> 

<!-- // 일본료칸 배너 연결 페이지 플래시 클릭시 url
function gotoUrl(str){

	var curUrl;

	if(str == 1){	 curUrl = "/planning/?plan=ryokan&list=1&cate=JAP&s_cate=loc&s_cate2=kyu";	}
	else if(str == 2){	 curUrl = "/planning/?plan=ryokan&list=2&cate=JAP&s_cate=loc&s_cate2=osa";	}
	else if(str == 3){	 curUrl = "/planning/?plan=ryokan&list=3&cate=JAP&s_cate=loc&s_cate2=tyo";	}
	else if(str == 4){	 curUrl = "/planning/?plan=ryokan&list=4&cate=JAP&s_cate=loc&s_cate2=hoku";	}
	else if(str == 5){	 curUrl = "/planning/?plan=ryokan&list=5&cate=JAP&s_cate=loc&s_cate2=hok";	}
	else if(str == 6){	 curUrl = "/planning/?plan=ryokan&list=6&cate=JAP&s_cate=loc&s_cate2=ext";	}

	location.href = curUrl;
}
//-->

<!--// 상품상세보기 내 요금 월 탭
var enabletabpersistence=1 //메뉴활성화기억 1
var tabcontentIDs=new Object()

function expandcontent(linkobj){
var ulid=linkobj.parentNode.parentNode.id //id of UL element
var ullist=document.getElementById(ulid).getElementsByTagName("li") //get list of LIs corresponding to the tab contents
    for (var i=0; i<ullist.length; i++){
        ullist[i].className=""  //deselect all tabs
    if (typeof tabcontentIDs[ulid][i]!="undefined") //if tab content within this array index exists (exception: More tabs than there are tab contents)
        document.getElementById(tabcontentIDs[ulid][i]).style.display="none" //hide all tab contents
    }
        linkobj.parentNode.className="selected"  //highlight currently clicked on tab
        document.getElementById(linkobj.getAttribute("rel")).style.display="block" //expand corresponding tab content
        saveselectedtabcontentid(ulid, linkobj.getAttribute("rel"))
    }

function savetabcontentids(ulid, relattribute){// save ids of tab content divs
    if (typeof tabcontentIDs[ulid]=="undefined") //if this array doesn't exist yet
        tabcontentIDs[ulid]=new Array()
        tabcontentIDs[ulid][tabcontentIDs[ulid].length]=relattribute
}

function saveselectedtabcontentid(ulid, selectedtabid){ //set id of clicked on tab as selected tab id & enter into cookie
    if (enabletabpersistence==1) //if persistence feature turned on
        setCookie(ulid, selectedtabid)
}

function getullistlinkbyId(ulid, tabcontentid){ //returns a tab link based on the ID of the associated tab content
    var ullist=document.getElementById(ulid).getElementsByTagName("li")
    for (var i=0; i<ullist.length; i++){
    if (ullist[i].getElementsByTagName("a")[0].getAttribute("rel")==tabcontentid){
        return ullist[i].getElementsByTagName("a")[0]
        break
        }
    }
}

function initializetabcontent(){
    for (var i=0; i<arguments.length; i++){ //loop through passed UL ids
    if (enabletabpersistence==0 && getCookie(arguments[i])!="") //clean up cookie if persist=off
        setCookie(arguments[i], "")
    var clickedontab=getCookie(arguments[i]) //retrieve ID of last clicked on tab from cookie, if any
    var ulobj=document.getElementById(arguments[i])
    var ulist=ulobj.getElementsByTagName("li") //array containing the LI elements within UL
    for (var x=0; x<ulist.length; x++){ //loop through each LI element
    var ulistlink=ulist[x].getElementsByTagName("a")[0]
    if (ulistlink.getAttribute("rel")){
        savetabcontentids(arguments[i], ulistlink.getAttribute("rel")) //save id of each tab content as loop runs
        ulistlink.onclick=function(){
        expandcontent(this)
        return false
    }
    if (ulist[x].className=="selected" && clickedontab=="") //if a tab is set to be selected by default
        expandcontent(ulistlink) //auto load currenly selected tab content
        }
    } 

    if (clickedontab!=""){ //if a tab has been previously clicked on per the cookie value
        var culistlink=getullistlinkbyId(arguments[i], clickedontab)
    if (typeof culistlink!="undefined") //if match found between tabcontent id and rel attribute value
        expandcontent(culistlink) //auto load currenly selected tab content
    else //else if no match found between tabcontent id and rel attribute value (cookie mis-association)
        expandcontent(ulist[0].getElementsByTagName("a")[0]) //just auto load first tab instead
        }
    } //end outer for loop
}


function getCookie(Name){ 
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
    if (document.cookie.match(re)) //if cookie found
        return document.cookie.match(re)[0].split("=")[1] //return its value
    return ""
}

function setCookie(name, value){
    document.cookie = name+"="+value //cookie value is domain wide (path=/)
}
//-->