//------------------------------------------------------------------------------------------------------------
//	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 makeHttpRequest3(url3, callback_function3, return_xml3)
{
   var http_request3 = false;

   if (window.XMLHttpRequest) { // Mozilla, Safari y demas,...
       http_request3 = new XMLHttpRequest();

				   if (http_request3.overrideMimeType) {
					   http_request3.overrideMimeType('text/xml');
				   }

			   } else if (window.ActiveXObject) { // Explorer
				   try {
					   http_request3 = new ActiveXObject("Msxml2.XMLHTTP");
				   } catch (e) {
					   try {
						   http_request3 = new ActiveXObject("Microsoft.XMLHTTP");
					   } catch (e) {}
				   }
   }
//------------------------------------------------------------------------------------------------------------

   if (!http_request3) {
       alert('Tu explorador no soporta este tipo de programacion, actualiza el mismo.');
       return false;
   }

   //------------------------------------------------------------------------------------------------------------

   http_request3.onreadystatechange = function() {
       if (http_request3.readyState == 4) {
           if (http_request3.status == 200) {
               if (return_xml3) {
                   eval(callback_function3 + '(http_request3.responseXML)');
               } else {
                   eval(callback_function3 + '(http_request3.responseText)');
               }
           } else {
             //  alert('Hay un problema con el request.(Codigo: ' + http_request3.status + ')');
           }
       }
   }
   http_request3.open('GET', url3, true);
   http_request3.send(null);
}

//------------------------------------------------------------------------------------------------------------

function loadBanner3(xml3)
{
    var html_content3 = xml3.getElementsByTagName('content3').item(0).firstChild.nodeValue;
    var reload_after3 = xml3.getElementsByTagName('reload3').item(0).firstChild.nodeValue;
    document.getElementById('ajax-banner3').innerHTML = html_content3;

    try {
        clearTimeout(to3);
    } catch (e) {}

    to3 = setTimeout("nextAd3()", parseInt(reload_after3));

}
//------------------------------------------------------------------------------------------------------------

function nextAd3()
{
    var now = new Date();
    var url3 = 'ajax-banner3.asp?ts=' + now.getTime();
    makeHttpRequest3(url3, 'loadBanner3', true);
}
//------------------------------------------------------------------------------------------------------------
//window.onload = nextAd3;
//------------------------------------------------------------------------------------------------------------

