 
 function add_shout(message, by_talent_id)
 {
	//$('#tr'+id).remove();
	var dataString='message='+escape(message)+'&last_id='+last_id+'&buzz_type='+buzz_type+'&by_talent_id='+by_talent_id;
	//alert(dataString);
	//$('#proBuzz').html('<div align="center"><img src="/images/contest/ajax-loader.gif" /></div>' );
	$.ajax({
	  url: '/aj_shout.php',
	   type: "GET",
	   data: dataString,
	   dataType: "json",
	   cache: false,
	  success: function(data) {
		  if(data.no_res!=-1)
		  {
			  $('#proShoutIn').val('');
			  $('#proBuzz').html(data.htm);
			  if(data.last_id!=0)
			  {
				  last_id=data.last_id;
				  buzz_type=data.buzz_type;
			  }
			  //$('#proBuzzIn').html('Thank you for your post!');
			  setTimeout("change_shout_thanks();",3000);
		  }else
		  {
			  
		  }
	  }
	});
	
 }
 
 
 function change_shout_thanks()
 {
	//$('#proBuzzIn').html('<form><input type="text" name="shout-in" id="proShoutIn"  maxlength="80"/><a href="#" id="add_shout"><img src="/images/pro-buzz-post.gif" style="margin:1px;" /></a></form>'); 
	  $("#add_shout").click(function(event){
     add_shout($('#proShoutIn').val());
     event.preventDefault();
   });
   
   $('#proShoutIn').keypress(function(e){
      if(e.which == 13){
	  if($('#proShoutIn').val())
	  {
        add_shout($('#proShoutIn').val());
     	event.preventDefault();
	  }
     }
    });
	 
 }
	/**/
	
 function shutbox_refresh ()
 {
	
	$.ajax({
	  url: '/aj_shoutbox_refresh.php',
	   type: "GET",
	   dataType: "json",
	   data: 'last_id='+last_id+'&buzz_type='+buzz_type,
	   cache: false,
	   success: function(data) {
		  

		  if(data.count>0)
		  {
	
			  for (i=(data.count-1);i>=0;i--)
			  {
				  if(cname=='shoutA')
				  {
					  cname = 'shoutB';
				  }else
				  {
					  cname=='shoutA';
				  }
				 
				 //alert (data.shouts[i]);
				 $(data.shouts[i]).prependTo($('#proBuzz'));
				
			  }
			  
			  // Buble Pop
			  $('#dummy').HideBubblePopup();
			  $('#dummy').ShowBubblePopup({innerHtml: data.new_shout});
			  setTimeout("change_bubble_popup();", 30000);
			  
		  }
		 last_id = data.last_id;
		 buzz_type = data.buzz_type;
		   //console.log( last_id); 
	  }
	}); 
	
	 
 }
 
 // XXXXXXXXXX
 
 function change_bubble_popup()
 { 
	 $('#dummy').HideBubblePopup();
 }
