//Create XMLHttpRequest Object
//----------------------------------------------------------------
  function createHttpRequest(){

    //For Win IE
    if(window.ActiveXObject){
        try {
            //For MSXML2 or later
            return new ActiveXObject("Msxml2.XMLHTTP")
        } catch (e) {
            try {
                //For MSXML
                return new ActiveXObject("Microsoft.XMLHTTP")
            } catch (e2) {
                return null
            }
         }
    } else if(window.XMLHttpRequest){
        //For Browser has XMLHttpRequest Object except Win IE
        return new XMLHttpRequest()
    } else {
        return null
    }
  }


// Validate the message via accessign a file
//----------------------------------------------------------------
  function xHttprequestACT( data , method , fileName , async )
  {

    //Create XMLHttpRequest Object 
    var httpoj = createHttpRequest()

    //open Method
    httpoj.open( method , fileName , async )

    //Event of get message
    httpoj.onreadystatechange = function()
    {
      //Message recieve complete when the readyState is 4
      if (httpoj.readyState==4)
      {
        //callback
        on_loaded(httpoj)
      }
    }
    
    //send method
    httpoj.send( data )

  }


//callback function
//----------------------------------------------------------------
  function on_loaded(oj)
  {

        //get response
        res  = oj.responseText
        
        //Display the HTML on the layer
		getPageH();
		xhideAlt();
		document.getElementById('mainc').innerHTML = res
		document.getElementById('closer').style.display = "block";
		document.getElementById('mainc').style.display = "block";
		document.getElementById('mainwaku').style.display = "block";
		
  }


//Call ajax by the URL on load
		function getData(){
		var get_data;
		var arg;
		get_data = unescape(location.search);//value of address bar
		get_data = get_data.substring(get_data.indexOf('?')+1,get_data.length);
		
		term="&";
		split_get_data=get_data.split(term);
		eval(split_get_data[0]);
		//alert(arg);
		if(arg==1){ // Call the Ajax when the arg is 1
			if(get_data != ""){	// Address bar is not null
			get_data = get_data.substring(get_data.indexOf('?')+1,get_data.length);	// get the string after the ? of Address bar
			ajaxname ="./"+get_data+".html"
			xClickACT(ajaxname);//call ajax function
			}else{
					get_data = '';
			}
			}
			
		}
