/*
function getDomain(){
    var temp = window.location.href.split("/");
    return temp[2];
}

function closeVideo(display_id){
   
    $('#watch-video-'+display_id+' #watch-video-information #close-video').click(function(){       
        $(this).parent().parent().parent().hide().slideUp('slow');
        return false;
    });
    return false;
}

function ceil(i){
    //forces the rounding up of an float
    var divided = i/4;    
    var bits = divided.toString().split('.');
    var whole = bits[0];
    var decimal = bits[1];
    if(decimal<50){
        whole++;       
        return whole;
    }else{
        var rounded = Math.round(i/4);
        return rounded;
    }
    
    
}

$(function() {    

    $('.watch-image').click(function(){
        $('.watch-video').hide();
        var id = $(this).attr('id');
        var bits = id.split('-');        
        var video_id = bits[2];

        //addLoader(video_id);

        var domain = getDomain();
        var display_id = ceil(video_id);
       
        $.ajax({
            type: "GET",
            url: 'http://'+domain+'/'+'~andy'+'/'+'get_watch_ajax.php',
            data: ({video_id : video_id}),
            async: false,
            success: function(html){
                 $('#watch-video-'+display_id).html(html).slideDown();
             
                closeVideo(display_id);
  
               
            }

        });//ajax
    })



});
*/

function CloseVideo()
{
	$(".watch-img").fadeTo(100,1);
	$(".lines").slideUp("slow");


}

function LoadVideo(id, line)
{
	$(".watch-img").fadeTo(100,1);
	$("#video-" + id).fadeTo(250,0.5, function() {
		// Hide all the current lines on the page and remove all the current html..
		$(".lines").slideUp("slow");
		$(".lines").html("");

		
		// Load the appropriate video content to the correct div.
		
		$.get("view-video/view.php", { id: id }, function(data){
			$("#line-" + line).html(data);
			$("#line-" + line).hide();
			$("#line-" + line).slideDown("slow", function() { 
				$.scrollTo('#line-' + line, 800);
			});
			
		});	
	
	});

}
