function drawGlassPanel(){
 oBody = document.getElementsByTagName('body')[0];
 oDiv = document.createElement('div');
   with(oDiv){
     style.position='fixed';
     style.top='0';
     style.left='0';
     style.height='100%';
     style.width='100%';
     style.display='none';
     style.zIndex=999;
     style.cursor='wait';
     style.backgroundColor='#cccccc';
     style.opacity=1;
	   style.filter='alpha(opacity=100)';
   }

   if(navigator.userAgent.indexOf('MSIE 6.0') != -1){      
     oIframe = document.createElement('iframe');
     with(oIframe){
       style.position='absolute';
       style.top='0';
       style.left='0';
       style.height='100%';   
       style.width='100%';
  	   style.opacity=1;
  	   style.filter='alpha(opacity=100)';
     }
  
     oDiv.appendChild(oIframe);
   }
 	
 oDiv2 = document.createElement('div');
   with(oDiv2){
     style.position='absolute';
     style.display='none';
     style.visibility='hidden';
     style.opacity=1;
 	   style.filter='alpha(opacity=100)';
     style.borderStyle='solid';
     style.borderWidth='1px';
     style.borderColor='darkblue';
     style.textAlign='center';
     style.backgroundColor='#FFFFFF';
     style.fontFamily='Verdana, Arial';
 	   style.fontSize='1em';
 	   style.fontLetterSpacing='1px';
 	   style.color='#626262';
 	   style.zIndex=1000;
 	   style.padding='50px 90px';
   }
   
   oImg = document.createElement('img');
   with(oImg){
     src="img/waitImg.gif";
     style.marginTop='40px';
     style.marginBottom='10px';
     style.clear='both';
   }
   
   oDiv2.appendChild(oImg);
   
   var oBR = document.createElement('br');
   oDiv2.appendChild(oBR);
   
   oText = document.createTextNode('Un momento por favor,');
   oText2 = document.createTextNode('El Mensaje está siendo enviado');
	 oDiv2.appendChild(oText);
	 oDiv2.appendChild(oBR.cloneNode(true));
	 oDiv2.appendChild(oText2);
   oBody.appendChild(oDiv2);
	 oBody.appendChild(oDiv);
  }
  
  function showGlassPanel(){
	  if(navigator.userAgent.indexOf('MSIE 6.0') != -1){
      with(oDiv){
	    	 style.filter='alpha(opacity=100)';
	    	 style.display='inline';
		  }
      oIframe.style.display='inline'; 
     }else{ 
       with(oDiv){
        style.display='inline';
        style.opacity=0.5;
        style.filter='alpha(opacity=50)';
      }
     }
     oDiv2.style.display = 'inline';
     oDiv2.style.top = (document.body.offsetHeight - oDiv2.offsetHeight) /2 +'px';
     oDiv2.style.left = (document.body.offsetWidth - oDiv2.offsetWidth) /2 +'px';
     oDiv2.style.visibility = 'visible';
  }
  
  var timeFlag;
  var transparency = 50;
  var transparency2 = 100;

  function startFadeOut(){
  timeFlag = setInterval('fadeOut()',100);
  }
  
  function fadeOut() {
    transparency -= 3;
    transparency2 -= 6;
  		if(transparency2 < 6){
    	  transparency = 50;
        transparency2 = 100;
   		  clearInterval(timeFlag);
        hideGlassPanel();
    	}
    
    if (document.all){ 
        oDiv.style.filter = 'alpha(opacity='+transparency+')';
        oDiv2.style.filter = 'alpha(opacity='+transparency2+')';
    }else{
        oDiv.style.opacity = transparency /100;
        oDiv.style.MozOpacity = transparency /100;
        oDiv.style.KHTMLOpacity = transparency /100; 
        oDiv2.style.opacity = transparency2 /100;
        oDiv2.style.MozOpacity = transparency2 /100;
        oDiv2.style.KHTMLOpacity = transparency2 /100;  
    }
  }
  
  function hideGlassPanel(){ 
	  oDiv.style.display='none';
	  oDiv.style.cursor='pointer';
	  oDiv2.style.display='none';
  }

