<!--
/* YouTube video stuff */

$(document).ready(function(){
		
		
		
		if($('#VDSwitchVideoImage'))
        {
        $('.thickbox').bind('click', function(){
        
            $('#VDSwitchVideo').hide();
            $('#VDSwitchImage').show();
            $('#VDSwitchImagelink').hide();
            $('#VDSwitchVideolink').show();
        });
        
        $('#VDSwitchVideolink').unbind().bind('click', function(){
            $('#VDSwitchVideo').show();
            $('#VDSwitchImage').hide();
            $('#VDSwitchVideolink').hide();
             $('#VDSwitchImagelink').show();
        
        });
        
        $('#VDSwitchImagelink').unbind().bind('click', function(){
            $('#VDSwitchVideo').hide();
            $('#VDSwitchImage').show();
            $('#VDSwitchImagelink').hide();
            $('#VDSwitchVideolink').show();
        });
        
        };
		
		if($('#VDVideoDiv')){
		
			var mainDiv 	= $('#VDVideoDiv');
			var height 		= mainDiv.find('embed').height();
			var width 		= mainDiv.find('embed').width();

			if( (isNaN(parseInt(height)) && isNaN(parseInt(width)) ) && (height == null && width == null) || (height == 0 && width == 0)){
								
				height 	= mainDiv.find('object').height();
				width 	= mainDiv.find('object').width();
				
				if(height == 0 && width == 0){
					
					height 	= mainDiv.find('object').attr('height');
					width 	= mainDiv.find('object').attr('width');
					
				};
				
			};
			
			mainDiv.css('height', 0).css('width', width).find('div').hide();
			
			$('#VDVideolink').unbind().bind('click', function(){
			
				if(mainDiv.height() < 10){
				
					$(this).find('span.youtube').html('-').addClass('minus');
					mainDiv.animate({height: height}, 500, function(){
					
						$(this).find('div').show();
						
					});
					
				}else{
				
					$(this).find('span.youtube').html('+').removeClass('minus');
					mainDiv.find('div').hide();
					mainDiv.animate({height: 0}, 400);
					
				};
				
				return false;
				
			});
		
		};
		
});
//-->
