function createAjaxObj(){
	var httprequest=false;
	if (window.XMLHttpRequest){
		httprequest=new XMLHttpRequest();
		if (httprequest.overrideMimeType){
			httprequest.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject){
		try {
			httprequest=new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e){
			try{
				httprequest=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e){}
		}
	}
	return httprequest;
}
function getTranslate(name){
	var cookies = document.cookie;
	if (cookies.indexOf(name) != -1){
		var startpos = cookies.indexOf(name)+name.length+1;
		var endpos = cookies.indexOf(";",startpos);
		if(cookies.indexOf("&",startpos)<endpos){
			endpos=cookies.indexOf("&",startpos);
		}
		if (endpos == -2) endpos = cookies.length;
		return unescape(cookies.substring(startpos,endpos));
	}else{
		return false; // the cookie couldn't be found! it was never set before, or it expired.
	}
}
function translateAjax(s){
	if(getTranslate('lg')=='es-mx'){
		var ajax=createAjaxObj();
		var url='http://'+document.location.hostname+'/translate.asp';
		ajax.open('GET', url+'?content='+escape(s),false);
		ajax.send(null);
		if(ajax.status == 200) {
			s = ajax.responseText;					
		}
		ajax=null;
	}
	return s;
}






