﻿//标签浏览
function Show_Tab(ThisID,ThisID_TabCounts,ThisID_TabOrders)
{
	for(var i=0;i<ThisID_TabCounts;i++)
	{
		document.getElementById("Tab_Content_"+ThisID+i).style.display="none";
	}
	document.getElementById("Tab_Content_"+ThisID+ThisID_TabOrders).style.display="block";
	
	for(var i=0;i<ThisID_TabCounts;i++)
	{
		document.getElementById("Tab_Menu_"+ThisID+i).className="MenuOff";
	}
	document.getElementById("Tab_Menu_"+ThisID+ThisID_TabOrders).className="MenuOn";
}

//友情链接弹出窗口
function GotoLink(selectControl)
{
	var v = selectControl.value;
	if (v != "")
	{
		window.open(v);
		selectControl.blur();
	}
	selectControl.selectedIndex=0;
}

//首页图片新闻
function IndexPic(pics_from,texts_from,links_from)
{
	var focus_width=280;
	var focus_height=210;
	var text_height=23;
	var swf_height = focus_height+text_height;

	var pics=pics_from;
	var texts=texts_from;
	var links=links_from;

	var IndexPicContent;
	IndexPicContent='<object ID="IndexPic_flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">';
	IndexPicContent=IndexPicContent+'<param name="allowScriptAccess" value="sameDomain">';
	IndexPicContent=IndexPicContent+'<param name="movie" value="JS/IndexPic.swf">';
	IndexPicContent=IndexPicContent+'<param name="quality" value="high">';
	IndexPicContent=IndexPicContent+'<param name="bgcolor" value="#FFFFFF">';
	IndexPicContent=IndexPicContent+'<param name="menu" value="false">';
	IndexPicContent=IndexPicContent+'<param name=wmode value="opaque">';
	IndexPicContent=IndexPicContent+'<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">';
	
	IndexPicContent=IndexPicContent+'<embed ID="IndexPic_flash" allowScriptAccess="sameDomain" src="JS/IndexPic.swf" wmode="opaque" '
	IndexPicContent=IndexPicContent+'quality="high" bgcolor="#FFFFFF" menu="false" '
	IndexPicContent=IndexPicContent+'width="'+ focus_width +'" height="'+ swf_height +'" '
	IndexPicContent=IndexPicContent+'FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" '
	IndexPicContent=IndexPicContent+'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'; 
	IndexPicContent=IndexPicContent+'</object>';

	document.getElementById("IndexPicZone").innerHTML=IndexPicContent;
}

//引用评论
function replyTo(commentID,author,posttime,commentcontent) {
var inReplyTo='[Quote][QuoteTitle]以下引用['+author+']发表于'+posttime+'的评论: [/QuoteTitle]'+commentcontent+'[/Quote]\n';
	var myField;
		if (document.getElementById('CommentContent') && document.getElementById('CommentContent').type == 'textarea') {
		myField = document.getElementById('CommentContent');
	} else {
		return false;
	}
	if (document.selection) {
		myField.focus();
		sel = document.selection.createRange();
		sel.text = inReplyTo;
		myField.focus();
	}
	else if (myField.selectionStart || myField.selectionStart == '0') {
		var startPos = myField.selectionStart;
		var endPos = myField.selectionEnd;
		var cursorPos = endPos;
		myField.value = myField.value.substring(0, startPos)
						+ inReplyTo
						+ myField.value.substring(endPos, myField.value.length);
		cursorPos += inReplyTo.length;
		myField.focus();
		myField.selectionStart = cursorPos;
		myField.selectionEnd = cursorPos;
	}
	else {
		myField.value += inReplyTo;
		myField.focus();
	}
}