function MM_openBrWindow(theURL,winName,features) { //v2.0
  PhotoWindow = window.open(theURL,winName,features);
  PhotoWindow.focus();
}
function yearIndex(yearIdx)
{
    var ry=0;
    if (yearIdx == 2008) { ry = 0;}
    else if (yearIdx == 2009) { ry = 1;}
    else if (yearIdx == 2010) { ry = 2;}
    else if (yearIdx == 2011) { ry = 3;}    
   return(ry);
}
function addDate(year, month, date, n)
	{
		    var leisure_number = n * 1000 * 60 * 60 * 24;
			var targetDate = new Date(year, month, date);
			var DateInMS = targetDate.getTime();
			DateInMS += leisure_number;
			targetDate.setTime(DateInMS);
			var theYear = targetDate.getFullYear();
			var theMonth = targetDate.getMonth();
			var theDate = targetDate.getDate();
		    rdt  = new Date(theYear, theMonth, theDate);
		    return(rdt);
		}
function setDate()
		{
		    leisure_nd = new Date();
		    y = leisure_nd.getFullYear();
		    m = leisure_nd.getMonth();
		    d = leisure_nd.getDate();
		    dt = addDate(y, m ,d, 7);
			document.f_quick.f_nen1.selectedIndex = yearIndex(dt.getFullYear());
			document.f_quick.f_tuki1.selectedIndex = dt.getMonth();
			document.f_quick.f_hi1.selectedIndex = dt.getDate()-1;
			document.f_quick1.f_nen1.selectedIndex = yearIndex(dt.getFullYear());
			document.f_quick1.f_tuki1.selectedIndex = dt.getMonth();
			document.f_quick1.f_hi1.selectedIndex = dt.getDate()-1;
			
		}
		
function setDate2()
		{
		    leisure_nd = new Date();
		    y = leisure_nd.getFullYear();
		    m = leisure_nd.getMonth();
		    d = leisure_nd.getDate();
		    dt = addDate(y, m ,d, 7);
		    if(document.f_quick){
				document.f_quick.f_nen1.selectedIndex = yearIndex(dt.getFullYear());
				document.f_quick.f_tuki1.selectedIndex = dt.getMonth();
				document.f_quick.f_hi1.selectedIndex = dt.getDate()-1;
			}
		}
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_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_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];}
}

var tabNews_on = new Array() ; 
var tabNews_off = new Array() ; 
tabNews_on[1] = new Image() ; 
tabNews_on[1].src = '/images/s_ukr.gif' ; 
tabNews_off[1] = new Image() ; 
tabNews_off[1].src = '/images/s_nkr.gif' ; 
tabNews_on[2] = new Image() ; 
tabNews_on[2].src = '/images/s_ujp.gif' ; 
tabNews_off[2] = new Image() ; 
tabNews_off[2].src = '/images/s_njp.gif' ; 
var tabNewsImgName, tabNewsLayName; 
function tabNewsAct() { 
for( i=1; i<=2; i++ ) { 
tabNewsImgName = 'tabNews' + i ; 
document.images[tabNewsImgName].src = tabNews_off[i].src ; 
tabNewsLayName = document.all['tabNewsLay'+i] ; 
tabNewsLayName.style.display = 'none' ; 
} 
tabNewsImgName = 'tabNews' + arguments[0] ; 
document.images[tabNewsImgName].src = tabNews_on[arguments[0]].src ; 
document.all['tabNewsLay'+arguments[0]].style.display = '' ; 
} 

//begin mouseover script
function openWin(url,name,wid,hei)
{
adWindow=window.open(url,name,'width='+wid+',height='+hei+',scrollbars=no,menubar=no,toolbar=no');
}

function findZipCode()
{
	var winOpts="width=446,height=200,scrollbars=yes";
	url = "/portal/krmy/kr_member_check.zipcode_search";
	ZipCodeWindow = window.open(url, "FindZipCode", winOpts);
	ZipCodeWindow.focus();
}
function valueSend(post_front, post_rear, addr) {
	document.form.f_yubin1.value = post_front;
	document.form.f_yubin2.value = post_rear;
	document.form.f_jusho1.value = addr;
}
function Ultimate(Utype,Umsgs,Ucursor,Uwidth,Uheight,Ubgcolor,Ubackground,Uspeed,Udelay,Ufirst) {
		
	document.writeln('<span id="Ubox" style="position:relative;width:'+Uwidth+';height:'+Uheight+';overflow:hiden;background-color:'+Ubgcolor+' ;background-image:url('+Ubackground+')">')
	document.writeln('<div style="position:absolute;width:'+Uwidth+';height:'+Uheight+';clip:rect(0 '+Uwidth+' '+Uheight+' 0);left:0;top:0">')

	document.writeln('<div id="Utxt" style="position:absolute;width:'+Uwidth+';left:0;top:'+Uheight+';">')
	document.write(Umsgs[Ufirst]);
	Uscroll(Utxt,Umsgs,Uheight,Uspeed,Udelay,Ufirst);
	document.writeln('</div>')
	document.writeln('</div>')
	document.writeln('</span>')
}

// Moves
function Uscroll(IDdiv,Umsgs,Uheight,Uspeed,Udelay,Ufirst){
	ttxt=eval(IDdiv);
	Ustep=eval(Ufirst);
	if (ttxt.style.pixelTop>0&&ttxt.style.pixelTop<=5){
	ttxt.style.pixelTop=0;
	setTimeout("Uscroll(ttxt,Umsgs,Uheight,Uspeed,Udelay,Ustep)",Udelay);
	return
	}
	else {
		if (ttxt.style.pixelTop>=ttxt.offsetHeight*-1){
		ttxt.style.pixelTop-=5
		setTimeout("Uscroll(ttxt,Umsgs,Uheight,Uspeed,Udelay,Ustep)",Uspeed);
		return
		}
		else {
		ttxt.style.pixelTop=Uheight;
		if (Ustep>=Umsgs.length-1)
			Ustep=0
			else		
			Ustep++;
		ttxt.innerHTML=Umsgs[Ustep];
		Uscroll(ttxt,Umsgs,Uheight,Uspeed,Udelay,Ustep);
		}
	}
}

function nextfocus(su,keta,nextname){
	if(keta<=su){
		nextname.focus();
		return;
	}
}

function ct(search){
	if(document.forms[0].f_search){
		document.forms[0].f_search.value=search;
		document.forms[0].submit();
	}
}
function changePage(page){
	if(document.search.f_page){
		document.search.f_page.value=page;
		document.search.submit();
	}
}

function changeT(type,sort){
        if(document.search.f_search){
                document.search.f_search.value=type;
                document.search.f_sort.value=sort;
                document.search.f_page.value=1;
                document.search.submit();
        }
}

function switchPhoto(flg){
	if(document.search.f_photo && document.search.f_photo.value !=flg ){
		document.search.f_photo.value=flg;
		document.search.submit();
	}
}

function change_form(target){
	if(target=="korean"){
		document.getElementById("kr_section").style.display = "";
		document.getElementById("kr_dot_section").style.display = "";		
		document.getElementById("kryubin").style.display = "";				
		document.getElementById("foyubin").style.display = "none";	
		document.getElementById("fo_section").style.display = "none";	
		document.getElementById("fo_section2").style.display = "none";	
		document.getElementById("fo_section3").style.display = "none";			
		document.getElementById("fo_dot_section").style.display = "none";	
		document.getElementById("fo_dot_section2").style.display = "none";
		document.getElementById("fo_dot_section3").style.display = "none";		
	}else if(target=="alien"){
		document.getElementById("kr_section").style.display = "none";
		document.getElementById("kr_dot_section").style.display = "none";	
		document.getElementById("kryubin").style.display = "none";				
		document.getElementById("foyubin").style.display = "";	
		document.getElementById("fo_section").style.display = "";	
		document.getElementById("fo_dot_section").style.display = "";	
		document.getElementById("fo_section2").style.display = "";	
		document.getElementById("fo_section3").style.display = "";	
		document.getElementById("fo_dot_section2").style.display = "";
		document.getElementById("fo_dot_section3").style.display = "";		
	}
}

function change_check_form(target){
	if(target=="korean"){
		document.getElementById("kr_section").style.display = "";
		document.getElementById("fo_section").style.display = "none";
		document.getElementById("fo_section2").style.display = "none";	
		document.getElementById("fo_section3").style.display = "none";			
	}else if(target=="alien"){
		document.getElementById("kr_section").style.display = "none";
		document.getElementById("fo_section").style.display = "";
		document.getElementById("fo_section2").style.display = "";	
		document.getElementById("fo_section3").style.display = "";			
	}
}

function refresh() {
	window.open('http://kr-travel.rakuten.com','_top');
}

//end mouseover script
//end hiding script from old browsers -->
