$(document).ready(function(){

	
	$(".menu ul li").fadeIn(700);
	$(".rside a img").fadeIn("slow");
	$(".rside a img").fadeIn("slow");

	
	$('.rside a img').each(function(a){
	
	});
	/////////////////////////MAIN MENU////////////////////
	var totWidth=0;
	var ttl=0;
	var positions = new Array();
	var custom2 = new Array();
	
	$('#menu ul li a').click(function(e){
			$('li.menuItem').removeClass('act').addClass('inact');
			$(this).parent().addClass('act');
			var pos = $(this).parent().prevAll('.menuItem').length;
			$('#slides').stop().animate({marginLeft:-positions[pos]+'px'},450);
			e.preventDefault();
	});
	$('#menu ul li.menuItem:first').addClass('act').siblings().addClass('inact');
	
	$('#homeslides .homeslide').each(function(a){
		custom2[a]= ttl;
		ttl += $(this).width();
		if(!$(this).width())
		{
			alert("Please, fill in width & height for all your images!");
			return false;
		}
	});
	$('#homeslides').width( ttl);
	
	//hover
	$('.rside a').hover(function(){
		$(this).stop().fadeTo(300,1);
	});
	$('.rside a').mouseleave(function(){
		$(this).stop().fadeTo(300,0.6);
	});
	
	//mainmenu:HOME
	$('.one a').click(function(b){$('#homeslides').stop().animate({marginLeft:-custom2[0]+'px'},650);b.preventDefault();});
	$('.two a').click(function(b){$('#homeslides').stop().animate({marginLeft:-custom2[1]+'px'},650);b.preventDefault();
	$('.aboutslide').animate({scrollTop: $("#main").offset().top},'slow');
	});
	$('.three a').click(function(b){$('#homeslides').stop().animate({marginLeft:-custom2[2]+'px'},650);b.preventDefault();});
	$('.four a').click(function(b){$('#homeslides').stop().animate({marginLeft:-custom2[3]+'px'},650);b.preventDefault();});
	$('.five a').click(function(b){$('#homeslides').stop().animate({marginLeft:-custom2[4]+'px'},650);b.preventDefault();});
	$('.six a').click(function(b){$('#homeslides').stop().animate({marginLeft:-custom2[5]+'px'},650);b.preventDefault();});
	$('.seven a').click(function(b){$('#homeslides').stop().animate({marginLeft:-custom2[6]+'px'},650);b.preventDefault();});
	$('.eight a').click(function(b){$('#homeslides').stop().animate({marginLeft:-custom2[7]+'px'},650);b.preventDefault();});
	
	$('.hmenu .hmenu1').click(function(b){
		$('.aboutslide').animate({scrollTop: $(".content2").offset().top - 160},'slow');
	});
	$('.hmenu .hmenu2').click(function(b){
		$('.aboutslide').animate({scrollTop: $(".content3").offset().top - 160},'slow');
	});
	$('.hmenu .hmenu3').click(function(b){
		$('.aboutslide').animate({scrollTop: $(".content4").offset().top - 160},'slow');
	});
	
});

