// Provide a default path to dwr.engine
if (dwr == null) var dwr = {};
if (dwr.engine == null) dwr.engine = {};
if (DWREngine == null) var DWREngine = dwr.engine;

if (HunterBean == null) var HunterBean = {};
HunterBean._path = '/activities/dwr';
HunterBean.init = function(callback) {
  dwr.engine._execute(HunterBean._path, 'HunterBean', 'init', callback);
}
HunterBean.getBlogCount = function(p0, callback) {
  dwr.engine._execute(HunterBean._path, 'HunterBean', 'getBlogCount', p0, callback);
}

HunterBean.getBlogs = function(p0, p1, p2, callback) {
  dwr.engine._execute(HunterBean._path, 'HunterBean', 'getBlogs', p0, p1, p2, callback);
}
HunterBean.recomBlog = function(p0, p1, callback) {
  dwr.engine._execute(HunterBean._path, 'HunterBean', 'recomBlog', p0, p1, callback);
}
HunterBean.shareBlog = function(p0, callback) {
  dwr.engine._execute(HunterBean._path, 'HunterBean', 'shareBlog', p0, false, callback);
}
HunterBean.getCommentCount = function(p0, callback) {
  dwr.engine._execute(HunterBean._path, 'HunterBean', 'getCommentCount', p0, callback);
}
HunterBean.setCaptchaService = function(p0, callback) {
  dwr.engine._execute(HunterBean._path, 'HunterBean', 'setCaptchaService', p0, callback);
}
HunterBean.isCheckImageValid = function(p0, callback) {
  dwr.engine._execute(HunterBean._path, 'HunterBean', 'isCheckImageValid', p0, false, callback);
}
HunterBean.getComments = function(p0, p1, p2, callback) {
  dwr.engine._execute(HunterBean._path, 'HunterBean', 'getComments', p0, p1, p2, callback);
}
HunterBean.deleteComment = function(p0, p1, callback) {
  dwr.engine._execute(HunterBean._path, 'HunterBean', 'deleteComment', p0, p1, false, callback);
}
HunterBean.publishComment = function(p0, p1, p2, p3, p4, callback) {
  dwr.engine._execute(HunterBean._path, 'HunterBean', 'publishComment', p0, p1, p2, p3, p4, false, callback);
}
HunterBean.setCommonService = function(p0, callback) {
  dwr.engine._execute(HunterBean._path, 'HunterBean', 'setCommonService', p0, callback);
}
function setPictools(){
	Event.observe("act_index_pic_tool_a0","click",function clickA(){
		selectPic(0);
	});
	Event.observe("act_index_pic_tool_a1","click",function clickA(){
		selectPic(1);
	});
	var picsInterval = window.setInterval("changePic()",3000);
}
function changePic(){
	var _e = $("act_index_pic_tool");
	if (_e){
		if( _e.className=="mr s00"){
			_e.className="mr s01";
			$_picIndex = 2
		}else{
			_e.className="mr s00";
			$_picIndex = 1
		}
	}
}
var $_picIndex = 1 ;
function selectPic(index){
	var _e = $("act_index_pic_tool");
	if (_e)
	_e.className = "mr s0" + index; 	
	
}
function clickPic(){
 window.open(pics[parseInt($_picIndex)-1]);
}
function setPicawards(){
	var awardsInterval = window.setInterval("movePic()",200);
}
function movePic(){
	var _e = $("act_index_pic_awards");
	if (_e) {
		var _x = parseInt(_e.style.left);
		_e.style.left = _x == -300 ? 0 : (_x - 5) + "px";
	}
}

function myblog(){
	if(currentUser.userId <=0 ){ login(false,false);return false;}
	window.location.href="hunter.do?action=myBlog";			
}
