
		if(typeof(PageControls)=="undefined")
           var PageControls = new Array();
		function PageControl(name)
		{
			this.name = name;
			this.index = PageControls.length;
     		this.bgcolor = "#fcfcfc"; 	//标签背景色
     		this.fcolor = "#005D99";   	//当前标签字体颜色
     		this.bdcolor = "#696969"; 	//边线颜色
     		this.bdShadowColor = "#424242"; //边线阴影颜色
     		this.bdToBgColor = "#F9F9F3"; //边线到背景色的过渡色
     		this.noSelBgColor = "#F3F3EF"; //未选中的标签背景色
     		this.curTopLineColor = "#E68B2C"; //当前标签的高亮颜色
     		this.curTopLineToBgColor = "#FFC73C"; //当前标签的高亮到背景的颜色
     		this.left = "0";
     		this.width = "100%";
     		this.height = "100%";
			this.alinkColor = "#000000";
			this.ahoverColor = "#000000";
			this.align = "left";
			this.autoTarget = false;

			this.target = "_self"//"frameLabel" + this.index;

			this.eventTarget = null;
            this.lastEventTarget = null;
			this.items = new Array();
			this.addItem = addItem;
			this.show = showLab;
			this.infoLabel = infolab;
			this.label = label;
			this.innerHTML = innerLabelHTML;
			this.form = null;
            this.autoPost = true;

            this.onclick = clickA;
			PageControls[PageControls.length] = this;

			document.write("<div width=" + this.width + " height=" + this.height + " id=PageControlDiv"+ this.index +" name=PageControlDiv"+ this.index +" ></div>");
		}
		function addItem(text,href,target,action)
		{
			if(typeof(target)=="undefined")
				target = this.target;

			var item = new labItem(text,href,target,action);
			this.items[this.items.length] = item;
		}

		function labItem(text,href,target,action)
		{
			if(typeof(href)=="undefined")
				href = "";
			if(typeof(target)=="undefined")
				target = "";
            if(typeof(action)=="undefined")
                action = "";

			this.text = text;
			this.href = href;
			this.target = target;
            this.action = action;

		}

		function showLab(curIndex)
		{
			if(typeof(curIndex)=="undefined" || curIndex.toString().search(/^[0-9]{1,}$/)>0 || curIndex>this.items.length)
				curIndex = 1;

			this.label(this.name,this.items.length);
			this.infoLabel(curIndex);
            if(!this.autoPost)this.onclick(curIndex);

            if(this.eventTarget != null && typeof(this.eventTarget)!= "undefined")
            {
                   this.eventTarget.value=curIndex;
            }
            if(this.lastEventTarget != null && typeof(this.lastEventTarget)!= "undefined")
            {
             		this.lastEventTarget.value = curIndex;
            }
		}

		function infolab(curIndex)
		{
			curIndex = parseInt(curIndex);
			
			var titleIndex = new Array;
			var m=1;
			var i=0;
			for(var i=2;i<=(this.items.length+1);i++)
			{
				if((curIndex+1)==i)titleIndex[i]=1;
				else titleIndex[i]=0;
			}
			
			for(var i=0;i<this.items.length;i++)
			{
				/*
				if(!this.items[i].target)
					var target = "frameLabel" + this.index;
				else
					target = this.items[i].target; 
				*/
				this.innerHTML((m++),titleIndex[m],this.items[i].text,this.items[i].href,this.items[i].target,this.items[i].action);
			}
		}
		
		function label(name,labnum){
    		var tempstr="";
			var bgcolor = this.bgcolor;
			var alinkcolor = this.alinkColor;
			var ahovercolor = this.ahoverColor;
			var bdcolor = this.bdcolor;
    tempstr = '<style>'+
              '.laba'+
              '{ '+
              '    FONT-SIZE: 9pt; '+
              '    COLOR: #ff0000; '+
              '    FONT-FAMILY: "宋体";  '+
              '    TEXT-DECORATION: none +}   '+
              '.laba:link   '+
              '{ '+
              '    COLOR: '+ alinkcolor +'; '+
              '    TEXT-DECORATION: none +} '+
              '.laba:visited  '+
              '{  '+
              '    COLOR: '+ alinkcolor +'; '+
              '    TEXT-DECORATION: none +} '+
              '.laba:hover  '+
              '{'+
              '    COLOR: '+ ahovercolor +'; '+
              '    TEXT-DECORATION: none +}'+
              '</style>'+
              '<table cellSpacing="0" cellPadding="0" width="' + this.width + '" border="0" height="' + this.height + '">' +
              '    <tr>';
    if(this.left != "0")
		tempstr += '<td valign="bottom"><table  border="0" cellpadding="0" cellspacing="0"><tr><td bgcolor="' + bdcolor + '"><img width="' + this.left + '" height="1"></td></tr></table><img height="1"></td>' ;	
    tempstr +='       <td vAlign="bottom" width="100%">' +
              '          <table cellSpacing="0" cellPadding="0" width="100%" border="0">' +
              '             <tr>' +
              '              <td align="' + this.align + '">' +
              '                <table cellSpacing="0" cellPadding="0" border="0">' +
              '                      <tr>';

    for(index=1;index<=labnum;index++){
        tempstr += '                               <td vAlign="bottom">' +
                   '                                 <SPAN id= "'+ name + "_labspan" + index +'" ></SPAN>' +
                   '                               </td>';
    }
    tempstr += '                               <td vAlign="bottom"><table height=1 cellSpacing="0" bgColor="'+ bdcolor + '" cellPadding="0" width="100%" border=0><tr><td></td></tr></table>' +
               '         　              </td> ' +
               '                      </tr> ' +
               '                   </table> ' +
               '                </td> ' +
               '                <td width="100%" vAlign="bottom"> <table height=1 cellSpacing="0" bgColor="'+ bdcolor + '" cellPadding="0" width="100%" border=0><tr><td></td></tr></table></td> ' +
               '             </tr>' +
               '             <tr bgColor="'+ bgcolor +'" >' +
               '                <td align="left" height="2" colSpan="2" style="border-left-style: solid; border-left-width: 1; border-right-style: solid; border-right-width: 1; border-top-width: 1; border-bottom-width: 1" bordercolor="' + bdcolor + '">' +
               ((this.eventTarget==null)?"":'<img height="2"  width="1">') +
               '</td></tr> ' +
               '          </table>' +
               '       </td>' +
               '    </tr>';
   if(this.autoTarget)
	tempstr += '	<tr>'+
               '		<td width="100%" '+((this.left=="0")?'':'colspan="2"')+' height="100%" style="border-left-style: solid; border-left-width: 1; border-right-style: solid; border-right-width: 1; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="' + bdcolor + '">'+
               '			<IFRAME id="frameLabel' + this.index + '" name="frameLabel' + this.index + '" src="" frameBorder="0" width="100%" height="100%" style="WIDTH: 100%; HEIGHT: 100%">浏览器不支持嵌入式框架，或被配置为不显示嵌入式框架。</IFRAME>'+
               '		</td>'+
               '	</tr>';

     tempstr +='</table>';
	 document.all("PageControlDiv"+ this.index).innerHTML = tempstr;
    //document.write(tempstr);
}

function innerLabelHTML(labelIndex,n,title,href,target,action){
     var name = this.name;
     var total = this.items.length;
     var bgcolor = this.bgcolor;
     var fcolor = this.fcolor;
     var bdcolor = this.bdcolor;
     var bdShadowColor = this.bdShadowColor;
     var bdToBgColor = this.bdToBgColor;
     var noSelBgColor = this.noSelBgColor;
     var curTopLineColor = this.curTopLineColor;
     var curTopLineToBgColor = this.curTopLineToBgColor;

     if(n==1){
            str1='<table cellSpacing="0" cellPadding="0" border="0">'+
                 '<tr>'+
                 '<td>'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td>'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + curTopLineColor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td>'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td>'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 ' </tr>'+
                 ' <tr>'+
                 '   <td>'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bdcolor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + curTopLineToBgColor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bdShadowColor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td>'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 ' </tr>'+
                 ' <tr>'+
                 '   <td bgColor="' + bdcolor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bgcolor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bgcolor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bdToBgColor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bdShadowColor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 ' </tr>'+
                 ' <tr>'+
                 '   <td bgColor="' + bdcolor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bgcolor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bgcolor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bdToBgColor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bdShadowColor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 ' </tr>'+
                 ' <tr>'+
                 '   <td bgColor="' + bdcolor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bgcolor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td noWrap bgColor="' + bgcolor + '" style="padding-left:10px;padding-right:10px;font-size:9pt;height:18px;">'+
                 '   <span style="color: '+ fcolor +'">'+title+'</span>' +
                 '   </td>'+
                 '   <td bgColor="' + bdToBgColor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bdShadowColor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 ' </tr>'+
                 ' <tr>'+
                 '   <td bgColor="' + bgcolor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bgcolor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bgcolor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bgcolor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 '   <td bgColor="' + bgcolor + '">'+
                 '   <img  border="0" width="1" height="1"></td>'+
                 ' </tr>'+
                 '</table>';
     }else {
     str1='<table cellSpacing="0" cellPadding="0" border="0">'+
                  ' <tr>'+
                  '   <td>'+
                  '   <img border="0" width="1" height="1"></td>'+
                  '   <td id="labelTDTop' + labelIndex + '" bgColor="' + bdcolor + '">'+
                  '   <img border="0" width="1" height="1"></td>'+
                  '   <td >'+
                  '   <img  border="0" width="1" height="1"></td>'+
                  '   <td>'+
                  '   <img  border="0" width="1" height="1"></td>'+
                  ' </tr>'+
                  ' <tr>'+
                   '   <td bgColor="' + bdcolor + '">'+
                  '   <img  border="0" width="1" height="1"></td>'+
                  '   <td id="labelTDTopU' + labelIndex + '" bgColor="' + bgcolor + '">'+
                  '   <img  border="0" width="1" height="1"></td>'+
                  '   <td bgColor="' + bdShadowColor + '">'+
                  '   <img  border="0" width="1" height="1"></td>'+
                  '   <td>'+
                  '   <img  border="0" width="1" height="1"></td>'+
                  ' </tr>'+
                  ' <tr>'+
                  '   <td noWrap bgColor="' + bdcolor  + '"></td>'+
 				  '   <td noWrap bgColor="' + noSelBgColor + '" style="padding-left:10px;padding-right:10px;font-size:9pt;height:18px;" '+
 				  ' 	onmouseover="reSetTDColor(document.all.labelTDTop' + labelIndex + ',\'' + curTopLineColor + '\');reSetTDColor(document.all.labelTDTopU' + labelIndex + ',\'' + curTopLineToBgColor + '\');"'+
 				  ' 	onmouseout="reSetTDColor(document.all.labelTDTop' + labelIndex + ',\'' + bdcolor + '\');reSetTDColor(document.all.labelTDTopU' + labelIndex + ',\'' + bgcolor + '\');">'+
				  '   <a class="laba"  onclick="return ' + ((action=="")?"true;":action+";") + '"' +
                       ((href!="")?('href="'+ href + '" target="' + target + '"'):"href=\"javascript:PageControls[" + this.index + '].infoLabel(' + labelIndex + ");PageControls[" + this.index + "].onclick(\'"+ labelIndex +"\');\"") + '>'+
				  //'   <a class="laba"  href="javascript:PageControls[' + this.index + '].infoLabel(' + labelIndex + ');clickA(\'' + href + '\');" >'+
                  title+'</a></td>'+
                  '   <td bgColor="' + bdToBgColor + '">'+
                  '   <img  border="0" width="1" height="1"></td>'+
                  '   <td bgColor="' + bdShadowColor + '">'+
                  '   <img  border="0" width="1" height="1"></td>'+
                  ' </tr>'+
                  ' <tr>'+
                  '   <td bgColor="' + bdcolor + '">'+
                  '   <img  border="0" width="1" height="1"></td>'+
                  '   <td bgColor="' + bdcolor + '">'+
                  '   <img  border="0" width="1" height="1"></td>'+
                  '  <td bgColor="' + bdcolor + '">'+
                  '   <img  border="0" width="1" height="1"></td>'+
                  '   <td bgColor="' + bdcolor + '">'+
                  '   <img  border="0" width="1" height="1"></td>'+
                  ' </tr> '+
                  '</table>';
     }
     document.all( name + '_labspan'+labelIndex).innerHTML = str1;
}

function reSetTDColor(td,color)
{
	if(typeof(td)=="undefined")return;
	td.bgColor = color;
}

function clickA(eventTarget)
{
    if(this.eventTarget != null && typeof(this.eventTarget)!= "undefined")
    {
           if(this.lastEventTarget != null && typeof(this.lastEventTarget)!= "undefined")
           {
            	this.lastEventTarget.value = this.eventTarget.value;
           }
           this.eventTarget.value=eventTarget;
    }

    if(this.autoPost)
    {
        this.form.submit();
    }
    else
    {
        for(var i=0;i<this.items.length;i++)
        {
         	if(typeof(this.items[i].target)!="undefined")
            {
         	 	if(typeof(this.items[i].target.style)!="undefined")
                {
             	 	if((eventTarget-1)==i)
                        this.items[i].target.style.display = "block";
                    else
                        this.items[i].target.style.display = "none";

                }
            }
        }

    }
}