
var request;

function newXMLHttpRequest() { 

  var xmlhttp = false; 

  if (window.XMLHttpRequest) {  
    xmlhttp = new XMLHttpRequest(); 
  } else if (window.ActiveXObject) {  
    try { 
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
    } catch (e1) { 
      try { 
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
      } catch (e2) { 
     	return false; 
	  } 
    } 
  } 
  return xmlhttp; 
}

function printData(txt_layer,txt) {
    document.getElementById(txt_layer).innerHTML = txt; 
}

function processReqChange() { 
	if (request.readyState == 4) { 
		if (request.status == 200) {
			printData('msg',request.responseText); 
			document.getElementById("msg").style.display="none"; 
		} else { 
			alert("a problem retrieving the XML data:\n" + 
			request.statusText); 
		} 
	} 
} 

function trim(str){
        return str.replace(/(^\s+)|(\s+)$/,"");
}


function hs_check(str,str_code)
{
    if(str_code == "han")   var check_patten = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    else                    var check_patten = "0123456789";

     for( i=0 ; i < str.length ; i++ ) {
         ch = check_patten.indexOf(str.charAt(i));
        if( ch == -1 ) return false;
     }
return true;
}

function layer_pointY(){
	var y_point = event.clientY;
	var theY    = parseInt(y_point)+document.body.scrollTop-110;
        
	return theY;
}

function layer_pointX(){
	var x_point = event.clientX;
	var theX    = parseInt(x_point)+document.body.scrollLeft;
        
	return theX;
}


