// JavaScript Document

jQuery.noConflict();

//animacao top - bottom
jQuery('html, body').animate({
    scrollTop: jQuery("#footer").offset().top
}, 2000);
jQuery('html, body').animate({
    scrollTop: jQuery("#header").offset().top
}, 500);
jQuery('html, body').animate({
    scrollTop: jQuery("#contentWindow").offset().top
}, 1000);

//mudanca de pagina
	function changePageWork(pag){
		if (jQuery("#contentWindowTeam").is(":visible")) {
			jQuery("#contPaiTeam").fadeOut(400);
			jQuery("#contentWindowTeam").slideUp(1000, function(){
				jQuery('html, body').animate({scrollTop: jQuery("#anc").offset().top}, 1000);
				jQuery("#contentWindowWork").slideDown(1000, function() {
    				jQuery("#contentWindowWork").load(pag);
  				});
			});
		}
		else if (jQuery("#contentWindowNews").is(":visible")) {
			jQuery("#contPaiShop").fadeOut(400);
			jQuery("#contentWindowNews").slideUp(1000, function(){
				jQuery('html, body').animate({scrollTop: jQuery("#anc").offset().top}, 1000);
				jQuery("#contentWindowWork").slideDown(1000, function() {
    				jQuery("#contentWindowWork").load(pag);
  				});
			});
		}
		else if (jQuery("#contentWindowWork").is(":visible")) {
			jQuery("#contPai").fadeOut(400);
			jQuery("#contentWindowWork").slideUp(1000)
		}
		else
	jQuery("#contentWindowWork").slideDown(1000, function() {
    jQuery("#contentWindowWork").load(pag);
  });
  
	}//end

	function changePageTeam(pag){
		if (jQuery("#contentWindowWork").is(":visible")) {
			jQuery("#contPai").fadeOut(400);
			jQuery("#contentWindowWork").slideUp(1000, function(){
				jQuery('html, body').animate({scrollTop: jQuery("#anc").offset().top}, 1000);
				jQuery("#contentWindowTeam").slideDown(1000, function() {
    				jQuery("#contentWindowTeam").load(pag);
  				});
			});
		}
		else if (jQuery("#contentWindowNews").is(":visible")) {
			jQuery("#contPaiShop").fadeOut(400);
			jQuery("#contentWindowNews").slideUp(1000, function(){
				jQuery('html, body').animate({scrollTop: jQuery("#anc").offset().top}, 1000);
				jQuery("#contentWindowTeam").slideDown(1000, function() {
    				jQuery("#contentWindowTeam").load(pag);
  				});
			});
		}
		else if (jQuery("#contentWindowTeam").is(":visible")) {
			jQuery("#contPaiTeam").fadeOut(400);
			jQuery("#contentWindowTeam").slideUp(1000)
		}
		else
	jQuery("#contentWindowTeam").slideDown(1000, function() {
    jQuery("#contentWindowTeam").load(pag);
  });
  
	}//end

	function changePageNews(pag){
		if (jQuery("#contentWindowWork").is(":visible")) {
			jQuery("#contPai").fadeOut(400);
			jQuery("#contentWindowWork").slideUp(1000, function(){
				jQuery('html, body').animate({scrollTop: jQuery("#anc").offset().top}, 1000);
				jQuery("#contentWindowNews").slideDown(1000, function() {
    				jQuery("#contentWindowNews").load(pag);
  				});
			});
		}
		else if (jQuery("#contentWindowTeam").is(":visible")) {
			jQuery("#contPaiTeam").fadeOut(400);
			jQuery("#contentWindowTeam").slideUp(1000, function(){
				jQuery('html, body').animate({scrollTop: jQuery("#anc").offset().top}, 1000);
				jQuery("#contentWindowNews").slideDown(1000, function() {
    				jQuery("#contentWindowNews").load(pag);
  				});
			});
		}
		else if (jQuery("#contentWindowNews").is(":visible")) {
			jQuery("#contPaiShop").fadeOut(400);
			jQuery("#contentWindowNews").slideUp(1000)
		}
		else
	jQuery("#contentWindowNews").slideDown(1000, function() {
    jQuery("#contentWindowNews").load(pag);
  });
  
	}//end

	function changePageWorkInd(pag){
	jQuery("#contentWindowWork").slideDown(1000, function() {
    jQuery("#contentWindowWork").load(pag);
  });
  
	}//end

	function changePageShop(pag){
	jQuery("#contentWindowNews").slideDown(1000, function() {
    jQuery("#contentWindowNews").load(pag);
  });
  
	}//end


	function changePageFilter(pag){
	jQuery("#contPai").fadeOut(1000, function() {
    jQuery("#contentWindowWork").load(pag);
  });
  
	}//end
	
	function changePageFilterShop(pag){
	jQuery("#contPaiShop").fadeOut(1000, function() {
    jQuery("#contentWindowNews").load(pag);
  });
  
	}//end
	
	function changeMapLisbon(){
		if (jQuery("#mapWindowAngola").is(":visible")) {
			jQuery("#imgLuanda").attr("class", "seeMap");
			jQuery("#mapWindowAngola").slideUp(1000, function(){
				jQuery('html, body').animate({scrollTop: jQuery("#anc2").offset().top}, 1000);
				jQuery("#mapWindowLisbon").slideDown(1000, function() {
    			jQuery("#mapWindowLisbon").load('maps.html #mapLisbon');
				jQuery("#imgLisbon").attr("class", "hideMap");
  				});
			});
		}
		else if (jQuery("#mapWindowLisbon").is(":visible")) {
			jQuery("#mapWindowLisbon").slideUp(1000);
			jQuery("#imgLisbon").attr("class", "seeMap");
		}
		else
	jQuery("#mapWindowLisbon").slideDown(1000, function() {
	jQuery("#imgLisbon").attr("class", "hideMap");
    jQuery("#mapWindowLisbon").load('maps.html #mapLisbon');
  });
  
	}//end
	
		function changeMapAngola(){
		if (jQuery("#mapWindowLisbon").is(":visible")) {
			jQuery("#imgLisbon").attr("class", "seeMap");
			jQuery("#mapWindowLisbon").slideUp(1000, function(){
				jQuery('html, body').animate({scrollTop: jQuery("#anc2").offset().top}, 1000);
				jQuery("#mapWindowAngola").slideDown(1000, function() {
    			jQuery("#mapWindowAngola").load('maps.html #mapAngola');
				jQuery("#imgLuanda").attr("class", "hideMap");
  				});
			});
		}
		else if (jQuery("#mapWindowAngola").is(":visible")) {
			jQuery("#mapWindowAngola").slideUp(1000);
			jQuery("#imgLuanda").attr("class", "seeMap");
		}
		else
	jQuery("#mapWindowAngola").slideDown(1000, function() {
    jQuery("#mapWindowAngola").load('maps.html #mapAngola');
	jQuery("#imgLuanda").attr("class", "hideMap");
  });
  
	}//end

	
function slideToWork(pagw){
			if (jQuery("#contentWindowTeam").is(":visible")) {
			jQuery("#contPaiTeam").fadeOut(400);
			jQuery("#contentWindowTeam").slideUp(1000, function(){
				jQuery('html, body').animate({scrollTop: jQuery("#anc").offset().top}, 2000);
				jQuery("#contentWindowWork").slideDown(1500, function() {
				jQuery("#contentWindowWork").load(pagw);
  				});
			});
		}
		else if (jQuery("#contentWindowNews").is(":visible")) {
			jQuery("#contPaiShop").fadeOut(400);
			jQuery("#contentWindowNews").slideUp(1000, function(){
				jQuery('html, body').animate({scrollTop: jQuery("#anc").offset().top}, 2000);
				jQuery("#contentWindowWork").slideDown(1500, function() {
				jQuery("#contentWindowWork").load(pagw);
  				});
			});
		}
		else
	jQuery('html, body').animate({scrollTop: jQuery("#anc").offset().top}, 2000);
	jQuery("#contentWindowWork").slideDown(1500, function() {
    jQuery("#contentWindowWork").load(pagw);
  });
}//end
	

//relogio
function updateClock ( )
{
  var currentTime = new Date ( );

  var currentHours = currentTime.getHours ( );
  var currentMinutes = currentTime.getMinutes ( );
  var currentSeconds = currentTime.getSeconds ( );

  // Pad the minutes and seconds with leading zeros, if required
  currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;

  // Compose the string for display
  var currentTimeString = currentHours + ":" + currentMinutes;

  // Update the time display
  document.getElementById("clock").firstChild.nodeValue = currentTimeString;
}//end

//filtro all
	function changeAll(){
	jQuery("#contPai").fadeOut(1000, function() {
	jQuery("#contentWindowWork").load('works.php')
  });
  
	}//end
	
//filtro client
	function changeClient(){
	jQuery("#contPai").fadeOut(1000, function() {
	jQuery("#contentWindowWork").load('filterClient.php')
  });
  
	}//end

//filtro offering
	function changeOffering(){
	jQuery("#contPai").fadeOut(1000, function() {
	jQuery("#contentWindowWork").load('filterOffering.php')
  });
  
	}//end

