
// JavaScript Document
function bgChange(id)
{
for(i=1;i<9;i++)
{
   document.getElementById(i).className="";
   }
var menuId=id; 
document.getElementById(menuId).className="current";
} 



function nTabs(thisObj,Num){ 
if(thisObj.className == "active")return; 
var tabObj = thisObj.parentNode.id; 
var tabList = document.getElementById(tabObj).getElementsByTagName("li"); 
for(i=0; i <tabList.length; i++) 
{ 
if (i == Num) 
{ 
thisObj.className = "active"; 
document.getElementById(tabObj+"_Content"+i).style.display = "block"; 
}else{ 
tabList[i].className = "normal"; 
document.getElementById(tabObj+"_Content"+i).style.display = "none"; 
} 
} 
} 
function openWin(obj)
{
	if(obj.value!="")
	{
		window.open(obj.value);
	}
}
function show(n)    
{       
     var o = document.getElementById('title').getElementsByTagName("a");    
     var c = document.getElementById('content').getElementsByTagName("div");    
     for(i = 0; l = o.length, i < l; o[i].className = '',c[i].style.display = 'none',i++ );    
     o[n].className = 'over';    
     c[n].style.display = 'block';       
}   
function showOption(n,title,content,style)    
{       
     var o = document.getElementById(title).getElementsByTagName("a");    
     var c = document.getElementById(content).getElementsByTagName("div");    
     for(i = 0; l = o.length, i < l; o[i].className = '',c[i].style.display = 'none',i++ );    
     o[n].className = style;    
     c[n].style.display = 'block';       
}  
function chgtxt(s) {
	with (document.getElementById("thecharact").style) {
		if (""+fontSize == "") fontSize = "14px";
		if (s == "middle") fontSize = "14px";
		if (s == "small") {
			if ( parseInt(fontSize, 10) <= 12 )
				fontSize = (parseInt(fontSize, 10) - 1) +"px";
			else
				fontSize = "12px";
		}
		if (s == "big") {
			if ( parseInt(fontSize, 10) >= 16 )
				fontSize = (parseInt(fontSize, 10) + 2) +"px";
			else
				fontSize = "16px";
		}
		lineHeight = "150%";
	}
}

function checkComment() {
	if (document.formComment.cc_content.value == "")
	{
		alert ("不能发送空的评论内容");
		document.formComment.cc_content.focus();
		return false;

	}	
	else {
		if (document.formComment.cc_content.value.length > 500) {
			alert("评论内容包含" + formComment.cc_content.value.length + "个汉字或字母，请修改至500个以内！");
			formComment.cc_content.focus();
			return false;
		}
	}

	var len = document.formComment.cc_content.value.length;
	var str =  document.formComment.cc_content.value;
	var k = 0; 
	for(i=0; i<len;i++){
		 if(str.charAt(i)==" "||str.charAt(i)=="　"){
			k++;	
		}
    }
     if(len==k){
		alert ("不能发送空的评论内容");
		document.formComment.cc_content.focus();
		return false;

	}	
	if (document.formComment.cc_us_name.value == "")
	{
		document.formComment.cc_us_name.value = "网站浏览者";
	}
	wait();
	document.formComment.submit();

}
function wait(){
  try{
    document.all.function_buttons.innerHTML = "<p align='left'></br><b>系统正在</br>处理中，</br>请稍侯...</b></p>";  
  }catch(e){
  
  }
}
