var menu = {
    init: function () {

        $('.nav-image').hover(function () {
            if (!$(this).attr('id') != menu._selectedId + '-nav' && $(this).attr('src').indexOf("-over.png") == -1) {
                var src = $(this).attr('src').replace(".png", "-over.png");
                $(this).attr('src', src);
            }
        },

			function () {

			    if ((page == "location" && $(this).attr('id') != "locator-nav") || (page == "development" && $(this).attr('id') != "development-nav") || (page == "mobile" && $(this).attr('id') != "mobile-nav") || (page == "consulting" && $(this).attr('id') != "consulting-nav") || page == "index") {
			        if (!$(this).attr('id') != menu._selectedId + '-nav' && $(this).attr('src').indexOf("-over.png") >= 0) {
			            var src = $(this).attr('src').replace("-over.png", ".png");
			            $(this).attr('src', src);
			        }
			    }
			});

			

},


    select: function (id) {

        $('#feature-display').removeClass();

        menu._selectedId = id;


        $('#feature-display').addClass('feature-' + id);

        $('#feature-txt-locator').hide();
        $('#feature-txt-development').hide();
        $('#feature-txt-mobile').hide();
        $('#feature-txt-consulting').hide();



        //$('#feature-txt-' + id).show();

    }
}




var locationsubmenu = {
	init: function(){
		$('.sub-nav-box-item').hover(function(){
				if(!$(this).attr('id') != locationsubmenu._selectedId){
					$(this).addClass('sub-nav-box-item-hover');
				}
			},
			function(){
				if(!$(this).attr('id') != locationsubmenu._selectedId){
					$(this).removeClass('sub-nav-box-item-hover');
				}
		});
		
		$('.sub-nav-box-item').click(function(){
			$('.sub-nav-box-item').removeClass('sub-nav-box-item-hover');
			$('.sub-nav-box-item').removeClass('sub-nav-box-item-selected');
			locationsubmenu._selectedId = $(this).attr('id');
			$(this).addClass('sub-nav-box-item-selected');
			
			$('#location-overview').hide();
			$('#location-printable-mapping').hide();
			$('#location-routing-logistics').hide();
			$('#location-spatial-data-analysis').hide();
			$('#location-store-locators').hide();
			$('#location-territory-delivery-zone-management').hide();
			
			$('#location-' + locationsubmenu._selectedId).show();
			
			$('#sub-page-hdr-logo').removeClass();
			$('#sub-page-hdr-logo').addClass('sub-page-hdr-logo-' + locationsubmenu._selectedId);

			
						
		});
		
	}
}

var mobilesubmenu = {
	init: function(){
		$('.sub-nav-box-item').hover(function(){
				if(!$(this).attr('id') != mobilesubmenu._selectedId){
					$(this).addClass('sub-nav-box-item-hover');
				}
			},
			function(){
				if(!$(this).attr('id') != mobilesubmenu._selectedId){
					$(this).removeClass('sub-nav-box-item-hover');
				}
		});
		
		$('.sub-nav-box-item').click(function(){
			$('.sub-nav-box-item').removeClass('sub-nav-box-item-hover');
			$('.sub-nav-box-item').removeClass('sub-nav-box-item-selected');
			mobilesubmenu._selectedId = $(this).attr('id');
			$(this).addClass('sub-nav-box-item-selected');
			
			$('#mobile-mobile-app-development').hide();
			$('#mobile-mobile-websites').hide();
						
			$('#mobile-' + mobilesubmenu._selectedId).show();
			
			$('#sub-page-hdr-logo').removeClass();
			$('#sub-page-hdr-logo').addClass('sub-page-hdr-logo-' + mobilesubmenu._selectedId);

			
						
		});
		
	}
}

var consultingsubmenu = {
	init: function(){
		$('.sub-nav-box-item').hover(function(){
				if(!$(this).attr('id') != consultingsubmenu._selectedId){
					$(this).addClass('sub-nav-box-item-hover');
				}
			},
			function(){
				if(!$(this).attr('id') != consultingsubmenu._selectedId){
					$(this).removeClass('sub-nav-box-item-hover');
				}
		});
		
		$('.sub-nav-box-item').click(function(){
			$('.sub-nav-box-item').removeClass('sub-nav-box-item-hover');
			$('.sub-nav-box-item').removeClass('sub-nav-box-item-selected');
			consultingsubmenu._selectedId = $(this).attr('id');
			$(this).addClass('sub-nav-box-item-selected');
			
			$('#consulting-discovery').hide();
			$('#consulting-systems-integration').hide();
			$('#consulting-business-plan-development').hide();
			$('#consulting-prototyping').hide();
			$('#consulting-technology-strategy').hide();
			
									
			$('#consulting-' + consultingsubmenu._selectedId).show();
			
			$('#sub-page-hdr-logo').removeClass();
			$('#sub-page-hdr-logo').addClass('sub-page-hdr-logo-' + consultingsubmenu._selectedId);

			
						
		});
		
	}
}

var developmentsubmenu = {
	init: function(){
		$('.sub-nav-box-item').hover(function(){
				if(!$(this).attr('id') != developmentsubmenu._selectedId){
					$(this).addClass('sub-nav-box-item-hover');
				}
			},
			function(){
				if(!$(this).attr('id') != developmentsubmenu._selectedId){
					$(this).removeClass('sub-nav-box-item-hover');
				}
		});
		
		$('.sub-nav-box-item').click(function(){
			$('.sub-nav-box-item').removeClass('sub-nav-box-item-hover');
			$('.sub-nav-box-item').removeClass('sub-nav-box-item-selected');
			developmentsubmenu._selectedId = $(this).attr('id');
			$(this).addClass('sub-nav-box-item-selected');
			
			$('#development-web-development').hide();
			$('#development-systems-integration').hide();
			$('#development-public-website').hide();
			$('#development-internal-systems').hide();
							
			$('#development-' + developmentsubmenu._selectedId).show();
			
			$('#sub-page-hdr-logo').removeClass();
			$('#sub-page-hdr-logo').addClass('sub-page-hdr-logo-' + developmentsubmenu._selectedId);

			
						
		});
		
	}
}



