var resstr;
function _gel(id){
return document.getElementById(id);
}

function getXmlHttpRequest()
{
var httpRequest=null;
try
{
httpRequest=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
httpRequest=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
httpRequest=null;
}
}
if(!httpRequest&&typeof XMLHttpRequest!="undefined")
{
httpRequest=new XMLHttpRequest();
}
return httpRequest;
}


function getUrlA(url){
	resstr=null;
	var tmpurl=url;	
	var xmlHttpReq=getXmlHttpRequest();
	if(!xmlHttpReq)	return;	
	
	xmlHttpReq.onreadystatechange=function(){		
		
		response(xmlHttpReq);		
	}
xmlHttpReq.open("GET",tmpurl,true);
xmlHttpReq.send(null);
}

function response(xmlhttp) {
  if(xmlhttp.readyState != 4) return;  
 var tmp=(xmlhttp.status == 200 || xmlhttp.status == 0) ? xmlhttp.responseText :"";

resstr=tmp;
  
}

function getUrl(url,tagId){
	var tmpurl=url;	
	var xmlHttpReq=getXmlHttpRequest();
	if(!xmlHttpReq)	return;
	//alert(_gel(tagId));
	if(_gel(tagId)=='') return;
	xmlHttpReq.onreadystatechange=function(){		
		 responseUrl(xmlHttpReq, tagId);
	}
	
xmlHttpReq.open("GET",tmpurl,true);
xmlHttpReq.send(null);
}

function responseUrl(xmlhttp,tagid) {
  if(xmlhttp.readyState != 4)return;
    var tmp= (xmlhttp.status == 200 || xmlhttp.status == 0) ? xmlhttp.responseText :"0";   
 _gel(tagid).innerHTML=tmp;
}
function parseScript(_source) {
	var source = _source;
	var scripts = new Array();
	
	// Strip out tags
	while(source.indexOf("<script") > -1 || source.indexOf("</script") > -1) {
		var s = source.indexOf("<script");
		var s_e = source.indexOf(">", s);
		var e = source.indexOf("</script", s);
		var e_e = source.indexOf(">", e);
		
		// Add to scripts array
		scripts.push(source.substring(s_e+1, e));
		// Strip from source
		source = source.substring(0, s) + source.substring(e_e+1);
	}
	
	// Loop through every script collected and eval it
	for(var i=0; i<scripts.length; i++) {
		try {
			eval(scripts[i]);
		}
		catch(ex) {
			// do what you want here when a script fails
		}
	}
	
	// Return the cleaned source
	return source;
}

