/*
jQuery(document).ready(function ($) {
	$('a[rel^="prettyPhoto"]').prettyPhoto({
		theme: 'dark_rounded'
	});
});
*/

$(function(){
	$(window).load(function() { 
	
		$("a[rel^='prettyPhoto']").prettyPhoto({
			social_tools: '<div class="facebook"><iframe src="http://www.facebook.com/plugins/like.php?locale=pt_BR&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'
		});

		
		$('.portfolio-thumb-link').live('click', function(){
			var dir 	= 'gallery/estrutura/';
			api_images 	= [dir+'estrutura_1.jpg',dir+'estrutura_2.jpg',dir+'estrutura_3.jpg',dir+'estrutura_4.jpg',dir+'estrutura_5.jpg',dir+'estrutura_6.jpg',dir+'estrutura_7.jpg',dir+'estrutura_8.jpg',dir+'estrutura_9.jpg',dir+'estrutura_10.jpg'];
			api_titles 	= ['Porto Brasil Grelhados','Porto Brasil Grelhados','Porto Brasil Grelhados','Porto Brasil Grelhados','Porto Brasil Grelhados','Porto Brasil Grelhados','Porto Brasil Grelhados','Porto Brasil Grelhados','Porto Brasil Grelhados','Porto Brasil Grelhados'];
			
			api_descriptions = ['Estrutura','Estrutura','Estrutura','Estrutura','Estrutura','Estrutura','Estrutura','Estrutura','Estrutura','Estrutura']
			$.prettyPhoto.open(api_images,api_titles,api_descriptions);
			
			return false;
		});
		
		$('.portfolio-video-link').live('click', function(){
			var dir 	= 'gallery/videos/';
			api_images 	= ['http://youtu.be/L-jsWrEH4H4?iframe=true&width=615&height=505','http://youtu.be/kazGj8LWUgA?iframe=true&width=615&height=505'];
			api_titles 	= ['Porto Brasil PITUBA','Porto Brasil VILLAS DO ATLÂNTICO'];
			
			api_descriptions = ['Passeio Virtual Pituba','Passeio Virtual Villas'];

			$.prettyPhoto.open(api_images,api_titles,api_descriptions);
			return false;
		});
		
		$('.newsLink').live('click', function(){
			var img 	= $(this).attr('href');
			var desc 	= $(this).attr('name');
			var title 	= $(this).attr('title');
			
			/*
			var ID_PRODUTO 	= ( $(this).attr('id') != '' )? $(this).attr('id') : 0;
			var URL_LINK	= 'http://portobrasilgrelhados.com.br/?p='+ID_PRODUTO+'#news';
			
			//console.log($(this).attr('id'));
			$(".news-link").prettyPhoto({
				social_tools: '<div class="facebook"><iframe src="http://www.facebook.com/plugins/like.php?locale=pt_BR&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'
			});
			*/
			$.prettyPhoto.open(img,title,desc);
			$.prettyPhoto.changePage('next');
			$.prettyPhoto.changePage('previous');
			//$.prettyPhoto.close();
			return false;
			
		});
		
		$('.menu-thumb-link').live('click', function(){
			var img 	= $(this).attr('href');
			var desc 	= $(this).attr('name');
			var title 	= $(this).attr('title');
			
			/*
			var ID_PRODUTO 	= ( $(this).attr('id') != '' )? $(this).attr('id') : 0;
			var URL_LINK	= 'http://portobrasilgrelhados.com.br/?p='+ID_PRODUTO+'#news';
			
			//console.log($(this).attr('id'));
			$(".news-link").prettyPhoto({
				social_tools: '<div class="facebook"><iframe src="http://www.facebook.com/plugins/like.php?locale=pt_BR&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'
			});
			*/
			$.prettyPhoto.open(img,title,desc);
			$.prettyPhoto.changePage('next');
			$.prettyPhoto.changePage('previous');
			//$.prettyPhoto.close();
			return false;
			
		});
		$("a[rel^='prettyPhoto']").trigger('click');
		
	});
});

