function loadScript(scriptURL){
	var newScript = document.createElement("script");
	newScript.src = scriptURL;
	document.body.appendChild(newScript);
}



function loadData(id,URL){
xmlReq = null;	
    //alert("LoadData: xmlReq: "+xmlReq+" id: "+id+" URL: "+URL);
   /* if(xmlReq == null){
            if(window.ActiveXObject){
                try{
                    xmlReq = new ActiveXObject("Msxml2.XMLHTTP");
                 } catch(e){
                        xmlReq = null;
                 	try{
                                xmlReq = new ActiveXObject("Microsoft.XMLHTTP");
                    } catch(E){
                      	if(window.XMLHttpRequest){
							try{
								xmlReq = new XMLHttpRequest();
								
							} catch(e) {
								if(window.createRequest){ 
									try{
										xmlReq = window.createRequest();
									}catch(e){
										alert('no browser found');
										return(0);
									}
								} 
							}
					   }
   					}
                }
        	}
     }  */               
                try{
                    xmlReq = new ActiveXObject("Msxml2.XMLHTTP");
                 } catch(e){
                 	try{
                                xmlReq = new ActiveXObject("Microsoft.XMLHTTP");
                    } catch(e){
							try{
								xmlReq = new XMLHttpRequest();
								
							} catch(e) {
								
									try{
										xmlReq = window.createRequest();
									}catch(e){
										//alert('no browser found');
										return(0);
									}
							 
							}
					 
   					}
               
        	}             
	//alert("xmlReq"+xmlReq);
	xmlReq.onreadystatechange = function(){	
	//alert("xmlReq.readyState: "+xmlReq.readyState);
		switch(xmlReq.readyState){
		case 0:	 SetWindowAjaxStatus('Connection: Uninitialized');
			break;
		case 1: SetWindowAjaxStatus('Connection: Loading...');
			break;
		case 2: SetWindowAjaxStatus('Connection: Loaded');
			break;
		case 3: SetWindowAjaxStatus('Connection: Interactive');
			break;
		case 4:	SetWindowAjaxStatus('Connection: Done!');
			setContent(id,xmlReq.responseText);
			break;
		default: SetWindowAjaxStatus('Connection: Error');
			break;
		}
	}

	try{
        xmlReq.open ('GET', URL, true);
    }catch(e){
	    xmlReq = null;    
    }
    
    if(xmlReq != null) { 
        setTimeout('xmlReq.send(null);',10);
    }
}

function setContent(id,datastr){	
	if((window.document.getElementById(id) != undefined) && (window.document.getElementById(id) != null)){
		window.document.getElementById(id).innerHTML = datastr;
	}
	//alert("id: "+ id +"\n\r"+datastr);
}
 
function SetWindowAjaxStatus(s){
/*
    try{
        window.status  = s;
        }catch(e){
            return true;
            }
*/
}

