var	doubleclickord=Math.random()*1000000000;
var imageServer="http://image.eet-china.com/";
var forumServer="http://forum.eet-cn.com/";
var serverName="http://www.eet-china.com/";
function s_chg(model)
{
	if (IsHomePage){
		document.getElementById('lc').innerHTML = '<span class="element1"><INPUT id=keyword name=keyword type=text size="50"></span>';
	}else{
		document.getElementById('lc').innerHTML = '<span class="element1"><b>分类：</b></span><span class="element1" id=dropdownsearch></span>'+
												  '<span class="element1"><b>关键词：</b></span>'+ 	 										  	  
	 										      '<span class="element1"><INPUT id=keyword type=text name=keyword ></span>';		
	}
	document.getElementById('btn1').innerHTML = '<span class="element1"><input name="image" type="image" src="'+imageServer+'search.gif" align="absmiddle"></span>'+	  
	  											'<span class="element1"><a id=searchhref href="'+imageServer+'advanced-search!default.jspa">高级搜索</a>|<a id=helphref href="'+forumServer+'STATIC/SITE/KEYWHELP.HTM" >帮助</a></span>';
	var tmpS=document.getElementById('dropdownsearch');
	if (tmpS){
		tmpS.innerHTML=WriteCustomDropdownList(selectTypeArray,'select',selectVal);
	}
}
function selectCategory(forumID) {
	window.location.replace('FORUM_LIST_'+forumID+'_0.HTM');
}
function forwardDownloadPage(alink, downloadTimes, icon, fileName, subject,thisPageUrl) {
    var downloadForm = document.getElementById("downloadForm");
    var href = alink.href;
    if(href.indexOf("pageUserId=-1") > -1) { 
    //var domain = href.substring(0, href.indexOf("/", 7)).replace("forum", "www");
    //window.location = domain + "/login.do?fromWhere="+thisPageUrl;
    login(thisPageUrl);
    return false;
    } else {
        downloadForm.href.value = href;
        downloadForm.downloadTimes.value = downloadTimes;
        downloadForm.icon.value = icon;
        downloadForm.fileName.value = fileName;
        downloadForm.subject.value = subject;
        downloadForm.submit();
    }
    return false;
}	
function popWin(newURL,wth,hgh)
{
	window.open(newURL,'','width='+wth+',height='+hgh+',left=70,top=130,scrollbars=yes');
}
<!--
function NewWin(newURL,wth,hgh)
{
	window.open(newURL,'','width='+wth+',height='+hgh+',left=70,top=130,scrollbars=yes');
}
function checkns4() {
	if (document.layers) {
		document.write("<style>");	
		document.write("BODY { margin-left: 2px }");
		document.write("</style>");
	}
}
checkns4();
NS4 = (document.layers);
IE4 = (document.all);
ver4 = (IE4);  
isMac = (navigator.appVersion.indexOf("Mac") != -1);
isMenu = (IE4 && !isMac); 
function popUp(){return};
function popDown(){return};
function startIt(){return};
if (!ver4) event=null;
//-->
var selectTypeArray =new  Array();
selectTypeArray.push('技术文章+WENKU');
selectTypeArray.push('新品+XINZHI');
selectTypeArray.push('新闻+XINWEN');
selectTypeArray.push('实例+SHILI');
selectTypeArray.push('小组+XIAOZU');
selectTypeArray.push('论坛+LUNTAN');
selectTypeArray.push('博客+BOKE');
selectTypeArray.push('研讨会+YANTAOHUI');
selectTypeArray.push('辞典+CIDIAN');
var IsHomePage=false;
var searchModel = 'globalsources';
var selectVal = 'LUNTAN';

var pollTypePost=400;
var blog=31;
function vote(pollForm,option,pollId,objectId)
{
	var action = "/ajaxVote.jspa";
	var pars ="pollId="+pollId+"&option="+option+"&objectId="+objectId;		
	var myAjax = new Ajax.Request(action,{method: 'post', parameters: pars, onComplete: updatePage} );
}
function updatePage(xmlHttp) 
{
	if (xmlHttp.readyState == 4) 
	{
	  	if (xmlHttp.status == 200) 
	  	{	
	  		var xmlobj = xmlHttp.responseXML;
	  		var status = xmlobj.getElementsByTagName("result")[0].getElementsByTagName("status")[0].firstChild.data;
			var objectType= xmlobj.getElementsByTagName("result")[0].getElementsByTagName("objectType")[0].firstChild.data;
			var objectId = xmlobj.getElementsByTagName("result")[0].getElementsByTagName("objectId")[0].firstChild.data;
			var optionCount = xmlobj.getElementsByTagName("result")[0].getElementsByTagName("count")[0].getElementsByTagName("optionCount")[0].firstChild.data;
			var totalCount = xmlobj.getElementsByTagName("result")[0].getElementsByTagName("count")[0].getElementsByTagName("totalCount")[0].firstChild.data;
			if(status == "alreadyVoted")
			{
				alert('您已经进行了投票。');
				return;
			}
			else if(status =="succVoted")
			{
				alert('您的投票已记录，谢谢您的参与');
			}
			else if(status=="postOwner")
			{
				alert('您不能对自己发表的帖子进行投票');
				return;
			}
			else if(status=="blogOwner")
			{
				alert('您不能对自己发表的文章进行投票');
				return;
			}
			else 
			{
				alert('系统发生错误。请联系系统管理员。');
				return;
			}
			if(objectType==pollTypePost)
			{			
				for(var i=0;i<optionCount;i++)
				{
					var count = xmlobj.getElementsByTagName("result")[0].getElementsByTagName("count")[0].getElementsByTagName("voteCount"+i)[0].firstChild.data;
					document.getElementById(objectId+"_"+i).innerHTML = count;
				}
			}else if(objectType==blog){
				var count = xmlobj.getElementsByTagName("result")[0].getElementsByTagName("count")[0].getElementsByTagName("voteCount0")[0].firstChild.data;
				document.getElementById("cnt").innerHTML = count;
			}
		}
  	}
}	 
function saveProperty(threadId) {
	var styleClass=document.getElementById('titleColor').value
	var  bold="";
	if(document.getElementById("boldfaced").checked == true)
	{
		bold="Y";
	}
	window.location.href="EditStyle.jspa?styleContent="+styleClass+"&threadId="+threadId+"&bold="+bold;
}
function operate(newURL,wth,hgh)
{
	if(window.opener==null)
	{
		window.open(newURL,'','width='+wth+',height='+hgh+',left=70,top=130,scrollbars=yes');
	}
	else
	{
		window.location.href=newURL;	
	}
}
function gotoDownLoad(newURL,wth,hgh)
{
	if(window.opener==null)
	{
		window.open(newURL,'','width='+wth+',height='+hgh+',left=70,top=130,scrollbars=yes');
	}
	else
	{
		window.location.href=newURL;	
	}
}
function onQuickReplySubmit(action){			
	//document.getElementById("doQuickReplyButton").onclick = "javascript:quickreplied()";
	document.postform.action.value=action;
	//document.postform.content.value = editor.getHTML();
	document.postform.submit();
}		
function quickreplied(){
	return;
}
function setEntryToTop(entry_id){
	if (window.confirm("是否确定置顶文章？"))
	{
		window.location.href="set_entry_to_top.jspa?entry_id="+entry_id;
	}
}
function unsetEntryToTop(entry_id){
	if (window.confirm("是否确定取消置顶文章？"))
	{
		window.location.href="set_entry_to_top!unset.jspa?entry_id="+entry_id;
	}
}
function delEntry(entry_id){
		if (window.confirm("是否确定删除文章？"))
		{
			window.location.href="del_entry.jspa?entry_id="+entry_id;
		}
}
function approveEntry(entry_id){
		if (window.confirm("是否确定批准文章？"))
		{
			window.location.href="auth_blogContent.jspa?entryId="+entry_id;
		}
}
function delAttach(attach_id,blog_id,attach_desc){
		if (window.confirm("是否确定删除文档"+attach_desc+"？"))
		{
			window.location.href="del_attach.jspa?attachment_id="+attach_id+"&blog_id="+blog_id;
		}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function delComment(comment_id){
	if (window.confirm("是否确定删除评论？")){
		//	alert("Testing");
		window.location.href="del_comment.jspa?comment_id="+comment_id;
	}
}

function apprComment(comment_id,entry_id){
	if (window.confirm("是否批准此评论？")){
		window.location.href="approve_comment.jspa?comment_id="+comment_id+"&entry_id="+entry_id;
	}
}
function doSubmit(val){
	document.threadflatform.approve.value = val;
	document.threadflatform.submit();
}
var on1 = false;
function isEnglish(name){
	if(name.length == 0){
		return false;
	}
	for(i = 0; i < name.length; i++) {
		if(name.charCodeAt(i) > 128)
		return false;
	}
	return true;
}
function isMail(name){ 
	if(!isEnglish(name)){
		return false;
	}
	i = name.indexOf("@");
	j = name.lastIndexOf("@");
	if(i == -1){
		return false;
	}
	if(i != j){
		return false;
	}
	if(i == name.length){
		return false;
	}
	return true;
}
function doEmail(frm){
	if(! isMail(frm.toEmail.value)) {
		alert("您的电子邮件不合法！");
		frm.toEmail.focus();
		return false;
	}
	if(frm.toUser.value.lehgth == 0||frm.toUser.value == null){
		alert("请输入收件人名称!");
		frm.toUser.focus();
		return false;
	}
	frm.action=forumServer+"topicPK!email.jspa";
	frm.submit();
}

function sendSubmit(formName)
{
	var url ="POLL_VOTE_"+formName.pollID.value+"_"+formName.option.value+".HTM";
	OpenWin(url,500,400);
	return false;
}
function doLogin(){
	document.invite1.action=serverName+"login.do";
	document.invite1.submit();	 
}

function checkForm(frm) {
	if (frm.body.value.length>500){
		alert("输入文字大于500!");
		frm.body.focus();
		return false;
	}else if(frm.body.value.length == 0){
		alert("请输入内容!");
		frm.body.focus();
		return false;
	}
	return true;			
}

function doPost(frm){	
	if(!checkForm(frm)){
		frm.body.focus();
		return false;
	}
	frm.action=forumServer+"topicPK!post.jspa";
	frm.submit();		
}


function doScript(url) {
    window.location = url;
    return;
}

// For EETA blog homepage
// SwitchTabs
/*
	EXAMPLE:
		var tabInfoForSwitch={
			objname:"tabInfoForSwitch",
			autoTimeInterval:5000,
			menuActiveClass:"active",
			menuSlientClass:"silent",
			element:[
				{menuId:"cecT",contentId:"cecN"},
				{menuId:"elT",contentId:"elN"}
			]
		};
		switchTabs.init(tabInfoForSwitch);
*/
var switchTabs = {
	current:0,
	autoSwitch:0
}
switchTabs.init = function(obj){
	for(var i=0; i < obj.element.length; i++){
		$(obj.element[i].menuId).onmouseover = new Function("switchTabs.pauseSwitch(); switchTabs.change("+i+","+obj.objname+");");
		$(obj.element[i].menuId).onmouseout = new Function("switchTabs.auto("+obj.objname+");");
		
		$(obj.element[i].contentId).onmouseover = new Function("switchTabs.pauseSwitch();");
		$(obj.element[i].contentId).onmouseout = new Function("switchTabs.auto("+obj.objname+");");
	}
	switchTabs.auto(obj);
}
switchTabs.pauseSwitch = function(){
	clearInterval(switchTabs.autoSwitch);
}
switchTabs.auto = function(obj){
	clearInterval(switchTabs.autoSwitch);
	switchTabs.autoSwitch = setInterval(function(){
		switchTabs.change(switchTabs.current === (obj.element.length-1)?0:switchTabs.current+1,obj);
	},obj.autoTimeInterval);
}
switchTabs.change = function(index,obj){
	switchTabs.current = index;
	for(var j=0; j < obj.element.length; j++){
		if(j === index){
			$(obj.element[j].menuId).removeClassName(obj.menuSlientClass);
			$(obj.element[j].menuId).addClassName(obj.menuActiveClass);
			$(obj.element[j].contentId).style.display = "block";
		} else {
			$(obj.element[j].menuId).removeClassName(obj.menuActiveClass);
			$(obj.element[j].menuId).addClassName(obj.menuSlientClass);
			$(obj.element[j].contentId).style.display = "none";
		}
	}
}



// Switch image news
var swtichNews={
	current:0,
	autoScroller:0,
	scrollInterval:0
}
swtichNews.turn=function(index,obj){
	clearInterval(swtichNews.autoScroller);
	swtichNews.scroll(index,obj);
}
swtichNews.init = function(obj){
	$(obj.imgContent).onmouseover = new Function("swtichNews.pauseSwitch();") ;		
	$(obj.imgContent).onmouseout = new Function("swtichNews.auto("+obj.objname+");");
	
	for (i=0;i<obj.totalcount;i++) {	
		if(obj.numPre!=null && obj.numPre!="") {
		 $(obj.numPre+"_"+i).onmouseover = new Function("swtichNews.turn("+i+","+obj.objname+");swtichNews.pauseSwitch();") ;		
		 $(obj.numPre+"_"+i).onmouseout = new Function("swtichNews.auto("+obj.objname+");") ;	
		}
	}
	
	swtichNews.auto(obj);
}
swtichNews.auto = function(obj){
	clearInterval(swtichNews.autoScroller);
	swtichNews.autoScroller=setInterval(function(){
		swtichNews.scroll(swtichNews.current===(obj.totalcount-1)?0:swtichNews.current+1,obj);
	},obj.autoTimeInterval);
}
swtichNews.pauseSwitch = function() {
	clearInterval(swtichNews.autoScroller);
}
swtichNews.scroll = function(index,obj){
	
	var W=swtichNews;
	if(index==W.current){
		return;
	}
	
	var count=0;
	var duration=20;
	
	var imgHeight = obj.imgHeight;
	var spanNum = index-W.current;
	var begin_value=$(obj.imgContent).scrollTop;
	
	var chang_in_value=spanNum*imgHeight+(W.current*imgHeight-begin_value);

	clearInterval(W.scrollInterval);
	for(var i=0;i<obj.totalcount;i++){
		if(i === index){
			$(obj.numPre+"_"+i).addClassName(obj.selectedStyle);
		} else {
			$(obj.numPre+"_"+i).removeClassName(obj.selectedStyle);
		}
	}
	
	W.scrollInterval=setInterval(function(){doit(begin_value,chang_in_value)},10);
	function doit(b,c){
		$(obj.imgContent).scrollTop=cpu(count,b,c,duration);
		count++;
		if(count==duration){
			clearInterval(swtichNews.scrollInterval);
			scrollInterval=0;
			count=0;
			$(obj.imgContent).scrollTop=b+c;
			swtichNews.current=index;
		}
	}
	function cpu(t,b,c,d) {return c*((t=t/d-1)*t*t+1)+b;};
}

function trackJumpTo(code){
	var trackUrl = '/images/blank.gif?jumpto='+code+'_'+ new Date().getTime();
	(new Image()).src=trackUrl;
}

function trackUserAction(userAction){
	var trackUrl = '/images/blank.gif?user_action='+userAction+'&'+ new Date().getTime();
	(new Image()).src=trackUrl;
}

function goSearchList(frm,catId,forumId) {
	var url = '/FORUM_LIST_'+catId+'_'+forumId+'_0_' + frm.navi_view.value + '-' + frm.navi_sort.value + '-' + frm.navi_order.value + '.HTM';
	window.location.href = url;
}

function GS_DateAdd(interval,number,date){
	number = parseInt(number);
	if (typeof(date)=="string"){var date = new Date(date.split("-")[0],date.split("-")[1],date.split("-")[2])}
	if (typeof(date)=="object"){var date = date}
	switch(interval){
	case "y":return new Date(date.getFullYear()+number,date.getMonth(),date.getDate()); break;
	case "m":return new Date(date.getFullYear(),date.getMonth()+number,checkDate(date.getFullYear(),date.getMonth()+number,date.getDate())); break;
	case "d":return new Date(date.getFullYear(),date.getMonth(),date.getDate()+number); break;
	case "w":return new Date(date.getFullYear(),date.getMonth(),7*number+date.getDate()); break;
	}
	}
	function checkDate(year,month,date){
	var enddate = ["31","28","31","30","31","30","31","31","30","31","30","31"]; 
	var returnDate = "";
	if (year%4==0){enddate[1]="29"}
	if (date>enddate[month]){returnDate = enddate[month]}else{returnDate = date}
	return returnDate;
	}

	function WeekDay(date){
	var theDate;
	if (typeof(date)=="string"){theDate = new Date(date.split("-")[0],date.split("-")[1],date.split("-")[2]);}
	if (typeof(date)=="object"){theDate = date}
	return theDate.getDay();
	}
	function GS_calender(){
	var lis = "";
	var style = "";
	style +="<style type='text/css'>";
	style +=".calender { width:170px; height:auto; font-size:12px; margin-right:14px; background:#fff; border:1px solid #397EAE; padding:1px;overflow:hidden;}";
	style +=".calender ul {list-style-type:none; margin:0; padding:0;}";
	style +=".calender .day { background-color:#EDF5FF; height:20px;}";
	style +=".calender .day li,.calender .date li{ float:left; width:14%; height:20px; line-height:20px; text-align:center}";


	style +=".calender li a { text-decoration:none; font-family:Tahoma; font-size:11px; color:#333}";
	style +=".calender li a:hover { color:#f30; text-decoration:underline; font-size:11px;}";
	style +=".calender li a.hasArticle {font-weight:bold; color:#397eae !important}";
	style +=".lastMonthDate, .nextMonthDate {color:#bbb;font-size:12px}";
	style +=".selectThisYear a, .selectThisMonth a{text-decoration:none; margin:0 2px; color:#000; font-weight:bold}";
	style +=".calender .LastMonth, .calender .NextMonth{ text-decoration:none; color:#000;  font-weight:bold; line-height:16px;}";
	style +=".calender .LastMonth { float:left; font-size:14px;padding:0 0 0 3px;}";
	style +=".calender .NextMonth { float:right; font-size:14px;padding:0 3px 0 0;}";
	style +=".calender a.LastMonth:hover { font-size:14px;text-decoration:none;}";
	style +=".calender a.NextMonth:hover { font-size:14px;text-decoration:none;}";
	style +=".calenderBody {clear:both}";
	style +=".calenderTitle {text-align:center;height:auto; line-height:20px; clear:both;overflow:hidden;}";
	style +=".today { background-color:#b5d6ff;border:1px solid #397eae; padding:2px}";


	style +=".today a { color:#f30; }";
	style +=".calenderBottom {clear:both; border-top:1px solid #ddd; margin:0;padding: 0; text-align:center}";
	style +=".calenderBottom a {text-decoration:none; margin:2px !important; font-weight:bold; color:#000;text-align:center;line-height:22px;}";
	style +=".calenderTop {clear:both;height:14px; background:#b3d1fc;overflow:hidden;}";
	style +=".calenderTop a.closeCalender{display:block;width:12px;height:12px;line-height:12px;float:right;margin:0;padding:0;font-size:11px;text-decoration:none;text-align:center;font-weight:bold;color:#000;}";
	style +="</style>";

	var now;
	if (typeof(arguments[0])=="string"){
	   selectDate = arguments[0].split("-");
	   var year = selectDate[0];
	   var month = parseInt(selectDate[1])-1+"";
	   var date = selectDate[2];
	   now = new Date(year,month,date);
	}else if (typeof(arguments[0])=="object"){
	   now = arguments[0];
	}
	var lastMonthEndDate = GS_DateAdd("d","-1",now.getFullYear()+"-"+now.getMonth()+"-01").getDate();
	var lastMonthDate = WeekDay(now.getFullYear()+"-"+now.getMonth()+"-01");
	var thisMonthLastDate = GS_DateAdd("d","-1",now.getFullYear()+"-"+(parseInt(now.getMonth())+1).toString()+"-01");
	var thisMonthEndDate = thisMonthLastDate.getDate();
	var thisMonthEndDay = thisMonthLastDate.getDay();


	var todayObj = new Date();
	today = todayObj.getFullYear()+"-"+todayObj.getMonth()+"-"+todayObj.getDate();

	for (i=0; i<lastMonthDate; i++){   // Last Month's Date
	   lis = "<li class='lastMonthDate'>"+lastMonthEndDate+"</li>" + lis;
	   lastMonthEndDate--;
	}
	for (i=1; i<=thisMonthEndDate; i++){ // Current Month's Date


	   if(today == now.getFullYear()+"-"+now.getMonth()+"-"+i){
	   var todayString = now.getFullYear()+"-"+(parseInt(now.getMonth())+1).toString()+"-"+i;
	   lis += "<li><a href=javascript:void(0) class='today' onclick='_selectThisDay(this)' title='"+now.getFullYear()+"-"+(parseInt(now.getMonth())+1)+"-"+i+"'>"+i+"</a></li>";
	   }else{
	   lis += "<li><a href=javascript:void(0) onclick='_selectThisDay(this)' title='"+now.getFullYear()+"-"+(parseInt(now.getMonth())+1)+"-"+i+"'>"+i+"</a></li>";
	   }

	}
	var j=1;
	for (i=thisMonthEndDay; i<6; i++){   // Next Month's Date
	   lis += "<li class='nextMonthDate'>"+j+"</li>";


	   j++;
	}
	lis += style;

	var CalenderTitle = "<div class='calenderTop'><a href='javascript:void(0)' class='closeCalender' onclick='closeCalender(this)' title='关闭'>X</a></div><a href='javascript:void(0)' class='NextMonth' onclick=GS_calender(GS_DateAdd('m',1,'"+now.getFullYear()+"-"+now.getMonth()+"-"+now.getDate()+"'),this) title='下月'>&raquo;</a>";
	CalenderTitle += "<a href='javascript:void(0)' class='LastMonth' onclick=GS_calender(GS_DateAdd('m',-1,'"+now.getFullYear()+"-"+now.getMonth()+"-"+now.getDate()+"'),this) title='上月'>&laquo;</a>";
	CalenderTitle += "<span class='selectThisYear'><a href='javascript:void(0)' onclick='CalenderselectYear(this)' title='点击选择其它年份' >"+now.getFullYear()+"</a></span>年<span class='selectThisMonth'><a href='javascript:void(0)' onclick='CalenderselectMonth(this)' title='点击选择其它月份'>"+(parseInt(now.getMonth())+1).toString()+"</a></span>月";


	if (arguments.length>1){
	   arguments[1].parentNode.parentNode.getElementsByTagName("ul")[1].innerHTML = lis;
	   arguments[1].parentNode.innerHTML = CalenderTitle;

	}else{
	   var CalenderBox = style+"<div class='calender' id='calender'><div class='calenderTitle'>"+CalenderTitle+"</div><div class='calenderBody'><ul class='day'><li>日</li><li>一</li><li>二</li><li>三</li><li>四</li><li>五</li><li>六</li></ul><ul class='date' id='thisMonthDate'>"+lis+"</ul></div><div class='calenderBottom'><span><span><a href=javascript:void(0) onclick='_selectThisDay(this)' title='"+todayString+"'>今天</a></span></span></div></div>";
	   return CalenderBox;
	}
	}
	function _selectThisDay(d){
	var boxObj = d.parentNode.parentNode.parentNode.parentNode.parentNode;


	   boxObj.targetObj.value = d.title;
	   boxObj.parentNode.removeChild(boxObj);
	}
	function closeCalender(d){
	var boxObj = d.parentNode.parentNode.parentNode;
	   boxObj.parentNode.removeChild(boxObj);
	}

	function closeCalendar(){
	if (document.getElementById("calender")){
	document.getElementById("calender").style.display="none";
	}
	}

	function CalenderselectYear(obj){
	   var opt = "";
	   var thisYear = obj.innerHTML;
	   for (i=1990; i<=2020; i++){
	   if (i==thisYear){
	     opt += "<option value="+i+" selected>"+i+"</option>";
	   }else{
	     opt += "<option value="+i+">"+i+"</option>";
	   }
	   }
	   opt = "<select onblur='selectThisYear(this)' onchange='selectThisYear(this)' style='font-size:11px'>"+opt+"</select>";
	   obj.parentNode.innerHTML = opt;
	}


	function selectThisYear(obj){
	GS_calender(obj.value+"-"+obj.parentNode.parentNode.getElementsByTagName("span")[1].getElementsByTagName("a")[0].innerHTML+"-1",obj.parentNode);
	}

	function CalenderselectMonth(obj){
	   var opt = "";
	   var thisMonth = obj.innerHTML;
	   for (i=1; i<=12; i++){
	   if (i==thisMonth){
	     opt += "<option value="+i+" selected>"+i+"</option>";
	   }else{
	     opt += "<option value="+i+">"+i+"</option>";
	   }
	   }
	   opt = "<select onblur='selectThisMonth(this)' onchange='selectThisMonth(this)' style='font-size:11px'>"+opt+"</select>";
	   obj.parentNode.innerHTML = opt;
	}
	function selectThisMonth(obj){
	GS_calender(obj.parentNode.parentNode.getElementsByTagName("span")[0].getElementsByTagName("a")[0].innerHTML+"-"+obj.value+"-1",obj.parentNode);


	}
	function GS_setDate(inputObj){
	var calenderObj = document.createElement("span");
	calenderObj.innerHTML = GS_calender(new Date());
	calenderObj.style.position = "absolute";
	calenderObj.targetObj = inputObj;
	inputObj.parentNode.insertBefore(calenderObj,inputObj.nextSibling);
	}


	function $E(b){
		var a=typeof b=="string"?document.getElementById(b):b;
		if(a!=null){return a}else{}return null
	}
	
	String.prototype.replaceAll  = function(s1,s2){
		return this.replace(new RegExp(s1,"gm"),s2);
	}

	function inputCounter(objectid, msgId, isEditor, maxLength){
		var expectLength = maxLength;
		
		if(isEditor=="true"){
			var body = editor.getData();
			body = body.replaceAll("\t","");
			body = body.replaceAll("\n","");
			body = body.replaceAll("\r","");
			
			expectLength = maxLength - body.length;
		}else{
			var body = $E(objectid).value;
			body = body.replaceAll("\t","");
			body = body.replaceAll("\n","");
			body = body.replaceAll("\r","");
			var len = body.length;
			
			expectLength = maxLength - len;
		}

		//show the message
		var messageBox = $E(msgId);
		if(expectLength>=0){
			messageBox.innerHTML = "你还可以输入<span>"+expectLength+"</span>字";
		}else{
			messageBox.innerHTML = "已超出<span>"+Math.abs(expectLength)+"</span>字";
		}
	}
	

	function matchTag(titleId,bodyId,tagId){
		//var str = tinyMCE.getInstanceById(bodyId).getBody().innerHTML;
		var str = editor.getData();
		var content = document.getElementById(titleId).value;
		var noContent=0;
		var lessContent=1;
		var noMatch=2;
		str=clearHtmlCode(str);
		if(str==""){
			return noContent;
		}else{
		 	if(str.length<=20){
				return lessContent;
			}
		}
		var a=getHotTagArray();
		var len = a.length;
		var b=new Array();
		var index=new Array();
		for(var i=0;i<len;i++){
			index[i]=i;
			b[i]=(content.split(a[i]).length-1)+(str.split(a[i]).length-1);
		}
		var hotTags = "";
		var num=0;
		
		for (var i = 0; i < len-1; i++)
		    for (var j = i+1; j <len ; j++)
		        if (b[i] < b[j]) {
		            var temp = b[i];
		            b[i] = b[j];
		            b[j] = temp;
		            var _temp = index[i];
		            index[i] = index[j];
		            index[j] = _temp;
		        }
		        
		for (var i=0;i<5 ;i++)
		{	
			num = b[i];			
			if(num>0){		
				hotTags+= a[index[i]]+" ";
			}
		}	
			
		if(hotTags!=""){
			document.getElementById(tagId).value=hotTags;
		}else{
			document.getElementById(tagId).value="";
			return noMatch;
		}
	}

	function clearHtmlCode(text){
		text = text.replace(/<\/?[^>]+>/g,''); 
		text = text.replace(/[ | ]*\n/g,'\n'); 
		text= text.replace(/\n[\s| | ]*\r/g,'\n');
		return text;
	}

	var docEle = function() {
	    return document.getElementById(arguments[0]) || false;
	}

	function openPop(_id) {
		var m = "mask";
		var newMask = document.createElement("div");
		newMask.id = m;
		newMask.style.position = "absolute";
		newMask.style.zIndex = "999";
		_scrollWidth = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth);
		_scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
		newMask.style.width = _scrollWidth + "px";
		newMask.style.height = _scrollHeight + "px";
		newMask.style.top = "0px";
		newMask.style.left = "0px";
		newMask.style.background = "#999999";
		newMask.style.filter = "alpha(opacity=50)";
		newMask.style.opacity = "0.50";
		document.body.appendChild(newMask);
		document.getElementById(_id).style.display="block";
		
		var endHeight = window.screen.availHeight - document.getElementById(_id).offsetHeight;
		document.getElementById(_id).style.top = (document.documentElement.scrollTop+(endHeight/2))+"px";
		var endWidth = window.screen.availWidth - document.getElementById(_id).offsetWidth;
		document.getElementById(_id).style.left = (endWidth/2)+"px";
	}
			
	function closePop(_id) {
		document.getElementById(_id).style.display="none";
		document.body.removeChild(docEle("mask"));
		return false;
	}
	
	function fsubmit(obj){
		obj.submit();
	}

	function freset(obj){
		obj.reset();
	}

	var timeClose = 30;
	var timeCer;
	function player(id){
		clearTimeout(timeCer);
		var id=document.getElementById(id)
		id.style.display="block";
	}

	function clocer(id){
		this.xid = id;
		var self = this;
		timeCer = setTimeout(function(){
			var idx=document.getElementById(self.xid)
			idx.style.display="none";
		},timeClose);
	}


