
/*########################### href °æ·Î ###########################
	'ÇÔ¼ö¸í :	fnRef
	'³»¿ë   :	°æ·Î·Î º¸³»ÁØ´Ù.
	'ÆÄ¶ó¹ÌÅÍ :
	'str - ¸µÅ©µÉ °æ·Î
	'AUTH : ¿¬¾çÈì
	'ÀÛ¾÷ÀÏ : 2008.11.14
*/

function fnRef(str){
	location.href = str;
}

//########################### href °æ·Î ###########################


/*########################### href °æ·Î ###########################
	'ÇÔ¼ö¸í :	fnHome
	'³»¿ë   :	°æ·Î·Î º¸³»ÁØ´Ù.
	'ÆÄ¶ó¹ÌÅÍ :
	'str - ¸µÅ©µÉ °æ·Î
	'AUTH : ¿¬¾çÈì
	'ÀÛ¾÷ÀÏ : 2008.11.14
*/

function fnHome(){
	location.href = "/";
}

//########################### href °æ·Î ###########################

/*########################### À©µµ¿ìÃ¢ ¿ÀÇÂ ###########################
	'ÇÔ¼ö¸í :	fnRef
	'³»¿ë   :	°æ·Î·Î º¸³»ÁØ´Ù.
	'ÆÄ¶ó¹ÌÅÍ :
	'str - ¸µÅ©µÉ °æ·Î
	'AUTH : ¿¬¾çÈì
	'ÀÛ¾÷ÀÏ : 2008.11.14
*/

function fnWinOpen(width,height,left,top,name,url,scroll,obj){
	if (left!=''){
		LeftPosition	= left;
	}else{
		LeftPosition	= (screen.width)?(screen.width-width)/2:100;
	}

	if (top!=''){
		TopPosition		= top;
	}else{

		TopPosition		= (screen.height)?(screen.height-height)/2:100;
	}

	winprops		= 'width='+width+', height='+height+', top='+TopPosition+', left='+LeftPosition+' scrollbars='+scroll+', toolbar=no';
	if(obj){
		window.open('',name, winprops);
		obj.target		= name;
		obj.action		= url;
		obj.submit();
		return;
	}else{
		window.open(url,name, winprops);
	}
}

/*########################### ,°¡ ÀÖ´Â ±Ý¾× ¸®ÅÏ ###########################
	'ÇÔ¼ö¸í :	fnMoney
	'³»¿ë   :	,°¡ ÀÖ´Â ±Ý¾× ¸®ÅÏ
	'ÆÄ¶ó¹ÌÅÍ :
	'strNum - ±Ý¾×
	'AUTH : ¿¬¾çÈì
	'ÀÛ¾÷ÀÏ : 2008.11.22
*/

function fnMoney(strNum){
	if(event.keyCode==37||event.keyCode==39) return;

	var strNum = '' + strNum;
	var result = '';

	for(var i=0; i<strNum.length; i++) {
		if(i%3==0 && i!=0) result = ',' + result;
		result = strNum.charAt(strNum.length-(i+1)) + result;
	}

	return result;
}
function fnAllMoney(strNum){/////////////´ÜÀ§ È¯»êÀ» À§ÇØ
	if(event.keyCode==37||event.keyCode==39) return;

	var strNum = '' + strNum;
	var result = '';

	for(var i=0; i<strNum.length; i++) {
		if(i%3==0 && i!=0) result = ',' + result;
		result = strNum.charAt(strNum.length-(i+1)) + result;
	}

	return result;
}


//########################## ,°¡ ÀÖ´Â ±Ý¾× ¸®ÅÏ ###########################

/*########################### ½ÂÀÎÃ¢ ###########################
	'ÇÔ¼ö¸í :	fnConfirm
	'³»¿ë   :	½ÂÀÎÃ¢
	'ÆÄ¶ó¹ÌÅÍ :
	'msg - ¸Þ¼¼Áö
	'AUTH : ¿¬¾çÈì
	'ÀÛ¾÷ÀÏ : 2008.11.22
*/
function fnConfirm(msg){
	ans = confirm('   \n\n    '+msg+'         \n\n');
	if(!ans) return 1;
}
//########################### ½ÂÀÎÃ¢ ###########################



/*########################### Æ÷Ä¿½º ÀÌµ¿ ###########################
	'ÇÔ¼ö¸í :	fnNextFocus
	'³»¿ë   :	Æ÷Ä¿½º ÀÌµ¿
	'ÆÄ¶ó¹ÌÅÍ :
	'obj1 - ¼±ÅÃµÈ ¿ÀºêÁ§Æ®
	'obj2 - ÀÌµ¿ÇÒ ¿ÀºêÁ§Æ®
	'len - ±æÀÌ Ã¼Å©ÈÄ ÀÌµ¿
	'AUTH : ¿¬¾çÈì
	'ÀÛ¾÷ÀÏ : 2008.11.22
*/
function fnNextFocus(obj1,obj2,len){
	if (obj1.value.length==len){
		obj2.focus();
	}
}
//########################### Æ÷Ä¿½º ÀÌµ¿ ###########################


/*########################### ½ºÄÉÁì ÇÁ¸°Æ® ###########################
	'ÇÔ¼ö¸í :	fnSchedulePrint
	'³»¿ë   :	½ºÄÉÁì ÇÁ¸°Æ®
	'ÆÄ¶ó¹ÌÅÍ :
	'obj - ÇÁ¸°Æ®È­¸é
	'AUTH : ¿¬¾çÈì
	'ÀÛ¾÷ÀÏ : 2008.11.22
*/
function fnSchedulePrint(obj){
	var url = "/tour/common/pop_schedule_print.asp";
	fnWinOpen("690","600","","","schedule_print",url,"yes",obj);

}
function fnScheduleMail(event_cd, comp_cd){
	var url = "http://tour.paran.com/tour/common/admin_pop_schedule_mail.asp";
	fnWinOpen("760","700","","","schedule_mail",url,"yes", document.frmRes);
}
//########################### ½ºÄÉÁì ÇÁ¸°Æ® ###########################

//########################### À©µµ¿ìÃ¢ ¿ÀÇÂ ###########################

// ÀÌ¹ÌÁö Å¬¸¯ ½Ã Á¡¼± ¾ø¾Ö±â
// 2008-11-14 Çã±¤¸í
function bluring(){
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocus=bluring;


// ÇÃ·¡½Ã ¸µÅ©
// 2008-11-22 Çã±¤¸í
// »ç¿ë¹æ¹ý
// <script>flash("°¡·ÎÅ©±â","¼¼·ÎÅ©±â","url")</script>

function inicisPopup(){
	window.open('http://tour.clubrichtour.co.kr/common/pop_card.asp', 'card_popup', 'width=333, height=430');
}

function paran_flash(width,height,flash_name) {
	//alert("asdf");

	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'">');
	document.write('<param name="movie" value="'+flash_name+'" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="transparent" />');  //Åõ¸íÇÃ·¡½¬°¡ ¾Æ´Ò°æ¿ì ÀÌ ¶óÀÎÀ» »èÁ¦
	//document.write('<param name="bgcolor" value="ffffff" />');
	document.write("<param name='allowScriptAccess' value='always' />");
	document.write('<embed src="'+flash_name+'" quality="high" wmode="transparent" bgcolor="ffffff" width="'+width+'" height="'+height+'"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>')

}

function paran_flash_notran(width,height,flash_name) {
	//alert("asdf");

	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'">');
	document.write('<param name="movie" value="'+flash_name+'" />');
	document.write('<param name="quality" value="high" />');
	//document.write('<param name="wmode" value="transparent" />');  //Åõ¸íÇÃ·¡½¬°¡ ¾Æ´Ò°æ¿ì ÀÌ ¶óÀÎÀ» »èÁ¦
	//document.write('<param name="bgcolor" value="ffffff" />');
	document.write("<param name='allowScriptAccess' value='always' />");
	document.write('<embed src="'+flash_name+'" quality="high" wmode="transparent" bgcolor="ffffff" width="'+width+'" height="'+height+'"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>')

}

// ±¹³»¼÷¹Ú : ±âÈ¹/ÀÌº¥Æ®Àü °øÅë »ç¿ëÇÏ±â
// 2008-12-17 Çã±¤¸í
// À¯ÀÇ»çÇ×
// ½ºÅ©¸³Æ® º¯°æ ½Ã ÆÄ¶õ¿¡µµ º¯°æÇØ¾ß ÇÔ
function goDomHotel(hn){
	//hn : È£ÅÚÄÚµå

	location.href='http://tour3.paran.com/agent/reservation/main?aid=paran&amp;hcode='+hn;

}


//-- Ajax
var ajax_request;
function createRequest()
{
	try {
		ajax_request = new XMLHttpRequest();
	} catch (trymicrosoft) {
		try {
			ajax_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (othermicrosoft) {
			try {
				ajax_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (failed) {
				ajax_request = false;
			}
		}
	}
}

//-- Swap Image
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_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_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];}
}

//-- ÄíÅ°
function setCookie( name, value, expiredays )
{ var todayDate = new Date();
  todayDate.setDate( todayDate.getDate() + expiredays );
  document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function getCookie( name )
{
	var nameOfCookie = name + "=";
	var x = 0;
	while( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie )
		{	if( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	return "";
}

//-- ¼ýÀÚ¸¸ ÀÔ·Â¹Þ±â
function OnlyNumber()
{ if( (event.keyCode<48) || (event.keyCode>57) )
  { event.returnValue = false; }
}

//-- ¶óµð¿À ¹öÆ°ÀÇ Ã¼Å©µÈ index ±¸ÇÏ±â
function get_checked_index( obj )
{
	if( obj.length )
	{	for( var i=0; i<obj.length; i++ )
		{ if( obj[i].checked == true )
			{ return i; }
		}
	}
	else
	{ if( obj.checked == true )
		{ return 0; }
	}
	return -1;
}


// Çã±¤¸í Å¬·´¸®Ä¡¿¡¼­ ¿Å°Ü ¿ÔÀ½
//-- Ãµ ´ÜÀ§¸¶´Ù ÄÞ¸¶(,) ³Ö±â

function comma( val )
{
	var num = val.toString()
	var len = num.length;
	var cnt = 1;
	var str = "";

	if( len > 3  )
	{ while( len >= cnt )
		{ str = str + num.substr(len-cnt,1);
			if( cnt % 3 == 0 && cnt < len )
			{ str = str + ","; }
			cnt++;
		}
		len = str.length;
		num = "";
		for( var i=1; i<=str.length; i++ )
		{	num = num + str.substr(len-i,1); }
	}

	return num;
}


//-- Re-define trim function.
String.prototype.trim = function() {
  return this.replace(/(^\s*)|(\s*$)/g, "");
}


//-- ÆË¾÷¿­±â
var open_win;
function popwinOpen( url, iWidth, iHeight )
{
	var wleft = (screen.availWidth-iWidth)/2;
	var wtop = (screen.availHeight-iHeight)/2-40;
	if( open_win != null )
	{ open_win.close(); }
	open_win = window.open(url,"open_pop","toolbar=no,meunbar=no,scrollbars=no,status=no,width="+iWidth+",height="+iHeight+",left="+wleft+",top="+wtop);
	open_win.focus();
}
