// JavaScript Document

	function ajaxFunction(file, action, param2, div){
		var xmlHttp;
		try{  // Firefox, Opera 8.0+, Safari  
			xmlHttp=new XMLHttpRequest();  
		}catch (e){  // Internet Explorer  
			try{    
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
			}catch (e){    
				try{      
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
				}catch (e){      
					alert("Your browser does not support AJAX!");      
					return false;      
				}    
			}  
		}
		xmlHttp.onreadystatechange=function(){
			if(xmlHttp.readyState==4){
			  if(div!='') document.getElementById(div).innerHTML=xmlHttp.responseText;
			  return true;
			}
		}
		xmlHttp.open("GET", file + "?checkID=" + parseInt(Math.random()*99999999) 
		                       + "&action=" + action + "&parameter=" + param2,true);
		xmlHttp.send(null);  
	}


function js_array_to_php_array (a)
// This converts a javascript array to a string in PHP serialized format.
// Javascript “escape()” function before you pass this string to PHP.
{
    var a_php = "";
    var total = 0;
    for (var key in a)
    {
        ++ total;
        a_php = a_php + "s:" +
                String(key).length + ":\"" + String(key) + "\";s:" +
                String(a[key]).length + ":\"" + String(a[key]) + "\";";
    }
    a_php = "a:" + total + ":{" + a_php + "}";
    return a_php;
}

