//<JavaScript>
//<Kategori id="refarensu" encoding="1"  ><![CDATA[ 
/**********************************************************************
 *
 * v 1.8 2006/02/07 03:19:55 pspencer Exp $
 *
 * purpose: a simple cross-browser XmlHttpRequest interface that adds
 *          support for multiple, concurrent requests
 *
 * author: Paul Spencer (pspencer@dmsolutions.ca)
 *
 * TODO:
 *   - reponse only contains responseText, should contain response so
 *     access to reponseXML is possible if we ever want to implement
 *     xml stuff (i.e. real AJAX)
 * 
 **********************************************************************/
 var testajax ="asdfasdfasdfsdf";
var READYSTATE_UNINITIALIZED=0;
var READYSTATE_LOADING=1;
var READYSTATE_LOADED=2;
var READYSTATE_INTERACTIVE=3;
var READYSTATE_COMPLETED =4;

var aXmlHttp = new Array();
var aXmlResponse = new Array();
var strPageView ="";
function xmlResult()
{
    for(var i=0;i<aXmlHttp.length;i++)
    {
        if(aXmlHttp[i] && aXmlHttp[i][0] && aXmlHttp[i][0].readyState==4&&aXmlHttp[i][0].responseText)
        {
            //must null out record before calling function in case
            //function invokes another xmlHttpRequest.
            var f = aXmlHttp[i][2];
            var o = aXmlHttp[i][1];
            var s = aXmlHttp[i][0].responseText;
            aXmlHttp[i][0] = null;
            aXmlHttp[i][1] = null;
            aXmlHttp[i] = null;
            f.apply(o,new Array(s));
        }
    }    
    pageTracker._trackPageview("/"+strPageView);
};

// u -> url
// o -> object (can be null) to invoke function on
// f -> callback function
// p -> optional argument to specify POST
function call(u,o,f)
{
    var method = "GET";
    var dat;
    strPageView = u.split(/\?/)[0];
    if (arguments.length==4){
        method = "POST";
        tmp = u.split(/\?/);
        u = tmp[0];
        dat = tmp[1];
    }
    var idx = aXmlHttp.length;
    for(var i=0; i<idx;i++)
    if (aXmlHttp[i] == null)
    {
        idx = i;
        break;
    }
    aXmlHttp[idx]=new Array(2);
    aXmlHttp[idx][0] = getXMLHTTP();

    aXmlHttp[idx][1] = o;
    aXmlHttp[idx][2] = f;
    if(aXmlHttp[idx])
    {
        aXmlHttp[idx][0].open(method,u,true);
        if(method == "POST"){
          aXmlHttp[idx][0].setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
         
         aXmlHttp[idx][0].send(dat);
        }
        aXmlHttp[idx][0].onreadystatechange=xmlResult;        
        if(method =="GET"){ aXmlHttp[idx][0].send(null);}
    }
};


// u -> url
// o -> object (can be null) to invoke function on
// f -> callback function
// p -> optional argument to specify POST
function callFalse(u,o,f)
{
//debugger;
    var method = "GET";
    var dat;
    if (arguments.length==4){
        method = "POST";
        tmp = u.split(/\?/);
        u = tmp[0];
        dat = tmp[1];
    }
    var idx = aXmlHttp.length;
    for(var i=0; i<idx;i++)
    if (aXmlHttp[i] == null)
    {
        idx = i;
        break;
    }
    aXmlHttp[idx]=new Array(2);
    aXmlHttp[idx][0] = getXMLHTTP();

    aXmlHttp[idx][1] = o;
    aXmlHttp[idx][2] = f;
    if(aXmlHttp[idx])
    {
        aXmlHttp[idx][0].open(method,u,false);
        if(method == "POST"){
          aXmlHttp[idx][0].setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
         
         aXmlHttp[idx][0].send(dat);
        }
        aXmlHttp[idx][0].onreadystatechange=xmlResult;        
        if(method =="GET"){ aXmlHttp[idx][0].send(null);}
    }
};
function back4IE(){

	objXml=getXMLHTTP();
	objXml.onreadystatechange =function(){
		var datum=null;
		if (objXml.readyState==READYSTATE_COMPLETED){
			datum=objXml.responseText;  
           }
    	//	inform(path,datum);
//    		new ActiveXObject('Microsoft.XMLHttp')
        } 
        //alert(url);
	//	objXml.open("GET",myurl);
	//	objXml.send(null);


};


function CreateXML(){

 return new ActiveXObject('Microsoft.XMLHttp')
};//---------------



function getXMLHTTP()
{
    var A=null;
    if(!A && typeof XMLHttpRequest != "undefined"){
        A=new XMLHttpRequest();
    }
    if (!A){
        try{
            A=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch(e){
            try{
                A=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch(oc){
                A=null
            }
        }
    }    
    return A;
};
//]]></Kategori>
//</JavaScript>