function general(){
	slideshow();
	navigation_menu();
	inside_side_nav();
	
	$('#slider_rotate').delegate('a', 'click', function(){	
		$('#slider_rotate').find('a').removeClass('showW');
		$(this).addClass('showW');	
		$('#slider_b img').removeClass('show').animate({opacity: 0.0}, 400);
		
		var id= $(this).attr('rel');
		var id2 = (parseInt(id))-1;
		$('#i'+id).css({opacity:0.0})
			.addClass('show')
			.animate({opacity: 1.0}, 300);
		var marg = (id==1)? (marg = 28):(marg = 28+(77*id2));
		$('#arrow').css({'margin-top':marg});
	});
	
	disable_ahref_on_nav();
}


//disable some of the a links in the navigation menu
function disable_ahref_on_nav(){
	$('#menu-item-17').find('a:first').attr({'href':''});
	$('#menu-item-33').find('a:first').attr({'href':'http://umlautlimited.com/new_site/WP/services/design'});
	$('#menu-item-55').find('a:first').attr({'href':'http://umlautlimited.com/new_site/WP/portfolio/kitchens'});
}

//the main navigation menu functions
function navigation_menu(){
	$('#nav').find('.subn').hide();
	$('#nav').find('li').hover(function(){
		$(this).find('.subn').show();
	}, function(){$(this).find('.subn').hide();});	
	
	$('#menu-main_nav').find('.sub-menu').hide();
	$('#menu-main_nav').find('li').hover(function(){
		$(this).find('.sub-menu').show();
	}, function(){$(this).find('.sub-menu').hide();});
}

function inside_side_nav(){
	$('#side_nav').find('a').hover( function(){
		$(this).parent('li')
			.css({'background-color':'#646363'});
	},function(){
		$(this).parent('li')
			.css({'background-color':'#8a8a8a'});
	});
}

//slideshow
function slideshow(){
	$('#slider_b').find('img').css({opacity: 0.0});
	$('#slider_b').find('img:first').css({opacity: 1.0});
	setInterval('gallery()', 6000);	
}
function gallery(){
	var current = ($('#slider_b img.show')? $('#slider_b img.show') : $('#slider_b img:first'));	
	var current_sm = ($('#slider_rotate a.showW')? $('#slider_rotate a.showW') : $('#slider_rotate a:first'));
	
	var curr_marg = parseInt($('#arrow').css('margin-top'));
	var marg = curr_marg +77; 
	
	var next_sm = (current_sm.next().hasClass('lastone'))? $('#slider_rotate a:first') :current_sm.next();
	 
	if(current.next().length){
		if(current.next().hasClass('lastone')){
			var next = $('#slider_b img:first');
			$('#arrow').css({'margin-top':'28px'});
		}else{
			var next = current.next();
			$('#arrow').css({'margin-top':marg});			
		}
	}else{
		var next = $('#slider_b img:first');
	}
	
	next.css({opacity:0.0})
		.addClass('show')
		.animate({opacity: 1.0}, 800);
		
	current.animate({opacity: 0.0}, 800)
		.removeClass('show');
		
	next_sm.addClass('showW');		
	current_sm.removeClass('showW');
}
