$(document).ready(function(){
	
    //$("._js_scrollable").scrollable();

    $("a[rel='example1']").colorbox();
    $("a.colorbox").colorbox();

    var slider_time = 10000;
       

    $('#slider').tinycarousel({
        interval: true, 
        intervaltime: slider_time, 
        animation: true, 
        axis: 'y'
    });
    $('#slider_novinky_index').tinycarousel({
        'axis':'y',
        'display': 3
    });
    $('#slider_novinky_page').tinycarousel({
        'axis':'y',
        'display': 2
    });
    $('#slider_novinky_novinky').tinycarousel({
        'axis':'y',
        'display': 5
    });


    jQuery('.carusel2').jcarousel({
        scroll: 1,
        wrap: 'last',
        initCallback: mycarousel_initCallback
        });
        
    //input---------------------------------
    //onclick reset input value
    $('._js_input').focus(
        function() {
            if (this.value == this.defaultValue) {
                this.value = '';
            }
        }
        );

    $('._js_input').blur(
        function() {
            if (this.value == '') {
                this.value = this.defaultValue;
            }
        }
        );

        

});

// JavaScript Document
function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        //carousel.startAuto(0); //stop autoscroll
    });

    carousel.buttonPrev.bind('click', function() {
        //carousel.startAuto(0); //stop autoscroll
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

function NewWindow(mypage,myname,w,h,scroll){
    var win= null;
    var winl = (screen.width-w)/2;
    var wint = (screen.height-h-80)/2;
    var settings ='height='+h+',';
    settings +='width='+w+',';
    settings +='top='+wint+',';
    settings +='left='+winl+',';
    settings +='scrollbars='+scroll+',';
    settings +='resizable=yes';
    win=window.open(mypage,myname,settings);
    if(parseInt(navigator.appVersion) >= 4){
        win.window.focus();
    }
}

function initialize(_long, _lat) {
    var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(_long, _lat), 12);
        map.setUIToDefault();
    var marker = new GMarker(new GLatLng(_long, _lat));
    map.addOverlay(marker);
    map.disableScrollWheelZoom();
    

} 
