AjaxDivStatusMsg = {};
var AjaxDivMsg = "Proccessing data, please wait...";
var AjaxDivShow = true;
(function(){
	AjaxDivStatusMsg.showAjaxDiv = function(){
	  if(!AjaxDivShow) return;
	  var msgw,msgh,bordercolor;
	  msgw=400;//messagebox width
	  msgh=100;//messagebox height
	  bordercolor="#336699";//messagebox border color
	
	  var sWidth,sHeight;
	  sWidth=document.body.offsetWidth;//browser width
	  sHeight=screen.height;//browser height
	
	
	  var bgObj=document.createElement("div");//create bg div
	  //define div
	  //<div id="ajaxBgDiv" style="position:absolute; top:0; background-color:#777; filter:progid:DXImagesTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75); opacity:0.6; left:0; width:918px; height:768px; z-index:10000;"></div>
	  bgObj.setAttribute('id','ajaxBgDiv');
	  bgObj.style.position="absolute";
	  bgObj.style.top="0";
	  if (!document.all)//firefox
		  bgObj.style.background="transparent";
	  else
		  bgObj.style.background="#777";
	  bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=0,finishOpacity=0";
	  bgObj.style.opacity="0.6";
	  bgObj.style.left="0";
	  bgObj.style.width=sWidth + "px";
	  bgObj.style.height=sHeight + "px";
	  bgObj.style.zIndex = "10000";
	  document.body.appendChild(bgObj);//add div
	
	 //Msgbox
	  var msgObj=document.createElement("div")
	  //define the div property
	  //<div id="ajaxMsgDiv" align="center" style="background-color:white; border:1px solid #336699; position:absolute; left:50%; top:50%; font:12px/1.6em Verdana,Geneva,Arial,Helvetica,sans-serif; margin-left:-225px; margin-top:npx; width:400px; height:100px; text-align:center; line-height:25px; z-index:100001;"></div>
	  msgObj.setAttribute("id","ajaxMsgDiv");
	  msgObj.setAttribute("align","center");
	  msgObj.style.background="white";
	  msgObj.style.border="1px solid " + bordercolor;
	  msgObj.style.position = "absolute";
	  msgObj.style.left = "50%";
	  msgObj.style.top = "50%";
	  msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
	  msgObj.style.marginLeft = "-225px" ;
	  msgObj.style.marginTop = -75+document.documentElement.scrollTop+"px";
	  msgObj.style.width = msgw + "px";
	  msgObj.style.height =msgh + "px";
	  msgObj.style.textAlign = "center";
	  msgObj.style.lineHeight ="25px";
	  msgObj.style.zIndex = "10001";
	
	  document.body.appendChild(msgObj);//Add msgbox
	
	  var txt=document.createElement("p");//Create a p object
	  txt.style.margin="1em 0"
	  txt.setAttribute("id","ajaxMsgTxt");
	  txt.innerHTML=AjaxDivMsg;//message
	  document.getElementById("ajaxMsgDiv").appendChild(txt);//add message to message box
	  
	}
	AjaxDivStatusMsg.removeAjaxDiv=function (){//close the messagebox
		var ajaxBgDiv = document.getElementById("ajaxBgDiv");
		if(ajaxBgDiv){
		  document.body.removeChild(ajaxBgDiv);//delete bg 
		  var ajaxMsgDiv = document.getElementById("ajaxMsgDiv");
		  document.body.removeChild(ajaxMsgDiv);//delete messagebox
		}
		AjaxDivMsg = "Proccessing data, please wait...";
		AjaxDivShow = true;			
	}
	AjaxDivStatusMsg.setMessage = function(str){
		AjaxDivMsg = str;
	}
})();		
