var xmlHttp;
var strResponse;

function requestURL(pStrURL, pStrResponse){
	strResponse = pStrResponse;	
	if (window.ActiveXObject) {                  
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");		      				
			xmlHttp.onreadystatechange = stateChanged;	  	 	
			xmlHttp.open("GET", pStrURL, true);                       	
			xmlHttp.send();
	}else{
	xmlHttp = new XMLHttpRequest();
        xmlHttp.onreadystatechange = stateChanged;
        xmlHttp.open("GET", pStrURL, true);
        xmlHttp.send(null);
	
	}
}

function stateChanged(){     
	if (xmlHttp.readyState == 4){ 				                    
		document.getElementById(strResponse).innerHTML = xmlHttp.responseText;	
	}                                                                         	
}              

function seccion(IDSECCION,QUERYSTRING,DIV){
	javascript:document.getElementById(DIV).innerHTML='<center><br><br><br><img src=/img/progress.gif><br><b>Loading...</b></center>';
	var strURL;                                               		                                    		
	strURL = "/index.php?IDSECCION="+IDSECCION+"&NOTEMPLATE=1"+QUERYSTRING;					
	requestURL( strURL, DIV);
}

var Color= new Array();
Color[1] = "BB";
Color[2] = "C0";
Color[3] = "C8";
Color[4] = "CC";
Color[5] = "D8";
Color[6] = "DD";
Color[7] = "E8";
Color[8] = "EE";
Color[9] = "F8";

function waittofade() {
	if (document.getElementById('fade')) {
    setTimeout("fadeIn(9)", 1000);
	 }
}

function fadeIn(where) {
    if (where >= 1) {
        document.getElementById('fade').style.backgroundColor = "#ffff" + Color[where];
		  if (where > 1) {
			  where -= 1;
			  setTimeout("fadeIn("+where+")", 400);
			}
    }
}

function pausecomp(millis) 
{
	var date = new Date();
	var curDate = null;
	do { curDate = new Date(); } 
	while(curDate-date < millis);
} 
