//------------------------------------------------------------------------------------------------------------
//	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 makeHttpRequest4(url4, callback_function4, return_xml4)
{
   var http_request4 = false;

   if (window.XMLHttpRequest) { // Mozilla, Safari y demas,...
       http_request4 = new XMLHttpRequest();

				   if (http_request4.overrideMimeType) {
					   http_request4.overrideMimeType('text/xml');
				   }

			   } else if (window.ActiveXObject) { // Explorer
				   try {
					   http_request4 = new ActiveXObject("Msxml2.XMLHTTP");
				   } catch (e) {
					   try {
						   http_request4 = new ActiveXObject("Microsoft.XMLHTTP");
					   } catch (e) {}
				   }
   }
//------------------------------------------------------------------------------------------------------------

   if (!http_request4) {
       alert('Tu explorador no soporta este tipo de programacion, actualiza el mismo.');
       return false;
   }

   //------------------------------------------------------------------------------------------------------------

   http_request4.onreadystatechange = function() {
       if (http_request4.readyState == 4) {
           if (http_request4.status == 200) {
               if (return_xml4) {
                   eval(callback_function4 + '(http_request4.responseXML)');
               } else {
                   eval(callback_function4 + '(http_request4.responseText)');
               }
           } else {
              // alert('Hay un problema con el request.(Codigo: ' + http_request4.status + ')');
           }
       }
   }
   http_request4.open('GET', url4, true);
   http_request4.send(null);
}

//------------------------------------------------------------------------------------------------------------

function loadBanner4(xml4)
{
    var html_content4 = xml4.getElementsByTagName('content4').item(0).firstChild.nodeValue;
    var reload_after4 = xml4.getElementsByTagName('reload4').item(0).firstChild.nodeValue;
    document.getElementById('ajax-banner4').innerHTML = html_content4;

    try {
        clearTimeout(to4);
    } catch (e) {}

    to4 = setTimeout("nextAd4()", parseInt(reload_after4));

}
//------------------------------------------------------------------------------------------------------------

function nextAd4()
{
    var now = new Date();
    var url4 = 'ajax-banner4.asp?ts=' + now.getTime();
    makeHttpRequest4(url4, 'loadBanner4', true);
}
//------------------------------------------------------------------------------------------------------------
//window.onload = nextAd4;
//------------------------------------------------------------------------------------------------------------

