$(function() {
   
//  
//        /*
//         * 
//         * 
//        content changer on specific boat profile page
//        */
//        
        if ($('.accordion').length) {
            var actualShown='';
    		//videoPlayer=document.getElementById('mpl');
            //video.init();
            $('#accordion div.accordion_content').css('display','block');
            $('#showcase_pagination').css('display','block');
            
            $(".accordion").accordion({ fillSpace: true });
            
            $('#h3_link_1').click(function() {
                if (actualShown!='#content_1') {
                    $('#content_1').show();
                    $('#content_1').siblings().hide();
                    actualShown='#content_1';
                }
            });     
            
            $('#h3_link_2').click(function() {
            	if (actualShown!='#content_2') {        
                    $('#content_2').show();
                    $('#content_2').siblings().hide();          
                    actualShown='#content_2';
        			                    
                }
            });
            
            $('#h3_link_3').click(function() {
                if (actualShown!='#content_1') {        
                    $('#content_1').show();
                    $('#content_1').siblings().hide();  
                    actualShown='#content_1';       
                }
            });
    
            $('#h3_link_4').click(function() {
                if (actualShown!='#content_1') {        
                    $('#content_1').show();
                    $('#content_1').siblings().hide();      
                    actualShown='#content_1';                   
                }               
            });
    
            $('#h3_link_5').click(function() {
                if (actualShown!='#content_1') {        
                    $('#content_1').show();
                    $('#content_1').siblings().hide();          
                    actualShown='#content_1';       
                }           
            });
        }

        
        /*
         * options/details changer
         * in the accordion menu
         * template: boatSite
         */
        if($('#spec_standards_but').length){
            $('#spec_standards_but').click(function(event) {
                event.preventDefault();             
                $('#spec_standards_det').show();
                $('#spec_options_det').hide();
            });             
        }

        if($('#spec_options_but').length){
            $('#spec_options_but').click(function(event) {
                event.preventDefault();
                $('#spec_options_det').show();
                $('#spec_standards_det').hide();
            });             
        }   
        /**
         * 
         * 
         * 
        hoverimages
        */
                
        if ($('.specThumbPic').length) {
            $('.specThumbPic').hover(
                function(){
                    var id;
                    id = $(this).attr("id");
                        $('#specContent #pic_'+id).show();
                        $('#specBoatMap #map_'+id).show();
                        $('#specContent #pic_'+id).siblings().hide();        
                        $('#specBoatMap #map_'+id).siblings().hide();
                },
                function(){
                                                                        
                    $('#specContent #desc').show();
                    $('#specContent #desc').siblings().hide();              
                    
            });
        }       
        /**
         * 
         * 
         * 
        tooltip
        */
                
        if ($('.img').length) {
        	
	            $('.img').hover(
	                function(){
	                	if ($('.img').size()!=1) $(this).next().next('.tooltip').show();
	                	$(this).next('.vt_title').slideDown();
	                },
	                function(){
	                	if ($('.img').size()!=1) $(this).next().next('.tooltip').hide();
	                	$(this).next('.vt_title').slideUp();                	
	                	
	            });
        	
        }       
        
        
        /**
         * 
         * 
         * 
        showcase implementation (jquery gallery)
        (boat profile page)
        
         */
        
        if ($('#showcase_right').length) {
        	
        	$('.sliderImgContainer').css('display','block');
        	
        	
            $('#showcase_right').showcase({
                animation: { type: "fade" },
                
                titleBar: { autoHide: true,
                    position: "top",
                    css: {
                        backgroundColor: "#fff",
                        "color":"#333333",
                        "font-size":"10px",
                        "text-decoration":"none",
                        "font-style":"normal",
                        "height":"15px",
                        "opacity":"0.7"
                    }
                },
                
                navigator: {
                    position: "bottom-left",
                    autoHide: false,
                    css: { padding:"0px",
                           margin: "0px 0px 5px 5px" },
                    showNumber: true,
                    item: {
                        css: {  height:"12px",
                                "line-height":"12px",
                                "width":"12px",
                                "font-size":"12px",
                                "-moz-border-radius": "0px",
                                "-webkit-border-radius": "0px",
                                "background": "#121212",
                                "border":"0px",
                                "margin":"3px",
                                "color": "#aaa",
                                "padding" : "2px",
                                "text-align": "center",
                                "font-weight":"bold",
                                "vertical-align": "middle" },
                        cssHover: {
                            "background": "#121212",
                            "color":"#ffffff",
                            "border":"0px" },
                        cssSelected: {
                            backgroundColor: "#121212",
                            "border":"0px",
                            "color":"#ff6600"}
                    }
                }       
            });         
            
        }
        /**
         * 
         * 
        showcase implementation (jquery gallery) for startsite
         
        */

        if (('#right_content').length) {
        	
        	$('.sliderImgContainer').css('display','block');
        	
        	$('#right_content').showcase({
      	       	
                animation: { type: "fade" },
                
                titleBar: { autoHide: true,
                    position: "top",
                    css: {
                        "background": "#fff",
                        "color":"#333333",
                        "font-size":"10px",
                        "text-decoration":"none",
                        "font-style":"normal",
                        "height":"15px",
                        "opacity":"0.7"
                    }
                },
                
                navigator: {
                    position: "bottom-left",
                    autoHide: true,
                    css: { padding:"0px",
                           margin: "0px 0px 5px 5px" },
                    showNumber: false,
                    item: {
                        css: {  height:"12px",
                                "line-height":"12px",
                                "width":"12px",
                                "font-size":"12px",
                                "-moz-border-radius": "0px",
                                "-webkit-border-radius": "0px",
                                "background": "#121212",
                                "border":"0px",
                                "margin":"3px",
                                "color": "#aaa",
                                "padding" : "2px",
                                "text-align": "center",
                                "font-weight":"bold",
                                "vertical-align": "middle" },
                        cssHover: {
                            "background": "#121212",
                            "color":"#ffffff",
                            "border":"0px" },
                        cssSelected: {
                            "background": "#ff6600",
                            "border":"0px",
                            "color":"#ff6600"}
                    }
                }       
            });         
        }
        
        
      if ($('#videoplayer').length) {
	      $('#videoplayer').media({ 
	          width: 341, 
	          height:   192, 
	          autoplay:  1,
	          flashvars: {
	              autostart: true,
	              controlbar: 'over',
	              repeat:'always',
	              backcolor:'#000000',
	              frontcolor:'#ffffff',
	              lightcolor:'#000000',
	              screencolor:'#000000',
	              autohide: true
	          },
	          caption: false
	      }); 
  	}
      if ($('a.media').length) {
	      $('a.media').media({ 
	          width: 341, 
	          height:   192, 
	          autoplay:  1,
	          flashvars: {
	              autostart: true,
	              controlbar: 'over',
	              repeat:'always',
	              backcolor:'#000000',
	              frontcolor:'#ffffff',
	              lightcolor:'#000000',
	              screencolor:'#000000',
	              autohide: true
	          },
	          caption: false
	      }); 
  	}
      
      if ($('.boatThumbnailImg').length) {
          $('.boatThumbnailImg').hover(
                  function(){
                      var id;
                      //id = $(this).attr("id");
                      		$(this).css('z-index','1000');
                      		$(this).animate(
                      				{
                      				height: "+=8px",
                      				top: "6px",
                      				width: "+=13px",
                      				left: "-6px"
                      				},                       				
                      				100
                      		);
                      		$(this).closest('.boatThumbnailContainer').find('.boatImgTitle').fadeIn(100);                      		
                      		$(this).closest('.boatThumbnailContainer').find('.boatImgTitleBG').fadeIn(100);                		                      		
                  },
                  function(){
                      var id;
                      //id = $(this).attr("id");
                        $(this).css('z-index','999');
                		$(this).animate(
                  				{
                  				height: "-=8px",
                  				top: "10px",                  				
                  				width: "-=13px",
                  				left: "2px"	
                  				},                  				
                  				100
                  		);
                  		$(this).closest('.boatThumbnailContainer').find('.boatImgTitle').fadeOut(100);                		                  		
                		$(this).closest('.boatThumbnailContainer').find('.boatImgTitleBG').fadeOut(100);                		
//                      $('#specContent #desc').show();
//                      $('#specContent #desc').siblings().hide();              
                      
              });
      }
        

      /*
       * video implementation for boot pages
       */
      
      
            
      
});
