<!--

document.write("<style type=text/css>.Xnc_Btn{Text-align: center;cursor: pointer;HEIGHT: 31px;WIDTH: 31px;}.Xnc_BtnMouseOverUp{border : 1px solid #3169C6;background-color : #C6D3EF;Text-align: center;cursor: pointer;HEIGHT: 31px;WIDTH: 31px;}</style>")


var EmotPage,AuPage,Board_Setting79;
var Board_Setting79 =1;
/******************************************************************************
* MagicEmot functions.                                                        *
******************************************************************************/
document.write('<Div id="Xnc_Emot" Style="POSITION:absolute;Z-INDEX: 99;"></Div>');
document.write('<script type="text/javascript" src="Xnc_Emot/MagicEmot/Me_Note.Js"><\/script>');

function DispMagicEmot(EmotID){
	MagicEmotUrl = "Xnc_Emot/MagicEmot/Swf/" + EmotID + ".swf";
	var obj = document.getElementById("Xnc_Emot");
		obj.innerHTML = '<Div style="padding:0;position:relative;"><Div style="padding:0;position:absolute;z-index:1;"><OBJECT codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="300"><PARAM NAME=movie VALUE="'+ MagicEmotUrl +'"><PARAM NAME=quality VALUE=high><PARAM NAME=play VALUE=true><param name="wmode" value="transparent"><embed src="' + MagicEmotUrl +'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="400" height="300"></embed></OBJECT></Div><img src="Xnc_Emot/blank.gif" style="padding:0;position:absolute;width:400;height:300;left:0;top:0;z-index:2;cursor:hand;" Onclick="document.getElementById(\'Xnc_Emot\').innerHTML=\'\';" Alt="点击隐藏魔法表情"  oncontextmenu="false"></Div>';
		obj.style.top = (document.body.scrollTop+((document.body.clientHeight-300)/2))+"px";
		obj.style.left = (document.body.scrollLeft+((document.body.clientWidth-400)/2))+"px";
		obj.style.display = 'inline';
	EmotID += Math.random();
	window.setTimeout('HideMagicEmot('+EmotID+')',8000);
	NowMeID = EmotID;
}

function HideMagicEmot(EmotID) {
	if(NowMeID == EmotID) {
		document.getElementById("Xnc_Emot").style.display = 'none';
		NowMeID = '';
	}
}

var MePage_Size			= 12;

//选择魔法表情
function Show_Xnc_MagicEmot(Page,Mode) {
	if(!Board_Setting79){
		alert("页面尚未载入完毕！");
	}else{
		if(Board_Setting79!="1"){
			alert("本版禁止使用魔法传情！");
		}else{

		if(!Mode&&Mode!=0) { Mode=1;}
		var MeItemCount			= Xnc_MagicEmot_ID[Mode].length-1;
		var MePage_Max			= MeItemCount/MePage_Size;
		
		if ((MeItemCount % MePage_Size)>0){MePage_Max = Math.floor(MePage_Max+1);}
			//if (MagicPage&&Page==0){Page=MagicPage;}
			if(Page==0){Page=1}

			MagicPage = Page;
			var ShowList = '';
			for (i = Page * MePage_Size - MePage_Size + 1;i <= (Page * MePage_Size);i++){
				if (i <= MeItemCount){
						ShowList = ShowList + '<img src="image/MagicEmot/Gif/' + Xnc_MagicEmot_ID[Mode][i] + '.gif" border="0" oncontextmenu="DispMagicEmot(\'' + Xnc_MagicEmot_ID[Mode][i] + '\');" Onclick="addsmile(\'\[magic' + Xnc_MagicEmot_ID[Mode][i] + '\]\');" style="cursor: hand;border:2px solid #666666;margin:1px 0 0 1px" title="' + Xnc_MagicEmot_Info[Mode][i] + '">'
				}
			}

			ShowList = '<table width="100%" height="60" border="0" cellspacing="1" cellpadding="1" Onselectstart="return false" oncontextmenu=self.event.returnValue=false><TR><TH height="22">' + Show_Xnc_MagicEmot_Class(Mode) + '<\/TH><\/TR><TR><TD>' + ShowList + '<\/TD><\/TR><TR><TD>&nbsp;[<font color="red">左键插入，右键播放</font>] ' + Xnc_PageJump('魔法表情',Xnc_MagicEmot_Class[Mode],'Show_Xnc_MagicEmot',MeItemCount,Page,MePage_Max,Mode) + '<\/TD><\/TR><\/table>'

			document.getElementById("emot").innerHTML = ShowList;
			Xnc_SetBtnMode(3);
		}
	}
}

function Show_Xnc_MagicEmot_Class(Mode) {
	var Classlist ='';
	
		for (i = 1;i <= MeClassCount;i++){
				if (i == Mode) {
					Classlist += '[ ' + Xnc_MagicEmot_Class[i] +' ] | ';
				}else{
					Classlist += '<A href="javascript:Show_Xnc_MagicEmot(1,' + i +')">'+Xnc_MagicEmot_Class[i] + '</A> | ';
				}
		}
		if (Mode == 0) {
			Classlist += '[ ' + Xnc_MagicEmot_Class[0] +' ]';
		}else{
			Classlist += '<A href="javascript:Show_Xnc_MagicEmot(1,' + 0 +')">'+Xnc_MagicEmot_Class[0] + '</A>';
		}
		return Classlist
}

//插入并累加到Cookie,创建常用类
function _inputMagicEmot(nID,sText){
	nIdCount = 12;	//设定常用类的数目
	sTlist   = Xnc_MagicEmot_ID[0].toString(0)+',';
	if(sTlist.indexOf(','+nID+',')== -1){
		sIDlist ='|'+ nID;
		ssaylist = '|' + sText;
	for (i = 1;i < nIdCount;i++){
		if(Xnc_MagicEmot_ID[0][i]){
			sIDlist += '|' + Xnc_MagicEmot_ID[0][i];
			ssaylist += '|' + Xnc_MagicEmot_Info[0][i];
		}
	}
	Xnc_MagicEmot_ID[0] = sIDlist.split("|");
	Xnc_MagicEmot_Info[0] =ssaylist.split("|");
	SetCookie("MagicEmot_ID",sIDlist);
	SetCookie("MagicEmot_Info",ssaylist);
	}
	putEmot('Magic' + nID);
}


/******************************************************************************
* End of MagicEmot functions.                                                 *
******************************************************************************/

/******************************************************************************
* Share functions.                                                           *
******************************************************************************/


//分页处理
function Xnc_PageJump(Typename,ClassType,Act,ItemCount,Page,MaxPage,Mode) {
	var PageList ='';
	if(Page > 1) {
		PageList = 	' <A href="javascript:' + Act+'(1,' + Mode + ')">1<\/A>';
	}

		if((Page-5)>1){
			PageList += '..'
			PageList += 	' <A href="javascript:' + Act+'(' + (Page-4) + ',' + Mode + ')">' + (Page-4) + '<\/A>';
			PageList += 	' <A href="javascript:' + Act+'(' + (Page-3) + ',' + Mode + ')">' + (Page-3) + '<\/A>';
			PageList += 	' <A href="javascript:' + Act+'(' + (Page-2) + ',' + Mode + ')">' + (Page-2) + '<\/A>';
			PageList += 	' <A href="javascript:' + Act+'(' + (Page-1) + ',' + Mode + ')">' + (Page-1) + '<\/A>';
		}else{
			for (i = 2;i < Page;i++){
				PageList += 	' <A href="javascript:' + Act+'(' + i + ',' + Mode + ')">' + i + '<\/A>';
			}
		}
		PageList += ' [<B>'+Page+'</B>]';
		if((MaxPage-4)>Page){
			PageList += 	' <A href="javascript:' + Act+'(' + (Page+1) + ',' + Mode + ')">' + (Page+1) + '<\/A>';
			PageList += 	' <A href="javascript:' + Act+'(' + (Page+2) + ',' + Mode + ')">' + (Page+2) + '<\/A>';
			PageList += 	' <A href="javascript:' + Act+'(' + (Page+3) + ',' + Mode + ')">' + (Page+3) + '<\/A>';
			PageList += '..'
		}else{
			for (i = (Page+1);i < MaxPage;i++){
				PageList += 	' <A href="javascript:' + Act+'(' + i + ',' + Mode + ')">' + i + '<\/A>';
			}
		}

	if(Page < MaxPage) {
		PageList += 	' <A href="javascript:' + Act +'(' +  MaxPage + ',' + Mode + ')">' + MaxPage + '<\/A>'
	}

	return ClassType + '类共 ' + ItemCount + ' 个' + Typename + '，分页：'+PageList;
}

function Xnc_PageList(Typename,Act,ItemCount,Page,MaxPage) {
	var PageList ='';
	if(Page > 1) {
		PageList = 	' <A href="javascript:' + Act+'(1)">1<\/A>';
	}

		if((Page-4)>1){
			PageList += '..'
			PageList += 	' <A href="javascript:' + Act+'(' + (Page-3) + ')">' + (Page-3) + '<\/A>';
			PageList += 	' <A href="javascript:' + Act+'(' + (Page-2) + ')">' + (Page-2) + '<\/A>';
			PageList += 	' <A href="javascript:' + Act+'(' + (Page-1) + ')">' + (Page-1) + '<\/A>';
		}else{
			for (i = 2;i < Page;i++){
				PageList += 	' <A href="javascript:' + Act+'(' + i + ')">' + i + '<\/A>';
			}
		}
		PageList += ' [<B>'+Page+'</B>]';
		if((MaxPage-5)>Page){
			PageList += 	' <A href="javascript:' + Act+'(' + (Page+1) + ')">' + (Page+1) + '<\/A>';
			PageList += 	' <A href="javascript:' + Act+'(' + (Page+2) + ')">' + (Page+2) + '<\/A>';
			PageList += 	' <A href="javascript:' + Act+'(' + (Page+3) + ')">' + (Page+3) + '<\/A>';
			PageList += 	' <A href="javascript:' + Act+'(' + (Page+4) + ')">' + (Page+4) + '<\/A>';
			PageList += '..'
		}else{
			for (i = (Page+1);i < MaxPage;i++){
				PageList += 	' <A href="javascript:' + Act+'(' + i + ')">' + i + '<\/A>';
			}
		}

	if(Page < MaxPage) {
		PageList += 	' <A href="javascript:' + Act +'(' +  MaxPage + ')">' + MaxPage + '<\/A>'
	}

	return '共' + ItemCount + '个' + Typename + '，分页：'+PageList;
}

/*初始化*/
function Xnc_Emot_init() {
	Xnc_SetBtnMode(3);
}

/*按钮样式控制*/
function Xnc_SetBtnMode(Mode){
	var MeBtn = document.getElementById("SetMe");

		switch(Mode) {
			case 3 :
				MeBtn.className="Xnc_BtnMouseOverUp";
				break;
		}
}


/******************************************************************************
* Cookie functions.                                                           *
******************************************************************************/
function SetCookie(sName, sValue){
	document.cookie = "Xnc_Emot" + sName + "=" + escape(sValue) + "; path=/; expires=Sun, 25 Oct 2099 23:59:59 UTC;";
}

function GetCookie(name) {
  var search;

  search = "Xnc_Emot" + name + "=";
  offset = document.cookie.indexOf(search) ;
  if (offset != -1) {
    offset += search.length ;
    end = document.cookie.indexOf(";", offset) ;
    if (end == -1)
      end = document.cookie.length;
    return unescape(document.cookie.substring(offset, end));
  }
  else
    return "";
}

function deleteCookie(name) {
	setCookie(name, "");
}
/******************************************************************************
* End of cookie functions.                                                    *
******************************************************************************/
-->