﻿function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject

function changeObjectVisibility(objectId, isVisibility) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
		if(isVisibility){
			styleObject.visibility = "visible";
		}else{
			styleObject.visibility = "hidden";
		}
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectVisibility

function isObjectVisibility(objectId){
	var styleObject = getStyleObject(objectId);
	return (styleObject && styleObject.visibility == "visible");
}

function showMenu(objid, eventObj) {
    //alert(eventObj);
	eventObj.cancelBubble = true;
	hideAllMenus();
	return changeObjectVisibility(objid, true);
}

function hideAllMenus() {
	changeObjectVisibility('diglog', false);
	changeObjectVisibility('digbuzz', false);
	changeObjectVisibility('digg', false);
	changeObjectVisibility('rsspop', false);
}

function showRSSfeed(feedUrl, feedTitle, themeUrl, panghulu){
document.write("<strong>在线订阅：</strong><br /><a href=\"http://www.xianguo.com/subscribe.php?url="+feedUrl+"\"><img src=\"http://img.feedsky.com/images/icon_subshot02_xianguo.jpg\" border=\"0\" alt=\"订阅到鲜果\"/></a> <a href=\"http://www.zhuaxia.com/add_channel.php?url="+feedUrl+"\"><img src=\"http://img.feedsky.com/images/icon_subshot02_zhuaxia.gif\" border=\"0\" alt=\"订阅到抓虾\"/></a> <a href=\"http://www.pageflakes.com/subscribe.aspx?url="+feedUrl+"\"><img src=\"http://img.feedsky.com/images/icon_subshot02_pageflakes.gif\" border=\"0\" alt=\"订阅到飞鸽\"/></a> <a href=\"http://www.bloglines.com/sub/"+feedUrl+"\"><img src=\"http://img.feedsky.com/images/icon_subshot02_bloglines.gif\" alt=\"bloglines\" border=\"0\"/></a> <a href=\"http://fusion.google.com/add?feedurl="+feedUrl+"\"><img src=\"http://img.feedsky.com/images/icon_subshot02_google.gif\" alt=\"google reader\" border=\"0\"/></a> <a href=\"http://rss.gougou.com/find_rss.jsp?url="+feedUrl+"\"><img src=\"http://img.feedsky.com/images/icon_subshot02_gougou.gif\" alt=\"gougou\" border=\"0\"/></a> <a href=\"http://add.my.yahoo.com/rss?url="+feedUrl+"\"><img src=\"http://img.feedsky.com/images/icon_subshot02_yahoo.gif\" alt=\"my yahoo\" border=\"0\"/></a> <a href=\"http://www.rojo.com/add-subscription?resource="+feedUrl+"\"><img src=\"http://img.feedsky.com/images/icon_subshot02_rojo.gif\" alt=\"Rojo\" border=\"0\"/></a> <a href=\"http://www.newsgator.com/ngs/subscriber/subfext.aspx?url="+feedUrl+"\"><img src=\"http://img.feedsky.com/images/icon_subshot02_newsgator.gif\" alt=\"Newsgator\" border=\"0\"/></a> <a href=\"http://www.netvibes.com/subscribe.php?url="+feedUrl+"\"><img src=\"http://img.feedsky.com/images/icon_subshot02_netvibes.gif\" alt=\"netvibes\" border=\"0\"/></a> <a href=\"http://www.live.com/?add="+feedUrl+"\"><img src=\""+themeUrl+"/images/rss_icon_live.gif\" alt=\"订阅到Live\" border=\"0\"/></a> <a href=\"http://www.emailrss.cn/?rss="+feedUrl+"\"><img src=\""+themeUrl+"/images/rss_icon_emailrss.gif\" alt=\"通过邮件订阅\" border=\"0\"/></a><br /> <br /><strong>使用离线阅读器：</strong><br /> <a href=\"javascript:location.href='http://www.potu.com/sub/'+ encodeURI('"+feedUrl+"')\"><img src=\"http://feeds.feedsky.com/images/potu_01.png\" alt=\"周博通\" border=\"0\"/></a> <a href=\"javascript:location.href='http://127.0.0.1:18087/subitem?title="+feedTitle+"&url='+ encodeURI('"+feedUrl+"')\" target=\"_blank\"><img src=\"http://feeds.feedsky.com/images/newsants.png\" alt=\"新闻蚂蚁\" border=\"0\"/></a><br /><small>如果你没有安装上述离线阅读器，请先选择下载：</small><br /><select name=\"select\" onchange=\"location.href=this.options[this.selectedIndex].value;\"><option value=\"--\" disabled=\"disabled\" selected=\"selected\">阅读器下载</option><option value=\"http://www.potu.com/index/download/PotuRss.exe\">周博通</option><option value=\"http://newsants.com/downloads/files/newsants1701.exe\">新闻蚂蚁</option></select><br /><br /><strong>IM提醒：</strong> <a href=\"http://www.anothr.com/add?url="+feedUrl+"\"><img src=\"http://img.feedsky.com/images/addtoanothr4.gif\" border=\"0\" align=\"middle\" alt=\"Subscribe by Anothr\"/></a><br /><br /><a href=\"http://www.panghulu.com/feed!view.do?feed.id="+panghulu+"\" target=\"_blank\"><img src=\"http://barcode.panghulu.com/encoder/dm?code="+panghulu+"\" src=\"胖号\" border=\"0\" /></a>");
}
//document.onclick = hideAllMenus;