function $(id) {
	return document.getElementById(id);
}

function isUndefined(variable) {
	return typeof variable == 'undefined' ? true : false;
}

function findtags(parentobj, tag) {
	if(!isUndefined(parentobj.getElementsByTagName)) {
		return parentobj.getElementsByTagName(tag);
	} else if(parentobj.all && parentobj.all.tags) {
		return parentobj.all.tags(tag);
	} else {
		return null;
	}
}
function doane(event) {
	e = event ? event : window.event ;
	if(is_ie) {
		e.returnValue = false;
		e.cancelBubble = true;
	} else {
		e.stopPropagation();
		e.preventDefault();
	}
}

function selectAll(t)
{
    var checkboxs = document.getElementsByName('ck_' + t);
    for (var i = 0; i < checkboxs.length; i++)
    {
        checkboxs[i].checked = true;
    }
}

function selectReverse(t)
{
    var checkboxs = document.getElementsByName('ck_' + t);
    for (var i = 0; i < checkboxs.length; i++)
    {
        if (checkboxs[i].checked)
        {
            checkboxs[i].checked = false;
        }
        else
        {
            checkboxs[i].checked = true;
        }
    }
}

function popWin(obj,width,height) 
{
    URL=obj.href;
    
    if (width == '' || width==null)
    {
        width=693;
    }
    if (height == '' || height==null)
    {
        height=595;
    }
    var left = ( screen.width - width ) / 2;
    var top = ( screen.height - height ) / 2;
    window.open(URL,'','width='+width+',height='+height+',top='+top+',left='+left+',scrollbars=0,resizable=0');
    return false;
}

function GetXMLHttp()
{
    var xmlhttp=false;
    
    try 
    {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } 
    catch (e) 
    {
        try 
        {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (E)
        {
            xmlhttp = false;
        }
    }

    // Mozilla then?
    if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
       xmlhttp = new XMLHttpRequest();
    }
    
    return xmlhttp;
}

function changeTab(id, count, prefix)
{
    for (var i = 1; i <= count; i++)
    {
        var tag = document.getElementById(prefix + "_tab_" + i);
        var ul = document.getElementById(prefix + "_body_" + i);
        
        if (i == id)
        {
            tag.className = "sel";
            ul.style.display = "block";
        }
        else
        {
            tag.className = "unsel";
            ul.style.display = "none";
        }
    }
}

function AddFav(url1, title1)
{
	document.write('<ul class="fav">');
	document.writeln("<li><a href=\"javascript:u=\'"+url1+"\';t=\'"+title1+"\';c = %22%22 + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text);var url=%22http://cang.baidu.com/do/add?it=%22+encodeURIComponent(t)+%22&iu=%22+encodeURIComponent(u)+%22&dc=%22+encodeURIComponent(c)+%22&fr=ien#nw=1%22;window.open(url,%22_blank%22,%22scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes%22); void 0\" title=\"Baidu搜藏\"><img border=\"0\" src=\"/images/wj/baidu.gif\" alt=\"Baidu搜藏\"></a></li>");
	document.writeln("<li><a  href=\"javascript:window.open(\'http://shuqian.qq.com/post?title=\'+encodeURIComponent(\'"+title1+"\')+\'&uri="+url1+"&jumpback=2&noui=1\',\'favit\',\'width=960,height=600,left=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes\');void(0)\"><img src=\"/images/wj/qq.gif\" alt=\"QQ书签\"  border=\"0\" title=\"QQ书签\"></a></li>");
	document.writeln("<li><a href=\"javascript:location.href=\'http://www.google.com/bookmarks/mark?op=add&bkmk="+url1+"&title=\'+encodeURIComponent(\'"+title1+"\')\" target=\'_blank\'><img src=\"/images/wj/google.gif\" alt=\"Google书签\" border=\"0\"></a></li>");
	document.writeln("<li><a href=\"javascript:location.href=\'http://del.icio.us/post?&url="+url1+"&title=\'+encodeURIComponent(\'"+title1+"\')\" target=\'_blank\'><img src=\"/images/wj/delicious.gif\" alt=\"Del.icio.us\" border=\"0\" title=\"Del.icio.us\"></a></li>");
	document.writeln("<li><a href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(keyit=window.open(\'http://my.poco.cn/fav/storeIt.php?t=\'+escape(\'"+title1+"\')+\'&u=\'+escape(\'"+url1+"\')+\'&c=\'+escape(t)+\'&img=http://www.h-strong.com/blog/logo.gif\',\'keyit\',\'scrollbars=no,width=475,height=575,status=no,resizable=yes\'));keyit.focus();\" title=\"POCO网摘\"><img src=\"/images/wj/poco.gif\" alt=\"POCO网摘\" border=\"0\"></a></li>");
	document.writeln("<li><a href=\"javascript:location.href=\'http://myweb2.search.yahoo.com/myresults/bookmarklet?u=\'+encodeURIComponent(\'"+url1+"\')+\'&t=\'+encodeURIComponent(\'"+title1+"\')\" title=\"Yahoo书签\"><img src=\"/images/wj/yahoo.gif\" alt=\"Yahoo书签\" border=\"0\"></a></li>");
	document.writeln("<li><a href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(vivi=window.open(\'http://vivi.sina.com.cn/collect/icollect.php?pid=28&title=\'+escape(\'"+title1+"\')+\'&url=\'+escape(\'"+url1+"\')+\'&desc=\'+escape(t),\'vivi\',\'scrollbars=no,width=480,height=480,left=75,top=20,status=no,resizable=yes\'));vivi.focus();\" title=\"新浪ViVi\"><img src=\"/images/wj/vivi.gif\" alt=\"新浪ViVi\" border=\"0\"></a></li>");
	document.writeln("<li><a href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(keyit=window.open(\'http://www.365key.com/storeit.aspx?t=\'+escape(\'"+title1+"\')+\'&u=\'+escape(\'"+url1+"\')+\'&c=\'+escape(t),\'keyit\',\'scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes\'));keyit.focus();\" title=\"365Key网摘\"><img src=\"/images/wj/365key.gif\" alt=\"365Key网摘\" border=\"0\"></a></li>");
	document.writeln("<li><a href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(yesky=window.open(\'http://hot.yesky.com/dp.aspx?t=\'+escape(\'"+title1+"\')+\'&u=\'+escape(\'"+url1+"\')+\'&c=\'+escape(t)+\'&st=2\',\'yesky\',\'scrollbars=no,width=400,height=480,left=75,top=20,status=no,resizable=yes\'));yesky.focus();\" title=\"天极网摘\"><img src=\"/images/wj/yesky.gif\" alt=\"天极网摘\" border=\"0\"></a></li>");
	document.writeln("<li><a href=\"javascript:t=\'"+title1+"\';u=\'"+url1+"\';e=document.selection?(document.selection.type!=\'None\'?document.selection.createRange().text:\'\'):(document.getSelection?document.getSelection():\'\');void(open(\'http://bookmark.hexun.com/post.aspx?title=\'+escape(\'"+title1+"\')+\'&url=\'+escape(\'"+url1+"\')+\'&excerpt=\'+escape(e),\'HexunBookmark\',\'scrollbars=no,width=600,height=450,left=80,top=80,status=no,resizable=yes\'));\" title=\"和讯网摘\"><img src=\"/images/wj/hexun.gif\" alt=\"和讯网摘\" border=\"0\"></A></li>");
	document.writeln("<li><a href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(live=window.open(\'https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=\'+escape(\'"+url1+"\')+\'&title=\'+escape(\'"+title1+"\')+\'&top=1\',\'live\',\'scrollbars=no,status=no,resizable=yes\'));live.focus();\"><img src=\"/images/wj/live.gif\" alt=\"Windows Live\" border=\"0\"></a></li>");
	document.writeln("<li><a title=\"鼠标选中部分作为描述，提交到diglog.com\" href=\"javascript://\" onclick=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(keyit=window.open(\'http://www.diglog.com/submit.aspx?title=\'+escape(\'"+title1+"\')+\'&url=\'+escape(\'"+url1+"\')+\'&description=\'+escape(t),\'keyit\',\'scrollbars=yes,width=500,height=500,left=65,top=20,status=no,resizable=yes\'));keyit.focus();\"><img src=\"/images/wj/digit.gif\" border=\"0\" alt=\"提交新发现，Dig it\" /></a></li>");
	document.write('</ul>');
}
