//Hide JS Error
//function killErrors() {
//return true;
//}
//window.onerror = killErrors;
//
function doZoom(size){
document.getElementById('zoom').style.fontSize=size+'px'
}
var NS4 = (document.layers);
var IE4 = (document.all);
var win = window;
var n   = 0;
function findIt() {
if (searchstr.value != "")
findInPage(searchstr.value);
}
var flag=true;
function DrawImage(ImgD){ 
    var image=new Image(); 
    image.src=ImgD.src; 
    if(image.width>0 && image.height>0){ 
        flag=true;
        if(image.width>=700){
            ImgD.width=700;
            ImgD.height=(image.height*700)/image.width;
        }else{
            ImgD.width=image.width;
            ImgD.height=image.height; 
        }
    }
}
function ContentImage(ImgD){
    var image=new Image();
    image.src=ImgD.src;
    if(image.width>0 && image.height>0){
        flag=true;
        if(image.width>=500){ 
            ImgD.width=500; 
            ImgD.height=(image.height*500)/image.width; 
        }else{ 
            ImgD.width=image.width;
            ImgD.height=image.height;
        }
    }
}
//鼠标中键缩放图片
function cgimg(o){
//var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
return false;
}
//双击自动滚屏
//var currentpos,timer; 
//function initialize() 
//{ 
//timer=setInterval("scrollwindow()",10);
//} 
//function sc(){
//clearInterval(timer); 
//}
//function scrollwindow() 
//{ 
//currentpos=document.body.scrollTop; 
//window.scroll(0,++currentpos); 
//if (currentpos != document.body.scrollTop) 
//sc();
//} 
//document.onmousedown=sc
//document.ondblclick=initialize
function gbcount(message,total,used,remain)
{
	var max;
	max = total.value;
	if (message.value.length > max) {
		message.value = message.value.substring(0,max);
		used.value = max;
		remain.value = 0;
		alert("留言不能超过" +max+ "个字!");
		}
	else {
		used.value = message.value.length;
		remain.value = max - used.value;
		}
}
function showsubmenu(sid)
{
whichel = eval("submenu" + sid);
	if (whichel.style.display == "none")
	{
	eval("submenu" + sid + ".style.display='';");
	}
	else
	{
	eval("submenu" + sid + ".style.display='none';");
	}
}
//Ajax会员注册名检查
var xmlHttp = false;
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}
function updatePage() {
  if (xmlHttp.readyState < 4) {
	AllowName.innerHTML="";
  }
  if (xmlHttp.readyState == 4) {
    var response = xmlHttp.responseText;
	AllowName.innerHTML=response;
  }
}
function callServer() {
  var username2 = document.getElementById("username2").value;
  if ((username2 == null) || (username2 == "")) return;
  var url = "Ft_CheckName.asp?username=" + escape(username2);
  xmlHttp.open("GET", url, true);
  xmlHttp.onreadystatechange = updatePage;
  xmlHttp.send(null);
}
function callServeremail() {
  var email2 = document.getElementById("email").value;
  if ((email2 == null) || (email2 == "")) return;
  var url = "Ft_CheckName.asp?email=" + escape(email2);
  xmlHttp.open("GET", url, true);
  xmlHttp.onreadystatechange = updatePageemail;
  xmlHttp.send(null);
}
function updatePageemail() {
  if (xmlHttp.readyState < 4) {
	AllowName.innerHTML="";
  }
  if (xmlHttp.readyState == 4) {
    var response = xmlHttp.responseText;
	AllowEmail.innerHTML=response;
  }
}
//提交按钮检查
function checkform()
{
document.addremark.submit.disabled=true;
document.addremark.submit.value="已提交";
return true;
}
//让文本框运行代码
function runEx(cod1)
{
  cod=document.all(cod1);
  var code=cod.value;
  if (code!="")
  {
  var newwin=window.open('','',''); 
  newwin.opener = null;
  newwin.document.write(code);
  newwin.document.close();
  }
}
//复制文本域代码
function cycode(obj) {
	var rng = document.body.createTextRange();
	rng.moveToElementText(obj);
	rng.scrollIntoView();
	rng.select();
	rng.execCommand("Copy");
	window.status="高亮度包含的代码已被复制到剪贴板！Contents highlighted and copied to clipboard!"
	setTimeout("window.status=''",1800)
	rng.collapse(false);
}
//另存代码
function svcode(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();
}
//以下为横向二级菜单所添加的JS
var tID = "nav1";
function showmenuline(ID){
  if(ID!=tID){
	var IDObj = document.getElementById( ID );
	var tIDObj = document.getElementById( tID );
	var IDObj_content = document.getElementById( ID + "_" );
	var tIDObj_content = document.getElementById( tID + "_" );
    	IDObj.className='nav_link_02';
    	tIDObj.className='nav_link_01';
  	tIDObj_content.style.display='none';
  	IDObj_content.style.display='';
    	tID=ID;
  }
}
function pop(pageurl)
{
var
popwin=window.open(pageurl,"popWin","scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,width=520,height=320");
return false;
}
