jQuery(document).ready(function() {
    
    
    
    $('.miniatury ul li:first-child a img').css('opacity',0.5);

    $(".miniatury a").click(function(){

            $('.miniatury a img').css('opacity',1);
            $(this).children().css('opacity',0.5);

            var sciezka = $(this).attr("href");
            var tytul = $(this).attr("title");
						
						//alert($("#duze_a").attr({ href: sciezka }));

            $(".duzy").attr({ src: sciezka, alt: tytul });
						$(".duze_a").attr({ href: sciezka });

            return false;
    });
    
    
    
    $("#slider").easySlider({
        prevText: '',
	nextText: ''
    });

    var sprawdz = document.getElementById('fileFile');

    if(sprawdz) {

        $('#fileFile').uploadify(
        {
            'uploader' : '/public/scripts/jquery.uploadify/uploadify.swf',
            'script2' : '/ajax/index/upload/',
            'script' : '/public/scripts/jquery.uploadify/uploadify.php',
            'cancelImg' : '/public/scripts/jquery.uploadify/cancel.png',
            'folder' : '/public/admin/cv',
            'auto' : true,
            'multi' : false,
            'removeCompleted' : false,
            'hideButton' : true,
            'width' : 100,
            'height' : 160,
            'wmode' : 'transparent',
            'fileExt' : '*.jpg;*.jpeg',
            'fileDesc' : 'Pliki JPG (.jpg, .jpeg)',
            'onCancel' : function(event, ID, fileObj, data)
            {
                fileCVUsun();
            },
            'onComplete' : function(event, ID, fileObj, response, data)
            {
                //data.speed in kbs, response from php
                $('.file').replaceWith('<div id="file" class="file"><div id="fileInner"><span></span><img id="fileImg" src="/public/admin/cv/_' + response + '" alt="" /></div></div>');
                $('#fileCVName').val(response);
                $('#fileUsun').remove();
                //window.alert(response);
            }
        });

    }

//$(".footer_inner").height($(document).height()-260);
    /***STOPKA***/
    if ($("body").height() > $(window).height()) {
        $('#jQ_foot').css('position', 'static');
//        $('#jQ_foot').height($(document).height());
    } else{
        $('#jQ_foot').css('position', 'fixed');
        $('#jQ_foot').css('bottom', '0px');
//        $('#jQ_foot').height($(document).height());
    }

$(".c_left, .c_center, .c_right").height($(".content_left").height());

    /***CUFON***/
    /***CZCIONKI***/
//    Cufon.replace(".main_menu",{
//	hover: true
//    });
//    Cufon.replace(".header2_left");
//    Cufon.replace(".title");
//    Cufon.replace(".footer1");

});

function fileCVUsun() {
    $('#file').replaceWith('<div id="file2" class="file">Dodaj zdjęcie</div>');
    $('#fileCVName').val('');
    $('#fileUsun').remove();
}

/***MAPA GOOGLE***/

function initialize() {
    var latlng = new google.maps.LatLng(50.02638, 21.979716);
    var myOptions = {
      zoom: 15,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById("maps"),
            myOptions);

    var contentString =
            '<div><br /><h4>BigCom - agencja interaktywna</h4><br />'+
            'ul. Tadeusza Boya-Żeleńskiego 12,<br />' +
            '35-105 Rzeszów,<br />' +
            'telefon: +48 17 864 22 60 <br />'+
            '</div>';

    var marker = new google.maps.Marker({
      position: latlng
    });


    var infowindow = new google.maps.InfoWindow({
            content: contentString
    });

    marker.setMap(map);
    infowindow.open(map,marker);
}

