Format = function(formatStr)    
{    
    var str = formatStr;
	var today = new Date();   
    var Week = ['일','월','화','수','목','금','토'];   
   
    str=str.replace(/yyyy|YYYY/,today.getFullYear());    
    str=str.replace(/yy|YY/,(today.getYear() % 100)>9?(today.getYear() % 100).toString():'0' + (today.getYear() % 100));  
	
   	var month=today.getMonth()+1;
    str=str.replace(/MM/,month>9?month.toString():'0' + month);    
    str=str.replace(/M/g,month);    
   
    str=str.replace(/w|W/g,Week[today.getDay()]);    
   
    str=str.replace(/dd|DD/,today.getDate()>9?today.getDate().toString():'0' + today.getDate());    
    str=str.replace(/d|D/g,today.getDate());    
   
    str=str.replace(/hh|HH/,today.getHours()>9?today.getHours().toString():'0' + today.getHours());    
    str=str.replace(/h|H/g,today.getHours());    
    str=str.replace(/mm/,today.getMinutes()>9?today.getMinutes().toString():'0' + today.getMinutes());    
    str=str.replace(/m/g,today.getMinutes());    
   
    str=str.replace(/ss|SS/,today.getSeconds()>9?today.getSeconds().toString():'0' + today.getSeconds());    
    str=str.replace(/s|S/g,today.getSeconds());    
    return str;    
}



function search_hotel(){
	//var url=document.hotel_form.action;
	var url="http://kr.hotels.com/";
	url+="search.do?";
	var city=document.hotel_form.city.value;
	if(city!=""){
		url+="destination="+city;
	}
	var from_date=document.hotel_form.from_date.value;
	if(from_date!=""){
		url+="&searchParams.arrivalDate="+from_date;
	}
	var to_date=document.hotel_form.to_date.value;
	if(to_date!=""){
		url+="&searchParams.departureDate="+to_date;
	}
	window.open(url);
	//window.location.href=url;
	//document.hotel_form.action=url;
	//document.hotel_form.action="http://kr.hotels.com/";
	//alert(document.hotel_form.action);
}
function search_hotel_more(){
	//document.hotel_form.action="http://kr.hotels.com/";
	//document.hotel_form.submit();
	window.open("http://kr.hotels.com/");
}
function search_plane_more(){
	document.hotel_form.action="http://www.webtour.com/Domestic/air_index.asp";
	//document.hotel_form.submit();
	window.open("http://www.webtour.com/Domestic/air_index.asp");

}
function hotel_plane_change(obj,tid){
	if(obj.className=="current"){
		return;
	}
	var tabList=obj.parentNode.getElementsByTagName("li");
	var hotel_plane_content=document.getElementById("hotel_plane_content").getElementsByTagName("li");
	for(var i=0;i<tabList.length;i++){
		if(i==tid){
			tabList[i].className="current";
			hotel_plane_content[i].style.display="block";
		}else{
			tabList[i].className="";
			hotel_plane_content[i].style.display="none";
		}
	}
}





	 //下拉框改变事件  
	 function changeCityOptions()  
	 {  
	 
	 	var airport_city={
	"GMP":"CJU|제주|PUS|부산|KWJ|광주|USN|울산|KPO|포항|HIN|진주|RSU|여수|MWX|무안",
	"ZZZ":"CJU|제주|PUS|부산|TAE|대구",
	"KWJ":"GMP|김포|CJU|제주 ",
	"MWX":"CJU|제주",
	"KUV":"CJU|제주",
	"TAE":"ICN|인천|CJU|제주",
	"PUS":"ICN|인천|GMP|김포|CJU|제주",
	"RSU":"GMP|김포|CJU|제주",
	"USN":"GMP|김포|CJU|제주",
	"WJU":"CJU|제주",
	"CJU":"CJU|제주",
	"HIN":"CJU|제주",
	"CJJ":"CJU|제주",
	"KPO":"CJU|제주"
	}

	     var whereDepCity=document.getElementById("whereDepCity");  
	     var whereArrCity=document.getElementById("whereArrCity");  
	     whereArrCity.length=0;  
	     if(whereDepCity.value==-1)  
	     {      
	         whereArrCity.options.add(new Option("aipport"," "));  
	     }  
	     else  
	     {  
	         
			 var key=whereDepCity.value;
			 //alert(key);
			 var city_string=airport_city[key];
			 //alert(city_string);
			 var cityArray= city_string.split("|");  
			 for(var i=0;i<cityArray.length;i++){
			 	if(i%2==0){
					//alert(cityArray[i+1]);
					whereArrCity.options.add(new Option(cityArray[i+1], cityArray[i]));
				}
			 	
			 }
			 
			 
	     }   
	    return;     
	 }  
	 
	 
	 
	 
function change_naver_blog_img(img){
	img.src="images/ggf/share_blog_h.png";		
}
function change_naver_blog_img_1(img){
	img.src="images/ggf/share_naver_blog.png";		
}



// recommend_ad.php and recommend_ad_1.php {
function createCookie(name,value,days){
     var argv=createCookie.arguments;
     var argc=createCookie.arguments.length;
	if (days) { 
		var expires = new Date(); 
		expires.setTime(expires.getTime()+(days*24*60*60*1000)); 
	}
	 var path = '/';
	 //var domain = 'localhost';
	 var domain = null;
	 var secure = false;
     document.cookie=name+"="+escape(value)+((expires==null)?"":("; expires="+expires.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain))+((secure==true)?"; secure":"");
}
function readCookie(Name) {
 var search = Name + "=";
 var returnvalue = "";
 if (document.cookie.length > 0) {
  offset = document.cookie.lastIndexOf(search);
  if (offset != -1) {
   offset += search.length;
   end = document.cookie.indexOf(";", offset);
   if (end == -1)
   end = document.cookie.length;
   returnvalue=unescape(document.cookie.substring(offset,end));
  }
 }
 return returnvalue;
}


//} recommend_ad.php and recommend_ad_1.php 





//chromeplus news change the "title"
function changeNewTitle(obj){
	//alert(obj.tagName);
	old_title=document.title;
	var parent=obj.parentNode;
	var a=parent.childNodes;
	var a=parent.getElementsByTagName("a")[0];
	var new_title=a.getAttribute("title");
	document.title=new_title;
	var srcript=document.getElementById("changeSrc");
	//alert(srcript.src);
	srcript.src="js/sharethis.js";

 }
 
 function changeOldTitle(obj){
	var parent=obj.parentNode;
	var a=parent.childNodes;
	var a=parent.getElementsByTagName("a")[0];
	var new_title=a.getAttribute("title");
	var tempArray=new_title.split("|");
	document.title=tempArray[1];
	var srcript=document.getElementById("changeSrc");
	//alert(srcript.src);
	srcript.src="http://w.sharethis.com/button/buttons.js";

 }



function set_iframe_src(){
	//alert(37);
	document.getElementById('weather_iframe').src="http://websitekr.com/weather.php";
	//alert("weather");
	document.getElementById('search_iframe').src="/style/searchEngine.html";
	//alert("search");
	document.getElementById('ad_iframe').src="http://websitekr.com/recommend_ad.php";
	//alert("ad");
	document.getElementById('groupon_iframe').src="http://websitekr.com/groupon_shopping.php";
	//alert("group");
	document.getElementById('chromenews_iframe').src="http://websitekr.com/chromeplus_news/chromeplus.php";
	//alert("news");
	document.getElementById('game_iframe').src="http://websitekr.com/game.php";
	//alert("game");

}

function close_left_ad(obj){
	var left_ad=obj.parentNode;
	left_ad.style.display="none";
		
}





