//------------------------------------------------------------------------------------------------------------
//	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 makeHttpRequest5(url5, callback_function5, return_xml5)
{
   var http_request5 = false;

   if (window.XMLHttpRequest) { // Mozilla, Safari y demas,...
       http_request5 = new XMLHttpRequest();

				   if (http_request5.overrideMimeType) {
					   http_request5.overrideMimeType('text/xml');
				   }

			   } else if (window.ActiveXObject) { // Explorer
				   try {
					   http_request5 = new ActiveXObject("Msxml2.XMLHTTP");
				   } catch (e) {
					   try {
						   http_request5 = new ActiveXObject("Microsoft.XMLHTTP");
					   } catch (e) {}
				   }
   }
//------------------------------------------------------------------------------------------------------------

   if (!http_request5) {
       alert('Tu explorador no soporta este tipo de programacion, actualiza el mismo.');
       return false;
   }

   //------------------------------------------------------------------------------------------------------------

   http_request5.onreadystatechange = function() {
       if (http_request5.readyState == 4) {
           if (http_request5.status == 200) {
               if (return_xml5) {
                   eval(callback_function5 + '(http_request5.responseXML)');
               } else {
                   eval(callback_function5 + '(http_request5.responseText)');
               }
           } else {
              // alert('Hay un problema con el request.(Codigo: ' + http_request5.status + ')');
           }
       }
   }
   http_request5.open('GET', url5, true);
   http_request5.send(null);
}

//------------------------------------------------------------------------------------------------------------

function loadBanner5(xml5)
{
    var html_content5 = xml5.getElementsByTagName('content5').item(0).firstChild.nodeValue;
    var reload_after5 = xml5.getElementsByTagName('reload5').item(0).firstChild.nodeValue;
    document.getElementById('ajax-banner5').innerHTML = html_content5;

    try {
        clearTimeout(to5);
    } catch (e) {}

    to5 = setTimeout("nextAd5()", parseInt(reload_after5));

}
//------------------------------------------------------------------------------------------------------------

function nextAd5()
{
    var now = new Date();
    var url5 = 'ajax-banner5.asp?ts=' + now.getTime();
    makeHttpRequest5(url5, 'loadBanner5', true);
}
//------------------------------------------------------------------------------------------------------------
//window.onload = nextAd5;
//------------------------------------------------------------------------------------------------------------

