var post_page         				 = "所有文章";
var post_new         				 = "发表新文章";
var post_reply         				 = "跟随话题";
var post_edit         				 = "编辑文章";
var post_view         				 = "阅读文章";
var post_index        				 = "本版公告";
var post_list                        = "论坛地图帖子列表";
var post_month                       = "论坛帖子月表";
var user_online       				 = "在线列表";
var approve_page      				 = "精华文章浏览";
var approve_view      				 = "阅读精华文章";
var approve_page      				 = "精华文章";
var topic_page        				 = "";
var topic_view        				 = "阅读专题文章";
var keyword_page                     = "热门搜索";
var post_search       				 = "全文检索";
var user_myclub       				 = "我的设置";
var user_edit         				 = "编辑我的设置";
var user_show      					 = "查看网友档案";
var user_userjs                      = "网络名片"
var user_present                     = "赠送财富值"
var post_reward                      = "奖励财富值"
var vote                             = "投票区";
var votefree                         = "投票区";
var page_policy       				 = "社区法则";
var page_pickpost     				 = "精选文章";
var page_term         				 = "服务条款";
var page_faq         				 = "新手上路";
var page_ebookfaq      				 = "个人文集常见问题";
var page_oldmemberupgrade			 = "用户升级说明";

var user_message_index               = "我的留言";
var user_message_send                = "编辑留言";
var user_message_inbox               = "我收到的留言";
var user_message_outbox              = "我发出的留言";
var user_message_view                = "阅读我的留言";

var user_address_list                = "我的好友名单";
var user_address_add                 = "加入我的好友";
var user_address_edit                = "编辑我的好友";
var user_mypost                      = "我的文章"
var user_myfavorite                  = "我的收藏"

var _announcement         			 = "社区广告";

var _forums                          = "论坛列表";
var _whatsnew                        = "新文章";

var user_register                    = "用户登录";

var index                            = "论坛首页";

var ebook                            = "个人文集首页";
var ebookhome                        = "个人文集首页";
var ebook_dump                       = "倒入个人文集";
var ebook_admin_home                 = "管理文集首页";
var ebook_admin_directory            = "管理文集目录";
var ebook_admin_article              = "管理文集文章";
var ebook_admin_comment              = "管理文集评论";
var ebook_admin_link                 = "管理文集链接";
var ebook_directory                  = "个人文集目录";
var ebook_chapter                    = "个人文集章节";
var ebook_article                    = "个人文集文章";
var ebook_articleedit                = "个人文集文章";
var ebook_recommend                  = "个人文集评论";
var ebook_list                       = "个人文集列表";

var js_boardtoppost                  = "行业首页"

var myalibaba                        = "阿里助手";

var sitemap_home                     = "论坛地图首页";



function showWhereAmI() {
 	var str=window.location+"";
 	var here=""; 	 	
 	
 	var pos = str.indexOf("/club/");
 	str=str.substring(pos+"/club/".length);
 	pos = str.indexOf("/");
 	
 	var key1=str.substring(0,pos);
 	var key2="";
 	var key3="";
 	str=str.substring(pos+1);
 	var i =0;
 	for (; i<str.length; i++) {
 		if(str.charAt(i)=="/" || str.charAt(i)=="." || str.charAt(i)=="?" ||  str.charAt(i)=="#") { 		
 			break;
 		}
 		key2=key2+str.charAt(i);
 	}
 	
 	str = str.substring(i+1);
 	for (i=0; i<str.length; i++) {
 		if(str.charAt(i)=="/" || str.charAt(i)=="." || str.charAt(i)=="?" ||  str.charAt(i)=="#" || str.charAt(i)=="=") { 		
 			break;
 		}
 		key3=key3+str.charAt(i);
 	}
	
 	if (eval("typeof("+key1+"_"+key2+")")!='undefined')  { 		
 		here = eval(key1+"_"+key2);
 	} 
 	else if (eval("typeof("+key1+"_"+key2+"_"+key3+")")!='undefined')  {
 		here = eval(key1+"_"+key2+"_"+key3);	
 	}
 	else if (eval("typeof(_"+key1+")")!='undefined') {
 		here = eval("_"+key1);	
 	}
 	
	if( here.length > 0) {
		document.write("> <b>"+here+"</b>");
	}
	
}

function viewtopic(id,bid,tpc,pge) {
	var url = "/club/topic/view/"+id+"?bid="+bid+"&tpc="+tpc+"&pge="+pge;
	//var win = window.open(url,"topic","toolbar=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes, width=620,height=600");	
	window.location=url;
    //win.focus();
}

function topicpage(bid,tpc,pge) {
	//?tpc=4&bid=1&sty=0&pge=1
	var url = "/club/topic/page?tpc="+tpc+"&bid="+bid+"&pge="+pge;
	window.location=url;
}

function uploadpic() {
	var url = "/club/post/upload/picture"; 	
	var win = window.open(url,"uploadpic","width=620,height=200");    	
    win.focus();
}

function uploadattach() {
	var url = "/club/post/upload/attachment"; 	
	var win = window.open(url,"uploadattachment","width=620,height=200");    	
    win.focus();
}

function pageInit() {
	if(last_logon == 0) {
		var lasttime = getCookie("last"+bid);
		if(!lasttime) {
			var lasttime = parseInt(new Date().getTime()/1000);		
		}
		setCookie("last"+bid,lasttime);	
		last_logon=lasttime;	
	}
}

function getIcon(id,child,posted) {
		if (child==0) {			
			if (posted > last_logon && ids.indexOf(id)<0) {
				document.write("<img alt=. src=http://img.china.alibaba.com/images/club/club/newfile.gif hspace=5>");
			}
			else {
				document.write("<img alt=. src=http://img.china.alibaba.com/images/club/club/file.gif hspace=5>");
			}			
		}
		else {
			if (posted > last_logon && ids.indexOf(id)<0) {
				document.write("<img alt=+ src=http://img.china.alibaba.com/images/club/club/newmulti.gif hspace=5>");
			}
			else {
				document.write("<img alt=+ src=http://img.china.alibaba.com/images/club/club/multi.gif hspace=5>");
			}		
		}
	}

function viewPost(id,posted) {
	///club/post/view/$post.Id?par=$part&bid=$bid&pge=$pge&sty=$sty#post$post.Id			
	if(posted > last_logon) {
		var ids = getCookie("b"+bid);		
		if(!ids) {
			ids = id;
			setCookie("b"+bid,ids,"","/club");
		}
		else {
			if(ids.indexOf(id)<0) {
				ids = ids + "," + id;
				setCookie("b"+bid,ids,"","/club");
			}
		}		
	}
}


var currentpos,timer; 
function initialize() 
{ 
timer=setInterval("scrollwindow()",10);
} 
function sc(){
clearInterval(timer);	
}
function scrollwindow() 
{ 
currentpos=document.body.scrollTop; 
window.scroll(0,++currentpos); 
if (currentpos != document.body.scrollTop) 
sc();
} 
document.onmousedown=sc
document.ondblclick=initialize

function checkVoteSelectedNum(frmname,total,limit) {
    //frmname:表单名称;total:选项总数;limit:受限个数
    var i = 0;
    var j = 0;
    for(j=0;j<total;j++) {
        if(frmname.num[j].checked == true) {
            i++;
        }
    }
    if(i==0) {
        alert("您还没有选择投票项，欢迎参加投票")
        return false;
    }
    if(i>limit) {
        alert("这个投票最多只能选择"+limit+"个\n\n请重新选择 ^_^");
        return false;
    }
    return true;
}
