/*=============通用JS================
  This JavaScript was written by 511735.Com
  @2006-2010 511735.com All rights reserved.
===================================*/

<!-- 
function killErrors() 
{
  //return true;
}
window.onerror = killErrors;


function $E(objectId)
{
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId);
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId);
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
}

document.write("<form id=UrlPost method=Post></form>")
function UrlPost(Url){
	$E("UrlPost").action = Url;
	document.forms['UrlPost'].submit()
}

function tabDiv(obj,num,len,cn)
{
 var cssname=cn; 
 for(var id = 1;id<=len;id++)
 {
  var ss=obj+id;
  var snav =obj+"nav"+id;
  var snavhref=obj+"_href"+id;
  if(id==num){
  try{$E(ss).style.display="block"}catch(e){};
  try{$E(snav).className=cssname;$E(snavhref).className="selectON"}catch(e){};
  }else{
  try{$E(ss).style.display="none"}catch(e){};
  try{$E(snav).className="";$E(snavhref).className="";}catch(e){};
  }
 }  
}

function hideDiv(obj,len)
{ 
 for(var id = 1;id<=len;id++)
 {
  var ss=obj+id;  
  try{$E(ss).style.display="none"}catch(e){};
 }  
}


/*=============鼠标进入/离开的背景交替效果================*/
function myOver(src,clrOver){
  if (!src.contains(event.fromElement)) {		
	src.bgColor=clrOver;
  }
}
function myOut(src,clrIn)  {
  if (!src.contains(event.toElement)) {
 	src.style.cursor = 'default';
	src.bgColor='';
  }
}

/*=============正文字体大小================*/
function doZoom(size)
{
  $E('zoom').style.fontSize=size+'px';
}

/*=============翻页================*/
function pagei()
{
  window.location.href=document.pfrm.pag.value;
}

function oCopy(str)
{
  var clipBoardContent=str;
  window.clipboardData.setData("Text",clipBoardContent);
  alert("复制成功，您可以粘贴到你的 MSN/QQ/Blog/BBS 上推荐给你的好友");
}

//设定图片显示尺寸
var flag=false; 
function DrawImage(ImgD,w,h){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>= w/h){ 
    if(image.width>w){ 
      ImgD.width=w; 
      ImgD.height=(image.height*w)/image.width; 
    }else{ 
      ImgD.width=image.width; 
      ImgD.height=image.height; 
    } 
  }else{ 
    if(image.height>h){ 
      ImgD.height=h; 
      ImgD.width=(image.width*h)/image.height; 
    }else{ 
      ImgD.width=image.width; 
      ImgD.height=image.height; 
    } 
  } 
} 
}

function log_out()
{
	ht = document.getElementsByTagName("html");
	ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm('你确定要退出？'))
	{
		UrlPost("bbs/Login.asp?Menu=OUT");
	}
	else
	{
		ht[0].style.filter = "";
		return false;
	}
}
