var AImg = new Image();

function CacheAjaxImg()
{
	AImg.src="/ajax_indicator.gif"
}

window.size = function(){
	var w = 0;
	var h = 0;
	
	//IE
	if(!window.innerWidth){
		//strict mode
		if(!(document.documentElement.clientWidth == 0)){	
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}
		//quirks mode
		else{
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	}
	//w3c
	else{
		w = window.innerWidth;
		h = window.innerHeight;
		}
	return {width:w,height:h};
}

function ShowIndicator(WaitText)
{
 	
	var d = document.createElement("div");
	    d.style.height = window.size().height;
	    d.style.width = window.size().width;
	    d.style.opacity = "0.30";
	    d.style.filter = "alpha(opacity = 30)";		
	    d.style.backgroundColor = "#000000";
	    d.style.position = "absolute";
	    d.style.left = "0";
	    d.style.top = "0";
            document.body.appendChild(d);

                   
        var d_center = document.createElement("div");
	    d_center.id = "searchResult";
            d_center.style.position = "absolute";
	    d_center.style.left = window.size().width/2-190;
	    d_center.style.top = window.size().height/2-40;

        var table = document.createElement("table");
            table.border = "0";
            table.cellspacing = "0";
            table.cellpadding = "0";
            table.id = "TbIndicator";
        var row = document.createElement("tr");
        var tdtxt = document.createElement("td");
            tdtxt.appendChild(document.createTextNode(WaitText));
        var tdimg = document.createElement("td");
        var i = new Image();
            i.src = AImg.src;
            tdimg.appendChild(i);
            row.appendChild(tdtxt);
            row.appendChild(tdimg);
            table.appendChild(row);
                                       
            d_center.appendChild(table); 
                    
	if (navigator.appName.indexOf("Microsoft")!=-1)
	{
	    d_center.innerHTML="<table align='center' id='TbIndicator'><tr><td>"+WaitText+"</td><td><img id='ImgIndicator' src='/ajax_indicator.gif'></td></tr></table>";    	
	}
	   document.body.appendChild(d_center);	
}