$(function() {
	$.easy.navigation();
	$.easy.tooltip();
	//$.easy.popup();
	$.easy.external();
	$.easy.rotate();
	$.easy.cycle();
	$.easy.forms();
	$.easy.showhide();
	$.easy.jump();
});

$(document).ready(function() {
	$("#footer").removeClass("inner");
	$('.project_gallery .project_gallery_thumb').click(function() {
		var img_id = $(this).attr("id");
		var ext = $(this).attr("alt");
		$('.project_gallery .full img').attr("src", "../userfile/media/"+img_id+"medium."+ext);
		$('.project_gallery .full a').attr("href", "../userfile/media/"+img_id+"medlarge."+ext);
	});
	
	    $('.sample_img').cycle({
        fx: 'fade',
        speed: 'slow',
        after: function(idx, slide, opts){
            $('#banner_title').html($(slide).children(0).attr('alt'));
            
        },
        pager: '#slide_list',
        
        pagerAnchorBuilder: function(idx, slide){
            return '<li><a href="#">' + (idx + 1) + '</a></li>';
        }
    });
	
	$('.data').each(function() {
		$(this).hide();
		if ($(this).attr("name") == 0) 
			$(this).show();
	});
	
	$("a.popup").fancybox();
	
	
	$('#tabs li').eq(0).addClass("selected");
	$('#tabs li').eq(0).children().css("visibility", "visible");
	contentSwitch(0);
	
	$('#tabs li a').each(function() {
		$(this).click(function() {
			var page_id = $(this).parent().attr("name");
			contentSwitch(page_id);
			
			
			$(this).parent().parent().children().each(function() {
				$(this).removeClass("selected");
				
			});
			
			$(this).parent().addClass("selected");
			
			
			
		});
	});
	
	function contentSwitch(page_id) {
	
		$('.data').each(function() {
			$(this).hide();
			if ($(this).attr("name") == page_id) 
				$(this).show();
		});
		
		
	}
	var content = parseInt($('#content').height());
	var header = parseInt($('#header').height());
	var footer = parseInt($('#footer').height());
	
	if (parseInt(content + header + footer) < parseInt($(window).height())) {
		var diff = parseInt($(window).height()) - parseInt(content + header + footer);
		$('#content').height(content + diff)
	}
});

