$(document).ready(function(){

    $('.content-inner-lower img').each(function(){

        $(this).gallerizer();

    });





    $('a.partner-link').hover (function ()



    {



        $(this)



            .parent()



            .addClass('hover')



    },



    function ()



    {



        $(this)



            .parent()



            .removeClass('hover');



    });







   /* $('#tdregisterfoglalkozas_egyeb')



        .parent()



        .hide();







    $('#registerfoglalkozas').change (function ()



    {



        x = $('#registerfoglalkozas').val();







        if (x == '8' || x == '9')



        {



            $('#tdregisterfoglalkozas_egyeb')



                .parent()



                .show();



        }



        else



        {



            $('#tdregisterfoglalkozas_egyeb')



                .parent()



                .hide();



        }



    });  */



    



    //kia reg



    $('#submit_registerkia').click(function() {



      var c = formValidate('registerkia');



      if(c == true){



        $("#registerkia").hide();



        var params=$("#registerkia").serialize();



        $.ajax({



            url:'kiareg.php?ajax=1',



            type:"POST",



            data:params,



            success:function(data){if(data==1){



                alert("Ez az e-mail cím már foglalt!");



                $("#registerkia").show();  



            }



            else



            {$("#confirmdata").html(data);}}})



      }



      return false;



    });



    







    // képek leméretezése, ha nagyobbak



    $('img.content-large').each (function ()



    {



        var $this = $(this);







        if ($this.width() > $this.height())



        {



            if ($this.width() > 500)



                $this.width (500);



        }



        else



        {



            if ($this.height() > 500)



                $this.height (500);



        }



    });







    $('img.content-medium').each (function ()



    {



        var $this = $(this);







        if ($this.width() > $this.height())



        {



            if ($this.width() > 200)



                $this.width (200);



        }



        else



        {



            if ($this.height() > 200)



                $this.height (200);



        }



    });







    $('img.content-small').each (function ()



    {



        var $this = $(this);







        if ($this.width() > $this.height())



        {



            if ($this.width() > 120)



                $this.width (120);



        }



        else



        {



            if ($this.height() > 120)



                $this.height (120);



        }



    });







    // margin-os classt az alignolt képekre



    $('img[align=left]')



        .addClass ('align-left');







    $('img[align=right]')



        .addClass ('align-right');



        



        



    // oldalmenük



    



    var nav2top = $('#content-nav').css("top");



    $('#content-nav2').css("top", nav2top);



    



    



    // IE8 hiba kép szélessége







    $('.content-inner-image img').each(function(){



            



        var szelesseg = $(this).width();



        



        if(szelesseg >= 150) {



            $(this).attr("width", 150);



        } else {



            $(this).attr("width", szelesseg);



        }



    });





    



});



    

jQuery.fn.gallerizer = function(){

        var iframe = '';

        var siteBaseUrl = 'http://www.litera.hu/';

        var imgUrl = $(this).attr('src');

        var imgWidth = $(this).width();
		
		var imgFloat = $(this).css('float');

        var httpN = imgUrl.search(/http/i);

        if ( httpN < 0 ){

            imgUrl = siteBaseUrl + imgUrl;

        }

        

        $(this).wrap('<a href="'+imgUrl+'" rel="kepek2" class="article-gallery f-'+imgFloat+'" style="width: '+imgWidth+'px;"></a>');

    }











function confirmation(link) {



  var answer = confirm("Figyelem, a törlés végleges!\\nKattints az OK gombra, ha tényleg ezt akarod.")



  if (answer){



   MyWindow=window.open(link,'MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=280,height=40');



  }



}







    function kiareg_back(){



        $('#confirmdata').empty();



        $("#registerkia").show(); 



    }
