﻿function doResize() {


//    var windowHeight = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;

//    if (windowHeight > 650) {
//        $("#img_alt").css("position", "fixed");
//        $("#img_alt").css("top", "461px");

//        $("#about").css("bottom", "");
//        $("#about").css("position", "fixed");
//        $("#about").css("top", "537px");
//    }
//    else {
//        $("#img_alt").css("position", "relative");
//        $("#img_alt").css("top", "-573px");

//        $("#about").css("top", "");
//        $("#about").css("position", "absolute");
//        $("#about").css("bottom", "0px");

//    }
}

window.onresize = doResize;

function validate_email() {
    return true;
}

$(document).ready(function () {

    $('#panelContact').hide();
    $('#panelPrograms').hide();
    $('#panelCooperation').hide();
    $('#panelAdditional').hide();
    $('#panelGallery').hide();
    $('#panelYouTube').hide();
    $('#panelMessage').hide();


    doResize();

    var windowHeight = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;

    if (windowHeight > 650) {
        $("#imButton1").animate({ opacity: .8 });
        $("#imButton2").animate({ opacity: .6 });
        $("#imButton3").animate({ opacity: .4 });
        $("#imButton4").animate({ opacity: .2 });
    }

    $('#cross-slide').crossSlide({
        sleep: 4,
        fade: 1
    }, [
                  { src: 'pictures/main_1.jpg', text: "<i><center>Our dreams are about sport. Our vision is about sport. Our world is sport.</center></i> " },
                  { src: 'pictures/main_2.jpg', text: "<center><b>Our mission:</b> To provide professional athletes with motivating, effective and enjoyable rope skipping training.</center>" },
                  { src: 'pictures/main_3.jpg', text: "<center> We will enable athletes to achieve higher level performance and discover wider range of effective training programs by using jump rope.</center>" },
                  { src: 'pictures/main_4.jpg', text: "<i>Endurance and speed training helped me to take my performance to higher level. It was one of the most effective training programs I’ve tried. It kept me focused all the time. </i><br />" },
                  { src: 'pictures/main_5.jpg', text: "<i>Amazing program, enjoyable, effective, creative and versatile, you have to try it to believe it.</i>&nbsp;&nbsp;University of Maribor" },
                  { src: 'pictures/main_6.jpg', text: "<i>... I definitely recommend the program to everyone, you can improve your condition and coordination at the same time, and you will enjoy it as well.</i>&nbsp;&nbsp;Gergo Woller European Wrestling Champion " }
                ], function (idx, img, idxOut, imgOut) {
                    if (idxOut == undefined) {
                        $('#img_alt2').html(img.alt).animate({ opacity: .6 })
                    }
                    else {
                        $('img_alt2').fadeOut()
                    }
                });

            });

            $(function () {
               

                $("#imTitle").animate({ top: -40 }).animate({ top: -75 });

                $("#imButtonEmail").hover(function () { $(this).css("cursor", "pointer") }, function () { $(this).css("cursor", "default") })
                $("#imButtonGallery").hover(function () { $(this).css("cursor", "pointer") }, function () { $(this).css("cursor", "default") })
                $("#imButtonYouTube").hover(function () { $(this).css("cursor", "pointer") }, function () { $(this).css("cursor", "default") })

                $("#tabs").tabs({});
                $("#tabs2").tabs({});
                $("#tabs3").tabs({});


                function makeShort() {
                    $("#imTitle").animate({ top: -75 });
                }

                function makeTall() {
                    $("#imTitle").animate({ top: -40 });
                }

                var config = {
                    over: makeTall, // function = onMouseOver callback (REQUIRED)    
                    timeout: 500, // number = milliseconds delay before onMouseOut    
                    out: makeShort // function = onMouseOut callback (REQUIRED)    
                };

                var config0 = {
                    over: makeBigOut0, // function = onMouseOver callback (REQUIRED)    
                    timeout: 500, // number = milliseconds delay before onMouseOut    
                    out: makeSmallIn0 // function = onMouseOut callback (REQUIRED)    
                };

                function makeBigOut0() {
                    $("#div0").animate({ opacity: 0, fontSize: 80 });
                }
                function makeSmallIn0() {
                    $("#div0").animate({ opacity: 1, fontSize: 16 })
                }


                $("#imTitle").hoverIntent(config);

                $("#imButton1, #div0").hover(function () { $(this).css("cursor", "pointer") }, function () { $(this).css("cursor", "default") })
                $("#imButton2, #div1").hover(function () { $(this).css("cursor", "pointer") }, function () { $(this).css("cursor", "default") })
                $("#imButton3, #div2").hover(function () { $(this).css("cursor", "pointer") }, function () { $(this).css("cursor", "default") })
                $("#imButton4, #div3").hover(function () { $(this).css("cursor", "pointer") }, function () { $(this).css("cursor", "default") })

                var windowHeight = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;

                $("#imButton1, #div0").click(function () {

                    $(this).attr('src', 'Pictures/about_b.jpg');
                    $(this).animate({ opacity: 1 })

                    $("#imButton2").attr('src', 'Pictures/programs_c.jpg');
                    $("#imButton3").attr('src', 'Pictures/cooperation_c.jpg');
                    $("#imButton4").attr('src', 'Pictures/additional_c.jpg');

                    if (windowHeight > 650) {
                        $("#imButton2").animate({ opacity: 0.5 })
                        $("#imButton3").animate({ opacity: 0.5 })
                        $("#imButton4").animate({ opacity: 0.5 })
                    }
                    $('#panelContact').show();
                    $('#panelPrograms').hide();
                    $('#panelCooperation').hide();
                    $('#panelAdditional').hide();
                    $('#panelGallery').hide();
                    $('#panelYouTube').hide();
                    $('#panelMessage').hide();


                });
                $("#imButton2, #div1").click(function () {
                    $(this).attr('src', 'Pictures/programs_b.jpg');
                    $(this).animate({ opacity: 1 })

                    $("#imButton1").attr('src', 'Pictures/about_c.jpg');
                    $("#imButton3").attr('src', 'Pictures/cooperation_c.jpg');
                    $("#imButton4").attr('src', 'Pictures/additional_c.jpg');

                    if (windowHeight > 650) {
                        $("#imButton1").animate({ opacity: 0.5 })
                        $("#imButton3").animate({ opacity: 0.5 })
                        $("#imButton4").animate({ opacity: 0.5 })
                    }
                    $('#panelContact').hide();
                    $('#panelPrograms').show();
                    $('#panelCooperation').hide();
                    $('#panelAdditional').hide();
                    $('#panelGallery').hide();
                    $('#panelYouTube').hide();
                    $('#panelMessage').hide();


                });
                $("#imButton3, #div2").click(function () {
                    $(this).attr('src', 'Pictures/cooperation_b.jpg');
                    $(this).animate({ opacity: 1 })

                    $("#imButton2").attr('src', 'Pictures/programs_c.jpg');
                    $("#imButton1").attr('src', 'Pictures/about_c.jpg');
                    $("#imButton4").attr('src', 'Pictures/additional_c.jpg');

                    if (windowHeight > 650) {
                        $("#imButton1").animate({ opacity: 0.5 })
                        $("#imButton2").animate({ opacity: 0.5 })
                        $("#imButton4").animate({ opacity: 0.5 })
                    }

                    $('#panelContact').hide();
                    $('#panelPrograms').hide();
                    $('#panelCooperation').show();
                    $('#panelAdditional').hide();
                    $('#panelGallery').hide();
                    $('#panelYouTube').hide();
                    $('#panelMessage').hide();


                });
                $("#imButton4, #div3").click(function () {
                    $(this).attr('src', 'Pictures/additional_b.jpg');
                    $(this).animate({ opacity: 1 })

                    $("#imButton2").attr('src', 'Pictures/programs_c.jpg');
                    $("#imButton3").attr('src', 'Pictures/cooperation_c.jpg');
                    $("#imButton1").attr('src', 'Pictures/about_c.jpg');

                    if (windowHeight > 650) {
                        $("#imButton1").animate({ opacity: 0.5 })
                        $("#imButton2").animate({ opacity: 0.5 })
                        $("#imButton3").animate({ opacity: 0.5 })
                    }

                    $('#panelContact').hide();
                    $('#panelPrograms').hide();
                    $('#panelCooperation').hide();
                    $('#panelAdditional').show();
                    $('#panelGallery').hide();
                    $('#panelYouTube').hide();
                    $('#panelMessage').hide();


                });
                $("#imButtonGallery").click(function () {
                    $('#panelContact').hide();
                    $('#panelPrograms').hide();
                    $('#panelCooperation').hide();
                    $('#panelAdditional').hide();
                    $('#panelGallery').hide();
                    $('#panelYouTube').hide();
                    $('#panelMessage').hide();


//                    $('#photos').galleryView({
//                        panel_width: 800,
//                        panel_height: 350,
//                        frame_width: 50,
//                        frame_height: 50
//                    });
                });
                $("#imButtonYouTube").click(function () {
                    $('#panelContact').hide();
                    $('#panelPrograms').hide();
                    $('#panelCooperation').hide();
                    $('#panelAdditional').hide();
                    $('#panelGallery').hide();
                    $('#panelYouTube').show();
                    $('#panelMessage').hide();



                });
                $("#imButtonEmail").click(function () {
                    $('#panelContact').hide();
                    $('#panelPrograms').hide();
                    $('#panelCooperation').hide();
                    $('#panelAdditional').hide();
                    $('#panelGallery').hide();
                    $('#panelYouTube').hide();
                    $('#panelMessage').show();



                });
            });
