function ShowSubMenu(sender,submenuid){
var x = findPosX(sender);
var y = findPosY(sender)+30;
var o = document.getElementById(submenuid);
o.style.left = x;
o.style.top = y;
o.style.display = "block";
}
//find real x position value of an object
function findPosX(obj) {
obj=document.getElementById(obj);
var curleft = 0;
if (obj.offsetParent) {
while (obj.offsetParent) {
	curleft += obj.offsetLeft
	obj = obj.offsetParent;
}
}else if (obj.x)
curleft += obj.x;
return curleft;
}
//find real y position value of an object
function findPosY(obj) {
obj=document.getElementById(obj);
var curtop = 0;
if (obj.offsetParent) {
while (obj.offsetParent){
	curtop += obj.offsetTop
	obj = obj.offsetParent;
}
} else if (obj.y)
curtop += obj.y;
return curtop;
}
document.onclick=function(){
document.getElementById('sub_menu_1').style.display = "none";
document.getElementById('sub_menu_2').style.display = "none";
document.getElementById('sub_menu_3').style.display = "none";
document.getElementById('sub_menu_4').style.display = "none";
document.getElementById('sub_menu_5').style.display = "none";
document.getElementById('sub_menu_6').style.display = "none";
}


function openWindows(theURL,winName,features) {
window.open(theURL,winName,features);
}

var myfar;
var mytitle;
myfar="http://34c.cc";
mytitle="寵寵微積-寵物論壇";
function favority() {
if (navigator.appName!="Netscape"){
window.external.AddFavorite(myfar, mytitle);
}else{
window.location = myfar;
}
}

  // 修改自 AJAX: Getting Started - MDC
  function makeRequest(url) {
    var http_request = false;

    if (window.XMLHttpRequest) { // Mozilla, Safari,...
      http_request = new XMLHttpRequest();
    } else if (window.ActiveXObject) { // IE
      try {
        http_request = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
        try {
          http_request = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {}
      }
    }

    if (!http_request) {
      alert('Giving up :( Cannot create an XMLHTTP instance');
      return false;
    }
    // 定義事件處理函數為 alterContents()
    http_request.onreadystatechange = function() { 
                                      alertContents(http_request); };
    http_request.open('GET', url, true);
    http_request.send(null);
    window.scroll(0,0);
  }

  function alertContents(http_request) {
  if (http_request.readyState !=4) {
        document.getElementById("rssBox").innerHTML="<div align='center' style='width: 699; '></div><br><br><br><center>載入中，請稍後....<br><img src=pic/load.gif></center>";
  }else{
      if (http_request.status == 200) {
      var restext="";
      restext = http_request.responseText;
      restext = restext.replace("\n", "<br>");
      //alert(mesg);
      document.getElementById("rssBox").innerHTML=restext ;
      } else {
       document.getElementById("rssBox").innerHTML="<br><br><br><center>很抱歉！找不到您所要的資料<br>錯誤位置："+url+"</center>";
      }
  }

}

  function copy_text(copy_text2) {
  	var k=copy_text2;
k.execCommand( "Copy" );
alert('已經將指定內容複製到您的剪貼簿中囉！'+k);
}