var count = 0;
function Anthem_PreCallBack() { 
    count++;
    setTimeout("CallBackStarted()", 500); 
}
function Anthem_PostCallBack() { CallBackFinished(); }

function CallBackStarted() {
  if (count > 0){  
    var item = document.getElementById('wait');
    if ((!window.XMLHttpRequest) && (document.documentElement)){
      item.style.position = 'absolute';
      //code to make ie6 behave
      if (document.documentElement.scrollTop){
        item.style.top = document.documentElement.scrollTop + 15;
      }
      else{ item.style.top = 15; }      
      item.style.right = 15;
    }
    item.style.display = 'block';    
  }
}
 
function CallBackFinished(){
  count--;
  if (count == 0){
    var item = document.getElementById('wait');
    if (item != null){
        item.style.display = 'none';
    }
  }
}

window.onload = function(){
	var url="/BVModules/Themes/Extend%20BV/images/headers/";
	var header="logoHome.jpg";
	
	var form=document.getElementById("aspnetForm").action;

	if(form.indexOf("/BVSoftware-AddOns.aspx")!=-1){
		header = "logoAddons.jpg";
		document.getElementById("categorymain").setAttribute("class","bvAddons");
		document.getElementById("categorymain").setAttribute("className","bvAddons");
	}else
	if (form.indexOf("/Products/") != -1) {
		header = "logoAddons.jpg";
	}else
	if(form.indexOf("/BV_CustomSolutions.aspx")!=-1){
		header = "Header-CustomSolutions.jpg";
		document.getElementById("categorymain").setAttribute("class","bvAddons");
		document.getElementById("categorymain").setAttribute("className","bvAddons");
	}else
	if(form.indexOf("/Testimonials.aspx")!=-1){
		header = "Header-Testimonials.jpg";
		document.getElementById("categorymain").setAttribute("class","bvAddons");
		document.getElementById("categorymain").setAttribute("className","bvAddons");
	}else
	if(form.indexOf("/ContactUs.aspx")!=-1){
		header = "logoContactUs.jpg";
		document.getElementById("categorymain").setAttribute("class","bvAddons");
		document.getElementById("categorymain").setAttribute("className","bvAddons");
	}else
	if(form.indexOf("/BVSoftware-Themes.aspx")!=-1){

		header = "logoThemes.jpg";
		document.getElementById("categorymain").setAttribute("class","bvAddons");
		document.getElementById("categorymain").setAttribute("className","bvAddons");
	}else
	if(form.indexOf("/BVSoftware-Hosting.aspx")!=-1){

		header = "logoHosting.jpg";
		document.getElementById("categorymain").setAttribute("class","bvAddons");
		document.getElementById("categorymain").setAttribute("className","bvAddons");
	}

	document.getElementById("brandingarea").style.backgroundImage="url("+url+header+")";
}

