


$(document).ready(function(){
	

	Cufon.replace(['.mainBox p, .mainMenu > li > a, .sideLeft > .caption p, .mainBoxDark > .caption, .sideRight > .caption'],	 { fontFamily: 'Bodoni', hover: true });

	
	$('a img, input[type=image], .mainLogo a').not('.slidesContainer a img, .topLanguage a img').hover(
	  function () {
		$(this).fadeTo("fast", 0.7);
	  }, 
	  function () {
		$(this).fadeTo("fast", 1);
	  }
	);	
	
	$(".topLanguage a img").fadeTo(0, 0.6);
	$(".topLanguage li.active a img").fadeTo(0, 1);
	$(".topLanguage li").not(".topLanguage li.active").hover(
	  function () {
		$('a img', this).fadeTo("fast", 1);
	  }, 
	  function () {
		$('a img', this).fadeTo("fast", 0.6);
	  }
	);	
	
	$('.mapSide > a').click(function() {
		return false;
	});
	
	$('.mITitle a').click(function(){
		$(this).parent().parent().animate({opacity: "hide"}, "fast");
		return false;
	});
	
	$('.mainSlider').slides({
		preload: true,
		preloadImage: 'img/loading.gif',
		play: 4500,
		pause: 2500,
		hoverPause: true,
		generatePagination: true,
		container: 'slidesContainer'
	});
	
	$('.jobOffers tr:nth-child(2n)').addClass('even');
	$('.mainMenu > li:last-child').addClass('last');
	$('.mainMenu > li:last-child').prev().addClass('lastPrev');
	
	$('.menuLeft  li ul').parent().addClass('withSubMenu');
	
	$('.mapSearch input[type=text]').focus(function(){
		if(this.value=="wpisz miasto"){
    		this.value = "";
    	}}
    );	
	$('.mapSearch input[type=text]').blur(function () {
		if(this.value==""){
			this.value = "wpisz miasto";
		}}
    );	
    
	$(function () {
		var tabContainers = $(".tab");
		tabContainers.hide().filter(":first-child").show();
		$(".mainBoxNav li a").click(function () {
			tabContainers.hide();
			tabContainers.filter('.'+this.rel).show();
			$(this).parent().parent().children('li').removeClass("active");
			$(this).parent().addClass("active");
			return false;
		}).filter(".mainBoxNav li:first-child a").click();
	});


	$('img[usemap]').maphilight({
        fill: true,
        fillColor: 'c5e4ff',
        fillOpacity: 1,
        stroke: true,
        strokeColor: 'a8c5e3',
        strokeOpacity: 0.9,
        strokeWidth: 2,
        fade: true,
        alwaysOn: false,
        neverOn: false,
        groupBy: false
    });
    

    var triggerFlag = 0;
    
	$("area").hover(function(){
		if(triggerFlag==1){
            (this).next().css("display","block");
        }else{
            $('.mapSide').animate({opacity: "hide"}, "fast");
            triggerFlag = 0;
        }
		$(this).next().animate({opacity: "show"}, "fast");     
	}, function() {
		$(this).next().css("display","none");
	});
	$(".mapSide").hover(function(){
        triggerFlag = 1;
        $(this).prev().trigger('mouseover');
		$(this).css("display","block");
      
	}, function() {
        triggerFlag = 0;
        $(this).prev().trigger('mouseout');
		$(this).css("display","none");
        

	});
	
	$(".redirectGoogleMaps").click(function(){
		var adres = $(this).attr("href");
		adres = adres + $(".txtPostcode").val();
		window.location.href = adres;
		return false;

	});
	
	$("#move-to-selected-category").change(function(){
		var link = $(this).val();
		if(link != 0){
			if(link == 1){
				link = "http://www.axxiome.com/jobs/";
			}
			document.location.href = link;
		}
	});
	
 });
 
 /*
 	$("area").mouseover(function(){

		$('.mapSide').animate({opacity: "hide"}, "fast");
		$(this).next().animate({opacity: "show"}, "fast");
	}).mouseout(function(){

		$(this).next().css("display","none");
	});
	$(".mapSide").mouseover(function(){
		$(this).css("display","block");
	}).mouseout(function(){
		$(this).animate({opacity: "hide"}, "fast");
	});
	
 });
 */



