var js_suggest = {
	name: 'js_suggest',
	loading: '<img src="/bu-content/images/common/icon/loading.gif" width="16" height="16" />',
	_init: function () {
		alert("I'm "+this.name);
    },
	
	makeSuggestion:function($param, $theme, $target_div , $root){
		//alert('hihi');
		$($target_div).innerHTML = this.loading;
		$('suggest_btn').disabled = true;
		new Ajax.Request("/bu-content/api.php", 
		{     
		method:'post',
		parameters: 'action=makeSuggest&'+$param,
		onSuccess: function(transport){       
		var response = transport.responseText || "no response text";
		//alert(response);
		$('suggest_btn').disabled  = false;
		$($target_div).innerHTML = ''
		var data = response.evalJSON(); 
		//alert(data.error);
			if(data.error == 'true'){
				Effect.ScrollTo(data.target,{offset : -30});
				new Effect.Highlight(data.target);
				alert(data.msg);
				if(data.target == 'code'){
				$('vimage').src = "/bu-include/vimage.php?"+Date();	
				}
				
			}else{   
				alert(data.msg);
				//alert($root+"/$theme/pedia/");
				document.location = $root+"/"+$theme+"/pedia/";
			
			}
			;
			
		},     
		onFailure: function(){ alert('Something went wrong...') }   
		});
	
		
	}	
	
}
