//最后更新：2011-03-11 Randy

var IE=(navigator.appName=="Microsoft Internet Explorer");
var IE6=(IE && navigator.userAgent.indexOf("MSIE 6")>-1);
var IE7=(IE && navigator.userAgent.indexOf("MSIE 7")>-1);
var IE8=(IE && navigator.userAgent.indexOf("MSIE 8")>-1);
var NS=(navigator.appName=="Netscape");
var FF=(NS && navigator.userAgent.indexOf("Firefox")>-1);
var GG=(NS && navigator.userAgent.indexOf("Safari")>-1);
var OP=(navigator.appName=="Opera");
var oHtml=document.documentElement;
var oBody=document.body;

//@ 1 @++++@ 返回HttpRequest对象 @++++@ 1 @
function GetHttpRequest()
{
  var XmlHR;

  if (IE) XmlHR=new ActiveXObject("MSXML2.XMLHTTP");
  else if (NS || OP) XmlHR=new XMLHttpRequest();
  else XmlHR=new ActiveXObject("MSXML2.XMLHTTP");

  return XmlHR;
}
//@ 1 @----@ 返回HttpRequest对象 @----@ 1 @

//@ 1 @++++@ 返回对象的上、右、下、左 @++++@ 1 @
function GetRect(obj)
{
  var iRect=new Array();
  var oRect=obj.getBoundingClientRect();

  iRect.push(oRect.top+oHtml.scrollTop);//上
  iRect.push(oRect.right+oHtml.scrollLeft);//右
  iRect.push(oRect.bottom+oHtml.scrollTop);//下
  iRect.push(oRect.left+oHtml.scrollLeft);//左

  iRect.push(iRect[1]-iRect[3]);//对象宽度
  iRect.push(iRect[2]-iRect[0]);//对象高度
  iRect.push(oHtml.clientWidth);//窗口可见宽度
  iRect.push(oHtml.clientHeight);//窗口可见高度
  if (GG) iRect.push(oBody.scrollTop);//滚动高度
  else iRect.push(oHtml.scrollTop);
  if (GG) iRect.push(oBody.scrollLeft);//滚动宽度
  else iRect.push(oHtml.scrollLeft);

  return iRect;
}
//@ 1 @----@ 返回对象的上、右、下、左 @----@ 1 @

//@ 1 @++++@ 显示Flash @++++@ 1 @
function ShowFlash(url,w,h,t,id)
{
  document.write("<object");
  if (id) document.write(" id='"+id+"'");
  document.write(" classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'");
  document.write(" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10.1.102.64'");
  document.write(" width='"+w+"' height='"+h+"'>");
  document.write("<param name='movie' value='"+url+"'>");
  document.write("<param name='quality' value='high'>");
  if (t=="yes") document.write("<param name='wmode' value='transparent'>");
  document.write("<param name='menu' value='false'>");
  document.write("<embed src='"+url+"'");
  if (id) document.write(" id='"+id+"'");
  document.write(" quality='high' type='application/x-shockwave-flash'");
  document.write(" pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash'");
  document.write(" width='"+w+"' height='"+h+"'");
  if (t=="yes") document.write(" wmode='transparent'");
  document.write("></embed>");
  document.write("</object>");
}
//@ 1 @----@ 显示Flash @----@ 1 @
