//页面顶部显示
function showhead123(pathlevel)
{
var pathdot="";
if (pathlevel=="2") pathdot="../"
if (pathlevel=="3") pathdot="../../"
if (pathlevel=="4") pathdot="../../../"

//document.write("<div align=center>");
//document.write("<center>");
//document.write("<table border=0 width=760 cellpadding=0 cellspacing=0>");
//document.write("	<tr>");
//document.write("		<td width=224><img border=0 src="+pathdot+"images/logodong.gif width=254 height=69></td>");
//document.write("		<td width=540>");
//document.write("			<p align=center>");
//document.write("			<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" WIDTH=497 HEIGHT=45>");
//document.write("			<PARAM NAME=movie VALUE=\""+pathdot+"images/Movie12.swf\"> <PARAM NAME=quality VALUE=high> ");
//document.write("			<PARAM NAME=bgcolor VALUE=#FFFFFF> ");
//document.write("			<EMBED src=\""+pathdot+"images/Movie12.swf\" quality=\"high\" bgcolor=\"#FFFFFF\"  WIDTH=\"460\" HEIGHT=\"45\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></EMBED>");
//document.write("			</OBJECT>");
//document.write("		</td>");
//document.write("	</tr>");
//document.write("</table>");
//document.write("</center>");
//document.write(" </div> ");
//
//document.write("<div align=center>");
//document.write("<center>");
//document.write("<table border=0 width=760 cellpadding=0 cellspacing=0>");
//
//document.write("	<tr>");
//document.write("		<td background="+pathdot+"images/menu.gif height=24 width=642>");
//document.write("			<div align=center>");
//document.write("			<table border=0 cellpadding=0 cellspacing=0 width=100%>");
//document.write("			 <tr>");
//document.write("				 <td>");
//document.write("				   <p align=center> ");
//document.write("					&nbsp;&nbsp;&nbsp;<a href="+pathdot+"index.jsp><font color=ffffff>主&nbsp;页</font></a>"); 
//document.write("					&nbsp;&nbsp;&nbsp;<a href="+pathdot+"wangsgsyw/index.jsp><font color=ffffff>网上工商业务</font></a> ");
//document.write("					&nbsp;&nbsp;&nbsp;<a href="+pathdot+"gongsqyzx/index.jsp><font color=ffffff>工商企业在线</font></a> ");
//document.write("					&nbsp;&nbsp;&nbsp;<a href="+pathdot+"wangyzx/wangyzx.htm><font color=ffffff>网员中心</font></a> ");
//document.write("					&nbsp;&nbsp;&nbsp;<a href="+pathdot+"wangyzx/index.jsp><font color=ffffff>企业自助展台</font></a> ");
//document.write("					&nbsp;&nbsp;&nbsp;<a href="+pathdot+"hudzq/index.htm><font color=ffffff>互动专区</font></a> ");
//document.write("					&nbsp;&nbsp;&nbsp;<font color=ffffff>专业市场</font>");
//document.write("			      </p> ");
//document.write("				</td> ");
//document.write("			 </tr> ");
//document.write("			 </table> ");
//document.write("			</div> ");
//document.write("		</td>  ");
//document.write("		<td height=18 width=120>&nbsp;</td>  ");
//document.write("	</tr> ");
//document.write("</table>");
//document.write("</center>");
//document.write(" </div> ");


//-----------------------------------------------------------


document.write("<div align=center>");
document.write("<center>");
document.write("<table border=0 width=760 cellpadding=0 cellspacing=0>");
document.write("	<tr>");
document.write("		<td width=256 background="+pathdot+"images/top11.gif height=136 valign=top><img border=0 src="+pathdot+"images/logodong.gif width=254 height=69></td>");
document.write("		<td width=504>");
document.write("       <OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"");
document.write(" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" ");
document.write("WIDTH=504 HEIGHT=136 id=header ALIGN=\"\">");
document.write(" <PARAM NAME=movie VALUE=\""+pathdot+"images/header.swf\"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> ");
document.write("<EMBED src="+pathdot+"images/header.swf quality=high bgcolor=#FFFFFF  WIDTH=504 HEIGHT=136 NAME=header ALIGN=\" \" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>");
document.write("</OBJECT>		</td>");
document.write("	</tr>");
document.write("</table>");
document.write("</center>");
document.write(" </div> ");

document.write("<div align=center>");
document.write("  <table border=0 cellpadding=0 cellspacing=0 width=760 height=29 background=\""+pathdot+"images/topcaidan.gif\">");
document.write("    <tr>");
document.write("      <td>");
document.write("        <div align=center>");
document.write("          <table border=0 cellpadding=0 cellspacing=0>");
document.write("            <tr>");
document.write("              <td align=\"center\"><a href=\""+pathdot+"index.jsp\">主&nbsp;&nbsp;页</a>&nbsp;&nbsp;</td>");
document.write("  <center>");
document.write("              <td width=\"108\" align=center>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\""+pathdot+"wangsgsyw/index.jsp\">网上工商业务</a></td>");
document.write("              <td width=\"108\" align=center>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\""+pathdot+"gongsqyzx/index.jsp\">工商企业在线</a></td>");
document.write("              <td width=\"109\" align=center>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\""+pathdot+"wangyzx/wangyzx.htm\">网员中心</a></td>");
document.write("              <td width=\"109\" align=center>&nbsp;&nbsp;<a href=\""+pathdot+"wangyzx/index.jsp\">企业自助展台</a></td>");
document.write("              <td width=\"109\" align=center>&nbsp;&nbsp;<a href=\""+pathdot+"hudzq/index.htm\">互动专区</a></td>");
document.write("              <td width=\"109\" align=center>&nbsp;&nbsp;<a href=\""+pathdot+"qiyjz/index.htm\">企业建站</a></td>");
document.write("            </tr>");
document.write("          </table>");
document.write("        </div>");
document.write("      </td>");
document.write("    </tr>");
document.write("  </table>");
document.write("</div>");

}

//-----------------------------------------------------------






//页面底部显示
function showfoot123(pathlevel)
{
var pathdot="";
if (pathlevel=="2") pathdot="../"
if (pathlevel=="3") pathdot="../../"
if (pathlevel=="4") pathdot="../../../"
//document.write("<div align=center>");
//document.write("<center>");
//document.write("<hr noshade size=1 color=#C0C0C0 width=740>");
//document.write("<table border=0 width=760>");
//document.write("<tr>");
//document.write("<td align=middle width=760 height=30>");
//document.write("<a href=\""+pathdot+"jicgn/guanywm/index.htm\" target=_top>关&nbsp;于&nbsp;我&nbsp;们</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
//document.write("<a href=\""+pathdot+"jicgn/wangzdt/index.htm\" target=_top>网&nbsp;站&nbsp;地&nbsp;图</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
//document.write("<a href=\""+pathdot+"jicgn/changjwt/index.htm\" target=_top>常&nbsp;见&nbsp;问&nbsp;题</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
//document.write("<a href=\""+pathdot+"jicgn/qiyjz/index.htm\" target=_top>企&nbsp;业&nbsp;建&nbsp;站</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
//document.write("<a href=\""+pathdot+"jicgn/sousyq/index.htm\" target=_top>搜&nbsp;索&nbsp;引&nbsp;擎</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
//document.write("<a href=\""+pathdot+"jicgn/sousyq/index.htm\" target=_top>搜&nbsp;索&nbsp;引&nbsp;擎</a>");
//document.write("<a href=\""+pathdot+"jicgn/youqlj/index.htm\" target=_top>友&nbsp;情&nbsp;链&nbsp;接</a>&nbsp;&nbsp;&nbsp;");
//document.write("</td>");
//document.write("</tr>");
//document.write("<tr>");
//document.write("<td vAlign=bottom align=middle>");                
//document.write("<p align=center><a href=http://www.snaic.gov.cn>陕西省工商行政管理局</a> 版权所有&nbsp;陕ICP备030038号<br>");                               
//document.write("<a href=http://www.snhd.com.cn>陕西红盾在线科技有限公司</a> 运营维护<br>");  
//document.write("</p></td>"); 
//document.write("陕ICP备030038号</p></td>");   
//document.write("</tr>");
//document.write("</table>");
//document.write("</center>");
//document.write(" </div> ");

document.write("<div align=center>");
document.write("<center>");
document.write("<hr noshade size=1 color=#C0C0C0 width=740>");
document.write("<div align=center>");
document.write("  <table border=0 cellpadding=0 cellspacing=0 width=554 height=34 background="+pathdot+"images/bottom.gif>");
document.write("    <tr>");
document.write("      <td width=39>　</td>");
document.write("      <td width=114 align=center>");
document.write("<a href="+pathdot+"jicgn/guanywm/index.htm target=_top>关&nbsp;于&nbsp;我&nbsp;们</a></td>");
document.write("      <td width=124 align=center><a href="+pathdot+"jicgn/wangzdt/index.htm target=_top>网&nbsp;站&nbsp;地&nbsp;图</a></td>");
document.write("      <td width=123 align=center><a href="+pathdot+"jicgn/changjwt/index.htm target=_top>常&nbsp;见&nbsp;问&nbsp;题</a></td>");
document.write("      <td width=99 align=center><a href="+pathdot+"jicgn/sousyq/index.htm target=_top>搜&nbsp;索&nbsp;引&nbsp;擎</a></td>");
document.write("      <td width=43>　</td>");
document.write("    </tr>");
document.write("  </table>");
document.write("</div>");
document.write("<table border=0 width=760 height=57>");
document.write("<tr>");
document.write("<td width=760 height=12>");
document.write("</td> ");
document.write("</tr> ");
document.write("<tr> ");
document.write("<td vAlign=bottom align=middle height=37>                 ");
document.write("<p align=center><a href=http://www.snaic.gov.cn>陕西省工商行政管理局</a> 版权所有&nbsp;陕ICP备030038号<br>         ");                         
document.write("<a href=http://www.snhd.com.cn>陕西红盾在线科技有限公司</a> 运营维护  ");
document.write("</p></td>    ");
document.write("</tr>   ");
document.write("</table>   ");
document.write("</center>   ");
document.write(" </div>   ");
   



}




//-----------------以下为客户端脚本验证函数------
function Weboochknull(o,c)
{
//判断输入项是否为空
	var s=o.value;
	if(s.length==0) {alert(""+c+"输入项不能为空！");o.focus();
		//o.scrollIntoView();
		return(false);}
	return(true);
}

function Weboochkleng(o,c,l)
{
//判断输入项不能大l于字节
        
	var s=o.value;
	
	var len=strlength(s);
	if(len>l) {alert(""+c+"输入项长度不能大于"+l+"字节！");o.focus();
	//o.scrollIntoView();
	return(false);}
	return(true);
}

function Weboochklen(o,c,l)
{
//判断输入项必须等于某个l字节
	var s=o.value;
	var len=strlength(s);
	if(len>0)
	{
	if(len!=l) {alert(""+c+"输入项长度必须等于"+l+"字节！");o.focus();
	//o.scrollIntoView();
	return(false);}
	}
	return(true);
}

function Weboochknum(o,c)
{
//判断输入项是否为整数
	var s=o.value;
	if(isDigit(s)==false){alert (""+c+"输入项必须为整数，请重新输入！");o.focus();
	//o.scrollIntoView();
	return(false);}
	return(true);
}
function Weboochkeven(o,c,n)
{
//判断输入项是否等于某个值
	var s=o.value;
	if(s!=n) {alert(""+c+"左右值必须相符！");o.focus();o.scrollIntoView();return(false);}
	return(true);
}
function Weboochkcomp(o,p,m,n)
{
//判断第一个输入项是否大于第二个输入项
	var s=o.value;
	var t=p.value;
	if(parseFloat(s)>parseFloat(t)) {alert(""+m+"输入项不能大于"+n+"输入项！");o.focus();
	//o.scrollIntoView();
	return(false);}
	return(true);
}
function Weboochksame(o1,o2)
{
//判断两个输入项是否相同(校验密码)
	var s1=o1.value;
	var s2=o2.value;
	if(s1!=s2){alert ("两次输入的密码不同，请重新输入！");o1.focus();
	//o1.scrollIntoView();
	return(false);}
	return(true);
}
function Weboochkmail(o)
{
//判断EMAIL格式
	//var s=o.value;
	//if(s!="" && s.indexOf('@')<=0){alert ("电子邮电格式不对，请重新输入！");o.focus();o.scrollIntoView();return(false);}
	//return(true);
	var s=o.value;
	var regu = "^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[0-9a-zA-Z]+))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2}|net|NET|com|COM|gov|GOV|mil|MIL|org|ORG|edu|EDU|int|INT)$";
	var re = new RegExp(regu);
	if(s=="") return true;
	if (s.search(re)==-1) {alert ("电子邮电格式不对，请重新输入！");o.focus();
	//o.scrollIntoView();
	return(false);}
	return(true);
}

function Weboochkpost(o,l,c)
{
//判断邮编输入格式
var s=o.value
var len=strlength(s)
if (s!="")
{
if(isNaN(s)==true) 
	{
	alert(""+c+"必须为数字");
	o.focus();o.scrollIntoView();
	return(false);
	}
if(len!=l) 
	{
	alert(""+c+"长度必须为"+l+"位");
	o.focus();o.scrollIntoView();
	return(false);
	}
}
return(true);
}
//判断输入是日期
function  strDate(str){ 
        var isData="true" 
	var  year  =  str.substring(0,4);
	var  month  =  str.substring(5,7);
	var  day  =  str.substring(8,10);
	if(isNaN(year))isData="false";
	if(isNaN(month))isData="false";
	if(isNaN(day))isData="false";
	if(month>12 || month<1)isData="false";
	if(day>31 || day<1)isData="false";
	var  flag1=str.substring(4,5);
	var  flag2=str.substring(7,8); 
	if(flag1!="-")isData="false";   
	if(flag2!="-")isData="false";
    return isData;
}  

function Weboochkdate(o,c)
{
//判断邮编输入格式
var s=o.value
var len=strlength(s)
if (s!="")
{
if(strDate(s)==false) 
	{
	alert(""+c+"必须为有效日期");
	o.focus();o.scrollIntoView();
	return(false);
	}
}
return(true);
}

//判断字符个数 每个汉字做两个字符处理
function strlength(str){
	var l=str.length;
	var n=l;
	for (var i=0;i<l;i++)
	{
	if (str.charCodeAt(i)<0||str.charCodeAt(i)>255) n++
	}
	return n 
}


//-----------------以上为客户端脚本验证函数------
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function isNaNa(str)
{
   var numStr="0123456789.";
   var IsNumStr=true;

   // check if only -
	if((str.length==1)&&(str.charAt(0)=='-')) return false;

   for(i=0;i<str.length;i++)
   {
      var IsNumchar=false;
      for(j=0;j<numStr.length;j++)
        if(str.charAt(i)==numStr.charAt(j)){ IsNumchar=true;break;}
        if(!IsNumchar){ 
			if((str.charAt(i)=='-')&&(i==0)) IsNumStr=true;
			else IsNumStr=false;
			break;
		} 
   }
   return IsNumStr;
}

function WeboochkNaNa(o,c,l,l2)
{
//判断输入项不能大l于字节
        
	var s=o.value;
	
	var flg=s.indexOf('-');

	// check -
	if(flg==0) {s=s.substring(1,s.length);};	// fix the pre -

	
	// check only -
	var len=strlength(s);
	if((len==0)&&(flg==0)) {alert(""+c+"输入项只能为数字！");o.focus();o.scrollIntoView();return(false);}


	var loc=s.indexOf('.');


	// check l
	l=l-l2;


	if(!isNaNa(s)) {alert(""+c+"输入项只能为数字！");o.focus();o.scrollIntoView();return(false);}


	if(loc<0) {
		if(len>l) {alert(""+c+"输入项小数点前不能大于"+l+"字节！");o.focus();o.scrollIntoView();return(false);}
	}
	else {
		if(loc>l) {alert(""+c+"输入项小数点前不能大于"+l+"字节！");o.focus();o.scrollIntoView();return(false);}
		if(len-loc-1>l2) {alert(""+c+"输入项小数点后不能大于"+l2+"字节！");o.focus();o.scrollIntoView();return(false);}
	}

	return(true);
}
   

   function WeboochkNaNaB(o,l,l2)
{
//判断输入项不能大l于字节
        
	var s=o.value;
	
	var len=strlength(s);

	var loc=s.indexOf('.');

	// check l
	l=l-l2;

	if(!isNaNa(s)) {alert("该输入项只能为数字！");o.focus();o.scrollIntoView();return(false);}


	if(loc<0) {
		if(len>l) {alert("该输入项整数长度不能大于"+l+"字节！");o.focus();o.scrollIntoView();return(false);}
	}
	else {
		if(loc>l) {alert("该输入项整数长度不能大于"+l+"字节！");o.focus();o.scrollIntoView();return(false);}

	}

	return(true);
}

//数字型
function isDigit(theNum){
    
    for(var j=0;j<theNum.length;j++){
		var c = theNum.charAt(j);
		if (c<"0"||c>"9"){
			return false;
		}
     }
     return true;
}
//-->


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////// --- date pop start----- ////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



function getNowDate()
{
   var nn=new Date();
   year1=nn.getYear();
   mon1=nn.getMonth()+1;
   date1=nn.getDate();
   var monstr1;
   var datestr1
   if(mon1<10)
    monstr1="0"+mon1;
   else
    monstr1=""+mon1;

   if(date1<10)
     datestr1="0"+date1;
   else
     datestr1=""+date1;
   return year1+"-"+monstr1+"-"+datestr1;
}

function getlastweekDate()
{
   var nn=new Date();
   year1=nn.getYear();
   mon1=nn.getMonth()+1;
   date1=nn.getDate();

   var mm=new Date(year1,mon1-1,date1);
   var tmp1=new Date(2000,1,1);
   var tmp2=new Date(2000,1,15);
   var ne=tmp2-tmp1;
   var mm2=new Date();
   mm2.setTime(mm.getTime()-ne);


   year2=mm2.getYear();
   mon2=mm2.getMonth()+1;
   date2=mm2.getDate();


     if(mon2<10)
    monstr2="0"+mon2;
   else
    monstr2=""+mon2;

   if(date2<10)
     datestr2="0"+date2;
   else
     datestr2=""+date2;


    return year2+"-"+monstr2+"-"+datestr2;
}



var gdCtrl = new Object();
var goSelectTag = new Array();
var gcGray   = "#808080";
var gcToggle = "#FB8664";
var gcBG = "#e5e6ec";
var previousObject = null;

var gdCurDate = new Date();
var giYear = gdCurDate.getFullYear();
var giMonth = gdCurDate.getMonth()+1;
var giDay = gdCurDate.getDate();

function fSetDate(iYear, iMonth, iDay){
  VicPopCal.style.visibility = "hidden";
  if ((iYear == 0) && (iMonth == 0) && (iDay == 0)){
  	gdCtrl.value = "";
  }else{
  	iMonth = iMonth + 100 + "";
  	iMonth = iMonth.substring(1);
  	iDay   = iDay + 100 + "";
  	iDay   = iDay.substring(1);
  	if(gdCtrl.tagName == "INPUT"){
  	  	gdCtrl.value = iYear+"-"+iMonth+"-"+iDay;
  	}else{
  	  	gdCtrl.innerText = iYear+"-"+iMonth+"-"+iDay;
  	}
  }

  for (i in goSelectTag)
  	goSelectTag[i].style.visibility = "visible";
  goSelectTag.length = 0;

  window.returnValue=gdCtrl.value;


}

function HiddenDiv()
{
	var i;
  VicPopCal.style.visibility = "hidden";
  for (i in goSelectTag)
  	goSelectTag[i].style.visibility = "visible";
  goSelectTag.length = 0;

}
function fSetSelected(aCell){
  var iOffset = 0;
  var iYear = parseInt(tbSelYear.value);
  var iMonth = parseInt(tbSelMonth.value);

  aCell.bgColor = gcBG;
  with (aCell.children["cellText"]){
  	var iDay = parseInt(innerText);
  	if (color==gcGray)
		iOffset = (Victor<10)?-1:1;
	iMonth += iOffset;
	if (iMonth<1) {
		iYear--;
		iMonth = 12;
	}else if (iMonth>12){
		iYear++;
		iMonth = 1;
	}
  }
  fSetDate(iYear, iMonth, iDay);
}

function Point(iX, iY){
	this.x = iX;
	this.y = iY;
}

function fBuildCal(iYear, iMonth) {
  var aMonth=new Array();
  for(i=1;i<7;i++)
  	aMonth[i]=new Array(i);

  var dCalDate=new Date(iYear, iMonth-1, 1);
  var iDayOfFirst=dCalDate.getDay();
  var iDaysInMonth=new Date(iYear, iMonth, 0).getDate();
  var iOffsetLast=new Date(iYear, iMonth-1, 0).getDate()-iDayOfFirst+1;
  var iDate = 1;
  var iNext = 1;

  for (d = 0; d < 7; d++)
	aMonth[1][d] = (d<iDayOfFirst)?-(iOffsetLast+d):iDate++;
  for (w = 2; w < 7; w++)
  	for (d = 0; d < 7; d++)
		aMonth[w][d] = (iDate<=iDaysInMonth)?iDate++:-(iNext++);
  return aMonth;
}

function fDrawCal(iYear, iMonth, iCellHeight, sDateTextSize) {
  var WeekDay = new Array("日","一","二","三","四","五","六");
  var styleTD = " bgcolor='"+gcBG+"' bordercolor='"+gcBG+"' valign='middle' align='center' height='"+iCellHeight+"' style='font:bold arial "+sDateTextSize+";";            //Coded by Hcy email:hcy110@263.net

  with (document) {
	write("<tr>");
	for(i=0; i<7; i++){
		write("<td "+styleTD+"color:maroon' >"+ WeekDay[i] + "</td>");
	}
	write("</tr>");

  	for (w = 1; w < 7; w++) {
		write("<tr>");
		for (d = 0; d < 7; d++) {
			write("<td id=calCell "+styleTD+"cursor:hand;' onMouseOver='this.bgColor=gcToggle' onMouseOut='this.bgColor=gcBG' onclick='fSetSelected(this)'>");
			write("<font id=cellText Victor='Hcy_Flag'> </font>");
			write("</td>")
		}
		write("</tr>");
	}
  }
}

function fUpdateCal(iYear, iMonth) {
  myMonth = fBuildCal(iYear, iMonth);
  var i = 0;
  for (w = 0; w < 6; w++)
	for (d = 0; d < 7; d++)
		with (cellText[(7*w)+d]) {
			Victor = i++;
			if (myMonth[w+1][d]<0) {
				color = gcGray;
				innerText = -myMonth[w+1][d];
			}else{
				color = ((d==0)||(d==6))?"red":"black";
				innerText = myMonth[w+1][d];
			}
		}
}

function fSetYearMon(iYear, iMon){
  tbSelMonth.options[iMon-1].selected = true;
  for (i = 0; i < tbSelYear.length; i++)
	if (tbSelYear.options[i].value == iYear)
		tbSelYear.options[i].selected = true;
  fUpdateCal(iYear, iMon);
}

function fPrevMonth(){
  var iMon = tbSelMonth.value;
  var iYear = tbSelYear.value;

  if (--iMon<1) {
	  iMon = 12;
	  iYear--;
  }

  fSetYearMon(iYear, iMon);
}

function fNextMonth(){
  var iMon = tbSelMonth.value;
  var iYear = tbSelYear.value;

  if (++iMon>12) {
	  iMon = 1;
	  iYear++;
  }

  fSetYearMon(iYear, iMon);
}

function fToggleTags(){
  with (document.all.tags("SELECT")){
 	for (i=0; i<length; i++)
 		if ((item(i).Victor!="Won")&&fTagInBound(item(i))){
 			item(i).style.visibility = "hidden";
 			goSelectTag[goSelectTag.length] = item(i);
 		}
  }
}

function fTagInBound(aTag){
  with (VicPopCal.style){
  	var l = parseInt(left);
  	var t = parseInt(top);
  	var r = l+parseInt(width);
  	var b = t+parseInt(height);
	var ptLT = fGetXY(aTag);
	return !((ptLT.x>r)||(ptLT.x+aTag.offsetWidth<l)||(ptLT.y>b)||(ptLT.y+aTag.offsetHeight<t));
  }
}

function fGetXY(aTag){
  var oTmp = aTag;
  var pt = new Point(0,0);
  do {
  	pt.x += oTmp.offsetLeft;
  	pt.y += oTmp.offsetTop;
  	oTmp = oTmp.offsetParent;
  } while(oTmp.tagName!="BODY");
  return pt;
}

function GetWidthHeight() {
//IE,NS
//This function returns the width and height of the menus frame.
//------------------------------
//Version 1.0
//
	mFrame = eval(frames['self']);
	return [mFrame.document.body.clientWidth,mFrame.document.body.clientHeight];

}

function GetLeftTop() {
//IE,NS
//This function returns the scroll bars position on the menus frame.
//------------------------------
//Version 1.0
//
	mFrame = eval(frames['self']);
	return [mFrame.document.body.scrollLeft,mFrame.document.body.scrollTop];

}


function fPopCalendar(popCtrl, dateCtrl,strDate){
  if (popCtrl == previousObject){
	  	if (VicPopCal.style.visibility == "visible"){
  		HiddenDiv();
  		return true;
  	}

  }
  previousObject = popCtrl;
  gdCtrl = dateCtrl;
  fInitialDate(strDate);
  fSetYearMon(giYear, giMonth);
  var point = fGetXY(popCtrl);
  with (VicPopCal.style) {
  	left = point.x;
	top  = point.y+popCtrl.offsetHeight;
	width = VicPopCal.offsetWidth;
	height = VicPopCal.offsetHeight;

	// check and fix left
	var pW = GetWidthHeight()[0] + GetLeftTop()[0];
	var pH = GetWidthHeight()[1] + GetLeftTop()[1];

	left = ((parseInt(left)+parseInt(width))>pW)?pW - parseInt(width):left;
	//top =  ((parseInt(top)+parseInt(height))>pH)?pH - parseInt(height):top;


	fToggleTags(point);
	visibility = 'visible';
  }
}

function fInitialDate(strDate){
	if( strDate == null || strDate.length != 10 )
		return false;

	var sYear  = strDate.substring(0,4);
	var sMonth = strDate.substring(5,7);
	var sDay   = strDate.substring(8,10);

	if( sMonth.charAt(0) == '0' ) { sMonth = sMonth.substring(1,2); }
	if( sDay.charAt(0)   == '0' ) { sDay   = sDay.substring(1,2);   }

	var nYear  = parseInt(sYear );
	var nMonth = parseInt(sMonth);
	var nDay   = parseInt(sDay  );

	if ( isNaN(nYear ) )	return false;
	if ( isNaN(nMonth) )	return false;
	if ( isNaN(nDay  ) )	return false;

	var arrMon = new Array(12);
	arrMon[ 0] = 31;	arrMon[ 1] = nYear % 4 == 0 ? 29:28;
	arrMon[ 2] = 31;	arrMon[ 3] = 30;
	arrMon[ 4] = 31;	arrMon[ 5] = 30;
	arrMon[ 6] = 31;	arrMon[ 7] = 31;
	arrMon[ 8] = 30;	arrMon[ 9] = 31;
	arrMon[10] = 30;	arrMon[11] = 31;

	if ( nYear  < 1900 || nYear > 2100 )			return false;
	if ( nMonth < 1 || nMonth > 12 )				return false;
	if ( nDay < 1 || nDay > arrMon[nMonth - 1] )	return false;

	giYear  = nYear;
	giMonth = nMonth;
	giDay   = nDay;
	return true;
}

var gMonths = new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");

with (document) {
write("<Div id='VicPopCal' style='POSITION:absolute;VISIBILITY:hidden;border:2px ridge;z-index:100;'>");
write("<table border='0'class=word cellpadding='0' cellspacing='0' width='150px'  bgcolor='#cccccc'>");
write("<TR>");
write("<td valign='middle' align='center'><input type='button' name='PrevMonth' value='<' style='height:20;width:20;FONT:bold' onClick='fPrevMonth()'>");
write("&nbsp;&nbsp;<SELECT name='tbSelYear' onChange='fUpdateCal(tbSelYear.value, tbSelMonth.value)' Victor='Won'>");
for(i=1949;i<2015;i++)
	write("<OPTION value='"+i+"'>"+i+" 年</OPTION>");
write("</SELECT>");
write("&nbsp;&nbsp;&nbsp;&nbsp;<select name='tbSelMonth' onChange='fUpdateCal(tbSelYear.value, tbSelMonth.value)' Victor='Won'>");
for (i=0; i<12; i++)
	write("<option value='"+(i+1)+"'>"+gMonths[i]+"</option>");
write("</SELECT>");
write("&nbsp;&nbsp;<input type='button' name='PrevMonth' value='>' style='height:20;width:20;FONT:bold' onclick='fNextMonth()'>");
write("</td>");
write("</TR><TR>");
write("<td align='center' style='background-color:teal'>");
write("<table align='center' class=word border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td>");
fDrawCal(giYear, giMonth, 20, '12');
write("</td></tr></table>");
write("</td>");
write("</TR><TR><TD align='center'>");
write("<TABLE align='center' class=word border='0' cellpadding='0' cellspacing='0' width='100%'><TR><TD align='center'>");
write("<font style='cursor:hand' onclick='fSetDate(0,0,0)' onMouseOver='this.style.color=gcToggle' onMouseOut='this.style.color=0'><b>清空</b></font>");
write(" <font style='cursor:hand' onclick='fSetDate(giYear,giMonth,giDay)' onMouseOver='this.style.color=gcToggle' onMouseOut='this.style.color=0'><b>今天: "+giYear+"/"+giMonth+"/"+giDay+"</b></font>");
write("</td></tr></table>");
write("</TD></TR>");
write("</TABLE></Div>");
}







////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////// --- date pop end----- /////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////// --- big number opertion----- /////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function BN_ZEROGENERATE(n)
{

	var i=0;
	var s="";

	for(i=0;i<n;i++) s=s+"0";
	return s;

}

function BN_ADDSUB(a,b,x)	// x -> true:add, false:sub
{
	var numset="0123456789";
	var s="";

	// translate to string from float
	var sa,sb;
	sa=new String(a);
	sb=new String(b);


	// search dot postion
	var za,zb;
	za=sa.indexOf(".");
	zb=sb.indexOf(".");
	if(za==-1) sa=sa+".0";
	if(zb==-1) sb=sb+".0";
	za=sa.indexOf(".");
	zb=sb.indexOf(".");


	// fix string number dot left
	if((za-zb)>0) sb=BN_ZEROGENERATE(za-zb)+sb;
	else if((zb-za)>0)sa=BN_ZEROGENERATE(zb-za)+sa;

	// fix string number dot right
	if((sa.length-sb.length)>0) sb=sb+BN_ZEROGENERATE(sa.length-sb.length);
	else if((sb.length-sa.length)>0)sa=sa+BN_ZEROGENERATE(sb.length-sa.length);

	// fu
	if((sb>sa)&&(x==false)) {
		return "-"+BN_ADDSUB(b,a,x);
	}

	//  add it
	var len=sa.length;
	var i;
	var c=false;
	var na=0,nb=0,nc=0;

	for(i=len-1;i>=0;i--) {
		if(sa.charAt(i)=='.') {
			s="."+s;
			continue;
		}
		
		// to number
		na=numset.indexOf(sa.charAt(i));
		nb=numset.indexOf(sb.charAt(i));
		if(na==-1) return "ERROR";
		if(nb==-1) return "ERROR";

		// do operation
		if(x==true) {
			nc=na+nb;
			if(c==true) nc=nc+1;

			if(nc>9) {
				c=true;
				nc=nc-10;
			}
			else {
				c=false;
			}
		}
		else {
			nc=na-nb;
			if(c==true) nc=nc-1;

			if(nc<0) {
				c=true;
				nc=nc+10;
			}
			else {
				c=false;
			}
		}
		
		s=numset.charAt(nc)+s;
	
	}
	// if add opertion & has c flag then add one length
	if((x==true)&&(c==true)) s="1"+s;
	
	// delete heard & foot zero
	var tmp2,tmp1;
	for(i=s.length-1;i>=0;i--) {
		if(s.charAt(i)=='.') {
			tmp2=i-1;
			break;
		}
		if(s.charAt(i)!='0') {
			tmp2=i;
			break;
		}
	}

	for(i=0;i<s.length;i++) {
		if(s.charAt(i)=='.') {
			tmp1=i;
			break;
		}
		if(s.charAt(i)!='0') {
			tmp1=i;
			break;
		}
	}
	
	s=s.substr(tmp1,tmp2-tmp1+1);
	if(s.charAt(0)=='.') s="0"+s;
	if(s.length==0) s="0";
	return s;
}

function BN_ADD(a,b)
{
	var fa=true,fb=true;
	if(a.charAt(0)=='-') {
		fa=false;
		a=a.substr(1);
	}
	if(b.charAt(0)=='-') {
		fb=false;
		b=b.substr(1);
	}
	
	if((fa==true)&&(fb==true)) return BN_ADDSUB(a,b,true);
	if((fa==false)&&(fb==false)) return "-"+BN_ADDSUB(a,b,true);
	if((fa==true)&&(fb==false)) return BN_ADDSUB(a,b,false);
	if((fa==false)&&(fb==true)) return BN_ADDSUB(b,a,false);
	
}
function BN_SUB(a,b)
{
	var fa=true,fb=true;
	if(a.charAt(0)=='-') {
		fa=false;
		a=a.substr(1);
	}
	if(b.charAt(0)=='-') {
		fb=false;
		b=b.substr(1);
	}
	if((fa==true)&&(fb==true)) return BN_ADDSUB(a,b,false);
	if((fa==false)&&(fb==false)) return BN_ADDSUB(b,a,false);
	if((fa==true)&&(fb==false)) return BN_ADDSUB(a,b,true);
	if((fa==false)&&(fb==true)) return "-"+BN_ADDSUB(a,b,true);
	

}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////// --- big number opertion end----- /////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//鼠标在表格上移动效果
function mOvr(src,clrOver){ 
	if (!src.contains(event.fromElement)) { 
		src.style.cursor = 'hand'; 
		src.bgColor = clrOver; 
	}
}
function mOut(src,clrIn)  { 
	if (!src.contains(event.toElement)) {  
		src.style.cursor = 'default'; 
		src.bgColor = clrIn; 
	}
} 


////////////////////////////////// today string and diff date old //////////
function sToday(){
   var d, s = "";
   d = new Date();
   s += (d.getMonth() + 1) + "/";
   s += d.getDate() + "/";
   s += d.getFullYear();
   return(s);
}

function oldDay(s){
d1=new Date(Date.parse(s));
d2=new Date(Date.parse(sToday()));
return (d2-d1)/24/60/60/1000;
}


////////////////////////////////// sprite zip  //////////
function ziptel(o,o1,o2,o3)
{
	o.value=o1.value+"-"+o2.value+"-"+o3.value;
}
function unziptel(o,o1,o2,o3)
{
	var rr=/^(.*)-(.*)-(.*)$/;
	var r=o.value.match(rr);
	try{
	o1.value=r[1];
	o2.value=r[2];
	o3.value=r[3];
	}catch(err){}
}

//////////////////////////////////////////////
// 验证是否选择图片

function fAvailPic(o)
{
	var rr=/^http(.*)noqiy.gif$/;
	var r=o.src.match(rr);
	if(r==null) return true;
	else return false;
}

function focusctl(o)
{
	o.focus();
	o.scrollIntoView();
	return;
}


function confirmSearch(o){
	if(confirm("您确定要查询“"+o.innerText+"”的信息?"))
		{
		return true;
	}else return false;
}
