//------------------------------------------------------------------------------------------------------------
//	banner rotativo - arturo -  abril 2011 -  http://www.sieteflores.com.ar - arturo@sieteflores.com.ar
//------------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------------
//	banner rotativo - arturo -  abril 2011 -  http://www.sieteflores.com.ar - arturo@sieteflores.com.ar
//------------------------------------------------------------------------------------------------------------

function makeHttpRequest2(url2, callback_function2, return_xml2)
{
   var http_request2 = false;

   if (window.XMLHttpRequest) { // Mozilla, Safari y demas,...
       http_request2 = new XMLHttpRequest();

				   if (http_request2.overrideMimeType) {
					   http_request2.overrideMimeType('text/xml');
				   }

			   } else if (window.ActiveXObject) { // Explorer
				   try {
					   http_request2 = new ActiveXObject("Msxml2.XMLHTTP");
				   } catch (e) {
					   try {
						   http_request2 = new ActiveXObject("Microsoft.XMLHTTP");
					   } catch (e) {}
				   }
   }
//------------------------------------------------------------------------------------------------------------

   if (!http_request2) {
       alert('Tu explorador no soporta este tipo de programacion, actualiza el mismo.');
       return false;
   }

   //------------------------------------------------------------------------------------------------------------

   http_request2.onreadystatechange = function() {
       if (http_request2.readyState == 4) {
           if (http_request2.status == 200) {
               if (return_xml2) {
                   eval(callback_function2 + '(http_request2.responseXML)');
               } else {
                   eval(callback_function2 + '(http_request2.responseText)');
               }
           } else {
              // alert('Hay un problema con el request.(Codigo: ' + http_request2.status + ')');
           }
       }
   }
   http_request2.open('GET', url2, true);
   http_request2.send(null);
}

//------------------------------------------------------------------------------------------------------------

function loadBanner2(xml2)
{
    var html_content2 = xml2.getElementsByTagName('content2').item(0).firstChild.nodeValue;
    var reload_after2 = xml2.getElementsByTagName('reload2').item(0).firstChild.nodeValue;
    document.getElementById('ajax-banner2').innerHTML = html_content2;

    try {
        clearTimeout(to2);
    } catch (e) {}

    to2 = setTimeout("nextAd2()", parseInt(reload_after2));

}
//------------------------------------------------------------------------------------------------------------

function nextAd2()
{
    var now = new Date();
    var url2 = 'ajax-banner2.asp?ts=' + now.getTime();
    makeHttpRequest2(url2, 'loadBanner2', true);
}
//------------------------------------------------------------------------------------------------------------
//window.onload = nextAd2;
//------------------------------------------------------------------------------------------------------------

