$(document).ready(function(){
   $("#click-on-form").hide();

    $("#click-on-form-play").click(function(){
        $("#click-on-form").slideToggle("slow");
         
        
    });
    
    $("#click-off-form-play").click(function(){
        $("#click-on-form").slideToggle("slow");
         
        
    });
    
    
   


});

this.imagePreview = function(){	
	/* CONFIG */
		
		xOffset = 10;
		yOffset = 30;
		
		
	/* END CONFIG */
	$("span.preview").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<p class='prew-p'>" + this.t : "" + "</p>";
		var img = this.id;
		$("body").append("<div id='preview'><img src='/download/img_big/"+ img +"' alt='Image preview' width='200' height='200' />"+ c +"</div>");								 
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#preview").remove();
    });	
	$("a.preview").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};


// starting the script on page load
$(document).ready(function(){
	imagePreview();
});


this.videoPreview = function(){	
	/* CONFIG */
		
		xOffset = 70;
		yOffset = 20;
		
		
	/* END CONFIG */
	$("a.preview-video").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<p class='prew-p'>" + this.t : "" + "</p>";
		var img = this.id;
		$("body").append("<div id='preview-video'><img src='/tv/nahledy/"+ img +"' alt='Image preview' width='225' height='140' />"+ c +"</div>");								 
		$("#preview-video")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#preview-video").remove();
    });	
	$("a.preview-video").mousemove(function(e){
		$("#preview-video")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};


// starting the script on page load
$(document).ready(function(){
	videoPreview();
});


