$(document).ready(function(){
	
	$("#tab-about").attr('src',"img/tab-about-over.png");
	$("#content-about").show();	
	$("#content3").css({"border-top-left-radius":"0px","-moz-border-radius-topleft":"0px","-webkit-border-top-left-radius":"0px"});

	
	$(".infoTab").click(function(){
		
		if($(this).attr('src').indexOf("-over") != -1)
		{
			return false;
		}
		
		fullName = $(this).attr('src');
		fullName = fullName.split("/");
		path	 = fullName[0];
		fullName = fullName[1].split(".");
		
		name = fullName[0];
		extension = fullName[1];
		
		clearTabs();
		
		$(this).attr('src', path + '/' + name + '-over.' + extension);
		
		if($(this).attr('src').indexOf("about") != -1){  
			$("#content-about").show();	
			$("#content3").css({"border-top-left-radius":"0px","-moz-border-radius-topleft":"0px","-webkit-border-top-left-radius":"0px"});	
		} 

		if($(this).attr('src').indexOf("dev") != -1){  
			$("#content-dev").show();				
		} 
		
		if($(this).attr('src').indexOf("contact") != -1){  
			$("#content-contact").show();	
			$("#content3").css({"border-top-right-radius":"0px","-moz-border-radius-topright":"0px","-webkit-border-top-right-radius":"0px"});		
			
		} 
		
		if($(this).attr('src').indexOf("news") != -1){  
			$("#content-news").show();	
		} 
		
		if($(this).attr('src').indexOf("faq") != -1){  
			$("#content-faq").show();	
		}
		
	});
	
	$(".faq-header").click(function(){
		$(this).parent().children('.faq-content').slideToggle(function(){
			$('body').scrollTo($(this).parent(),100);		
				
			visibility = $(this).parent().children('.faq-content').css('display');	
				
			if(visibility == 'none')
			{
				$(this).parent().children('.faq-header').children('.faq-plus').attr('src','img/plus.png');

			}else{
				$(this).parent().children('.faq-header').children('.faq-plus').attr('src','img/minus.png');	
			}
		});

		
	});
	
});

function clearTabs(){
	
	$('body').scrollTo( $('#content3-tabs'), 100);
	
	$("#tab-about").attr('src','img/tab-about.png');
	$("#tab-dev").attr('src','img/tab-dev.png');
	$("#tab-contact").attr('src','img/tab-contact.png');
	$("#tab-news").attr('src','img/tab-news.png');
	$("#tab-faq").attr('src','img/tab-faq.png');
	
	$("#content-about").hide();	
	$("#content-dev").hide();	
	$("#content-news").hide();				
	$("#content-faq").hide();			
	$("#content-contact").hide();	
	
	$("#content3").css({"border-radius":"10px","-moz-border-radius":"10px","-webkit-border-radius":"10px"});	
}	
