//==============================================================================
//var theFlushArea=null; var theFlushArea2=null;
var theStartDate=new Date();
var iClientStart=theStartDate.valueOf();
// ==== site ===================================================================
var theSiteTime=null; var theSiteBar=null;
var iSiteLatest=0;
function wd_gen_ShowSiteStatus() {
	var thePagesBar=document.getElementById("wd_genbar_pages");
	if (theNavycntBar && theNavyBar && thePagesBar && theSiteBar) {
		var iNavyCnt=parseInt(theNavycntBar.style.width);
		var iNavy=parseInt(theNavyBar.style.width);
		var iPages=parseInt(thePagesBar.style.width);
		var iPercents=Math.ceil((iNavyCnt*iPercNavcnt+iNavy*iPercNav+iPages*iPercPages)/100);
		if (iPercents>100) iPercents=100;
		if (iPercents!==iSiteLatest) {
			var sPercents=iPercents+"%";
			theSiteBar.style.width=sPercents;
			theSiteBar.innerHTML=sPercents;
			theSiteBar.title=" "+sPercents+" ";
			iSiteLatest=iPercents;
		}
	}
	//
	if (theSiteTime) {
		var theCurrDate=new Date();
		var iClientCurr=Math.ceil((theCurrDate.valueOf()-iClientStart)/1000);
		theSiteTime.innerHTML=iClientCurr;
	}
	//
	if (iPagesGenCompleted && iNavyGenCompleted) {
		if (document.getElementById('wd_result_nvygened')) document.getElementById('wd_result_nvygened').innerHTML=theNavyCurract.innerHTML;
		if (document.getElementById('wd_result_pgsgened')) document.getElementById('wd_result_pgsgened').innerHTML=thePagesCurract.innerHTML;
		if (document.getElementById('wd_result_srvtime')) document.getElementById('wd_result_srvtime').innerHTML=(parseInt(theNavycntTime.innerHTML)+parseInt(theNavyTime.innerHTML)+parseInt(thePagesTime.innerHTML))+" "+LBL_SEC;
		if (document.getElementById('wd_result_clnttime')) document.getElementById('wd_result_clnttime').innerHTML=parseInt(theSiteTime.innerHTML)+" "+LBL_SEC;
		if (document.getElementById('wd_result_title')) document.getElementById('wd_result_title').innerHTML=LBL_MAIN_PUBLISH_COMPLETED;
		if (document.getElementById('wd_genbar_site_title')) {
			document.getElementById('wd_genbar_site_title').innerHTML=LBL_MAIN_PUBLISH_COMPLETED.toLowerCase();
		}
		//
		var bWereErrors=0; var sErrHash='';
		var sNavyResult='';
		for (sErrHash in arrNavyErrors) {
			sNavyResult+="<SPAN STYLE=\"color:#990000;\">&bull;&nbsp;"+LBL_MAIN_PUBLISH_NVYWEREERRS+"</SPAN>";
			bWereErrors=1;
			break;
		}
		if (!sNavyResult.length) sNavyResult+="<SPAN STYLE=\"color:#006600;\">&bull;&nbsp;"+LBL_MAIN_PUBLISH_NVYNOERRS+"</SPAN>";
		//
		var sPagesResult=''; 
		for (sErrHash in arrPagesErrors) {
			sPagesResult+="<SPAN STYLE=\"color:#990000;\">&bull;&nbsp;"+LBL_MAIN_PUBLISH_PGSWEREERRS+"</SPAN>";
			bWereErrors=1;
			break;
		}
		if (!sPagesResult.length) sPagesResult+="<SPAN STYLE=\"color:#006600;\">&bull;&nbsp;"+LBL_MAIN_PUBLISH_PGSNOERRS+"</SPAN>";
		//
		var theResulter=document.getElementById('wd_publish_result_text');
		if (theResulter) theResulter.innerHTML=sNavyResult+'<BR>'+sPagesResult;
		//
		if (bWereErrors) {
			if (document.images['wd_genimage']) document.images['wd_genimage'].src="/webdirector/mdl_content/images/genoops.gif";
			//document.getElementById('wd_result_repeatbtt').style.display="";
		} else {
			if (document.images['wd_genimage']) document.images['wd_genimage'].src="/webdirector/mdl_content/images/genok.gif";
		}
		if (document.getElementById('wd_result_exitbtt')) document.getElementById('wd_result_exitbtt').style.display="";
	}
}