var images_info = [
	{path:'_lib/img/index_lang_pt_over.jpg',	left:190, top:540},
	{path:'_lib/img/index_lang_en_over.jpg',	left:303, top:540},
	{path:'_lib/img/index_plura_over.jpg',		left:304, top:575}
];

$(document).ready(function(){

		var styles = {
			pop:	{'width':'500px','height':'500px','position':'absolute','z-index':'10','background-color':'#f39','padding':'0px','left':'50%','top':'50%','margin-left':'-250px','margin-top':'-250px'},
			popp:	{'height':'12px','width':'500px','margin':'0px','padding':'4px 0 4px 20px','color':'#fff','font-family':'Verdana','font-size':'9px','font-weight':'bold','cursor':'pointer'},
			popi: 	{'width':'460px','height':'460px','margin-left':'20px','overflow':'auto','border':'none','background-color':'#fff'}
		}

		//popup1
		$('<div id="pop1"><p/><iframe/></div><div id="pop2"><p/><iframe/></div>').appendTo('body').css(styles.pop).hide();
		$('#pop1 p, #pop2 p').text('fechar | close').css(styles.popp).click(function(){ $(this).parent().hide('slow'); });
		$('#pop1 iframe, #pop2 iframe').css(styles.popi);
		
		$('#pop1 iframe').attr('src','extra/popup1.php');
		$('#map1 area:eq(0)').click(function(){ $('#pop1').show('slow'); });
		
		$('#pop2 iframe').attr('src','extra/popup2.php');
		$('#map1 area:eq(4)').click(function(){ $('#pop2').show('slow'); })
				
		
		//rollovers
		$(images_info).each(function(i){
				$('#index').append('<img src="'+images_info[i].path+'" id="img'+i+'"/>');
				
				$('#img'+i).attr('href', $('#map2 area:eq('+i+')').attr('href'))
						   .css({'position':'absolute', 'top':images_info[i].top, 'left':images_info[i].left, 'cursor':'pointer', 'z-index':(10+i)})
						   .click(function(){ document.location = $(this).attr('href'); })
						   .mouseout(function() { $(this).hide(); })
						   .hide();	
						   
				$('#map2 area:eq('+i+')').attr("img", "#img"+i).mouseover(function(){ $($(this).attr('img')).show(); });
			}
		);
	}
);