// JavaScript Document
var $ = jQuery.noConflict();
$(document).ready(function(){

/*
	FLIR.init( { path: 'library/plugins/FLIR/' } );
	
	$("ul.links li a").each(function(){ 
			FLIR.replace(this , new FLIRStyle({ cFont:'content_header1' }) ); 
	});
	
	$("h1, h2, h3, h4, h5, h6, .ref_title").each(function(){ 
			FLIR.replace(this , new FLIRStyle({ cFont:'content_header1' , mode:'wrap', useExtendedStyles:true }) ); 
	});
*/


	$('.dot_big_image').click(function(){
		window.location.href = 'index.php';
	});
	
	$('.image_container > div').hover(function(){
		
			$(this).css({ borderColor: '#0f5082'});
		
		},function(){
		
				$(this).css({ borderColor: '#CCC'});
		
			});
	
	$('.header_letters ul li[list_value]').bind("mouseenter",function(){
		$('.keyword > div').html($(this).attr('list_value'));
	});
	
	$('.recent_work1, .recent_work2, .click_work').click(function(){
		
		var thisID = $(this).attr('p_id');
		var types = $(this).attr('type');
		showPopUp(types,thisID);
	
	});
	
	$('.close_btn_wrapper').stop().fadeTo('slow', 0.5);
		
	function showPopUp(type_popup,thisID){
		
		var pwidth = $('body').width();
		var pheight = $('body').height();
		
		
		$('.fader').animate({
			width: pwidth,
			height: pheight
		}, 100).stop().fadeTo('slow', 0.5);
		
		//switch(type_popup){
		//	case "identities":
				$('.popup_portfolio').fadeTo('fast', 1);
				$.post("library/includes/views/popup_portfolio.php", { id: thisID, type: type_popup } , function(data){
					$('.popup_portfolio').html(data);
				});
		//	break;
		//}
	
	}
	
	$('.popup_portfolio').bind("mouseenter", function(){
		$('.fader').stop().fadeTo("slow", 0.5);
		$(this).stop().fadeTo("slow", 1);
		$('.close_btn_wrapper').stop().fadeTo('slow', 0.5);
	});
	
	$('.fader').bind("mouseenter", function(){
		$(this).stop().fadeTo("slow", 0.3);
		$('.popup_portfolio').stop().fadeTo("slow", 0.9);
		$('.close_btn').stop().fadeTo('slow', 1);
	}).click(function(){
		$('.popup_portfolio').hide();
		$(this).hide();
	});
	
	
	$('.scroll-content').each(function(){
	
		var countItems = $('> * .click_work', this).size();
		var widthContent = eval((countItems * 128) + (countItems * 23)) + 'px';  
		//alert(countItems);
		$(this).css({ width: widthContent });
	
	});
	
	$('table.cv tr.info').hover(function(){
		
		$(this).css({ backgroundColor: '#f3f3f3' });
		$(this).prev().css({ backgroundColor: '#f3f3f3' });
		$(this).next().css({ backgroundColor: '#f3f3f3' });
	
	},function(){
		
		$(this).css({ backgroundColor: '#fff' });
		$(this).prev().css({ backgroundColor: '#fff' });
		$(this).next().css({ backgroundColor: '#fff' });

	});
	
	/*$(".recent_work[product_slider='true']").easySlider();*/
	

});
