//box elrejtése, megjelenitése
function hideunhide(ClosedivID, OpendivID){
    var OpenBox = document.getElementById(OpendivID);
    var CloseBox = document.getElementById(ClosedivID);
    OpenBox.style.display="inline";
    CloseBox.style.display="none"; 
}
//////////////////////////////////////////////////////

//box elrejtése, megjelenitése
function HideBox(ClosedivID){
    var CloseBox = document.getElementById(ClosedivID);
    CloseBox.style.display="none"; 
}
//////////////////////////////////////////////////////

//form elküldése
function submitform(FormId)
{
    document.forms[FormId].submit();
}
//////////////////////////////////////////////////////

    //gorgeto jobb oldal
    jQuery.fn.expAutoScroll = function(options) {
        return this.each(function() {
            var $this = $(this);
            var scActRow = 1;
            var scCount = $this.find('.nBox').size();
            var scHeight = $this.find('.nBox:first').outerHeight(true);
            if (options.stopOnHover) {
                $this.hover(
                    function(){$this.addClass('hovered')}
                    ,function(){$this.removeClass('hovered')}
                );
            }
            if (scCount > options.elementPerRow) {
                setInterval(function() {
                    if (!$this.hasClass('hovered')) {
                        var top = scActRow * scHeight;
                        if (scActRow*options.elementPerRow <= scCount) {
                            $this.stop().animate({scrollTop: top});
                            scActRow++;
                        } else {
                            $this.stop().animate({scrollTop: 0});
                            scActRow = 1;
                        }
                    }
                }
                ,options.interval);
            }
            return this;
        });
    }
    /* showcase animation in list */
    /*a görgetés sebességét az intervál növelése(lassú), vagy csökkentése(gyorsabb)*/
    $(document).ready(function(){
        if( $("#hirekBox .body .tartalomright") ) {
            $("#hirekBox .body .tartalomright").expAutoScroll({elementPerRow: 1, interval: 4000, elementClass: 'nBox', stopOnHover: true});
        }
    });
    ////////////////////////////////////////

function resizeWindow(w,h)
{
    if(w > screen.width){
        w = screen.width;
    }
    if(h > 0){
        h = h;
    }
    else{
        h = screen.height;
    }
    if (parseInt(navigator.appVersion)>3) {
        if (navigator.appName=="Netscape") {
        top.outerWidth=w;
        top.outerHeight=h;
        }
        else top.resizeTo(w,h);
        }
}

function show_comapred_product_page(url)
{
    window.opener.location.href=url;
    window.close();
}
function isNumberKey(evt)
{
     var charCode = (evt.which) ? evt.which : event.keyCode
     if (charCode > 31 && (charCode < 48 || charCode > 57))
        return false;
     return true;
 }

