(function($) {
    var userAgent = navigator.userAgent.toLowerCase();

    $.browser = {
        version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
        safari: /webkit/.test( userAgent ),
        opera: /opera/.test( userAgent ),
        msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
        mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
    };

})(jQuery);


$(function() {
ordfrmp();
szallcimfrmp();
//$('.szallcim input,.szallcim select, .szallcim textarea').replaceWith('<div class="empty_saved">Egyezik a számlázási adatokkal.</div>');
if((typeof megegyezik!='undefined') && megegyezik) $('.olddata .szallcim').hide();
$('.olddata input,.olddata select, .olddata textarea').replaceWith('<div class="empty_saved">Nincs megadva.</div>');
$("#datsrc input").change(ordfrmp);
if($.browser.msie)  $('#checkbox_egycim').click(szallcimfrmp);

$('#checkbox_egycim').change(szallcimfrmp);
});
function $F2(name)
{
    return $('input[name='+name+']').fieldValue();
    //return $('input[name='+name+']').find(function(el) {return (el.checked) }).value;
}
function szallcimfrmp()
{
    
   
    if($F2('egycim')=='igen') {
        //alert("hiding");
        $('.szallcim').hide(); }
    else {
        //alert("showing");
    $('.szallcim').show();}
 
}
function ordfrmp()
{
    
    var toshow,tohide,swv;
swv=$F2("ro");
//alert("chg"+swv);
    if(swv=='profile')
    {
      
            //alert("prof");
            toshow=$(".olddata");
            tohide=$(".newdata");
    } else {  //alert("nprof"+(swv=='profile'));
            tohide=$(".olddata");
            toshow=$(".newdata");
            
        
        
    }
    tohide.hide();
    toshow.show();
}
