﻿document.write("<script src=\'/scripts/command.js\'></\script>");
function addbq(str) 
{ 
	var TxtContent=document.getElementById("content"); 
	var TxtContentLength=TxtContent.value.length; 
	TxtContent.focus(); 
	if(typeof document.selection !="undefined") 
	{ 
		document.selection.createRange().text=str; 
	} 
	else 
	{ 
		TxtContent.value=TxtContent.value.substr(0,TxtContent.selectionStart)+str+TxtContent.value.substring(TxtContent.selectionStart,TxtContentLength); 
	} 
}
function onShowtemt(){			
	if (document.getElementById('temt').value != ''){
		document.getElementById('showtemt').innerHTML='<img src=\"images\/gbooktemt\/' + document.getElementById('temt').value + '.gif\" />';}
	else{
		document.getElementById('showtemt').innerHTML='';
	}
} 
function onShowface(){			
	if (document.getElementById('uface').value != ''){
		document.getElementById('showface').innerHTML='<img src=\"images\/gbookface\/' + document.getElementById('uface').value + '.jpg\" />';}
	else{
		document.getElementById('showface').innerHTML='';
	}
} 
//跳转页面显示
function ad_cutPage(url,TotalPage,PageIndex,detNum,pagePaName){
	document.write("<form onsubmit=\"return false;\"><a class=\'MultiPages\'>"+PageIndex+"/"+TotalPage+"</a>");
	var showLend;
	var Biaozhun;
	Biaozhun = parseInt(detNum / 2);
	if(url.indexOf("?")==(-1)){
			showLend="?";
	}
	else
	{
			showLend="&";
	}
	if (PageIndex<(Biaozhun + 1)) {
		PageLong=detNum + 1 -PageIndex;
	}
	else
		if (TotalPage-PageIndex<(Biaozhun + 1)) {
			PageLong= detNum -(TotalPage-PageIndex)
		}
		else {
			PageLong=Biaozhun;
		}
	for (var i=1; i <= TotalPage; i++) {
		if (i < PageIndex+PageLong && i > PageIndex-PageLong || i==1 || i==TotalPage){
			if (PageIndex==i) {
				document.write("<a class=curpage>"+ i +"</a>");
			}
			else {
				document.write("<a class=uncurpage href="+url+showLend+""+ pagePaName +"="+i+">"+ i +"</a>");
			}
		}
	}
	document.write("<input onkeydown=if((event.keyCode==13)&&(this.value!=''))window.location=\""+url+showLend+pagePaName+"=\"+this.value+\"\"; onkeyup=if(isNaN(this.value))this.value='' class=PageInput></form>");
}

function showflash(swfurl,swfwidth,swfheight,sValue){
        document.writeln("<object id=\"FlashID\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+ swfwidth +"\" height=\""+ swfheight +"\">");
        document.writeln("  <param name=\"movie\" value=\""+ swfurl +"\" />");
        document.writeln("  <param name=\"quality\" value=\"high\" />");
        document.writeln("  <param name=\"wmode\" value=\""+ sValue +"\" />");
        document.writeln("  <param name=\"swfversion\" value=\"8.0.35.0\" />");
        document.writeln("  <!--[if !IE]>-->");
        document.writeln("  <object type=\"application/x-shockwave-flash\" data=\""+ swfurl +"\" width=\""+ swfwidth +"\" height=\""+ swfheight +"\">");
        document.writeln("    <param name=\"quality\" value=\"high\" />");
        document.writeln("    <param name=\"wmode\" value=\""+ sValue +"\" />");
        document.writeln("    <param name=\"swfversion\" value=\"8.0.35.0\" />");
        document.writeln("  </object>");
        document.writeln("  <!--<![endif]-->            ");
        document.writeln("</object> ");
}

// 修复 IE 下 PNG 图片不能透明显示的问题
function fixPNG(myImage) {
var arVersion = navigator.appVersion.split("MSIE");
var version = parseFloat(arVersion[1]);
 if ((version >= 5.5) && (version < 7) && (document.body.filters))
{
    var imgID = (myImage.id) ? "id='" + myImage.id + "' " : "";
    var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : "";
    var imgTitle = (myImage.title) ? "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' ";
    var imgStyle = "display:inline-block;" + myImage.style.cssText;
    var strNewHTML = "<span " + imgID + imgClass + imgTitle

   + " style=\"" + "width:" + myImage.width

   + "px; height:" + myImage.height

   + "px;" + imgStyle + ";"

   + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"

   + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>";
    myImage.outerHTML = strNewHTML;
} } 

function displaySubMenu(li) {
var subMenu = li.getElementsByTagName("ul")[0];
subMenu.style.display = "block";
}
function hideSubMenu(li) {
var subMenu = li.getElementsByTagName("ul")[0];
subMenu.style.display = "none";
}


function ShowMenu(MenuID) 
{ 
	if(MenuID.style.display=="none"){ 
		MenuID.style.display="";
		} 
	else 
	{ 
		MenuID.style.display="none";

	} 
} 

//选项卡切换
function ShowLayers(obj,n){
	var titparent=obj.parentNode; 
	var tempa=titparent.getElementsByTagName('a')
	for(i=0;i<tempa.length;i++){
		tempa[i].className='';
	}
	obj.className='on';
	
	var parentdiv=obj.parentNode.parentNode.parentNode;
	var cotdiv=parentdiv.childNodes;
	for(i=0;i<cotdiv.length;i++){
	  if (cotdiv[i].getAttribute('class')=='cot'){
		  cotdiv[i].style.display='none';
	  }			
	}		  
	cotdiv[n].style.display='';
}
function killerrors() {
        return true;
}
window.onerror = killerrors;
/*window.onload=function (){
	var fuHeight = document.getElementById("subfu").offsetHeight;
	var mainHeight = document.getElementById("submain").offsetHeight;
	if (fuHeight < mainHeight && fuHeight != "underfine" && mainHeight != "underfine" ){
		document.all["subfu"].style.height = mainHeight;
	}
}*/