﻿function showhidediv(id,openclose){
try{
if(document.getElementById(id)){
if(document.getElementById(id).style.display=='none'){
	document.getElementById(id).style.display='block';
	openclose.className="upArrow"
}else{
	document.getElementById(id).style.display='none';
	openclose.className="downArrow"
}
}
}catch(e){}
} 

/*//以下是实现复制的代码
function $(id)
{
	return document.getElementById(id);
}

//复制文本
function copyIdText(id)
{
  copy( $(id).innerText,$(id) );
}
function copyIdHtml(id)
{
  copy( $(id).innerHTML,$(id) );
}

function copy(txt,obj)
{
   if(window.clipboardData) 
   {
      window.clipboardData.clearData();        
      window.clipboardData.setData("Text", txt);
      alert("复制成功！")
      if(obj.style.display != 'none'){
      var rng = document.body.createTextRange();
      rng.moveToElementText(obj);
      rng.scrollIntoView();
      rng.select();
      rng.collapse(false);  
      }
   }
   else
   {
      var flashcopier = 'flashcopier';
      if(flashcopier==null) {
			var divholder = document.createElement('div');
			flashcopier=document.createElement('div');
			divholder.id = flashcopier;
			document.body.appendChild(divholder);
      }

      $(flashcopier).innerHTML = '<embed src="http://www.wilf.cn/image/clipboard.swf" FlashVars="clipboard='+encodeURIComponent(txt)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
      alert("Firefox下仅支持文章链接复制！")
		}
}

//运行代码
function runEx(cod1)  {
	 cod=document.getElementById(cod1)
	  var code=cod.value;
	  if (code!=""){
		  var newwin=window.open('','','');  
		  newwin.opener = null 
		  newwin.document.write(code);  
		  newwin.document.close();
	}
}

//另存代码
function doSave(obj) {
	var winname = window.open('', '_blank', 'top=10000');
	winname.document.open('text/html', 'replace');
	winname.document.writeln(obj.value);
	winname.document.execCommand('saveas','','code.htm');
	winname.close();
}

//<![CDATA[
var goto_top_type = -1;
var goto_top_itv = 0;

function goto_top_timer()
{
var y = goto_top_type == 1 ? document.documentElement.scrollTop : document.body.scrollTop;
var moveby = 15;

y -= Math.ceil(y * moveby / 100);
if (y < 0) {
y = 0;
}

if (goto_top_type == 1) {
document.documentElement.scrollTop = y;
}
else {
document.body.scrollTop = y;
}

if (y == 0) {
clearInterval(goto_top_itv);
goto_top_itv = 0;
}
}

function goto_top()
{
if (goto_top_itv == 0) {
if (document.documentElement && document.documentElement.scrollTop) {
goto_top_type = 1;
}
else if (document.body && document.body.scrollTop) {
goto_top_type = 2;
}
else {
goto_top_type = 0;
}

if (goto_top_type > 0) {
goto_top_itv = setInterval('goto_top_timer()', 50);
}
}
}
//]]>*/

/*//say no to ie6
var IE6 = (navigator.userAgent.indexOf("MSIE 6")>=0) ? true : false;
if(IE6){
	window.attachEvent("onload", function(){
		var now = new Date();
		var time = now.getTime();
		var div = document.createElement('a');
		var id = 'saynotoie6_div_' + time;
		div.setAttribute('id',id);
		div.setAttribute('href','http://www.savethedevelopers.org/');
		div.setAttribute('target','_blank');
		div.style.display = 'block';
		div.style.color = '#1d1d1d';
		div.style.textAlign = 'left';
		div.style.fontFamily = 'Arial,sans-serif';
		div.style.fontSize = '11px';
		div.style.background = 'url(http://www.wilf.cn/image/popDown.gif)';
		div.style.padding = '0';
		div.style.position = 'absolute';
		div.style.top = '0';
		div.style.right = '40px';
		div.style.zIndex = '999999';
		div.style.width = '330px';
		div.style.height = '63px';
		div.style.marginTop = '-80px';
		div.style.filter = 'alpha(opacity=95)';
		document.body.appendChild(div);
		
		var stdorg_animate = function(){
			var myDiv = document.getElementById(id);
			var value = parseInt(myDiv.style.marginTop);
			myDiv.style.marginTop = value + 1 + 'px';
			if(parseInt(myDiv.style.marginTop) < -1){
				var timer = setTimeout(stdorg_animate,30 * 80/Math.abs(value) * .27);
			}else{
				var timer = setTimeout(stdorg_hide,5000);
			}
		};
		
		var stdorg_hide = function(){
			var myDiv = document.getElementById(id);
			var value = parseInt(myDiv.style.marginTop);
			myDiv.style.marginTop = value - 1 + 'px';
			if(parseInt(myDiv.style.marginTop) > -80){
				var timer = setTimeout(stdorg_hide,1.4 * 80/Math.abs(value) * 3.70);
			}
		};
		
		setTimeout(stdorg_animate,1000);
	});
}*/
