function replace_video(id, width, zoom) {
  	$.ajax({
	  type: "GET",
   	  url: "/video/embed_video/" + id + "/" + width + "/true/" + zoom,
      success: function(msg){
		$('#main_video_container').html(msg);
		document.location = '#video';
      },
      failure: function(msg){
		 alert( "Error Loading Video, please refresh the page" );
      }
    });

}


function replace_item(id, width, forum) {
  	$.ajax({
	  type: "POST",
   	  url: "/cakephp/item/embed_item/" + id + "/" + width + "/true/",
   	  data: "forum=" + forum,
      success: function(msg){
		$('#main_video_container').html(msg);
		document.location = '#video';
		$('#item_id_input').attr('value',id);
      },
      failure: function(msg){
		 alert( "Error Loading item, please refresh the page" );
      }
    });

}

function replace_item_dark(id, width, forum) {
  	$.ajax({
	  type: "POST",
   	  url: "/cakephp/item/embed_item_dark/" + id + "/" + width + "/true/",
   	  data: "forum=" + forum,
      success: function(msg){
		$('#main_video_container').html(msg);
		$('.item_link').removeClass("now_playing");
		$('#link' + id).addClass("now_playing");
		$('#item_id_input').attr('value',id);
      },
      failure: function(msg){
		 alert( "Error Loading item, please refresh the page" );
      }
    });

}



function load_comments(initial, thread_id, forum, moderator) {
  	$.ajax({
	  type: "POST",
   	  url: "/comment/update/" + initial + "/" + thread_id + "/" + moderator,
   	  data: "forum=" + forum,
      success: function(msg){
		$('#comments_container').html(msg);
		document.location = '#comments';
      },
      failure: function(msg){
		 alert( "Error Loading comments, please refresh the page" );
      }
    });



}


function add_comment(forum, item_id) {

	$('#comment_form').css('display','block');
	$('#main_textarea').focus();

}
