//------------------------------------------------------------------------------------------------------------
//	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 makeHttpRequest1(url1, callback_function1, return_xml1)
{
   var http_request1 = false;

   if (window.XMLHttpRequest) { // Mozilla, Safari y demas,...
       http_request1 = new XMLHttpRequest();

				   if (http_request1.overrideMimeType) {
					   http_request1.overrideMimeType('text/xml');
				   }

			   } else if (window.ActiveXObject) { // Explorer
				   try {
					   http_request1 = new ActiveXObject("Msxml2.XMLHTTP");
				   } catch (e) {
					   try {
						   http_request1 = new ActiveXObject("Microsoft.XMLHTTP");
					   } catch (e) {}
				   }
   }
//------------------------------------------------------------------------------------------------------------

   if (!http_request1) {
       alert('Tu explorador no soporta este tipo de programacion, actualiza el mismo.');
       return false;
   }

   //------------------------------------------------------------------------------------------------------------

   http_request1.onreadystatechange = function() {
       if (http_request1.readyState == 4) {
           if (http_request1.status == 200) {
               if (return_xml1) {
                   eval(callback_function1 + '(http_request1.responseXML)');
               } else {
                   eval(callback_function1 + '(http_request1.responseText)');
               }
           } else {
               //alert('Hay un problema con el request.(Codigo: ' + http_request1.status + ')');
           }
       }
   }
   http_request1.open('GET', url1, true);
   http_request1.send(null);
}

//------------------------------------------------------------------------------------------------------------

function loadBanner1(xml1)
{
    var html_content1 = xml1.getElementsByTagName('content1').item(0).firstChild.nodeValue;
    var reload_after1 = xml1.getElementsByTagName('reload1').item(0).firstChild.nodeValue;
    document.getElementById('ajax-banner1').innerHTML = html_content1;

    try {
        clearTimeout(to1);
    } catch (e) {}

    to1 = setTimeout("nextAd1()", parseInt(reload_after1));

}
//------------------------------------------------------------------------------------------------------------

function nextAd1()
{
    var now = new Date();
    var url1 = 'ajax-banner1.asp?ts=' + now.getTime();
    makeHttpRequest1(url1, 'loadBanner1', true);
}
//------------------------------------------------------------------------------------------------------------
//window.onload = nextAd1;
//------------------------------------------------------------------------------------------------------------

