<?xml version="1.0" encoding="UTF-8"?>
  <feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html"><![CDATA[雕刻时光]]></title>
  <subtitle type="html"><![CDATA[小猪快跑的博客]]></subtitle>
  <id>http://www.uqqb.com/</id>
  <link rel="alternate" type="text/html" href="http://www.uqqb.com/" /> 
  <link rel="self" type="application/atom+xml" href="http://www.uqqb.com/atom.asp" /> 
  <generator uri="http://www.pjhome.net/" version="2.8">PJBlog3</generator> 
  <updated>2008-12-16T21:56:06+08:00</updated>

  <entry>
	  <title type="html"><![CDATA[什么是癌症？恶性肿瘤称为癌症]]></title>
	  <author>
		 <name>admin</name>
		 <uri>http://www.uqqb.com/</uri>
		 <email>2097367@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.uqqb.com/default.asp?cateID=7" label="其他文章" /> 
	  <updated>2008-12-16T21:56:06+08:00</updated>
	  <published>2008-12-16T21:56:06+08:00</published>
		  <summary type="html"><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 自从人类开始认识癌症以来，已经有多种假说试图揭示癌症的本质，例如最早定义癌症的古希腊医生希普科伦特就认为癌症像所有其他疾病一样，是体液失衡的结果，是&ldquo;黑胆汁忧郁症&rdquo;的附属物。时至今日，生物学已经进入分子水平，现代科学对癌症做出的是什么样的解释呢?</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>癌症</strong>是全世界一个主要死亡原因。据世界卫生组织报告，1997年全球的癌症死亡人数约620万，2000年全球癌症死亡人数约630万。在2005年全世界5800万死亡总数中，癌症占所有死亡的760万(或13%)。2005年所有癌症死亡的70%以上发生在低收入和中等收入国家。预计全世界癌症死亡将继续增加。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;面对这触目惊心的数字，我们不禁要思考，癌症到底是什么?人们常说的癌是各种恶性肿瘤的总称。研究发现，癌症原来是人体遗传基因染色体紊乱而出现的细胞增生症。通常，正常人的细胞染色体是46条，而癌症患者就不同了。由于染色体的紊乱致使癌细胞分裂增殖失控，于是就出现了细胞增生症，形成<strong>恶性肿瘤</strong>，这个恶性肿瘤就叫癌，这个细胞就是癌细胞。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 人体几乎每个部位都可能遭受癌症侵害。如果任癌细胞肆意恣行，就会把人体拖垮。但是，恶性肿瘤不像病毒，不是体外入侵者，它的成分和正常组织一样，因此，机体无法对它进行识别免疫。当癌细胞向人体释放毒素时，如果发现和治疗不及时，它还可转移到全身各处生长繁殖，最后导致人体消瘦、无力、贫血、食欲不振、发热及脏器功能受损等。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 目前，我们还无法确切地弄清癌细胞生长的机制，即基因突变的规律。然而，我们已知一些导致基因突变的因素，如环境因素：香烟、有毒化学气体、被污染的水和食物等。内分泌与代谢：内分泌紊乱、化学物在体内的代谢等都可能引发癌变。精神因素：长期焦虑、紧张，精神忧郁、压抑等。物理因素：辐射、紫外线、食物过热等。遗传有时也是癌变的起因。</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.uqqb.com/article/73.htm" /> 
	  <id>http://www.uqqb.com/default.asp?id=73</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[巧用书签]]></title>
	  <author>
		 <name>admin</name>
		 <uri>http://www.uqqb.com/</uri>
		 <email>2097367@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.uqqb.com/default.asp?cateID=13" label="SEO技术" /> 
	  <updated>2008-12-09T22:29:38+08:00</updated>
	  <published>2008-12-09T22:29:38+08:00</published>
		  <summary type="html"><![CDATA[现在的书签和rrs一样有用，先记录下n个书签的地址，至于怎么使用，大家见人见智吧。<br/><br/>国内：<br/><br/><a href="http://cang.baidu.com/" target="_blank" rel="external">http://cang.baidu.com/</a> <br/><a href="http://myweb.cn.yahoo.com/" target="_blank" rel="external">http://myweb.cn.yahoo.com/</a> <br/><a href="http://shuqian.qq.com/" target="_blank" rel="external">http://shuqian.qq.com/</a> <br/><a href="http://vivi.sina.com.cn/" target="_blank" rel="external">http://vivi.sina.com.cn/</a> <br/><a href="http://koudai.qihoo.com/" target="_blank" rel="external">http://koudai.qihoo.com/</a> <br/><a href="http://key.donews.com/" target="_blank" rel="external">http://key.donews.com/</a> <br/><a href="http://hot.yesky.com/" target="_blank" rel="external">http://hot.yesky.com/</a> <br/><a href="http://bookmark.hexun.com/" target="_blank" rel="external">http://bookmark.hexun.com/</a> <br/><a href="http://share.poco.cn/" target="_blank" rel="external">http://share.poco.cn/</a> <br/><a href="http://www.teein.com/" target="_blank" rel="external">http://www.teein.com/</a> <br/><a href="http://leshou.com/" target="_blank" rel="external">http://leshou.com/</a> <br/><a href="http://www.chunw.com/" target="_blank" rel="external">http://www.chunw.com/</a> <br/><a href="http://www.favorites.com.cn/" target="_blank" rel="external">http://www.favorites.com.cn/</a><br/><a href="http://bookmark.people.com.cn/" target="_blank" rel="external">http://bookmark.people.com.cn/</a> <br/><a href="http://www.renrenweb.com/" target="_blank" rel="external">http://www.renrenweb.com/</a> <br/><a href="http://wz.csdn.net/" target="_blank" rel="external">http://wz.csdn.net/</a> <br/><a href="http://www.wozhai.com/" target="_blank" rel="external">http://www.wozhai.com/</a> <br/><a href="http://myshare.url.com.tw/" target="_blank" rel="external">http://myshare.url.com.tw/</a> <br/><a href="http://www.xieker.com/navipal/index.jsp" target="_blank" rel="external">http://www.xieker.com/navipal/index.jsp</a> <br/><a href="http://www.gootou.com/" target="_blank" rel="external">http://www.gootou.com/</a> <br/><a href="http://www.shouker.com/" target="_blank" rel="external">http://www.shouker.com/</a> <br/><a href="http://bookmark.yinsha.com/" target="_blank" rel="external">http://bookmark.yinsha.com/</a> <br/><a href="http://v.hongxiu.com/" target="_blank" rel="external">http://v.hongxiu.com/</a> <br/><a href="http://www.35766.com/" target="_blank" rel="external">http://www.35766.com/</a> <br/><a href="http://szpc.net/" target="_blank" rel="external">http://szpc.net/</a> <br/><a href="http://www.yangku.com/" target="_blank" rel="external"><a href="http://www.yangku.com/" target="_blank" rel="external">http://www.yangku.com/</a></a> <br/><a href="http://www.yeelan.com/" target="_blank" rel="external">http://www.yeelan.com/</a> <br/><a href="http://www.wodipan.com/" target="_blank" rel="external">http://www.wodipan.com/</a> <br/><a href="http://www.hoozone.com/" target="_blank" rel="external">http://www.hoozone.com/</a> <br/><a href="http://www.yangku.com/" target="_blank" rel="external"><a href="http://www.yangku.com/" target="_blank" rel="external">http://www.yangku.com/</a></a> <br/><a href="http://bookmark.sina.com.cn/" target="_blank" rel="external">http://bookmark.sina.com.cn/</a> <br/><a href="http://bookmark.udn.com/" target="_blank" rel="external">http://bookmark.udn.com/</a> <br/><a href="http://tw.myweb2.search.yahoo.com/" target="_blank" rel="external">http://tw.myweb2.search.yahoo.com/</a> <br/><a href="http://www.ishuqian.com/" target="_blank" rel="external">http://www.ishuqian.com/</a> <br/><a href="http://www.mister-wong.cn/" target="_blank" rel="external">http://www.mister-wong.cn/</a> <br/><a href="http://www.9fav.com/" target="_blank" rel="external">http://www.9fav.com/</a> <br/><a href="http://www.1zhai.com/" target="_blank" rel="external">http://www.1zhai.com/</a> <br/><a href="http://link.eyou.com/" target="_blank" rel="external">http://link.eyou.com/</a> <br/><a href="http://fav.it.com.cn/" target="_blank" rel="external">http://fav.it.com.cn/</a> <br/><a href="http://ok.iweihai.cn/" target="_blank" rel="external">http://ok.iweihai.cn/</a> <br/><a href="http://www.dffy.com/wz/" target="_blank" rel="external">http://www.dffy.com/wz/</a> <br/><a href="http://www.128m.com/zhai/" target="_blank" rel="external">http://www.128m.com/zhai/</a> <br/><a href="http://www.blogmemes.cn/" target="_blank" rel="external">http://www.blogmemes.cn/</a> <br/><a href="http://www.diywz.com/" target="_blank" rel="external">http://www.diywz.com/</a> <br/><br/>国外：<br/><a href="http://del.icio.us/" target="_blank" rel="external">http://del.icio.us/</a> <br/><a href="http://www.mister-wong.com" target="_blank" rel="external">http://www.mister-wong.com</a><br/><a href="http://www.mister-wong.de" target="_blank" rel="external">http://www.mister-wong.de</a><br/><a href="http://www.webnews.de" target="_blank" rel="external">http://www.webnews.de</a><br/><a href="http://www.icio.de" target="_blank" rel="external">http://www.icio.de</a><br/><a href="http://www.oneview.de" target="_blank" rel="external">http://www.oneview.de</a><br/><a href="http://www.linkarena.com" target="_blank" rel="external">http://www.linkarena.com</a><br/><a href="http://www.favoriten.de" target="_blank" rel="external">http://www.favoriten.de</a><br/><a href="http://social-bookmarking.seekxl.de" target="_blank" rel="external">http://social-bookmarking.seekxl.de</a><br/><a href="http://smarking.com" target="_blank" rel="external">http://smarking.com</a><br/><a href="http://www.bonitrust.de" target="_blank" rel="external">http://www.bonitrust.de</a><br/><a href="http://www.power-oldie.com" target="_blank" rel="external">http://www.power-oldie.com</a><br/><a href="http://www.folkd.com" target="_blank" rel="external">http://www.folkd.com</a><br/><a href="http://www.blinkbits.com" target="_blank" rel="external">http://www.blinkbits.com</a><br/><a href="http://www.jumptags.com" target="_blank" rel="external">http://www.jumptags.com</a><br/><a href="http://www.pobobo.com" target="_blank" rel="external">http://www.pobobo.com</a> <br/><a href="http://www.upchuckr.com" target="_blank" rel="external">http://www.upchuckr.com</a><br/><a href="http://www.simpy.com" target="_blank" rel="external">http://www.simpy.com</a><br/><a href="http://www.stumbleupon.com" target="_blank" rel="external">http://www.stumbleupon.com</a><br/><a href="http://slashdot.org" target="_blank" rel="external">http://slashdot.org</a><br/><a href="http://www.netscape.com" target="_blank" rel="external">http://www.netscape.com</a><br/><a href="http://www.furl.net" target="_blank" rel="external">http://www.furl.net</a><br/><a href="http://www.spurl.net" target="_blank" rel="external">http://www.spurl.net</a><br/><a href="http://www.blinklist.com" target="_blank" rel="external">http://www.blinklist.com</a><br/><a href="http://blogmarks.net" target="_blank" rel="external">http://blogmarks.net</a><br/><a href="http://www.technorati.com" target="_blank" rel="external">http://www.technorati.com</a><br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.uqqb.com/article/71.htm" /> 
	  <id>http://www.uqqb.com/default.asp?id=71</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[寻找高质量的外部链接]]></title>
	  <author>
		 <name>admin</name>
		 <uri>http://www.uqqb.com/</uri>
		 <email>2097367@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.uqqb.com/default.asp?cateID=13" label="SEO技术" /> 
	  <updated>2008-12-09T22:11:09+08:00</updated>
	  <published>2008-12-09T22:11:09+08:00</published>
		  <summary type="html"><![CDATA[<p>如何寻找高质量的外部链接对做seo推广很重要，利用搜索引擎搜索下面的关键词，就会有很多的论坛，大家利用下。</p>
<p>powered by discuz inurl:org<br />
powered by discuz inurl:gov<br />
powered by discuz inurl:edu</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.uqqb.com/article/70.htm" /> 
	  <id>http://www.uqqb.com/default.asp?id=70</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[要想排名基本:网站结构标准格式]]></title>
	  <author>
		 <name>admin</name>
		 <uri>http://www.uqqb.com/</uri>
		 <email>2097367@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.uqqb.com/default.asp?cateID=13" label="SEO技术" /> 
	  <updated>2008-12-07T15:21:15+08:00</updated>
	  <published>2008-12-07T15:21:15+08:00</published>
		  <summary type="html"><![CDATA[<p>外部链接文字：10分<a name="entrymore"></a><br />
标题：10分<br />
域名：7分<br />
H1,H2字号标题：5分<br />
每段首句：5分<br />
路径或文件名：4分<br />
相似度（关键词堆积）：4分<br />
每句开头：1.5分<br />
加粗或斜体：1分<br />
文本用法：1分<br />
title属性：1分<br />
alt标记：0.5分<br />
Meta描述（Description）：0.5分<br />
Meta关键词（Keywords）：0.05分</p>
<p>&nbsp;</p>
<p>基本HTML代码<br />
&lt;html&gt; <br />
&lt;head&gt; <br />
&lt;title&gt;网站名称&lt;/title&gt; <br />
&lt;meta http-equiv=Content-Language content=zh-cn&gt; <br />
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot;&gt; <br />
&lt;meta name=&quot;keywords&quot; content=&quot;关键词&quot;&gt; <br />
&lt;meta name=&quot;description&quot; content=&quot;网站描述&quot;&gt; <br />
&lt;link href=&quot;inc/css.css&quot; _fcksavedurl=&quot;&quot;inc/css.css&quot;&quot; _fcksavedurl=&quot;&quot;inc/css.css&quot;&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot;&gt; <br />
&lt;/head&gt; <br />
&lt;body&gt;<br />
&lt;div&gt;网站名称&gt;&gt;&lt;a href=&quot;/&quot; title=&quot;链接说明&quot;&gt;内页标题&lt;/a&gt; <br />
&lt;div&gt; <br />
&lt;h1&gt;页面内容标题&lt;/h1&gt; <br />
&lt;h2&gt;页面相关性标题&lt;/h2&gt; <br />
&lt;h3&gt;标题系列&lt;/h3&gt; <br />
&lt;h4&gt;标题系列&lt;/h4&gt; <br />
&lt;h5&gt;标题系列&lt;/h5&gt; <br />
&lt;h6&gt;标题系列&lt;/h6&gt; <br />
&lt;img src=&quot;xxx.jpg&quot; alt=&quot;图片说明&quot;&gt; <br />
&lt;a href=&quot;/&quot; title=&quot;链接说明&quot;&gt;链接词&lt;/a&gt; <br />
&lt;strong&gt;重点关键词强调&lt;/strong&gt; <br />
&lt;b&gt;关键词强调&lt;/b&gt;&lt;u&gt;关键词强调&lt;/u&gt;&lt;i&gt;关键词强调&lt;/i&gt; <br />
&lt;/div&gt; <br />
&lt;div&gt; <br />
版权部分关键词强调 <br />
&lt;/div&gt; <br />
&lt;/body&gt; <br />
&lt;/html&gt;<br />
企业站如果把网站做到如此效果,基本就没有问题了</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.uqqb.com/article/69.htm" /> 
	  <id>http://www.uqqb.com/default.asp?id=69</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[央视二次曝光百度竞价排名黑幕:内部员工帮助造假]]></title>
	  <author>
		 <name>admin</name>
		 <uri>http://www.uqqb.com/</uri>
		 <email>2097367@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.uqqb.com/default.asp?cateID=7" label="其他文章" /> 
	  <updated>2008-11-17T09:52:54+08:00</updated>
	  <published>2008-11-17T09:52:54+08:00</published>
		  <summary type="html"><![CDATA[<p>央视二次曝光百度排名黑幕:内部员工帮助造假</p>
<embed menu="true" height="325" width="396" loop="false" src="mms://winmedia.cctv.com/news30/2008/11/news30_300_20081116_8.wmv autostart=" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" type="application/x-mplayer2" mediatype="0"></embed>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.uqqb.com/article/68.htm" /> 
	  <id>http://www.uqqb.com/default.asp?id=68</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[虚假信息借网传播 百度竞价排名遭质疑]]></title>
	  <author>
		 <name>admin</name>
		 <uri>http://www.uqqb.com/</uri>
		 <email>2097367@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.uqqb.com/default.asp?cateID=7" label="其他文章" /> 
	  <updated>2008-11-17T09:50:27+08:00</updated>
	  <published>2008-11-17T09:50:27+08:00</published>
		  <summary type="html"><![CDATA[<p>虚假信息借网传播 百度竞价排名遭质疑</p>
<p><embed menu="true" height="287" width="386" loop="false" autostart="false" src="mms://media.xinhuanet.com/media2/guoneixinwen/081115140009_liwei_b.Wmv" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" type="application/x-mplayer2" mediatype="0"></embed></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.uqqb.com/article/67.htm" /> 
	  <id>http://www.uqqb.com/default.asp?id=67</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[功能强大的js选项卡]]></title>
	  <author>
		 <name>admin</name>
		 <uri>http://www.uqqb.com/</uri>
		 <email>2097367@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.uqqb.com/default.asp?cateID=12" label="网页素材" /> 
	  <updated>2008-11-07T19:51:57+08:00</updated>
	  <published>2008-11-07T19:51:57+08:00</published>
		  <summary type="html"><![CDATA[<p>
<meta content="text/html; charset=gb2312" http-equiv="Content-Type" /><script type="text/javascript">   
/*  
    选项卡封装  
    by 井底的蛙  
    2008-2-4  
*/  
opCard = function()   
{   
    this.bind = new Array();   
    this.index = 0;     //默认显示哪个选项卡，从0开始   
       
    this.style = new Array();       //["","",""]   
    this.overStyle = false;     //选项是否有over, out变换样式事件，样式为this.style[2]   
    this.overChange = false;        //内容是否用over, out直接激活   
    this.menu = false;              //菜单类型   
    this.nesting = [false,false,"",""];     //是否嵌套，后面2个参数是指定menu,info的子集深度所用id   
       
    this.auto = [false, 1000];      //自动滚动[true,2000]   
    this.timerID = null;            //自动播放的   
    this.menutimerID = null;        //菜单延时的   
       
    this.creat = function(func)   
    {   
        var _arrMenu = document.getElementById(this.bind[0]).getElementsByTagName(this.bind[1]);   
        var _arrInfo = document.getElementById(this.bind[2]).getElementsByTagName(this.bind[3]);   
        var my = this, i;   
        var argLen = arguments.length;   
        var arrM = new Array();   
           
        if(this.nesting[0] || this.nesting[1])  // 有选项卡嵌套   
        {   // 过滤出需要的数据   
            var arrMenu = this.nesting[0]?getChilds(_arrMenu,this.bind[0],2):_arrMenu;   
            var arrInfo = this.nesting[1]?getChilds(_arrInfo,this.bind[2],3):_arrInfo;   
        }   
        else  
        {   
            var arrMenu = _arrMenu;   
            var arrInfo = _arrInfo;   
        }   
           
        var l = arrMenu.length;   
        if(l!=arrInfo.length){alert("菜单和内容必须拥有相同的数量\n如果需要，你可以放一个空的在那占位。")}   
           
        // 修正   
        if(this.menu){this.auto=false;this.overChange=true;} //如果是菜单，则没有自动运行，有over, out直接激活   
           
        // 循环添加各个事件等   
        for(i=0;i<l;i++)   
        {   
            arrMenu[i].cName = arrMenu[i].className;   
            arrMenu[i].className = (i!=this.index || this.menu)?getClass(arrMenu[i],this.style[0]):getClass(arrMenu[i],this.style[1]);      //加载样式，菜单的话统一样式   
               
            if(arrMenu[i].getAttribute("skip")) // 需要跳过的容器   
            {   
                if(this.overStyle || this.overChange)   // 有over, out 改变样式 或者 激活   
                {   
                    arrMenu[i].onmouseover = function(){changeTitle(this, 2);autoStop(this, 0);}   
                    arrMenu[i].onmouseout = function(){changeTitle(this, 0);autoStop(this, 1);}   
                }   
                arrMenu[i].onclick = function(){if(argLen==1){func()}}   
                arrInfo[i].style.display = "none";   
                continue;   
            }   
               
            if(i!=this.index || this.menu){arrInfo[i].style.display="none"};    //隐藏初始化，菜单的话全部隐藏   
            arrMenu[i].index = i;   //记录自己激活值[序号]   
            arrInfo[i].index = i;   
               
               
            if(this.overChange) //有鼠标over, out事件   
            {   
                arrMenu[i].onmouseover = function(){changeOption(this);my.menu?changeMenu(1):autoStop(this, 0);}   
                arrMenu[i].onmouseout = function(){changeOption(this);my.menu?changeMenu(0):autoStop(this, 1);}   
            }   
            else    //onclick触发   
            {   
                arrMenu[i].onclick = function(){changeOption(this);autoStop(this, 0);if(argLen==1){func()}}   
                if(this.overStyle)  // 有over, out 改变样式   
                {   
                    arrMenu[i].onmouseover = function(){changeTitle(this, 2);autoStop(this, 0);}   
                    arrMenu[i].onmouseout = function(){changeTitle(this, 0);autoStop(this, 1);}   
                }   
                else    // 没有over, out 改变样式   
                {   
                    if(this.auto[0])    // 有自动运行   
                    {   
                        arrMenu[i].onmouseover = function(){autoStop(this, 0);}   
                        arrMenu[i].onmouseout = function(){autoStop(this, 1);}   
                    }   
                }   
            }   
               
            if(this.auto[0] || this.menu)   //arrinfo 控制自动播放   
            {   
                arrInfo[i].onmouseover = function(){my.menu?changeMenu(1):autoStop(this, 0);}   
                arrInfo[i].onmouseout = function(){my.menu?changeMenu(0):autoStop(this, 1);}   
            }   
        }   //for结束   
           
        if(this.auto[0])   
        {   
            this.timerID = setTimeout(autoMove,this.auto[1])   
        }   
           
        // 自动播放   
        function autoMove()   
        {   
            var n;   
            n = my.index + 1;   
            if(n==l){n=0};   
            while(arrMenu[n].getAttribute("skip"))      // 需要跳过的容器   
            {   
                n += 1;   
                if(n==l){n=0};   
            }   
            changeOption(arrMenu[n]);   
            my.timerID = setTimeout(autoMove,my.auto[1]);   
        }   
           
        // onmouseover时，自动播放停止。num：0为over，1为out。 obj暂时无用。 -_-!!   
        function autoStop(obj, num)   
        {   
            if(!my.auto[0]){return;}   
            //if(obj.index==my.index)   
            num == 0 ? clearTimeout(my.timerID) : my.timerID = setTimeout(autoMove,my.auto[1]);   
        }   
           
        // 改变选项卡   
        function changeOption(obj)   
        {   
            arrMenu[my.index].className = getClass(arrMenu[my.index],my.style[0]);  //修改旧内容   
            arrInfo[my.index].style.display = "none";   //隐藏旧内容   
               
            obj.className = getClass(obj,my.style[1]);      //修改为新样式   
            arrInfo[obj.index].style.display = "";  //显示新内容   
               
            my.index = obj.index;   //更新当前选择的index   
        }   
           
        /*        
            只有onclick时，overStyle的onmouseover,onmouseout事件。用来预激活  
            obj：目标对象。   num：1为over，0为out  
        */  
        function changeTitle(obj, num)   
        {   
            if(!my.overStyle){return;};   
            if(obj.index!=my.index){obj.className = getClass(obj,my.style[num])}   
        }   
           
        /*        
            菜单类型时用  
            obj：目标对象。   num：1为over，0为out  
        */  
        function changeMenu(num)   
        {   
            if(!my.menu){return;}   
            num==0?my.menutimerID = setTimeout(menuClose,1000):clearTimeout(my.menutimerID)   
        }   
           
        //关闭菜单   
        function menuClose()   
        {   
            arrInfo[my.index].style.display = "none";   
            arrMenu[my.index].className = getClass(arrMenu[my.index],my.style[0]);   
        }   
           
        // 得到className（防止将原有样式覆盖）   
        function getClass(o, s)   
        {   
            if(o.cName==""){return s}   
            else{return o.cName + " " + s}   
        }   
           
        //嵌套情况下得到真正的子集   
        function getChilds(arrObj, id, num)   
        {   
            var depth = 0;   
            var firstObj = my.nesting[num]==""?arrObj[0]:document.getElementById(my.nesting[num]);      //得到第一个子集   
            do  //计算深度   
            {   
                if(firstObj.parentNode.getAttribute("id")==id){break}else{depth+=1}   
                firstObj = firstObj.parentNode;   
            }   
            while(firstObj.tagName.toLowerCase()!="body")   // body强制退出。   
               
            var t;   
            var arr = new Array();   
            for(i=0;i<arrObj.length;i++) //过滤出需要的数据   
            {   
                t = arrObj[i], d = 0;   
                do  
                {   
                    if(t.parentNode.getAttribute("id")==id && d == depth)   
                    {      
                        arr.push(arrObj[i]);break;      //得到数据   
                    }   
                    else  
                    {   
                        if(d==depth){break};d+=1;   
                    }   
                    t = t.parentNode;   
                }   
                while(t.tagName.toLowerCase()!="body")  // body强制退出   
            }   
            return arr;   
        }   
    }   
}   
window.onload = function()   
{   
    var aa = new opCard();   
    aa.bind = ["a1","div","b1","div"];   
    aa.style = ["a1_0","a1_1","a1_0"];   
    aa.index = 0;   
    aa.nesting = [false,true,"",""]   
    aa.creat();   
    aa =null;   
       
    // 默认的onclick中，第一个例子   
    var bba = new opCard();   
    bba.bind = ["a2","li","b2","div"];   
    bba.style = ["style1","style2","style3"];   
    bba.overStyle = true;   
    bba.creat();   
    bba = null;   
       
    // 默认的onclick中，第二个例子   
    var bbb = new opCard();   
    bbb.bind = ["a3","li","b3","div"];   
    bbb.style = ["style1","style2","style3"];   
    bbb.overStyle = true;   
    bbb.creat();   
    bbb = null;   
       
    // onmousover触发中的例子   
    var cc = new opCard();   
    cc.bind = ["a4","li","b4","div"];   
    cc.style = ["style1","style2","style3"];   
    cc.overStyle = true;   
    cc.overChange = true;   
    cc.creat();   
    cc = null;   
       
    //自动播放auto第一个例子   
    var dd = new opCard();   
    dd.bind = ["a5","li","b5","div"];   
    dd.style = ["style1","style2","style3"];   
    dd.auto = [true, 3000];   
    dd.creat();   
    dd = null;   
       
    //自动播放auto第二个例子   
    var ee = new opCard();   
    ee.bind = ["a6","li","b6","div"];   
    ee.style = ["style1","style2","style3"];   
    ee.auto = [true, 2000];   
    ee.overChange = true;   
    ee.creat();   
    ee = null;   
       
    //自动播放auto第三个例子   
    var ff = new opCard();   
    ff.bind = ["a7","li","b7","div"];   
    ff.style = ["style1","style2","style3"];   
    ff.auto = [true, 1000];   
    ff.overChange = true;   
    ff.overStyle = true;   
    ff.creat();   
    ff = null;   
       
    //菜单导航例子   
    var gg = new opCard();   
    gg.bind = ["a8","li","b8","div"];   
    gg.style = ["style1","style2","style3"];   
    gg.overStyle = true;   
    gg.menu = true;   
    gg.creat();   
    gg = null;   
       
    //其他应用   
    var hh = new opCard();   
    hh.bind = ["a9","li","a9","li"];   
    hh.style = ["style4","style4","style4"];   
    //hh.overStyle = true;   
    hh.auto = [true, 1000];   
    hh.creat();   
    hh = null;   
}   
</script><style type="text/css">   
body{font-size:12px; font-family:Verdana,"宋体";}   
p,ul{margin:0px; padding:0px;}   
td,div{font-size:12px}   
.a1_0 {border:1px dotted #3399FF; width:120px; background-color:#f5f5f5; margin:3px; padding:2px 0px; cursor:pointer;}   
.a1_1 {border:1px solid #FF9900; width:120px; margin:3px; padding:2px 0px; cursor:pointer;}   
.test{text-decoration:underline;}   
#b1 div.s{border:1px solid #999999; width:90%; height:500px; margin:3px; padding:10px; overflow-y:auto; line-height:18px;}   
#b1 div.s strong{color:#0066FF;}   
/* */  
.style1{float:left; width:80px; background-color:#f5f5f5; border:1px solid #3399FF; text-align:center; margin-right:2px; list-style-type:none; cursor:pointer;}   
.style2{float:left; width:80px; background-color:#f5f5f5; border:1px solid #FF9900; text-align:center; margin-right:2px; list-style-type:none; cursor:pointer;}   
.style3{float:left; width:80px; background-color:#f5f5f5; border:1px solid #666666; text-align:center; margin-right:2px; list-style-type:none; cursor:pointer;}   
#a2,#a3,#a4,#a5,#a6,#a7,#a8 {height:22px;}   
#b2 div,#b3 div,#b4 div,#b5 div,#b6 div,#b7 div{border:1px solid #FF9900; height:100px; width:400px; padding:5px; overflow-y:auto;}   
#b8 div{border:1px solid #FF9900; height:20px; width:350px; padding:2px 5px;}   
#b8 div a{margin-right:20px;}   
.style4{float:left; background-color:#999999; text-align:left; list-style-type:none; padding:2px 5px; color:#FFFFFF;}   </style></p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tbody>
        <tr>
            <td id="a1" valign="top" width="140" align="center">
            <div class="test">简单介绍</div>
            <div class="test">默认的onclick</div>
            <div class="test">onmousover触发</div>
            <div class="test">自动播放auto</div>
            <div class="test">菜单导航</div>
            <div class="test">关于嵌套</div>
            <div class="test">其他应用</div>
            <div class="test">一些说明</div>
            <div class="test">源码下载</div>
            <div class="test">&nbsp;</div>
            <div class="test">&nbsp;</div>
            <div class="test">&nbsp;</div>
            </td>
            <td id="b1" valign="top">
            <div class="s">封装了一个选项卡，不过已经不像选项卡了-_-!!!<br />
            <br />
            现稍微说明下吧，如果不明白的话，旁边有几个例子可能说明起来更清楚些<br />
            <br />
            <p><strong>obj.bind = [&quot;a1&quot;,&quot;td&quot;,&quot;b1&quot;,&quot;div&quot;];</strong><br />
            绑定id=&quot;a1&quot;下的td标签为菜单，绑定id=&quot;b1&quot;下的div标签为内容，简单么？<br />
            td标签的数量和div标签的数量必须相同<br />
            （若不需要显示内容，只显示菜单话，可以这个在td标签上加&lt;td skip=&quot;true&quot;&gt;）<br />
            如果id=&quot;a1&quot;下的td标签有嵌套表格，这样的话，就不是所有的td都是菜单，这时候需要用下nesting<br />
            <br />
            <strong>obj.nesting = [false,true,&quot;&quot;,&quot;&quot;];</strong><br />
            当标签tag有嵌套时，需要用到这个<br />
            比如选项卡内容是放在div容器里，而本身这个内容里也有div标签，这时就需要用到<br />
            菜单嵌套为false，内容嵌套为true，且会自动判断出内容标签，多数时候这样就可以了<br />
            判断方法为，认定getElementsByTagName后第一个标签为内容第一项，其他的就用这个第一项的深度来判断<br />
            但有些情况下，这样还是不行<br />
            我用后面2个参数做id来指定菜单或者内容的第一项nesting = [false,true,&quot;&quot;,&quot;q2&quot;];<br />
            这样就肯定不会错了（不明白的话看下例子就简单多了）<br />
            <br />
            <strong>obj.index = 0;</strong><br />
            默认显示第几个选项卡，序号从0开始<br />
            <br />
            <strong>obj.style = [&quot;c1&quot;,&quot;c2&quot;,&quot;c3&quot;]</strong><br />
            菜单加载的样式的className：<br />
            菜单未选中的className是c1<br />
            菜单选中的className是c2<br />
            菜单onmouseover的className是c3<br />
            <br />
            <strong>obj.overStyle = false;</strong><br />
            选项卡是否有onmouseover, onmouseout变换样式事件[非激活选项卡内容]，对应的样式为style[2]<br />
            <br />
            <strong>obj.overChange = false;</strong><br />
            选项卡内容是否用onmouseover, onmouseout直接激活<br />
            <br />
            <strong>obj.menu = false;</strong><br />
            选项卡是菜单类型<br />
            <br />
            <strong>obj.auto = [false, 1000];</strong><br />
            选项卡是否自动播放，播放速度（毫秒）<br />
            <br />
            <strong>obj.creat();</strong><br />
            开始生成选项卡，需要onclick触发事件的话，可以obj.creat(函数名)<br />
            所有的都会触发</p>
            </div>
            <div class="s"><!--默认的onclick中，第一个例子-->
            <div id="a2">
            <ul>
                <li>1</li>
                <li>2</li>
                <li>3</li>
                <li>4</li>
            </ul>
            </div>
            <div id="b2">
            <div>这个例子是用onclick触发的<br />
            并设置overStyle = true;<br />
            (over，out改变样式,但不激活)</div>
            <div>var bba = new opCard();<br />
            bba.bind = [&quot;a2&quot;,&quot;li&quot;,&quot;b2&quot;,&quot;div&quot;];<br />
            bba.style = [&quot;style1&quot;,&quot;style2&quot;,&quot;style1&quot;];<br />
            bba.overStyle = true;<br />
            bba.creat();<br />
            bba = null;</div>
            <div>33333</div>
            <div>4444444</div>
            </div>
            <br />
            <!--默认的onclick中，第二个例子-->
            <div id="a3">
            <ul>
                <li>1</li>
                <li>2</li>
                <li>3</li>
                <li skip="true">4</li>
            </ul>
            </div>
            <div id="b3">
            <div>这个例子是比上面增加skip=&quot;true&quot;<br />
            即&lt;li skip=&quot;true&quot;&gt;4&lt;/li&gt;<br />
            所以选项卡4是没有内容的<br />
            你可以为选项卡的文字直接加上链接，我这里就不加了</div>
            <div>222222</div>
            <div>33333</div>
            <div>4444444</div>
            </div>
            </div>
            <div class="s"><!--onmousover触发中的例子-->
            <div id="a4">
            <ul>
                <li>1</li>
                <li>2</li>
                <li skip="true">3</li>
                <li>4</li>
            </ul>
            </div>
            <div id="b4">
            <div>这个例子是用onmouseover触发的<br />
            (over，out直接激活)<br />
            并且&lt;li skip=&quot;true&quot;&gt;3&lt;/li&gt;[选项卡3不会被激活]<br />
            overStyle = true;</div>
            <div>var cc = new opCard();<br />
            cc.bind = [&quot;a4&quot;,&quot;li&quot;,&quot;b4&quot;,&quot;div&quot;];<br />
            cc.style = [&quot;style1&quot;,&quot;style2&quot;,&quot;style1&quot;];<br />
            cc.overStyle = true;<br />
            cc.overChange = true;<br />
            cc.creat();<br />
            cc = null;</div>
            <div>33333</div>
            <div>4444444</div>
            </div>
            </div>
            <div class="s"><!--自动播放auto第一个例子-->
            <div id="a5">
            <ul>
                <li>1</li>
                <li>2</li>
                <li>3</li>
                <li>4</li>
            </ul>
            </div>
            <div id="b5">
            <div>1111111<br />
            我每3秒切换一个选项卡</div>
            <div>var ee = new opCard();<br />
            ee.bind = [&quot;a6&quot;,&quot;li&quot;,&quot;b6&quot;,&quot;div&quot;];<br />
            ee.style = [&quot;style1&quot;,&quot;style2&quot;,&quot;style1&quot;];<br />
            ee.auto = [true, 2000];<br />
            ee.overChange = true;<br />
            ee.creat();<br />
            ee = null;</div>
            <div>33333<br />
            我每3秒切换一个选项卡</div>
            <div>4444444<br />
            我每3秒切换一个选项卡</div>
            </div>
            <div>注：<strong>鼠标在选项卡任意位置都会使停止播放</strong><br />
            <br />
            下面这个结合overChange一起</div>
            <!--自动播放auto第二个例子-->
            <div id="a6">
            <ul>
                <li>1</li>
                <li>2</li>
                <li>3</li>
                <li>4</li>
            </ul>
            </div>
            <div id="b6">
            <div>1111111<br />
            我每2秒切换一个选项卡</div>
            <div>var dd = new opCard();<br />
            dd.bind = [&quot;a5&quot;,&quot;li&quot;,&quot;b5&quot;,&quot;div&quot;];<br />
            dd.style = [&quot;style1&quot;,&quot;style2&quot;,&quot;style1&quot;];<br />
            dd.auto = [true, 3000];<br />
            dd.creat();<br />
            dd = null;<br />
            &nbsp;</div>
            <div>33333<br />
            我每2秒切换一个选项卡</div>
            <div>4444444<br />
            我每2秒切换一个选项卡</div>
            </div>
            <div><br />
            下面这个再来个&lt;li skip=&quot;true&quot;&gt;3&lt;/li&gt;，且overStyle=true;</div>
            <!--自动播放auto第三个例子-->
            <div id="a7">
            <ul>
                <li>1</li>
                <li>2</li>
                <li skip="true">3</li>
                <li>4</li>
            </ul>
            </div>
            <div id="b7">
            <div>1111111<br />
            我每1秒切换一个选项卡</div>
            <div>var ff = new opCard();<br />
            ff.bind = [&quot;a7&quot;,&quot;li&quot;,&quot;b7&quot;,&quot;div&quot;];<br />
            ff.style = [&quot;style1&quot;,&quot;style2&quot;,&quot;style1&quot;];<br />
            ff.auto = [true, 1000];<br />
            ff.overChange = true;<br />
            ff.overStyle = true;<br />
            ff.creat();<br />
            ff = null;</div>
            <div>33333<br />
            我每1秒切换一个选项卡</div>
            <div>4444444<br />
            我每1秒切换一个选项卡</div>
            </div>
            </div>
            <!--菜单导航的例子-->
            <div class="s">
            <div id="a8">
            <ul>
                <li skip="true">首页</li>
                <li>新闻</li>
                <li>论坛</li>
                <li skip="true">联系我们</li>
            </ul>
            </div>
            <div id="b8">
            <div>&nbsp;</div>
            <div><a href="http://www.uqqb.com/#">国内新闻</a><a href="http://www.uqqb.com/#">国际新闻</a><a href="http://www.uqqb.com/#">娱乐新闻</a><a href="http://www.uqqb.com/#">体育新闻</a></div>
            <div><a href="http://www.uqqb.com/#">蓝色理想</a><a href="http://www.uqqb.com/#">blue idea</a></div>
            <div>&nbsp;</div>
            </div>
            <div><strong>注：菜单延时一秒关闭</strong><br />
            这里只是演示，实际可以设置下position什么的。-o-<br />
            多级菜单不知道能不能支持，没试过</div>
            </div>
            <div class="s">我见过的许多选项卡都不能用来嵌套<br />
            但还是有些时候会用到的<br />
            所以如您所见，这个演示本身就是一个嵌套，效果还不错</div>
            <!--其他应用-->
            <div class="s">比如图片切换什么，不过我太懒了，不写了。。。<br />
            这个能干什么，我也不知道。。
            <div id="a9">
            <ul>
                <li>新年好啊</li>
                <li>快过年了</li>
                <li>天好冷啊</li>
                <li>大家去抢红包吧</li>
                <li>红包~！红包~！你在哪里啊？</li>
            </ul>
            </div>
            </div>
            <div class="s">选项卡标题（或者菜单）必须和选项卡内容的数量相同，否则会出错<br />
            即使选项卡菜单skip=&quot;true&quot;，内容也要放一个空的标签占位<br />
            其他好像暂时没发现什么<br />
            <br />
            本来打算加入ajax的，但有些还没想好。<br />
            效率的话，应该还行，我这个演示放了几个选项卡，似乎还不错<br />
            <br />
            写这个的目的就是以后弄选项卡只要处理样式就可以了，很多选项卡或者切换之类都是大同小异<br />
            本来是打算弄些特效在里面，考虑会增加不少代码，所以不加了，简洁点。<br />
            <br />
            哦，还有选项卡是附加样式，不会取消原本设置的样式<br />
            如左边的下划线是原有的样式</div>
            <div class="s"><textarea id="textarea" rows="50" cols="70" name="textarea">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
            &lt;html&gt;
            &lt;head&gt;
            &lt;FCK:meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot; /&gt;
            &lt;title&gt;井底的蛙&lt;/title&gt;
            <script type="text/javascript">   
/*  
    选项卡封装  
    by 井底的蛙  
    2008-2-4  
*/  
opCard = function()   
{   
    this.bind = new Array();   
    this.index = 0;     //默认显示哪个选项卡，从0开始   
       
    this.style = new Array();       //["","",""]   
    this.overStyle = false;     //选项是否有over, out变换样式事件，样式为this.style[2]   
    this.overChange = false;        //内容是否用over, out直接激活   
    this.menu = false;              //菜单类型   
    this.nesting = [false,false,"",""];     //是否嵌套，后面2个参数是指定menu,info的子集深度所用id   
       
    this.auto = [false, 1000];      //自动滚动[true,2000]   
    this.timerID = null;            //自动播放的   
    this.menutimerID = null;        //菜单延时的   
       
    this.creat = function(func)   
    {   
        var _arrMenu = document.getElementById(this.bind[0]).getElementsByTagName(this.bind[1]);   
        var _arrInfo = document.getElementById(this.bind[2]).getElementsByTagName(this.bind[3]);   
        var my = this, i;   
        var argLen = arguments.length;   
        var arrM = new Array();   
           
        if(this.nesting[0] || this.nesting[1])  // 有选项卡嵌套   
        {   // 过滤出需要的数据   
            var arrMenu = this.nesting[0]?getChilds(_arrMenu,this.bind[0],2):_arrMenu;   
            var arrInfo = this.nesting[1]?getChilds(_arrInfo,this.bind[2],3):_arrInfo;   
        }   
        else  
        {   
            var arrMenu = _arrMenu;   
            var arrInfo = _arrInfo;   
        }   
           
        var l = arrMenu.length;   
        if(l!=arrInfo.length){alert("菜单和内容必须拥有相同的数量\n如果需要，你可以放一个空的在那占位。")}   
           
        // 修正   
        if(this.menu){this.auto=false;this.overChange=true;} //如果是菜单，则没有自动运行，有over, out直接激活   
           
        // 循环添加各个事件等   
        for(i=0;i<l;i++)   
        {   
            arrMenu[i].cName = arrMenu[i].className;   
            arrMenu[i].className = (i!=this.index || this.menu)?getClass(arrMenu[i],this.style[0]):getClass(arrMenu[i],this.style[1]);      //加载样式，菜单的话统一样式   
               
            if(arrMenu[i].getAttribute("skip")) // 需要跳过的容器   
            {   
                if(this.overStyle || this.overChange)   // 有over, out 改变样式 或者 激活   
                {   
                    arrMenu[i].onmouseover = function(){changeTitle(this, 2);autoStop(this, 0);}   
                    arrMenu[i].onmouseout = function(){changeTitle(this, 0);autoStop(this, 1);}   
                }   
                arrMenu[i].onclick = function(){if(argLen==1){func()}}   
                arrInfo[i].style.display = "none";   
                continue;   
            }   
               
            if(i!=this.index || this.menu){arrInfo[i].style.display="none"};    //隐藏初始化，菜单的话全部隐藏   
            arrMenu[i].index = i;   //记录自己激活值[序号]   
            arrInfo[i].index = i;   
               
               
            if(this.overChange) //有鼠标over, out事件   
            {   
                arrMenu[i].onmouseover = function(){changeOption(this);my.menu?changeMenu(1):autoStop(this, 0);}   
                arrMenu[i].onmouseout = function(){changeOption(this);my.menu?changeMenu(0):autoStop(this, 1);}   
            }   
            else    //onclick触发   
            {   
                arrMenu[i].onclick = function(){changeOption(this);autoStop(this, 0);if(argLen==1){func()}}   
                if(this.overStyle)  // 有over, out 改变样式   
                {   
                    arrMenu[i].onmouseover = function(){changeTitle(this, 2);autoStop(this, 0);}   
                    arrMenu[i].onmouseout = function(){changeTitle(this, 0);autoStop(this, 1);}   
                }   
                else    // 没有over, out 改变样式   
                {   
                    if(this.auto[0])    // 有自动运行   
                    {   
                        arrMenu[i].onmouseover = function(){autoStop(this, 0);}   
                        arrMenu[i].onmouseout = function(){autoStop(this, 1);}   
                    }   
                }   
            }   
               
            if(this.auto[0] || this.menu)   //arrinfo 控制自动播放   
            {   
                arrInfo[i].onmouseover = function(){my.menu?changeMenu(1):autoStop(this, 0);}   
                arrInfo[i].onmouseout = function(){my.menu?changeMenu(0):autoStop(this, 1);}   
            }   
        }   //for结束   
           
        if(this.auto[0])   
        {   
            this.timerID = setTimeout(autoMove,this.auto[1])   
        }   
           
        // 自动播放   
        function autoMove()   
        {   
            var n;   
            n = my.index + 1;   
            if(n==l){n=0};   
            while(arrMenu[n].getAttribute("skip"))      // 需要跳过的容器   
            {   
                n += 1;   
                if(n==l){n=0};   
            }   
            changeOption(arrMenu[n]);   
            my.timerID = setTimeout(autoMove,my.auto[1]);   
        }   
           
        // onmouseover时，自动播放停止。num：0为over，1为out。 obj暂时无用。 -_-!!   
        function autoStop(obj, num)   
        {   
            if(!my.auto[0]){return;}   
            //if(obj.index==my.index)   
            num == 0 ? clearTimeout(my.timerID) : my.timerID = setTimeout(autoMove,my.auto[1]);   
        }   
           
        // 改变选项卡   
        function changeOption(obj)   
        {   
            arrMenu[my.index].className = getClass(arrMenu[my.index],my.style[0]);  //修改旧内容   
            arrInfo[my.index].style.display = "none";   //隐藏旧内容   
               
            obj.className = getClass(obj,my.style[1]);      //修改为新样式   
            arrInfo[obj.index].style.display = "";  //显示新内容   
               
            my.index = obj.index;   //更新当前选择的index   
        }   
           
        /*        
            只有onclick时，overStyle的onmouseover,onmouseout事件。用来预激活  
            obj：目标对象。   num：1为over，0为out  
        */  
        function changeTitle(obj, num)   
        {   
            if(!my.overStyle){return;};   
            if(obj.index!=my.index){obj.className = getClass(obj,my.style[num])}   
        }   
           
        /*        
            菜单类型时用  
            obj：目标对象。   num：1为over，0为out  
        */  
        function changeMenu(num)   
        {   
            if(!my.menu){return;}   
            num==0?my.menutimerID = setTimeout(menuClose,1000):clearTimeout(my.menutimerID)   
        }   
           
        //关闭菜单   
        function menuClose()   
        {   
            arrInfo[my.index].style.display = "none";   
            arrMenu[my.index].className = getClass(arrMenu[my.index],my.style[0]);   
        }   
           
        // 得到className（防止将原有样式覆盖）   
        function getClass(o, s)   
        {   
            if(o.cName==""){return s}   
            else{return o.cName + " " + s}   
        }   
           
        //嵌套情况下得到真正的子集   
        function getChilds(arrObj, id, num)   
        {   
            var depth = 0;   
            var firstObj = my.nesting[num]==""?arrObj[0]:document.getElementById(my.nesting[num]);      //得到第一个子集   
            do  //计算深度   
            {   
                if(firstObj.parentNode.getAttribute("id")==id){break}else{depth+=1}   
                firstObj = firstObj.parentNode;   
            }   
            while(firstObj.tagName.toLowerCase()!="body")   // body强制退出。   
               
            var t;   
            var arr = new Array();   
            for(i=0;i<arrObj.length;i++) //过滤出需要的数据   
            {   
                t = arrObj[i], d = 0;   
                do  
                {   
                    if(t.parentNode.getAttribute("id")==id && d == depth)   
                    {      
                        arr.push(arrObj[i]);break;      //得到数据   
                    }   
                    else  
                    {   
                        if(d==depth){break};d+=1;   
                    }   
                    t = t.parentNode;   
                }   
                while(t.tagName.toLowerCase()!="body")  // body强制退出   
            }   
            return arr;   
        }   
    }   
}   
window.onload = function()   
{   
    var aa = new opCard();   
    aa.bind = ["a1","div","b1","div"];   
    aa.style = ["a1_0","a1_1","a1_0"];   
    aa.index = 0;   
    aa.nesting = [false,true,"",""]   
    aa.creat();   
    aa =null;   
       
    // 默认的onclick中，第一个例子   
    var bba = new opCard();   
    bba.bind = ["a2","li","b2","div"];   
    bba.style = ["style1","style2","style3"];   
    bba.overStyle = true;   
    bba.creat();   
    bba = null;   
       
    // 默认的onclick中，第二个例子   
    var bbb = new opCard();   
    bbb.bind = ["a3","li","b3","div"];   
    bbb.style = ["style1","style2","style3"];   
    bbb.overStyle = true;   
    bbb.creat();   
    bbb = null;   
       
    // onmousover触发中的例子   
    var cc = new opCard();   
    cc.bind = ["a4","li","b4","div"];   
    cc.style = ["style1","style2","style3"];   
    cc.overStyle = true;   
    cc.overChange = true;   
    cc.creat();   
    cc = null;   
       
    //自动播放auto第一个例子   
    var dd = new opCard();   
    dd.bind = ["a5","li","b5","div"];   
    dd.style = ["style1","style2","style3"];   
    dd.auto = [true, 3000];   
    dd.creat();   
    dd = null;   
       
    //自动播放auto第二个例子   
    var ee = new opCard();   
    ee.bind = ["a6","li","b6","div"];   
    ee.style = ["style1","style2","style3"];   
    ee.auto = [true, 2000];   
    ee.overChange = true;   
    ee.creat();   
    ee = null;   
       
    //自动播放auto第三个例子   
    var ff = new opCard();   
    ff.bind = ["a7","li","b7","div"];   
    ff.style = ["style1","style2","style3"];   
    ff.auto = [true, 1000];   
    ff.overChange = true;   
    ff.overStyle = true;   
    ff.creat();   
    ff = null;   
       
    //菜单导航例子   
    var gg = new opCard();   
    gg.bind = ["a8","li","b8","div"];   
    gg.style = ["style1","style2","style3"];   
    gg.overStyle = true;   
    gg.menu = true;   
    gg.creat();   
    gg = null;   
       
    //其他应用   
    var hh = new opCard();   
    hh.bind = ["a9","li","a9","li"];   
    hh.style = ["style4","style4","style4"];   
    //hh.overStyle = true;   
    hh.auto = [true, 1000];   
    hh.creat();   
    hh = null;   
}   
</script>
            &lt;style type=&quot;text/css&quot;&gt;
            body{font-size:12px; font-family:Verdana,&quot;宋体&quot;;}
            p,ul{margin:0px; padding:0px;}
            td,div{font-size:12px}
            .a1_0 {border:1px dotted #3399FF; width:120px; background-color:#f5f5f5; margin:3px; padding:2px 0px; cursor:pointer;}
            .a1_1 {border:1px solid #FF9900; width:120px; margin:3px; padding:2px 0px; cursor:pointer;}
            .test{text-decoration:underline;}
            #b1 div.s{border:1px solid #999999; width:90%; height:500px; margin:3px; padding:10px; overflow-y:auto; line-height:18px;}
            #b1 div.s strong{color:#0066FF;}
            /* */
            .style1{float:left; width:80px; background-color:#f5f5f5; border:1px solid #3399FF; text-align:center; margin-right:2px; list-style-type:none; cursor:pointer;}
            .style2{float:left; width:80px; background-color:#f5f5f5; border:1px solid #FF9900; text-align:center; margin-right:2px; list-style-type:none; cursor:pointer;}
            .style3{float:left; width:80px; background-color:#f5f5f5; border:1px solid #666666; text-align:center; margin-right:2px; list-style-type:none; cursor:pointer;}
            #a2,#a3,#a4,#a5,#a6,#a7,#a8 {height:22px;}
            #b2 div,#b3 div,#b4 div,#b5 div,#b6 div,#b7 div{border:1px solid #FF9900; height:100px; width:400px; padding:5px; overflow-y:auto;}
            #b8 div{border:1px solid #FF9900; height:20px; width:350px; padding:2px 5px;}
            #b8 div a{margin-right:20px;}
            .style4{float:left; background-color:#999999; text-align:left; list-style-type:none; padding:2px 5px; color:#FFFFFF;}
            &lt;/style&gt;
            &lt;/head&gt;
            &lt;body&gt;
            &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
            &lt;tr&gt;
            &lt;td id=&quot;a1&quot; width=&quot;140&quot; valign=&quot;top&quot; align=&quot;center&quot;&gt;
            &lt;div class=&quot;test&quot;&gt;简单介绍&lt;/div&gt;
            &lt;div class=&quot;test&quot;&gt;默认的onclick&lt;/div&gt;
            &lt;div class=&quot;test&quot;&gt;onmousover触发&lt;/div&gt;
            &lt;div class=&quot;test&quot;&gt;自动播放auto&lt;/div&gt;
            &lt;div class=&quot;test&quot;&gt;菜单导航&lt;/div&gt;
            &lt;div class=&quot;test&quot;&gt;关于嵌套&lt;/div&gt;
            &lt;div class=&quot;test&quot;&gt;其他应用&lt;/div&gt;
            &lt;div class=&quot;test&quot;&gt;一些说明&lt;/div&gt;
            &lt;div class=&quot;test&quot;&gt;&nbsp;&lt;/div&gt;
            &lt;div class=&quot;test&quot;&gt;&nbsp;&lt;/div&gt;
            &lt;div class=&quot;test&quot;&gt;&nbsp;&lt;/div&gt;
            &lt;div class=&quot;test&quot;&gt;&nbsp;&lt;/div&gt;
            &lt;/td&gt;
            &lt;td id=&quot;b1&quot; valign=&quot;top&quot;&gt;
            &lt;div class=&quot;s&quot;&gt;
            封装了一个选项卡，不过已经不像选项卡了-_-!!!&lt;br&gt;&lt;br&gt;
            现稍微说明下吧，如果不明白的话，旁边有几个例子可能说明起来更清楚些&lt;br&gt;&lt;br&gt;
            &lt;p&gt;
            &lt;strong&gt;obj.bind = [&quot;a1&quot;,&quot;td&quot;,&quot;b1&quot;,&quot;div&quot;];&lt;/strong&gt;&lt;br&gt;
            绑定id=&quot;a1&quot;下的td标签为菜单，绑定id=&quot;b1&quot;下的div标签为内容，简单么？&lt;br&gt;
            td标签的数量和div标签的数量必须相同&lt;br&gt;
            （若不需要显示内容，只显示菜单话，可以这个在td标签上加&lt;td skip=&quot;true&quot;&gt;）&lt;br&gt;
            如果id=&quot;a1&quot;下的td标签有嵌套表格，这样的话，就不是所有的td都是菜单，这时候需要用下nesting&lt;br&gt;&lt;br&gt;
            &lt;strong&gt;obj.nesting = [false,true,&quot;&quot;,&quot;&quot;];&lt;/strong&gt;&lt;br&gt;
            当标签tag有嵌套时，需要用到这个&lt;br&gt;
            比如选项卡内容是放在div容器里，而本身这个内容里也有div标签，这时就需要用到&lt;br&gt;
            菜单嵌套为false，内容嵌套为true，且会自动判断出内容标签，多数时候这样就可以了&lt;br&gt;
            判断方法为，认定getElementsByTagName后第一个标签为内容第一项，其他的就用这个第一项的深度来判断&lt;br&gt;
            但有些情况下，这样还是不行&lt;br&gt;
            我用后面2个参数做id来指定菜单或者内容的第一项nesting = [false,true,&quot;&quot;,&quot;q2&quot;];&lt;br&gt;
            这样就肯定不会错了（不明白的话看下例子就简单多了）&lt;br&gt;&lt;br&gt;
            &lt;strong&gt;obj.index = 0;&lt;/strong&gt;&lt;br&gt;
            默认显示第几个选项卡，序号从0开始&lt;br&gt;&lt;br&gt;
            &lt;strong&gt;obj.style = [&quot;c1&quot;,&quot;c2&quot;,&quot;c3&quot;]&lt;/strong&gt;&lt;br&gt;
            菜单加载的样式的className：&lt;br&gt;
            菜单未选中的className是c1&lt;br&gt;
            菜单选中的className是c2&lt;br&gt;
            菜单onmouseover的className是c3&lt;br&gt;&lt;br&gt;
            &lt;strong&gt;obj.overStyle = false;&lt;/strong&gt;&lt;br&gt;
            选项卡是否有onmouseover, onmouseout变换样式事件[非激活选项卡内容]，对应的样式为style[2]&lt;br&gt;&lt;br&gt;
            &lt;strong&gt;obj.overChange = false;&lt;/strong&gt;&lt;br&gt;
            选项卡内容是否用onmouseover, onmouseout直接激活&lt;br&gt;&lt;br&gt;
            &lt;strong&gt;obj.menu = false;&lt;/strong&gt;&lt;br&gt;
            选项卡是菜单类型&lt;br&gt;&lt;br&gt;
            &lt;strong&gt;obj.auto = [false, 1000];&lt;/strong&gt;&lt;br&gt;
            选项卡是否自动播放，播放速度（毫秒）&lt;br&gt;&lt;br&gt;
            &lt;strong&gt;obj.creat();&lt;/strong&gt;&lt;br&gt;
            开始生成选项卡，需要onclick触发事件的话，可以obj.creat(函数名)&lt;br&gt;
            所有的都会触发
            &lt;/p&gt;
            &lt;/div&gt;
            &lt;div class=&quot;s&quot;&gt;
            <!--默认的onclick中，第一个例子-->
            &lt;div id=&quot;a2&quot;&gt;
            &lt;ul&gt;
            &lt;li&gt;1&lt;/li&gt;
            &lt;li&gt;2&lt;/li&gt;
            &lt;li&gt;3&lt;/li&gt;
            &lt;li&gt;4&lt;/li&gt;
            &lt;/ul&gt;
            &lt;/div&gt;
            &lt;div id=&quot;b2&quot;&gt;
            &lt;div&gt;这个例子是用onclick触发的&lt;br&gt;并设置overStyle = true;&lt;br&gt;(over，out改变样式,但不激活)&lt;/div&gt;
            &lt;div&gt;
            var bba = new opCard();&lt;br&gt;
            bba.bind = [&quot;a2&quot;,&quot;li&quot;,&quot;b2&quot;,&quot;div&quot;];&lt;br&gt;
            bba.style = [&quot;style1&quot;,&quot;style2&quot;,&quot;style1&quot;];&lt;br&gt;
            bba.overStyle = true;&lt;br&gt;
            bba.creat();&lt;br&gt;
            bba = null;
            &lt;/div&gt;
            &lt;div&gt;33333&lt;/div&gt;
            &lt;div&gt;4444444&lt;/div&gt;
            &lt;/div&gt;&lt;br&gt;
            <!--默认的onclick中，第二个例子-->
            &lt;div id=&quot;a3&quot;&gt;
            &lt;ul&gt;
            &lt;li&gt;1&lt;/li&gt;
            &lt;li&gt;2&lt;/li&gt;
            &lt;li&gt;3&lt;/li&gt;
            &lt;li skip=&quot;true&quot;&gt;4&lt;/li&gt;
            &lt;/ul&gt;
            &lt;/div&gt;
            &lt;div id=&quot;b3&quot;&gt;
            &lt;div&gt;
            这个例子是比上面增加skip=&quot;true&quot;&lt;br&gt;即&lt;li skip=&quot;true&quot;&gt;4&lt;/li&gt;&lt;br&gt;所以选项卡4是没有内容的&lt;br&gt;
            你可以为选项卡的文字直接加上链接，我这里就不加了
            &lt;/div&gt;
            &lt;div&gt;222222&lt;/div&gt;
            &lt;div&gt;33333&lt;/div&gt;
            &lt;div&gt;4444444&lt;/div&gt;
            &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class=&quot;s&quot;&gt;
            <!--onmousover触发中的例子-->
            &lt;div id=&quot;a4&quot;&gt;
            &lt;ul&gt;
            &lt;li&gt;1&lt;/li&gt;
            &lt;li&gt;2&lt;/li&gt;
            &lt;li skip=&quot;true&quot;&gt;3&lt;/li&gt;
            &lt;li&gt;4&lt;/li&gt;
            &lt;/ul&gt;
            &lt;/div&gt;
            &lt;div id=&quot;b4&quot;&gt;
            &lt;div&gt;这个例子是用onmouseover触发的&lt;br&gt;(over，out直接激活)&lt;br&gt;并且&lt;li skip=&quot;true&quot;&gt;3&lt;/li&gt;[选项卡3不会被激活]&lt;br&gt;overStyle = true;&lt;/div&gt;
            &lt;div&gt;
            var cc = new opCard();&lt;br&gt;
            cc.bind = [&quot;a4&quot;,&quot;li&quot;,&quot;b4&quot;,&quot;div&quot;];&lt;br&gt;
            cc.style = [&quot;style1&quot;,&quot;style2&quot;,&quot;style1&quot;];&lt;br&gt;
            cc.overStyle = true;&lt;br&gt;
            cc.overChange = true;&lt;br&gt;
            cc.creat();&lt;br&gt;
            cc = null;
            &lt;/div&gt;
            &lt;div&gt;33333&lt;/div&gt;
            &lt;div&gt;4444444&lt;/div&gt;
            &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class=&quot;s&quot;&gt;
            <!--自动播放auto第一个例子-->
            &lt;div id=&quot;a5&quot;&gt;
            &lt;ul&gt;
            &lt;li&gt;1&lt;/li&gt;
            &lt;li&gt;2&lt;/li&gt;
            &lt;li&gt;3&lt;/li&gt;
            &lt;li&gt;4&lt;/li&gt;
            &lt;/ul&gt;
            &lt;/div&gt;
            &lt;div id=&quot;b5&quot;&gt;
            &lt;div&gt;1111111&lt;br&gt;我每3秒切换一个选项卡&lt;/div&gt;
            &lt;div&gt;
            var ee = new opCard();&lt;br&gt;
            ee.bind = [&quot;a6&quot;,&quot;li&quot;,&quot;b6&quot;,&quot;div&quot;];&lt;br&gt;
            ee.style = [&quot;style1&quot;,&quot;style2&quot;,&quot;style1&quot;];&lt;br&gt;
            ee.auto = [true, 2000];&lt;br&gt;
            ee.overChange = true;&lt;br&gt;
            ee.creat();&lt;br&gt;
            ee = null;
            &lt;/div&gt;
            &lt;div&gt;33333&lt;br&gt;我每3秒切换一个选项卡&lt;/div&gt;
            &lt;div&gt;4444444&lt;br&gt;我每3秒切换一个选项卡&lt;/div&gt;
            &lt;/div&gt;
            &lt;div&gt;注：&lt;strong&gt;鼠标在选项卡任意位置都会使停止播放&lt;/strong&gt;&lt;br&gt;&lt;br&gt;下面这个结合overChange一起&lt;/div&gt;
            <!--自动播放auto第二个例子-->
            &lt;div id=&quot;a6&quot;&gt;
            &lt;ul&gt;
            &lt;li&gt;1&lt;/li&gt;
            &lt;li&gt;2&lt;/li&gt;
            &lt;li&gt;3&lt;/li&gt;
            &lt;li&gt;4&lt;/li&gt;
            &lt;/ul&gt;
            &lt;/div&gt;
            &lt;div id=&quot;b6&quot;&gt;
            &lt;div&gt;1111111&lt;br&gt;我每2秒切换一个选项卡&lt;/div&gt;
            &lt;div&gt;
            var dd = new opCard();&lt;br&gt;
            dd.bind = [&quot;a5&quot;,&quot;li&quot;,&quot;b5&quot;,&quot;div&quot;];&lt;br&gt;
            dd.style = [&quot;style1&quot;,&quot;style2&quot;,&quot;style1&quot;];&lt;br&gt;
            dd.auto = [true, 3000];&lt;br&gt;
            dd.creat();&lt;br&gt;
            dd = null;&lt;br&gt;
            &lt;/div&gt;
            &lt;div&gt;33333&lt;br&gt;我每2秒切换一个选项卡&lt;/div&gt;
            &lt;div&gt;4444444&lt;br&gt;我每2秒切换一个选项卡&lt;/div&gt;
            &lt;/div&gt;
            &lt;div&gt;&lt;br&gt;下面这个再来个&lt;li skip=&quot;true&quot;&gt;3&lt;/li&gt;，且overStyle=true;&lt;/div&gt;
            <!--自动播放auto第三个例子-->
            &lt;div id=&quot;a7&quot;&gt;
            &lt;ul&gt;
            &lt;li&gt;1&lt;/li&gt;
            &lt;li&gt;2&lt;/li&gt;
            &lt;li skip=&quot;true&quot;&gt;3&lt;/li&gt;
            &lt;li&gt;4&lt;/li&gt;
            &lt;/ul&gt;
            &lt;/div&gt;
            &lt;div id=&quot;b7&quot;&gt;
            &lt;div&gt;1111111&lt;br&gt;我每1秒切换一个选项卡&lt;/div&gt;
            &lt;div&gt;
            var ff = new opCard();&lt;br&gt;
            ff.bind = [&quot;a7&quot;,&quot;li&quot;,&quot;b7&quot;,&quot;div&quot;];&lt;br&gt;
            ff.style = [&quot;style1&quot;,&quot;style2&quot;,&quot;style1&quot;];&lt;br&gt;
            ff.auto = [true, 1000];&lt;br&gt;
            ff.overChange = true;&lt;br&gt;
            ff.overStyle = true;&lt;br&gt;
            ff.creat();&lt;br&gt;
            ff = null;
            &lt;/div&gt;
            &lt;div&gt;33333&lt;br&gt;我每1秒切换一个选项卡&lt;/div&gt;
            &lt;div&gt;4444444&lt;br&gt;我每1秒切换一个选项卡&lt;/div&gt;
            &lt;/div&gt;
            &lt;/div&gt;
            <!--菜单导航的例子-->
            &lt;div class=&quot;s&quot;&gt;
            &lt;div id=&quot;a8&quot;&gt;
            &lt;ul&gt;
            &lt;li skip=&quot;true&quot;&gt;首页&lt;/li&gt;
            &lt;li&gt;新闻&lt;/li&gt;
            &lt;li&gt;论坛&lt;/li&gt;
            &lt;li skip=&quot;true&quot;&gt;联系我们&lt;/li&gt;
            &lt;/ul&gt;
            &lt;/div&gt;
            &lt;div id=&quot;b8&quot;&gt;
            &lt;div&gt;&lt;/div&gt;
            &lt;div&gt;&lt;a href=&quot;#&quot; _fcksavedurl=&quot;#&quot;&gt;国内新闻&lt;/a&gt;&lt;a href=&quot;#&quot; _fcksavedurl=&quot;#&quot;&gt;国际新闻&lt;/a&gt;&lt;a href=&quot;#&quot; _fcksavedurl=&quot;#&quot;&gt;娱乐新闻&lt;/a&gt;&lt;a href=&quot;#&quot; _fcksavedurl=&quot;#&quot;&gt;体育新闻&lt;/a&gt;&lt;/div&gt;
            &lt;div&gt;&lt;a href=&quot;#&quot; _fcksavedurl=&quot;#&quot;&gt;蓝色理想&lt;/a&gt;&lt;a href=&quot;#&quot; _fcksavedurl=&quot;#&quot;&gt;blue idea&lt;/a&gt;&lt;/div&gt;
            &lt;div&gt;&lt;/div&gt;
            &lt;/div&gt;
            &lt;div&gt;&lt;strong&gt;注：菜单延时一秒关闭&lt;/strong&gt;&lt;br&gt;这里只是演示，实际可以设置下position什么的。-o-&lt;br&gt;多级菜单不知道能不能支持，没试过&lt;/div&gt;
            &lt;/div&gt;
            &lt;div class=&quot;s&quot;&gt;
            我见过的许多选项卡都不能用来嵌套&lt;br&gt;但还是有些时候会用到的&lt;br&gt;
            所以如您所见，这个演示本身就是一个嵌套，效果还不错
            &lt;/div&gt;
            <!--其他应用-->
            &lt;div class=&quot;s&quot;&gt;
            比如图片切换什么，不过我太懒了，不写了。。。&lt;br&gt;
            这个能干什么，我也不知道。。
            &lt;div id=&quot;a9&quot;&gt;
            &lt;li&gt;新年好啊&lt;/li&gt;
            &lt;li&gt;快过年了&lt;/li&gt;
            &lt;li&gt;天好冷啊&lt;/li&gt;
            &lt;li&gt;大家去抢红包吧&lt;/li&gt;
            &lt;li&gt;红包~！红包~！你在哪里啊？&lt;/li&gt;
            &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class=&quot;s&quot;&gt;
            选项卡标题（或者菜单）必须和选项卡内容的数量相同，否则会出错&lt;br&gt;即使选项卡菜单skip=&quot;true&quot;，内容也要放一个空的标签占位&lt;br&gt;
            其他好像暂时没发现什么&lt;br&gt;&lt;br&gt;
            本来打算加入ajax的，但有些还没想好。&lt;br&gt;
            效率的话，应该还行，我这个演示放了几个选项卡，似乎还不错&lt;br&gt;&lt;br&gt;
            写这个的目的就是以后弄选项卡只要处理样式就可以了，很多选项卡或者切换之类都是大同小异&lt;br&gt;
            本来是打算弄些特效在里面，考虑会增加不少代码，所以不加了，简洁点。&lt;br&gt;&lt;br&gt;
            哦，还有选项卡是附加样式，不会取消原本设置的样式&lt;br&gt;
            如左边的下划线是原有的样式
            &lt;/div&gt;
            &lt;div class=&quot;s&quot;&gt;啥都没有1&lt;/div&gt;
            &lt;div class=&quot;s&quot;&gt;啥都没有2&lt;/div&gt;
            &lt;div class=&quot;s&quot;&gt;啥都没有3&lt;/div&gt;
            &lt;div class=&quot;s&quot;&gt;啥都没有4&lt;/div&gt;
            &lt;/td&gt;
            &lt;/tr&gt;
            &lt;/table&gt;
            &lt;/body&gt;
            &lt;/html&gt;  </textarea></div>
            <div class="s">啥都没有2</div>
            <div class="s">啥都没有3</div>
            <div class="s">啥都没有4</div>
            </td>
        </tr>
    </tbody>
</table>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.uqqb.com/article/66.htm" /> 
	  <id>http://www.uqqb.com/default.asp?id=66</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Js格式化工具]]></title>
	  <author>
		 <name>admin</name>
		 <uri>http://www.uqqb.com/</uri>
		 <email>2097367@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.uqqb.com/default.asp?cateID=12" label="网页素材" /> 
	  <updated>2008-11-03T08:12:57+08:00</updated>
	  <published>2008-11-03T08:12:57+08:00</published>
		  <summary type="html"><![CDATA[<SCRIPT language=JavaScript>  
  
            var xx        = new CLASS_FORMATER(code);            

            document.getElementById("display").innerHTML = xx.format(); 
function CLASS_FORMAT(code){
    //哈希表类
    function Hashtable(){
        this._hash        = new Object();
        this.add        = function(key,value){
                            if(typeof(key)!="undefined"){
                                if(this.contains(key)==false){
                                    this._hash[key]=typeof(value)=="undefined"?null:value;
                                    return true;
                                } else {
                                    return false;
                                }
                            } else {
                                return false;
                            }
                        }
        this.remove        = function(key){delete this._hash[key];}
        this.count        = function(){var i=0;for(var k in this._hash){i++;} return i;}
        this.items        = function(key){return this._hash[key];}
        this.contains    = function(key){return typeof(this._hash[key])!="undefined";}
        this.clear        = function(){for(var k in this._hash){delete this._hash[k];}}

    }

    this._caseSensitive = true;

    //字符串转换为哈希表
    this.str2hashtable = function(key,cs){
        
        var _key    = key.split(/,/g);
        var _hash    = new Hashtable(); 
        var _cs        = true;

    
        if(typeof(cs)=="undefined"||cs==null){
            _cs = this._caseSensitive;
        } else {
            _cs = cs;
        }

        for(var i in _key){
            if(_cs){
                _hash.add(_key[i]);
            } else {
                _hash.add((_key[i]+"").toLowerCase());
            }

        }
        return _hash;
    }

    //获得需要转换的代码
    this._codetxt        = code;

    if(typeof(syntax)=="undefined"){
        syntax = "";
    }

    this._deleteComment = false;
    //是否大小写敏感
    this._caseSensitive = true;
    //可以后面加块语句的关键字
    this._blockElement  = this.str2hashtable("switch,if,while,try,finally");
    //是函数申明
    this._function      = this.str2hashtable("function");
    //本行括号内分号不做换行
    this._isFor            = "for";

    this._choiceElement = this.str2hashtable("else,catch");

    this._beginBlock    = "{";
    this._endBlock      = "}";
    
    this._singleEyeElement = this.str2hashtable("var,new,return,else,delete,in,case");
    //得到分割字符
    this._wordDelimiters= "　 ,.?!;:\\/<>(){}[]\"'\r\n\t=+-|*%@#$^&";
    //引用字符
    this._quotation     = this.str2hashtable("\",'");
    //行注释字符
    this._lineComment   = "//";
    //转义字符
    this._escape        = "\\";
    //多行引用开始
    this._commentOn        = "/*";
    //多行引用结束
    this._commentOff    = "*/";
    //行结束词
    this._rowEnd        = ";";

    this._in            = "in";


    this.isCompress        = false;
    this.style            = 0;

    this._tabNum        = 0;


    this.format = function() {
        var codeArr        = new Array();
        var word_index    = 0;
        var htmlTxt        = new Array();

        if(this.isCompress){
            this._deleteComment = true;
        }


        //得到分割字符数组(分词)
        for (var i = 0; i < this._codetxt.length; i++) {       
            if (this._wordDelimiters.indexOf(this._codetxt.charAt(i)) == -1) {        //找不到关键字
                if (codeArr[word_index] == null || typeof(codeArr[word_index]) == 'undefined') {
                    codeArr[word_index] = "";
                }
                codeArr[word_index] += this._codetxt.charAt(i);
            } else {
                if (typeof(codeArr[word_index]) != 'undefined' && codeArr[word_index].length > 0)
                    word_index++;
                codeArr[word_index++] = this._codetxt.charAt(i);                
            } 
        }


        var quote_opened                = false;    //引用标记
        var slash_star_comment_opened   = false;    //多行注释标记
        var slash_slash_comment_opened  = false;    //单行注释标记
        var line_num                    = 1;        //行号
        var quote_char                  = "";       //引用标记类型

        var function_opened             = false;

        var bracket_open                = false;
        var for_open                    = false;

        //按分割字，分块显示
        for (var i=0; i <=word_index; i++){            
            //处理空行（由于转义带来）
            if(typeof(codeArr[i])=="undefined"||codeArr[i].length==0){
                continue;
            } else if(codeArr[i]==" "||codeArr[i]=="\t"){
                if(slash_slash_comment_opened||slash_star_comment_opened){
                    if(!this._deleteComment){
                        htmlTxt[htmlTxt.length] = codeArr[i];
                    }
                }
                if(quote_opened){
                        htmlTxt[htmlTxt.length] = codeArr[i];                    
                }
            } else if(codeArr[i]=="\n"){
            //处理换行
            } else if (codeArr[i] == "\r"){                                                                    
                slash_slash_comment_opened = false;    
                quote_opened    = false;
                line_num++;
                if(!this.isCompress){
                    htmlTxt[htmlTxt.length] = "\r\n"+ this.getIdent();    
                }
            //处理function里的参数标记
            } else if (!slash_slash_comment_opened&&!slash_star_comment_opened && !quote_opened &&this.isFunction(codeArr[i])){
                htmlTxt[htmlTxt.length] = codeArr[i]  + " ";
                function_opened = true;
            } else if (!slash_slash_comment_opened&&!slash_star_comment_opened && !quote_opened &&codeArr[i]==this._isFor){
                htmlTxt[htmlTxt.length] = codeArr[i];
                for_open = true;
            } else if (!slash_slash_comment_opened&&!slash_star_comment_opened && !quote_opened &&codeArr[i]=="("){
                bracket_open    = true;
                htmlTxt[htmlTxt.length] = codeArr[i];
            } else if (!slash_slash_comment_opened&&!slash_star_comment_opened && !quote_opened &&codeArr[i]==")"){
                bracket_open    = false;
                htmlTxt[htmlTxt.length] = codeArr[i];
            } else if (!slash_slash_comment_opened&&!slash_star_comment_opened && !quote_opened &&codeArr[i]==this._rowEnd){
                if(!this.isCompress){
                    if(!for_open){
                        if(i<word_index&&(codeArr[i+1]!="\r"&&codeArr[i+1]!="\n")){                            
                            htmlTxt[htmlTxt.length] = codeArr[i] + "\n" + this.getIdent();
                        }else{
                            htmlTxt[htmlTxt.length] = codeArr[i] + this.getIdent();
                        }
                    }else{
                        htmlTxt[htmlTxt.length] = codeArr[i];                    
                    }
                }else{
                    htmlTxt[htmlTxt.length] = codeArr[i];
                }
            } else if(!slash_slash_comment_opened&&!slash_star_comment_opened && !quote_opened &&codeArr[i]==this._beginBlock){
                for_open    = false;
                if(!this.isCompress){
                    switch(this.style){
                        case 0:
                            this._tabNum++;
                            htmlTxt[htmlTxt.length] = codeArr[i] + "\n" + this.getIdent();
                            break;
                        case 1:
                            htmlTxt[htmlTxt.length] = "\n" + this.getIdent();
                            this._tabNum++;
                            htmlTxt[htmlTxt.length] = codeArr[i] + "\n"+ this.getIdent();
                            break;
                        default:
                            this._tabNum++;
                            htmlTxt[htmlTxt.length] = codeArr[i];
                            break;
                            
                    }
                }else{
                    htmlTxt[htmlTxt.length] = codeArr[i];
                }

            } else if(!slash_slash_comment_opened&&!slash_star_comment_opened && !quote_opened &&codeArr[i]==this._endBlock){
                if(!this.isCompress){
                    this._tabNum--;
                    if(i<word_index&&codeArr[i+1]!=this._rowEnd){
                        htmlTxt[htmlTxt.length] = "\n" + this.getIdent() + codeArr[i];
                    }else{
                        htmlTxt[htmlTxt.length] = "\n" + this.getIdent() + codeArr[i];
                    }
                }else{
                    if(i<word_index&&codeArr[i+1]!=this._rowEnd){
                        htmlTxt[htmlTxt.length] = codeArr[i] + this._rowEnd;
                    }else{
                        htmlTxt[htmlTxt.length] = codeArr[i];
                    }
                }
            //处理关键字
            } else if (!slash_slash_comment_opened&&!slash_star_comment_opened && !quote_opened && this.isBlockElement(codeArr[i])){     
                htmlTxt[htmlTxt.length] = codeArr[i];
            //处理内置对象(后面加一个空格)
            } else if (!slash_slash_comment_opened&&!slash_star_comment_opened && !quote_opened && this.isSingleEyeElement(codeArr[i])){    
                if(codeArr[i]==this._in){
                    htmlTxt[htmlTxt.length] = " ";
                }
                htmlTxt[htmlTxt.length] = codeArr[i] + " ";
            //处理双引号（引号前不能为转义字符）    
            } else if (!slash_star_comment_opened&&!slash_slash_comment_opened&&this._quotation.contains(codeArr[i])){                                                    
                if (quote_opened){
                    //是相应的引号
                    if(quote_char==codeArr[i]){
                        htmlTxt[htmlTxt.length] = codeArr[i];                    
                        quote_opened    = false;
                        quote_char      = "";
                    } else {
                        htmlTxt[htmlTxt.length] = codeArr[i];            
                    }
                } else {
                    htmlTxt[htmlTxt.length] =  codeArr[i];
                    quote_opened    = true;
                    quote_char        = codeArr[i];
                }                    
            //处理转义字符
            } else if(codeArr[i] == this._escape){    
                htmlTxt[htmlTxt.length] = codeArr[i]; 
                if(i<word_index-1){
                    if(codeArr[i+1].charCodeAt(0)>=32&&codeArr[i+1].charCodeAt(0)<=127){
                        htmlTxt[htmlTxt.length] = codeArr[i+1].substr(0,1);
                        htmlTxt[htmlTxt.length] = codeArr[i+1].substr(1);
                        i=i+1;
                    }
                }            
            //处理多行注释的开始
            } else if (!slash_slash_comment_opened && !slash_star_comment_opened&&!quote_opened&&this.isStartWith(this._commentOn,codeArr,i)){                                             
                slash_star_comment_opened = true;
                if(!this._deleteComment){
                    htmlTxt[htmlTxt.length] = this._commentOn;
                }
                i = i + this.getSkipLength(this._commentOn);    
            //处理单行注释
            } else if (!slash_slash_comment_opened && !slash_star_comment_opened&&!quote_opened&&this.isStartWith(this._lineComment,codeArr,i)){                                                
                slash_slash_comment_opened = true;
                if(!this._deleteComment){
                    htmlTxt[htmlTxt.length] =  this._lineComment;
                }
                i = i + this.getSkipLength(this._lineComment);    
            //处理忽略词
            } else if (!slash_slash_comment_opened && !slash_star_comment_opened&&!quote_opened&&this.isStartWith(this._ignore,codeArr,i)){                                                
                slash_slash_comment_opened = true;
                htmlTxt[htmlTxt.length] = this._ignore;
                i = i + this.getSkipLength(this._ignore);                    
            //处理多行注释结束    
            } else if (!quote_opened&&!slash_slash_comment_opened&&this.isStartWith(this._commentOff,codeArr,i)){                                
                if (slash_star_comment_opened) {
                    slash_star_comment_opened = false;
                    if(!this._deleteComment){
                        htmlTxt[htmlTxt.length] =  this._commentOff;
                    }
                    i = i + this.getSkipLength(this._commentOff);        
                }
            } else {
                //不是在字符串中
                if(!quote_opened){
                    //如果不是在注释重
                    if(!slash_slash_comment_opened && !slash_star_comment_opened){    
                            htmlTxt[htmlTxt.length] = codeArr[i];                        
                    //注释中                            
                    }else{
                        if(!this._deleteComment){
                            htmlTxt[htmlTxt.length] = codeArr[i];
                        }
                    }
                }else{
                            htmlTxt[htmlTxt.length] = codeArr[i];
                }
            }
            
        }

        return htmlTxt.join("");
    }

    this.isStartWith = function(str,code,index){

        if(typeof(str)!="undefined"&&str.length>0){        
            var cc = new Array();            
            for(var i=index;i<index+str.length;i++){
                cc[cc.length] = code[i];
            }
            var c = cc.join("");
            if(this._caseSensitive){
                if(str.length>=code[index].length&&c.indexOf(str)==0){
                    return true;
                }
            }else{
                if(str.length>=code[index].length&&c.toLowerCase().indexOf(str.toLowerCase())==0){
                    return true;
                }
            }
            return false;

        } else {
            return false;
        }
    }

    this.isFunction = function(val){
        return this._function.contains(this._caseSensitive?val:val.toLowerCase());
    }
    
    this.isBlockElement = function(val) {        
        return this._blockElement.contains(this._caseSensitive?val:val.toLowerCase());
    }

    this.isChoiceElement = function(val) {        
        return this._choiceElement.contains(this._caseSensitive?val:val.toLowerCase());
    }

    this.isSingleEyeElement = function(val) {
        return this._singleEyeElement.contains(this._caseSensitive?val:val.toLowerCase());
    }

    this.isNextElement = function(from,word){
        for(var i=from;i<word.length;i++){
            if(word[i]!=" "&&word[i]!="\t"&&word[i]!="\r"&&word[i]!="\n"){                
                return this.isChoiceElement(word[i]);
            }
        }
        return false;
    }

    this.getSkipLength = function(val){    
        var count = 0;
        for(var i=0;i<val.length;i++){
            if(this._wordDelimiters.indexOf(val.charAt(i))>=0){
                count++;
            }
        }
        if(count>0){
            count=count-1;
        }
        return count;
    }

    this.getIdent=function(){
        var n = [];
        for(var i=0;i<this._tabNum;i++){
            n[n.length] = "\t";
        }
        return n.join("");
    }
}

function doformat(o){
    var htmltxt = "";

    if (o == null){
        alert("domNode is null!");
        return;
    }

    var _codetxt = "";
    
    if(typeof(o)=="object"){
        switch(o.tagName){
            case "TEXTAREA":
            case "INPUT":
                _codetxt = o.value;
                break;
            case "DIV":
            case "SPAN":
                _codetxt = o.innerText;
                break;
            default:
                _codetxt = o.innerHTML;
                break;
        }
    }else{
        _codetxt = o;
    }

    var _syn = new CLASS_FORMAT(_codetxt);
    htmltxt = _syn.format();
    return  htmltxt;
}


function go()
{
    var code    = document.getElementById("code").value;
    var xx      = new CLASS_FORMAT(code);    
    var a       = new Date();

    if(document.getElementById('cboOperate').selectedIndex==1){
        xx.isCompress=true;
    }else{
        xx.style = parseInt(document.getElementById('cboStyle').value);
    }
    document.getElementById("display").value = xx.format();
    alert("共花：" + (new Date().getTime()-a.getTime()) + "ms");
}
//-->
</SCRIPT>
<p><textarea id="code" rows="12" cols="50">/*
这个是一个类
*/
function    xx   (num,str){//说明
var a = num;this.aa = a;
this.bb = function(){alert(str);}
this.cc = function(){for(var i=0;i&lt;10;i++){document.title=i;}}};
xx.prototype.dd= function(){alert(&quot;d  d        kd&quot;);}
var a = new xx(100,&quot;hello&quot;),b=new xx(0,&quot;ttyp&quot;);
if(1&gt;2)  {   alert();
}
else {
alert(&quot; hell &quot;);
}
a.bb();
b.dd();
alert(a.aa);
</textarea> <br />
<select id="cboOperate" onchange="if(this.selectedIndex==1)document.getElementById('cboStyle').disabled=true;else document.getElementById('cboStyle').disabled=false;">
<option value="0" selected="selected">格式化</option>
<option value="1">压缩</option>
</select> <select id="cboStyle">
<option value="0" selected="selected">经典</option>
<option value="1">微软</option>
</select> <input type="button" onclick="go()" value="go" /><br />
<textarea id="display" rows="12" cols="50"></textarea></p>
<p>&nbsp;</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.uqqb.com/article/65.htm" /> 
	  <id>http://www.uqqb.com/default.asp?id=65</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[windows自带防火墙和自带ftp冲突的解决办法]]></title>
	  <author>
		 <name>admin</name>
		 <uri>http://www.uqqb.com/</uri>
		 <email>2097367@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.uqqb.com/default.asp?cateID=5" label="服 务 器" /> 
	  <updated>2008-09-29T12:26:44+08:00</updated>
	  <published>2008-09-29T12:26:44+08:00</published>
		  <summary type="html"><![CDATA[在例外里面添加&nbsp;&nbsp;&nbsp;&nbsp; *\system32\inetsrv\inetinfo.exe程序]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.uqqb.com/article/64.htm" /> 
	  <id>http://www.uqqb.com/default.asp?id=64</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[lp主机不支持内容为中文的js两种解决方法]]></title>
	  <author>
		 <name>admin</name>
		 <uri>http://www.uqqb.com/</uri>
		 <email>2097367@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.uqqb.com/default.asp?cateID=12" label="网页素材" /> 
	  <updated>2008-09-14T14:56:18+08:00</updated>
	  <published>2008-09-14T14:56:18+08:00</published>
		  <summary type="html"><![CDATA[<div id="postmessage_186219" class="t_msgfont">一，在调用的js里添加 charset=&quot;gb2312&quot;<br />
<br />
例：&lt;script language=&quot;javascript&quot; src=&quot;http://www.zhongliuyao.com/js/links.js&quot; charset=&quot;gb2312&quot;&gt;&lt;/script&gt;<br />
<br />
有些朋友添加后刷新不起作用，我的是VPS重启一下就好了，虚拟主机怎么办？等服务器重启？<br />
<br />
二，把js里的所有中文转换成Ascii码<br />
<br />
请把以下内容复制保存为：Ascii.html</div>
<p>
<meta content="text/html; charset=gb2312" http-equiv="Content-Type" /><script style="text/javascript">
function ascii(str){
return str.replace(/[^\u0000-\u00FF]/g,function($0){return escape($0).replace(/(%u)(\w{4})/gi,"\\u$2")});
  }
function unascii(str){
  return unescape(str.replace(/\\u/g,"%u"));
  }
</script><textarea id="af1" rows="10" cols="50" name="af1"></textarea> <br />
<input id="Ianse_Com_Button" class="submit" type="button" onClick="if (af1.value==''){M('请输入需加密的Ascii');return false;}af2.value=ascii(af1.value);" value="加密Ascii" /> <input id="Ianse_Com_Button" class="submit" type="button" onClick="if (af1.value==''){M('请输入需要解密的Ascii');return false;}af2.value=unascii(af1.value);" value="解密Ascii" /> <br />
<textarea id="af2" rows="10" cols="50" name="af2"></textarea></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.uqqb.com/article/63.htm" /> 
	  <id>http://www.uqqb.com/default.asp?id=63</id>
  </entry>	
		
</feed>
