MOUS_X = -1;  //¹öÀü 4 ÀÌÇÏ¿¡¼­ÀÇ ¿¡·¯ ¹æÁö¸¦ À§ÇØ
MOUSE_Y = -1;  //¹öÀü 4 ÀÌÇÏ¿¡¼­ÀÇ ¿¡·¯ ¹æÁö¸¦ À§ÇØ
client_X = 0;
client_Y = 0;
client_XX = 0;
client_YY = 0;

document.onmousemove = mouseXY;  //¸¶¿ì½º ÀÌµ¿ ÀÌº¥Æ® ÇÚµé·¯¸¦ ÁöÁ¤
function mouseXY(e){
	if (navigator.appName == "Microsoft Internet Explorer"){
		client_X = document.body.scrollLeft + event.clientX;  //XÁÂÇ¥°ªÀ» ±¸ÇÑ´Ù.
		client_Y = document.body.scrollTop + event.clientY;  //YÁÂÇ¥°ªÀ» ±¸ÇÑ´Ù.
		client_XX = event.clientX;
		client_YY = event.clientY;

	} else {
		client_X = document.body.scrollLeft + e.clientX;  //XÁÂÇ¥°ªÀ» ±¸ÇÑ´Ù.
		client_Y = document.body.scrollTop + e.clientY;  //YÁÂÇ¥°ªÀ» ±¸ÇÑ´Ù.
		client_XX = e.clientX;
		client_YY = e.clientY;
	}
}

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];}
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function close_window() {
    window.close();
}


function borderit(which,color){
    if (document.all||document.getElementById){
        which.style.borderColor=color
    }
}

function pop_money()
{
	window.open('/tourinfo/money/money.asp','money','resizable=no scrollbars=no width=184 height=175');
}


function popView(str){
	window.open(str, 'popView', 'width=648, height=650, top=0, left=0, scrollbars=yes');
}

// ÅÃ½º¶õ?

function showToolTip(e,text){
      document.all.ToolTip.innerHTML="<table><tr><td class=ToolTipTD>"+text+"</td></tr></table>";
      ToolTip.style.pixelLeft=(e.x+5+document.body.scrollLeft);
      ToolTip.style.pixelTop=(e.y+document.body.scrollTop);
      ToolTip.style.visibility="visible";
}

function hideToolTip(){
      ToolTip.style.visibility="hidden";
}

// ÇÁ¸°ÅÍ
function printWindow() {
	//browserVersion = parseInt(navigator.appVersion)
	//if(browserVersion >=4)
		window.print()
}

// ÀÌ¹ÌÁö¿¡ ¸ÂÃç¼­, ÆË¾÷¶ç¿ì±â
function popimage(imagesrc,winwidth,winheight){
    var look='width='+winwidth+',height='+winheight+','
        popwin=window.open("","",look)
        popwin.document.open()
        popwin.document.write('<title>Image Window</title><body topmargin=0 leftmargin=0><img style=cursor:hand; onclick="self.close()" src="'+imagesrc+'"></body>')
        popwin.document.close()
}
// Â÷ÀÌ³ª¹Ú»ç ¹«ÇÑºñÀÚ
function showToolTipChina(a,text2){
      document.all.ToolTipChina.innerHTML="<table><tr><td class=ToolTipTD>"+text2+"</td></tr></table>";
      ToolTipChina.style.pixelLeft=(a.x+5+document.body.scrollLeft);
      ToolTipChina.style.pixelTop=(a.y+document.body.scrollTop);
      ToolTipChina.style.visibility="visible";
}

function hideToolTipChina(){
      ToolTipChina.style.visibility="hidden";
}

// ±ÛÀÚ¼ö Ã¼Å©(¼³¸í,Æû,±æÀÌ)
function TTcheck_length(strchar,strreal_byte,len) {
    real_byte = strreal_byte.value.length;
    for (ii=0; ii < strreal_byte.value.length; ii++){
        temp = strreal_byte.value.substr(ii,1).charCodeAt(0);
        if (temp > 127) { real_byte++; }
    }
    if (real_byte > len){
        alert(strchar+"´Â(Àº) "+len+"byte¸¦ ³ÑÀ»¼ö ¾ø½À´Ï´Ù.")
        return false;
    }
    return true;
}
/******************************************************
 * Function¸í : NullStringCheck(Ã¼Å©Æû,Æ÷Ä¿½ºÆû,¿¡·¯¸Þ½ÃÁö)
 * ¼³      ¸í : ÇÊ¼öÀÔ·Â Ã¼Å©(TEXT)
 ******************************************************/
function TTNullStringCheck(obj,focobj,msg){
    if (trim(obj.value)==""){
        if(msg!="")
            alert(msg);
        if(focobj!="")
            focobj.focus();
        return false;
    }
    return true;
}

/******************************************************
 * Function¸í : NullRadioCheck(Ã¼Å©Æû,Æ÷Ä¿½ºÆû,¿¡·¯¸Þ½ÃÁö)
 * ¼³      ¸í : ÇÊ¼öÀÔ·Â Ã¼Å©(RADIO)
 ******************************************************/
function NullRadioCheck(obj,focobj,msg){
	var pi = 0
	for(var i=0; i<obj.length;i++){
		if(obj[i].checked == true) pi=1;
	}
	if(pi != 1){
		alert(msg + "¸¦(À») ¼±ÅÃÇØ ÁÖ¼¼¿ä");
        if(focobj!="")
            focobj.focus();
        return false;
	}
	return true;
}

/******************************************************
 * Function¸í : TTIsNumber(Ã¼Å©Æû,Æ÷Ä¿½ºÆû,¿¡·¯¸Þ½ÃÁö)
 * ¼³      ¸í : ¼ýÀÚÇüÃ¼Å©
 ******************************************************/
function TTIsNumber(obj,focobj,msg){
       for(var i=0; i<obj.value.length; i++){
        var chr = obj.value.substr(i,1);
        if((chr < '0' || chr > '9')){
		if(msg!="")
			alert(msg);
		if(focobj!="")
			focobj.focus();
            return false;
        }
    }
    return true;
}

function trim (str) {
    str = this != window? this : str;
    return str.replace(/^\s+/, '').replace(/\s+$/, '');
}


function snedMail(m){
	window.open("http://corp.tourbaksa.com/pop_Staff_email.asp?mail=" + m, "_sendMail", "width=420,height=420");
}




/*****************************************************
 * function ¸í : xmlRequest()
 * ¼³¸í : ±âº» XMLHttpRequest ¼³Á¤ °ü·Ã 
 *2009-01-13 ÀÌÈÄ ¼³Á¤ ºÎºÐ¿¡¼­ ±âº» ¼³Á¤ ÇÏ±â!
*****************************************************/
var greq = false;
 function xmlRequest() {
	
	if (window.XMLHttpRequest) {	// Create XMLHttpRequest object in non-Microsoft browsers
		greq = new XMLHttpRequest();
	} else if (window.ActiveXObject) {// Create XMLHttpRequest via MS ActiveX
		try {	 // Try to create XMLHttpRequest in later versions
			// of Internet Explorer
			greq = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {	// Failed to create required ActiveXObject
			try { // Try version supported by older versions
				// of Internet Explorer
				greq = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {	// Unable to create an XMLHttpRequest with ActiveX
			}
		}
	}
	return greq;
}

function $(id){
	return document.getElementById(id);
}