var xmlHttp = createXmlHttpRequestObject();
var g_oldHtml='';
var g_DivID='';
var g_url='';

function createXmlHttpRequestObject() 
{
  var xmlHttp;
  // this should work for all browsers except IE6 and older
  try
  {
    xmlHttp = new XMLHttpRequest();
  }
  catch(e)
  {
    // assume IE6 or older
    var XmlHttpVersions = new Array('MSXML2.XMLHTTP.6.0',
                                    'MSXML2.XMLHTTP.5.0',
                                    'MSXML2.XMLHTTP.4.0',
                                    'MSXML2.XMLHTTP.3.0',
                                    'MSXML2.XMLHTTP',
                                    'Microsoft.XMLHTTP');
    // try every prog id until one works
    for (var i=0; i<XmlHttpVersions.length && !xmlHttp; i++) 
    {
      try 
 
      { 
        xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
      } 
      catch (e) {}
    }
  }
  if (!xmlHttp)
    alert("Error creating the XMLHttpRequest object.");
  else 
    return xmlHttp;
}

function get_needs( page)
{
//	alert('get_needs'+String(page));
  if (xmlHttp)
  {
    try
    {
      url="need_list.php?page="+String(page) ;
      xmlHttp.open("GET", url, false);
//      xmlHttp.onreadystatechange = handleRequestStateChange;
      xmlHttp.send(null);
	  myDiv = document.getElementById("xrDivNeeds");
	  myDiv.innerHTML = xmlHttp.responseText;
    }
    catch (e)
    {
      alert("Can't connect to server:\n" + e.toString());
    }
  }
}
function get_helps( page)
{
//	alert('get_needs'+String(page));
  if (xmlHttp)
  {
    try
    {
      url="help_list.php?page="+String(page) ;
      xmlHttp.open("GET", url, false);
//      xmlHttp.onreadystatechange = handleRequestStateChange;
      xmlHttp.send(null);
	  myDiv = document.getElementById("xrDivHelps");
	  myDiv.innerHTML = xmlHttp.responseText;
    }
    catch (e)
    {
      alert("Can't connect to server:\n" + e.toString());
    }
  }
}
function get_need_help( page)
{
//	alert('get_needs'+String(page));
  if (xmlHttp)
  {
    try
    {
      url="need_help_list.php?page="+String(page) ;
      xmlHttp.open("GET", url, false);
//      xmlHttp.onreadystatechange = handleRequestStateChange;
      xmlHttp.send(null);
	  myDiv = document.getElementById("xrDivNeed_help");
	  myDiv.innerHTML = xmlHttp.responseText;
    }
    catch (e)
    {
      alert("Can't connect to server:\n" + e.toString());
    }
  }
}
function get_help_need( page)
{
//	alert('get_needs'+String(page));
  if (xmlHttp)
  {
    try
    {
      url="help_need_list.php?page="+String(page) ;
      xmlHttp.open("GET", url, false);
//      xmlHttp.onreadystatechange = handleRequestStateChange;
      xmlHttp.send(null);
	  myDiv = document.getElementById("xrDivHelp_need");
	  myDiv.innerHTML = xmlHttp.responseText;
    }
    catch (e)
    {
      alert("Can't connect to server:\n" + e.toString());
    }
  }
}

function get_active( page)
{
//	alert('get_needs'+String(page));
  if (xmlHttp)
  {
    try
    {
      url="active_list.php?page="+String(page) ;
      xmlHttp.open("GET", url, false);
//      xmlHttp.onreadystatechange = handleRequestStateChange;
      xmlHttp.send(null);
	  myDiv = document.getElementById("xrDivActive");
	  myDiv.innerHTML = xmlHttp.responseText;
    }
    catch (e)
    {
      alert("Can't connect to server:\n" + e.toString());
    }
  }
}
function test()
{
	alert('test');
}
function get_url(url,DivID)
{
//	alert('get_url   '+DivID);
	g_DivID = DivID;
	g_url = url ;
  if (xmlHttp)
  {
    try
    {
      document.getElementById(DivID).innerHTML = "正在载入数据......";
//	alert('send'+DivID);
     xmlHttp.open("GET", url, true);
      xmlHttp.onreadystatechange = handle_get_url;
      xmlHttp.send(null);
//	alert('send'+DivID);
   }
    catch (e)
    {
      alert("Can't connect to server:\n" + e.toString());
    }
  }
}

function handle_get_url() 
{
  // move forward only if the transaction has completed
  if (xmlHttp.readyState == 4) 
  {
    // status of 200 indicates the transaction completed successfully
    if (xmlHttp.status == 200) 
    {
	  myDiv = document.getElementById(g_DivID);
	  myDiv.innerHTML = xmlHttp.responseText;

	  try{
	  		var date1 = new Calendar ("time", "0000-00-00");
      		date1.display('TimeDiv');
      		var date2 = new Calendar ("time1", "9999-12-30");
      		date2.display('TimeDiv1');
	  }catch(e){
	  	
	  }
    } 
    else 
    {
       alert("Can't connect to server:\n" +xmlHttp.statusText );;
    }
  }
}


function get_xml_addHelp(url,DivID)
{
//	alert('js:get_xml_addHelp '+DivID);
	get_url(url,DivID);
//    alert("js/uc.js");
//   	var date1 = new UncCalendar ("help_time", "0000-00-00");
//   	date1.display('DivTime');
}
function start()
{
	get_needs(1);
	get_helps(1);
	get_need_help(1);
	get_help_need(1);
	get_active(1);
}

function MM_openBrWindow(theURL,winName,features) 
{ 
	 window.open(theURL,winName,features);
}

var isIe=(document.all)?true:false;
//设置select的可见状态
function setSelectState(state)
{
	var objl=document.getElementsByTagName('select');
	for(var i=0;i<objl.length;i++)
	{
		objl[i].style.visibility=state;
	}
}
function mousePosition(ev)
{
	if(ev.pageX || ev.pageY)
	{
		return {x:ev.pageX, y:ev.pageY};
	}
	return {
		x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,y:ev.clientY + document.body.scrollTop - document.body.clientTop
	};
}
//弹出方法
function showMessageBox(wTitle,content,pos,wWidth)
{
	closeWindow();
	var bWidth=parseInt(document.documentElement.scrollWidth);
	var bHeight=parseInt(document.documentElement.scrollHeight)+5000;
	if(isIe){
		setSelectState('hidden');
	}
	var back=document.createElement("div");
	back.id="back";
	var styleStr="top:0px;left:0px;position:absolute;background:#666;width:"+bWidth+"px;height:"+bHeight+"px;";
	styleStr+=(isIe)?"filter:alpha(opacity=40);":"opacity:0.40;";
	back.style.cssText=styleStr;
	document.body.appendChild(back);
	var mesW=document.createElement("div");
	mesW.id="mesWindow";
	mesW.className="mesWindow";
	mesW.innerHTML="<div class='mesWindowTop'>  \
					<table width='100%' height='100%' background='../xr/templates/images/index_04.jpg'> \
						<tr><td>"+wTitle+"</td>  \
							<td style='width:1px;'><input type='button' onclick='closeWindow();' title='关闭窗口' class='close' value='关闭' /></td> \
						</tr>  \
					</table>   \
				</div>  \
				<div class='mesWindowContent' id='mesWindowContent'>"+content+"</div>  \
				<div class='mesWindowBottom'></div>";
	styleStr="left:"+(((pos.x-wWidth)>0)?(pos.x-wWidth):pos.x)+"px;top:"+(pos.y)+"px;position:absolute;width:"+wWidth+"px;";
	mesW.style.cssText=styleStr;
	document.body.appendChild(mesW);
}
function showBackground(obj,endInt)
{
	obj.filters.alpha.opacity+=1;
	if(obj.filters.alpha.opacity<endInt)
	{
		setTimeout(function(){showBackground(obj,endInt)},8);
	}
}
//关闭窗口
function closeWindow()
{
	if(document.getElementById('back')!=null)
	{
		document.getElementById('back').parentNode.removeChild(document.getElementById('back'));
	}
	if(document.getElementById('mesWindow')!=null)
	{
		document.getElementById('mesWindow').parentNode.removeChild(document.getElementById('mesWindow'));
	}
	if(isIe){
		setSelectState('');
	}
}
//测试弹出
function testMessageBox(ev,id,nid)
{
	var objPos = mousePosition(ev);
	
	hid=String(id);
	nid=String(nid);
	messContent="<div style='padding:20px 0 20px 0;text-align:center' style='background-color:#FFFFFF'><form id='form1' name='form1' method='post' action=\"../xr/addinfo2.php\" ><p><input name='hid' id='hid' type=hidden value="+hid+"><input name='nid' id='nid' type=hidden value="+nid+"><table width='543' border='0' class='menu'><tr><td width='149' align='left' valign='top'>进行反馈：</td><td width='384' height='25'><p><input name='radiobutton' type='radio' value='1' checked='checked' />同意帮助对方需求，并该资源不再等待其他需求</p><p><input name='radiobutton' type='radio' value='2' />同意帮助对方，并继续提供资源给其他需求</p><p><input type='radio' name='radiobutton' value='3' />不同意提供给对方资源</p></td></tr><tr><td align='left' valign='top'><span class='STYLE1'>您想说的话：</span></td><td><textarea name='info2' cols='50' rows='10' id='info2'></textarea></td></tr><tr><td align='right'>&nbsp;</td><td>&nbsp;</td></tr><tr><td colspan='2' align='center'><input type='submit' name='Submit2' value='提交' />&nbsp;&nbsp;&nbsp;&nbsp;<input type='reset' name='Submit2' value='重置' /></td></tr></table></p></form><p>更详细的信息反馈请到您的圈子，谢谢！</p></div>";
	showMessageBox('反馈窗口',messContent,objPos,600);
}

function testMessageBox1(ev,id,hid)
{
	var objPos = mousePosition(ev);
	
	nid=String(id);
	hid=String(hid);
	messContent="<div style='padding:20px 0 20px 0;text-align:center' style='background-color:#FFFFFF'><form id='form1' name='form1' method='post' action=\"../xr/addinfo1.php\"><p><input name='nid' id='nid' type=hidden value="+nid+"><input name='hid' id='hid' type=hidden value="+hid+"><table width='543' border='0' class='menu'><tr><td width='149' align='left' valign='top'>进行反馈：</td><td width='384' height='25'><p><input name='radiobutton' type='radio' value='1' checked='checked' />接受对方资源，并不需要其他帮助资源</p><p><input name='radiobutton' type='radio' value='2' />接受对方资源，并继续等待其他帮助资源</p><p><input type='radio' name='radiobutton' value='3' />不接受对方帮助资源</p></td></tr><tr><td align='left' valign='top'><span class='STYLE1'>您想说的话：</span></td><td><textarea name='info1' cols='50' rows='10' id='info1'></textarea></td></tr><tr><td align='right'>&nbsp;</td><td>&nbsp;</td></tr><tr><td colspan='2' align='center'><input type='submit' name='Submit2' value='提交' />&nbsp;&nbsp;&nbsp;&nbsp;<input type='reset' name='Submit2' value='重置' /></td></tr></table></p></form><p>更详细的信息反馈请到您的圈子，谢谢！</p></div>";
	showMessageBox('反馈窗口',messContent,objPos,600);
}


function fankui_active(id)
{
	if(confirm('活动完成？')){
		location='../xr/fankui_active.php?aid='+String(id);
	}
}

function delete_need(id)
{
	if(confirm('确实要删除吗？')){
		location='../xr/delete_need.php?nid='+String(id);
	}
}

function delete_help(id)
{
	if(confirm('确实要删除吗？')){
		location='../xr/delete_help.php?hid='+String(id);
	}
}


function post_submit(url)
{
//alert('post_submit');
	g_url = url;
	g_oldHtml = document.getElementById('div_body').innerHTML;
//alert(g_oldHtml);
  if (xmlHttp)
  {
    try
    {
		params = getFormParams(document.form1.elements);
//alert(url+'?'+params);
	xmlHttp.open('POST', url, true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");
//alert('set header');
	xmlHttp.onreadystatechange = handle_post_submit;
	xmlHttp.send(params);
		//  myDiv = document.getElementById(DivID);
		//  myDiv.innerHTML = xmlHttp.responseText;
/*		alert(xmlHttp.responseText)	;
		if(xmlHttp.responseText=="OK")
		{
			get_url(g_url,g_DivID);
		}else{
	      document.getElementById(g_DivID).innerHTML = g_oldHtml;   
		}
*/    }
    catch (e)
    {
	      alert("Can't connect to server:\n" + e.toString());
	      document.getElementById('div_body').innerHTML = oldHtml;   
	 
    }
  }
}


function handle_post_submit() 
{
  // move forward only if the transaction has completed
  if (xmlHttp.readyState == 4) 
  {
//alert(g_oldHtml);
  	// status of 200 indicates the transaction completed successfully
    if (xmlHttp.status == 200) 
    {
		alert(xmlHttp.responseText)	;
		if(xmlHttp.responseText=="OK")
		{
			get_url(g_url,g_DivID);
		}else{
	      document.getElementById(g_DivID).innerHTML = g_oldHtml;   
		}
    } 
    else 
    {
       alert("Can't connect to server:\n" +xmlHttp.statusText );;
    }
  }
}

function post_search(url,DivID)
{
//	alert('post_search');
	g_oldHtml = document.getElementById(DivID).innerHTML;
	g_DivID = DivID;
  if (xmlHttp)
  {
    try
    {
		params = getFormParams(document.form1.elements);
//alert(url+'?'+params);
		xmlHttp.open('POST', url, true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
//alert('set header');
		xmlHttp.onreadystatechange = handle_get_url;
		xmlHttp.send(params);

//	    document.getElementById('div_body').innerHTML = xmlHttp.responseText;   
		
    }
    catch (e)
    {
	      alert("Can't connect to server:\n" + e.toString());
	      document.getElementById('div_body').innerHTML = g_oldHtml;   
	 
    }
  }
}

function getFormParams(items)
{
	str = '';
//	alert(items.length);
	for(i=0;i<items.length;i++)
	{
		if (str!='') str +='&'
			
		str +=items[i].name +"=" + items[i].value;
	};
//	alert(str);
	return str;
}

//////////////////////////////
// UncCalendar 1.0          //
// Author: Zhong@UNC        //
// E-mail: zhong@uncnet.com //
// 06/01/2004               //
//////////////////////////////



function Calendar (sName, sDate)
{
  /////////////////////////////////////////////////////////////////////////
  //定义UncCalendar对象的属性并赋默认值。
  //inputValue属性的值为"today"时表示（客户机）当前日期。
  //直接在这里把默认值修改成你想要的，使用时你就什么也不用设置了。
  this.inputName = sName || "uncDate";
  this.inputValue = sDate || "";
  this.inputSize = 10;
  this.inputClass = "";
  this.color = "#333333";
  this.bgColor = "#EEEEEE";
  this.buttonWidth = 60;
  this.buttonWords = "选择日期";
  this.canEdits = true;
  this.hidesSelects = true;
  /////////////////////////////////////////////////////////////////////////

  /////////////////////////////////////////////////////////////////////////
  //定义display方法。
  this.display = function (DivID)
  {
    var reDate = /^(19[7-9]\d|20[0-5]\d)\-(0?\d|1[0-2])\-([0-2]?\d|3[01])$/;
    if (reDate.test(this.inputValue))
    {
      var dates = this.inputValue.split("-");
      var year = parseInt(dates[0], 10);
      var month = parseInt(dates[1], 10);
      var mday = parseInt(dates[2], 10);
    }
    else
    {
      var today = new Date();
      var year = today.getFullYear();
      var month = today.getMonth()+1;
      var mday = today.getDate();
    }
    if (this.inputValue == "today")
      inputValue = year + "-" + month + "-" + mday;
    else
      inputValue = this.inputValue;
    var lastDay = new Date(year, month, 0);
    lastDay = lastDay.getDate();
    var firstDay = new Date(year, month-1, 1);
    firstDay = firstDay.getDay();
    
    var btnBorder =
      "border-left:1px solid " + this.color + ";" +
      "border-right:1px solid " + this.color + ";" +
      "border-top:1px solid " + this.color + ";" +
      "border-bottom:1px solid " + this.color + ";";
    var btnStyle =
      "padding-top:3px;cursor:default;width:" + this.buttonWidth + "px;text-align:center;height:18px;top:-9px;" +
      "font:normal 12px 宋体;position:absolute;z-index:99;background-color:" + this.bgColor + ";" +
      "line-height:12px;" + btnBorder + "color:" + this.color + ";";
    var boardStyle = 
      "position:absolute;width:1px;height:1px;background:" + this.bgColor + ";top:8px;border:1px solid "+
      this.color + ";display:none;padding:3px;";
    var buttonEvent =
      " onmouseover=\"this.childNodes[0].style.borderBottom='0px';" + 
          "this.childNodes[1].style.display='';this.style.zIndex=100;" +
          (this.hidesSelects ?
          "var slts=document.getElementsByTagName('SELECT');" +
          "for(var i=0;i<slts.length;i++)slts[i].style.visibility='hidden';"
          : "") + "\"" +
      " onmouseout=\"this.childNodes[0].style.borderBottom='1px solid " + this.color + "';" +
          "this.childNodes[1].style.display='none';this.style.zIndex=99;" +
          (this.hidesSelects ?
          "var slts=document.getElementsByTagName('SELECT');" +
          "for(var i=0;i<slts.length;i++)slts[i].style.visibility='';"
          : "") + "\"" +
      " onselectstart=\"return false;\"";
    var mdayStyle = "font:normal 9px Verdana,Arial,宋体;line-height:12px;cursor:default;color:" + this.color;
    var weekStyle = "font:normal 12px 宋体;line-height:15px;cursor:default;color:" + this.color;
    var arrowStyle = "font:bold 7px Verdana,宋体;cursor:hand;line-height:16px;color:" + this.color;
    var ymStyle = "font:bold 12px 宋体;line-height:16px;cursor:default;color:" + this.color;
    var changeMdays = 
      "var year=parseInt(this.parentNode.cells[2].childNodes[0].innerText);" +
      "var month=parseInt(this.parentNode.cells[2].childNodes[2].innerText);" +
      "var firstDay=new Date(year,month-1,1);firstDay=firstDay.getDay();" +
      "var lastDay=new Date(year,month,0);lastDay=lastDay.getDate();" +
      "var tab=this.parentNode.parentNode, day=1;" +
      "for(var row=2;row<8;row++)" +
      "  for(var col=0;col<7;col++){" +
      "    if(row==2&&col<firstDay){" +
      "      tab.rows[row].cells[col].innerHTML='&nbsp;';" +
      "      tab.rows[row].cells[col].isDay=0;}" +
      "    else if(day<=lastDay){" +
      "      tab.rows[row].cells[col].innerHTML=day;" +
      "      tab.rows[row].cells[col].isDay=1;day++;}" +
      "    else{" +
      "      tab.rows[row].cells[col].innerHTML='';" +
      "      tab.rows[row].cells[col].isDay=0;}" +
      "  }";
    var pyEvent =
      " onclick=\"var y=this.parentNode.cells[2].childNodes[0];y.innerText=parseInt(y.innerText)-1;" +
                  changeMdays + "\"";
    var pmEvent =
      " onclick=\"var y=this.parentNode.cells[2].childNodes[0];m=this.parentNode.cells[2].childNodes[2];" +
                 "m.innerText=parseInt(m.innerText)-1;if(m.innerText=='0'){m.innerText=12;y.innerText=" +
                 "parseInt(y.innerText)-1;}" + changeMdays + "\"";
    var nmEvent =
      " onclick=\"var y=this.parentNode.cells[2].childNodes[0];m=this.parentNode.cells[2].childNodes[2];" +
                 "m.innerText=parseInt(m.innerText)+1;if(m.innerText=='13'){m.innerText=1;y.innerText=" +
                 "parseInt(y.innerText)+1;}" + changeMdays + "\"";
    var nyEvent =
      " onclick=\"var y=this.parentNode.cells[2].childNodes[0];y.innerText=parseInt(y.innerText)+1;" +
                  changeMdays + "\"";
    var mdayEvent =
      " onmouseover=\"if(event.srcElement.tagName=='TD'&&event.srcElement.isDay){" +
          "event.srcElement.style.backgroundColor='" + this.color + "';" +
          "event.srcElement.style.color='" + this.bgColor + "';" +
          "event.srcElement.style.cursor='hand';" +
          "var ym=event.srcElement.parentNode.parentNode.rows[0].cells[2].childNodes;" +
          "event.srcElement.title=ym[0].innerText+'-'+ym[2].innerText+'-'+event.srcElement.innerText;}\"" +
      " onmouseout=\"if(event.srcElement.tagName=='TD'&&event.srcElement.isDay){" +
          "event.srcElement.style.backgroundColor='" + this.bgColor + "';" +
          "event.srcElement.style.color='" + this.color + "';" +
          "event.srcElement.style.cursor='default';" +
          "var ym=event.srcElement.parentNode.parentNode.rows[0].cells[2].childNodes;" +
          "event.srcElement.title=ym[0].innerText+'-'+ym[2].innerText+'-'+event.srcElement.innerText;}\"" +
      " onclick=\"if(event.srcElement.tagName=='TD'&&event.srcElement.isDay){" +
          "var inp=this.parentNode.parentNode.parentNode.previousSibling.childNodes[0];" +
          "inp.value=this.rows[0].cells[2].childNodes[0].innerText+'-'+this.rows[0].cells[2].childNodes[2]." +
          "innerText+'-'+event.srcElement.innerText;" +
          "this.parentNode.style.display='none';this.parentNode.parentNode.style.zIndex=99;" +
          "this.parentNode.previousSibling.style.borderBottom='1px solid " + this.color + "';" +
          (this.hidesSelects ?
          "var slts=document.getElementsByTagName('SELECT');" +
          "for(var i=0;i<slts.length;i++)slts[i].style.visibility='';"
          : "") + "}\"";

    var output = "";
    output += "<table cellpadding=0 cellspacing=1 style='display:inline;'><tr>";
    output += "  <td><input size=" + this.inputSize + " maxlength=10 value=\"" + inputValue + "\"";
    output +=    (this.canEdits ? "" : " readonly") + " name=\"" + this.inputName + "\"></td>";
    output += "  <td width=" + this.buttonWidth + ">";
    output += "    <div style=\"position:absolute;overflow:visible;width:0px;height:0px;\"" + buttonEvent + ">";
    output += "      <div style=\"" + btnStyle + "\"><nobr>" + this.buttonWords + "</nobr></div>";
    output += "      <div style=\"" + boardStyle + "\">";
    output += "        <table cellspacing=1 cellpadding=1 width=175" + mdayEvent + ">";
    output += "          <tr height=20 align=center>";
    output += "            <td style=\"" + arrowStyle + "\" title=\"上一年\"" + pyEvent + ">&lt;&lt;</td>";
    output += "            <td style=\"" + arrowStyle + "\" align=left title=\"上个月\"" + pmEvent + ">&lt;</td>";
    output += "            <td colspan=3 style=\"" + ymStyle + "\" valign=bottom>";
    output += "              <span>" + year + "</span><span>年</span><span>" + month + "</span><span>月</span>";
    output += "            </td>";
    output += "            <td style=\"" + arrowStyle + "\" align=right title=\"下个月\"" + nmEvent + ">&gt;</td>";
    output += "            <td style=\"" + arrowStyle + "\" title=\"下一年\"" + nyEvent + ">&gt;&gt;</td>";
    output += "          </tr>";
    output += "          <tr height=20 align=center bgcolor=" + this.bgColor + ">";
    output += "            <td width=14% style=\"" + weekStyle + "\">日</td>";
    output += "            <td width=14% style=\"" + weekStyle + "\">一</td>";
    output += "            <td width=14% style=\"" + weekStyle + "\">二</td>";
    output += "            <td width=14% style=\"" + weekStyle + "\">三</td>";
    output += "            <td width=14% style=\"" + weekStyle + "\">四</td>";
    output += "            <td width=14% style=\"" + weekStyle + "\">五</td>";
    output += "            <td width=14% style=\"" + weekStyle + "\">六</td>";
    output += "          </tr>";
    var day = 1;
    for (var row=0; row<6; row++)
    {
      output += "<tr align=center>";
      for (var col=0; col<7; col++)
      {
        if (row == 0 && col < firstDay)
          output += "<td style=\"" + mdayStyle + "\">&nbsp;</td>";
        else if (day <= lastDay)
        {
          output += "<td style=\"" + mdayStyle + "\" isDay=1>" + day + "</td>";
          day++;
        }
        else
          output += "<td style=\"" + mdayStyle + "\"></td>";
      }
      output += "</tr>";
    }
    output += "        </table>";
    output += "      </div>";
    output += "    </div>";
    output += "  </td>";
    output += "</tr></table>";
 	  myDiv = document.getElementById(DivID);
	  myDiv.innerHTML = output;
// alert('UncCalendar.display');
//    document.write(output);
  }
  /////////////////////////////////////////////////////////////////////////
}