  var cL = 0;
  var loadingObj = d.createElement('div');
      loadingObj.setAttribute('id','loadingDiv');

  var loadImgObj = d.createElement('div');
      loadImgObj.setAttribute('id','loadingImg');
      loadImgObj.innerHTML = '<img src="' + baseURL + '/images/loadtemplate.gif" alt="" />';
      
  d.getElementsByTagName('body')[0].appendChild(loadingObj);
  d.getElementsByTagName('body')[0].appendChild(loadImgObj);

  setOpacity(loadingObj,6);
  
  function checkLoading()
  {
  	if(window.innerHeight && window.scrollMaxY) {	
  		yScroll = window.innerHeight + window.scrollMaxY;
  	} else if (d.body.scrollHeight > d.body.offsetHeight){
  		yScroll = d.body.scrollHeight;
  	} else { 
  		yScroll = d.body.offsetHeight;
  	}
  	
  	if (self.innerHeight) {	
  		windowHeight = self.innerHeight;
  	} else if (d.documentElement && d.documentElement.clientHeight) { 
  		windowHeight = d.documentElement.clientHeight;
  	} else if (d.body) { 
  		windowHeight = d.body.clientHeight;
  	}	
  	
  	if(yScroll < windowHeight){
  		pageHeight = windowHeight;
  	} else { 
  		pageHeight = yScroll;
  	}
    d.getElementById('loadingDiv').style.height = pageHeight + 'px';
  }
  
  cL = window.setInterval("checkLoading();",10);
  