$(document).ready(function(){    /*TOP MENU*/    $(".topmenuinnerli").hover(function(){        },function(){            $(".innersubmenuul").slideUp("fast");        });    $(".topmenulink").hover(function(){        $(".innersubmenuul").hide();        $(this).next().slideDown("fast");        $(this).css("background","#505050");        $(this).css("color","#FFFFFF");        $(this).css("border-radius","5px 5px 0 0");        $(this).css("-moz-border-radius","5px 5px 0 0");        $(this).css("-webkit-border-radius","5px 5px 0 0");    },function(){        $(this).css("background","none");        $(this).css("color","#B31703");        $(this).css("border-radius","0 0 0 0");        $(this).css("-moz-border-radius","0 0 0 0");        $(this).css("-webkit-border-radius","0 0 0 0");    });    $(".innersubmenuul").hover(function(){        $(this).prev().css("background","#505050");        $(this).prev().css("color","#FFFFFF");        $(this).prev().css("border-radius","5px 5px 0 0");        $(this).prev().css("-moz-border-radius","5px 5px 0 0");        $(this).prev().css("-webkit-border-radius","5px 5px 0 0");    },function(){        $(this).prev().css("background","none");        $(this).prev().css("color","#B31703");        $(this).prev().css("border-radius","0 0 0 0");        $(this).prev().css("-moz-border-radius","0 0 0 0");        $(this).prev().css("-webkit-border-radius","0 0 0 0");        $(this).slideUp("fast");    });    /*END*/    /*GALLERY SLIDER*/    /*$('.imgGalleryTumbnail img').click(function(){        var thiz = $(this), act = $('.imgGalleryTumbnail img.active'), relBig = $('.imgGalleryMain').attr('rel');        if(!thiz.hasClass('active')){            $('.textOpacityBg').text(thiz.attr('alt'));            $('.imgGalleryMain').attr('rel', thiz.attr('src'));            thiz.attr('src', act.attr('src'));            act.attr('src', relBig).removeClass('active');            thiz.addClass('active');            $('.imgGalleryMain').attr('src', thiz.attr('rel'));        }    });*/    $('.navGalleryPrev span').css({        opacity: 0.5,         cursor: 'text'    });        $('.imgGalleryMain').hover(function(){        $('.textOpacityBg').css('display', 'block');    },function(){        $('.textOpacityBg').css('display', 'none');    });    $('.textOpacityBg').hover(function(){        $('.textOpacityBg').css('display', 'block');    },function(){        $('.textOpacityBg').css('display', 'none');    });    $('.imgGalleryTumbnail img').click(function(){        var thiz = $(this), act = $('.imgGalleryTumbnail img.active'), actSrc = $('.imgGalleryMain').attr('src');        if(!thiz.hasClass('active')){            if(thiz.prev().size()==0){                $('.navGalleryPrev span').css({                    opacity: 0.5,                     cursor: 'text'                });            }            else if(thiz.next().size()==0){                $('.navGalleryNext span').css({                    opacity: 0.5,                     cursor: 'text'                });            }            else {                $('.navGalleryPrev span, .navGalleryNext span').css({                    opacity: 1,                     cursor: 'pointer'                });            }            $('.textOpacityBg').text(thiz.attr('alt'));            $('.imgGalleryMain').attr('src', thiz.attr('src'));            thiz.attr('src', act.attr('src'));            act.removeClass('active');            thiz.addClass('active');            act.attr('src', actSrc);        }    });    $('.navGalleryPrev span').click(function(){        var prv = $('.imgGalleryTumbnail img.active').prev();        if(prv.size()>0){            prv.trigger('click');        }    });    $('.navGalleryNext span').click(function(){        var nxt = $('.imgGalleryTumbnail img.active').next();        if(nxt.size()>0){            nxt.trigger('click');        }    });        $('.imgGalleryMain').click(function(){        var nxt = $('.imgGalleryTumbnail img.active').next();        if(nxt.size()>0){            nxt.trigger('click');        }        else {            $('.imgGalleryTumbnail img:first').trigger('click');        }    });    /*END*/    /* Lang */    $('.langslink').toggle(function(){        var thiz = $('.lang_change_ul');        thiz.slideDown(100, function(){            if($.browser.msie){                thiz.css({top: thiz.offset().top+'px', left: thiz.offset().left+'px'}).appendTo('body');            }        });        return false;    }, function(){        $('.lang_change_ul').slideUp(100);        return false;    });/* END Lang */    $('.lnSelectOption').click(function(){        var thiz = $(this), ln = $(this).attr('rel');        $.get('/'+ln+'/index/isthis',{            controller : $('#urlcontrollerajax').val(),            id : $('#contentidajax').val()        },function(o){            /*alert(o);*/            if(o.length > 0){                var conf = confirm(o);                var lng = '';                if(ln != 'en'){lng = ln;}                if(conf==true){window.location.assign('/'+lng);}else{window.location.assign($(this).attr('href'));}            }            else {                window.location.assign(thiz.attr('href'));            }        });        return false;    });        /* Send email friend */    $('img[src$="skin/default/images/mail_small.png"]').click(function(){        $('body').append('<div id="zatyxanie" style="position:absolute;position:fixed;top:0px;left:0px;width:100%;height:100%;background: #000;"></div>');        $('#zatyxanie').css({opacity: 0.3});        $('body').append('<div id="sendMailFriendMain"><div id="sendMailFriend"><div id="closeSendFriend"><span>CLOSE</span></div></div></div>');        $.get('/members/sendfriend', {}, function(o){            if(o){                $('#sendMailFriend').append(o);                $('#sendMailFriendMain').css({top: $(window).height()/2-$('#sendMailFriendMain').height()/2+$(window).scrollTop()+'px', left: $('body').width()/2-$('#sendMailFriendMain').width()/2+'px'}).show();            }        });        return false;    });        $('form#FormSendfriend').live('submit', function(){        $.post('/members/sendfriend', {            sendthisto: $('#sendthisto').val(),            email: $('#email').val(),            'captcha[id]' : $('#captcha-id').val(),            'captcha[input]' : $('#captcha-input').val(),            url: window.location.href        }, function(o){            $('#FormSendfriend, .errorsSendFriend').remove();            $('#sendMailFriend').append(o);        });        return false;    });        $('#closeSendFriend span').live('click', function(){        $('#zatyxanie, #sendMailFriendMain').remove();    });    /* END Send email friend */});
