 jQuery(document).ready(function() {
	
    jQuery('#search').ajaxForm({ 
        target: '#video-results', 
		url: '/search.asp', 
        success: function() {
			fl();			
        } 
    }); 	
	

		
	
	function fl(){
		jQuery(".paging a").click(function(){ 
			var url = jQuery(this).attr("href").replace("default.asp","search.asp");
			jQuery('#video-results').fadeOut('slow',function(){
				jQuery("#video-results").load(url,'',function(){
					jQuery('#video-results').fadeIn('slow',fl); 
				});
			});			
			return false;	
		});	
		jQuery(".vid-load").click(function(){ 
			jQuery("#video-area").load("/video.asp?id=" + this.id,'',function(){
					st()
				});
			return false; 
		});			
		jQuery(".video-result .video-preview a img").hover( 
			function () { 
				jQuery(this).attr("src","/images/video_play.png");
			}, 
			function () { 
				jQuery(this).attr("src","/images/spacer.gif");	  
			} 
		); 					
	}
	
	jQuery("#sidebar .video-thumb a img").hover( 
		  function () { 
			jQuery(this).attr("src","/images/video_play_small.png");
		  }, 
		  function () { 
			jQuery(this).attr("src","/images/spacer.gif");	  
		  } 
	); 		
	
	function st(){
	addthis.init();
	 jQuery.scrollTo('#video-area',400);
	}
	
	fl()
 }); 

