// JS  -  JavaScript Document

var commworld = [];
commworld['pt'] = ["Portugal", "BBZ", "www.bbz.pt"];
commworld['es'] = ["Espanha", "Make", "www.agencia-de-publicidad.es"];
commworld['fr'] = ["França", "Raison de Plus", "www.raisondeplus.com"];
commworld['be'] = ["Bélgica", "IOTTA", "www.iotta.com"];
commworld['nl'] = ["Holanda", "Cooks", "www.cooks-inc.com"];
commworld['de'] = ["Alemanha", "Pro-Art", "www.pro-art.to"];
commworld['dk'] = ["Dinamarca", "727 Communications", "www.727.dk"];
commworld['se'] = ["Suécia", "Skooter", "www.skooter.se"];
commworld['ch'] = ["Suíça", "Kobalt", "www.kobalt.ch"];
commworld['it'] = ["Itália", "Gulliver", "www.gulliveradv.it"];
commworld['cz'] = ["República Checa", "Remmark", "www.remmark.cz"];
commworld['si'] = ["Eslovénia", "Kompas", "www.kompas-design.si"];
commworld['at'] = ["Aústria", "Reklamebüro", "www.reklamebuero.at"];
commworld['sk'] = ["Eslováquia", "Progress Promotion", "www.progress-promotion.sk"];
commworld['lv'] = ['Letónia', "Esplanade", "www.esplanade.lv"];
commworld['ee'] = ["Estónia", "Kala Ruudus", "www.kalaruudus.ee"];
commworld['ro'] = ["Roménia", "Heat", "www.heat.ro"];
commworld['bg'] = ["Bulgária", "Active Group", "www.activegroup.bg"];
commworld['ru'] = ["Rússia", "Arabesque", "www.arabesque.ru"];



$(document).ready(function() {
	$("#js-company-item-top").css({
		opacity: 0
	});
	
	$(".js-eur-tree-img").mouseover(function () {
		$(this).stop().animate({
			height: '99px',
			width: '93px'
		}, 200, function() {
			// Animation complete.
		});
		
		$(this).parent().stop().animate({
			height: '99px',
			width: '93px',
			left: '-34px'
		}, 200, function() {
			// Animation complete.
		});
		
		var tempId = $(this).parent().parent().attr('id');
		var partsArray = tempId.split('-');
		
		$('#js-company-item-top').stop().animate({
			opacity: 0
		}, 100, function() {
			$('#js-company-item-top-a').html(commworld[partsArray[2]][0]+'<br/>'+commworld[partsArray[2]][1]+'<br/>'+commworld[partsArray[2]][2]);
			$('#js-company-item-top').animate({
			opacity: 1
		}, 200, function() {
		});
		});
		
		
		
	});
	
	$(".js-eur-tree-img").mouseout(function () {
		$(this).stop().animate({
			height: '28px',
			width: '25px'
		}, 250, function() {
			// Animation complete.
		});
		
		$(this).parent().stop().animate({
			height: '28px',
			width: '25px',
			left: '0px'
		}, 250, function() {
			// Animation complete.
		});
		
		var tempId = $(this).parent().parent().attr('id');
		var partsArray = tempId.split('-');
			
		$('#js-company-item-top').stop().animate({
			opacity: 0
		}, 500, function() {
			$('#js-company-item-top-a').html("");
		});
		
		
		
		
	});
	
	
	$(".js-company-item").mouseover(function () {
		$(this).css({
			borderTop: 'dotted thin',
			borderBottom: 'dotted thin'
		});
		
		$(this).stop().animate({
			fontSize: '15px',
			lineHeight: '16px'
		}, 200, function() {
			// Animation complete.
		});
		
		var tempId = $(this).children().attr('id');
		var partsArray = tempId.split('-');
		
		$("#js-tree-"+partsArray[3]).children().children().stop().animate({
			height: '99px',
			width: '93px'
		}, 200, function() {
			// Animation complete.
		});
		
		$("#js-tree-"+partsArray[3]).children().stop().animate({
			height: '99px',
			width: '93px',
			left: '-34px'
		}, 200, function() {
			// Animation complete.
		});
		
	});
	
	$(".js-company-item").mouseout(function () {
		$(this).css({
			borderTop: 'none',
			borderBottom: 'none'
		});
		
		$(this).stop().animate({
			fontSize: '9px',
			lineHeight: '10px',
		}, 200, function() {
			// Animation complete.
		});
		
		var tempId = $(this).children().attr('id');
		var partsArray = tempId.split('-');
		
		$("#js-tree-"+partsArray[3]).children().children().stop().animate({
			height: '28px',
			width: '25px'
		}, 200, function() {
			// Animation complete.
		});
		
		$("#js-tree-"+partsArray[3]).children().stop().animate({
			height: '28px',
			width: '25px',
			left: '0px'
		}, 200, function() {
			// Animation complete.
		});
	});
	
});
	


