<!--

var xmlHttp;
function createXMLHttpRequest(){
	if(window.ActiveXObject){
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); // code for IE6, IE5
	}else if(window.XMLHttpRequest){ // if(window.ActiveXObject){
		xmlHttp = new XMLHttpRequest(); // code for IE7+, Firefox, Chrome, Opera, Safari
	}else{ // if(window.ActiveXObject){
		alert("Your browser does not support XMLHTTP!");
	} // end if(window.ActiveXObject){
} // end function createXMLHttpRequest(){

function startRequest(send_type,url_send,show_text,html_head,ajax_img,html_footer,script_box,text_box){
createXMLHttpRequest();

var send_type;
var url_send;
var show_text;
var html_head;
var ajax_img;
var html_footer;
var script_box;
var text_box;
var html = "";

if(send_type == "get"){
xmlHttp.open("get",url_send, true);
xmlHttp.send(null);
}else{ // if(send_type == "get"){

var pForm = document.forms[url_send];
//var file = document.getElementById("file").value;
var pBody = getRequestBody(pForm);   
xmlHttp.open("post",pForm.action, true);
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttp.send(pBody);  
} // end if(send_type == "get"){

//
if(html_head != ""){
html = html_head;
} // end if(html_head != ""){
if(ajax_img != ""){
html = html+"<img src='"+path['url']+"/images/background/loading/"+ajax_img+".gif'>";
} // end if(ajax_img != ""){
if(html_footer != ""){
html = html+html_footer;
} // end if(html_footer != ""){
if(html != ""){
document.getElementById(show_text).innerHTML=""+html+"";
} // end if(html != ""){
//

xmlHttp.onreadystatechange = function (){
if(xmlHttp.readyState == 4){
if(xmlHttp.status == 200){
displayInfo(xmlHttp.responseText,show_text,script_box,text_box);
} else{ // if(xmlHttp.status == 200){
displayInfo("err : " + xmlHttp.statusText,show_text,script_box,text_box);
} // end if(xmlHttp.status == 200){
} // end if(xmlHttp.readyState == 4){
} // end xmlHttp.onreadystatechange = function (){

} // end function startRequest(send_type,url_send,show_text,ajax_img){

// formID
function getRequestBody(pForm){
var nParams = new Array();
for(var i=0; i < pForm.elements.length; i++){
var pParam = encodeURIComponent(pForm.elements[i].name);
pParam += "=";
pParam += encodeURIComponent(pForm.elements[i].value);
nParams.push(pParam);
} // end for(var i=0; i < pForm.elements.length; i++){
return nParams.join("&");        
} // end function getRequestBody(pForm){
// formID

// displayInfo
function displayInfo(responseTextvalue,show_text,script_box,text_box){
document.getElementById(show_text).innerHTML = xmlHttp.responseText;
if(script_box == "alert"){

if(xmlHttp.responseText.indexOf("--+--") != -1){
text_alert = xmlHttp.responseText.split("--+--");
alert(text_alert[1].replace("-->","")+text_box);
}

} // if(script_box == "alert"){
// confirm("sometext");
// prompt("sometext","defaultvalue");
} // end function displayInfo(responseTextvalue,show_text){
// end displayInfo
	
//-->
