﻿var help = function ($){
     return{
         showHelptopic : function(chapter_id, chapter_count) {
            for(var i = 1; i <= chapter_count; i++) {
                $('#chapter'+i).css('display', 'none');
                $('#link'+i).removeClass('active');
            }
            $('#chapter'+chapter_id).css('display', 'block');
            
            //highlight chapter in overview
            $('#link'+chapter_id).addClass('active');
            
          
         },
         
         showPressTopic : function(id, count) {
            for(var i = 1; i <= count; i++) {
                $('#bericht'+i).css('display', 'none');
            }
            
            $('#'+id).css('display', 'block');
         },
         
         successYearList  : function(resultObj){
			var results;
			eval('results = ' + resultObj + '*/');
			
			var resHtml = [];
			$('#ddProdYearSelect').removeAttr('disabled');
			$('#ddProdYearSelect').removeClass('disabled');
			//$('#ddProdMonthSelect').removeAttr('disabled');
		   
			if(results.length == 1){
			    resHtml.push('<option value="-1">Jaar</option>');
			    resHtml.push('<option value="' + results[0] + '" selected="selected">' + results[0] + '</option>');
			    
			    $('#ddProdYearSelect').html(resHtml.join(''));
			}
			else {
			    resHtml.push('<option value="-1" selected="selected">Jaar</option>');
			    for(x = 0; x < results.length; x++){
				    resHtml.push('<option value="' + results[x] + '">' + results[x] + '</option>');
			    }
			    $('#ddProdYearSelect').html(resHtml.join(''));
			    $('#ddProdYearSelect').get(0).selectedIndex = 0;
			   
			}
			 
		    var hasYear = false;
            //check if the initial body has been set
			if (priv.initialYear != ''){
			    $('#ddProdYearSelect').attr('value', priv.initialYear);
			    priv.initialYear = '';
			    hasYear = true;
			}
			else {
			    priv.initialMonth = '';
		        priv.initialTypesOpened = false;
			}
			
			searchmycar.prodYearSelectChange();
		}    
     }
}(jQuery);
