/*
----------------------------------------------------------------
AJAX Class
oAjax.Connect('fncCargarCombo');
oAjax = new AjaxClass('main.asp?datos=1');
----------------------------------------------------------------
*/
function AjaxClass(oContent,sFile)
{
	var _urlHttpXml = 'http://www.carlotastockar.com/ajax/' + sFile;
 //var oHttpXml;
 //var  str   = String(document.location);
 //var _str_u   = str.indexOf("/");
 //_urlHttpXml =  str.substring(0,_str_u) + '/ajax/' + sFile;
// alert(_urlHttpXml);
	
    try { 
        oHttpXml = new ActiveXObject("MSXML2.XMLHTTP"); 
    }
    catch(ex) { 
        try {
            oHttpXml = new ActiveXObject("Microsoft.XMLHTTP"); 
        }
        catch(ex) { 
            try {
                oHttpXml = new XMLHttpRequest(); 
            } catch(ex) {
				oHttpXml = false; 
            }
        }
    }
    if(!oHttpXml){
		return false;
	}
	
	this.connect = function(FncProcData)
	{
		try {
            oHttpXml.open('POST', _urlHttpXml, true);
            oHttpXml.setRequestHeader("Method", "POST " + _urlHttpXml + " HTTP/1.1");
            oHttpXml.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
			
			oHttpXml.onreadystatechange = function(){
				if(oHttpXml.readyState == 4){
					if(FncProcData == null){
						if(oContent == null){
							document.write(oHttpXml.responseText);
						}else{
							document.getElementById(oContent).innerHTML = oHttpXml.responseText;
						}
					}else{
						var r = oHttpXml.responseText
						r = r.replace(/"/g, '');
						r = r.replace(/'/g, '"');
						window.eval(FncProcData + '(\'' + r + '\')');
					}
				}
			}
			oHttpXml.send(null);
		} catch(ex) {
			return ex.message;
		}
	}
}


function AjaxClassCoty(oContent,sFile,Preloader){
	
	var oHttpXml;
	/*
	var  str   = String(document.location);
	var _str_u   = str.indexOf("/");
	var _urlHttpXml =  str.substring(0,_str_u) + '/cotizador/ajax/' + sFile;  
	*/
	//var _urlHttpXml = 'http://www.clicktur.com/clientes/mouse/web/cotizador/ajax/' + sFile;
	var _urlHttpXml = 'http://mouse.clicktur.com/cotizador/ajax/' + sFile;

    try { 
        oHttpXml = new ActiveXObject("MSXML2.XMLHTTP"); 
    }
    catch(ex) { 
        try {
            oHttpXml = new ActiveXObject("Microsoft.XMLHTTP"); 
        }
        catch(ex) { 
            try {
                oHttpXml = new XMLHttpRequest(); 
            } catch(ex) {
				oHttpXml = false; 
            }
        }
    }
    if(!oHttpXml){
		return false;
	}
	
	this.connect = function(FncProcData){
		try {
            oHttpXml.open('POST', _urlHttpXml, true);
            oHttpXml.setRequestHeader("Method", "POST " + _urlHttpXml + " HTTP/1.1");
            oHttpXml.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
			
			oHttpXml.onreadystatechange = function(){
				if(oHttpXml.readyState == 4){
					if(FncProcData == null){
						if(oContent == null){
							document.write(oHttpXml.responseText);
						}else{
							document.getElementById(oContent).innerHTML = oHttpXml.responseText;
						}
					}else{
						var r = oHttpXml.responseText
						r = r.replace(/"/g, '');
						r = r.replace(/'/g, '"');
						window.eval(FncProcData + '(\'' + r + '\')');
					}
				}else{
					if(Preloader == 1){
						document.getElementById(oContent).innerHTML = "<table width='625' border='0' align='center' cellpadding='0' cellspacing='0' class='tbl_Panel'><tr><td height='100' align='center'><img src='http://www.clicktur.com/clientes/mouse/web/cotizador/images/preloader64.gif'><br>  <br />  <br />  <br />  <div style='font-family:Tahoma, font-size:13px; font-weight:bold;color:#0672b3 '>Buscando el mejor Precio</div></td></tr></table>";
					}
				}
			}
			oHttpXml.send(null);
		} catch(ex) {
			return ex.message;
		}
	}
	
}

