


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function isObject(x)
{
    return typeof x == "object" && x !== null;
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function isNumber(x)
{
    return typeof x == "number";
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function isArray(x)
{
    return isObject(x) && x.constructor == Array;
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function isBool(x)
{
    return typeof x == "boolean";
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function isString(x)
{
    return typeof x == "string";
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function isStringEmpty(x)
{
    return (typeof x == "string") && (x == "");
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function isUndefined(x)
{
    return typeof x == "undefined";
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function isFunction(x)
{
    return typeof x == "function";
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function getObject(obj)
{
    if (!isObject(obj))
        if (!isObject(obj = document.getElementById(obj)))
            return false;

    return obj;
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function serializeArray(aArray)
{
    var serialized = "";
    for (k in aArray)
        serialized += encodeURIComponent(aArray[k]) + "&";
    return serialized;
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function unserializeArray(aString)
{
    if (!isString(aString)) return [];

    var elements = aString.split("&");

    for (k in elements)
        elements[k] = decodeURIComponent(elements[k]);

    return elements;
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function toInt(num)
{
    if (isNumber(num))  return num;
    if (!isString(num)) return 0;

    var integerPattern = /^0*(-)?([0-9]*)[^0-9]*$/;
    var match = num.match(integerPattern);

    if (!match) return 0;

    return match[2] ? parseInt(match[2]) * (match[1] ? -1 : 1) : 0;
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function createCookie(name, value, days)
{
    if (days)
    {
        var date = new Date();
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
        var expires = "; expires="+date.toGMTString();
    }
    else
        var expires = "";

    document.cookie = name + "=" + value + expires + "; path=/";
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function readCookie(name)
{
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');

    for (var i = 0; i < ca.length; i++)
    {
        var c = ca[i];

        while (c.charAt(0) == ' ')
            c = c.substring(1, c.length);

        if (c.indexOf(nameEQ) == 0)
            return c.substring(nameEQ.length, c.length);
    }
    return null;
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function eraseCookie(name)
{
    createCookie(name, "", -1);
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function getElementX(obj)
{
    var curleft = 0;
    if (obj.offsetParent)
    {
        while (obj.offsetParent)
        {
            curleft += obj.offsetLeft
            obj = obj.offsetParent;
        }
    }
    else if (obj.x)
        curleft += obj.x;
    return curleft;// + (is_ie ? 12 : 0);
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function getElementY(obj)
{
    var curtop = 0;
    if (obj.offsetParent)
    {
        while (obj.offsetParent)
        {
            curtop += obj.offsetTop
            obj = obj.offsetParent;
        }
    }
    else if (obj.y)
        curtop += obj.y;
    return curtop;// + (is_ie ? 17 : 0);
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function getChildNodesList(aObj, aOutput, tag, recursive)
{
    if (!isObject(aObj)) return;
    if (!aObj.hasChildNodes()) return;

    var child = aObj.firstChild;
    tag = isString(tag) ? tag : "";

    do
    {
        if (tag == "" || (child.nodeType != 3 && child.tagName.toLowerCase() == tag))
            aOutput[aOutput.length] = child;
        if (child.hasChildNodes() && recursive == true)
            getChildNodesList(child, aOutput, tag, recursive);
        child = child.nextSibling;
    }
    while (child);
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function isInArray(aArray, aNeedle)
{
    if (!isArray(aArray)) return false;
    for (key in aArray)
        if (aArray[key] === aNeedle)
            return true;
    return false;
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function isMouseIn(obj)
{
    if (!isObject(obj))
        return false;

    oX = getElementX(obj);
    oY = getElementY(obj);
    oW = obj.offsetWidth;
    oH = obj.offsetHeight;
    if (mousePos.x <= (oX + oW) &&
        mousePos.x >= oX &&
        mousePos.y <= (oY + oH) &&
        mousePos.y >= oY)
    return true; else return false;
}

/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function bubbleEvent(aEvent, aBubble)
{
    try
    {
        if (!aEvent)
            if (!(aEvent = window.event)) return;

        aEvent.cancelBubble = !aBubble;

        if (aEvent.stopPropagation && !aBubble)
            aEvent.stopPropagation();
    }
    catch (e) {};
}
    /*-------------------------------------------------------------------------------------*/
function moveOptions(aSource, aDestination )
    {
        aSource = getObject(aSource);
        aDestination = getObject(aDestination);

        if (!aSource || !aDestination) return false;

        for (var i = aSource.length - 1; i >= 0; i--)
        {
            if (!aSource.options[i].selected) continue;
            aDestination.options[aDestination.options.length] = new Option(aSource.options[i].text, aSource.options[i].value);
            aSource.options[i] = null;
        }

        return true;
    }

/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function clearDocumentSelection()
{
    if (document.selection)
        if (document.selection.clear)
            document.selection.clear();

    if (window.getSelection)
    {
        if (window.getSelection().removeAllRanges)
            window.getSelection().removeAllRanges();
    }
    else
    {
        if (document.getSelection)
            if (document.getSelection().removeAllRanges)
                document.getSelection().removeAllRanges();
    }

    if (document.clearSelection)
        document.clearSelection();
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function centerWindow(wnd)
{
    wnd = getObject(wnd);

    if (!wnd) return;

    try
    {
        var x = Math.floor((getDocumentDmi().w  - wnd.offsetWidth)  / 2);
        var y = Math.floor((getDocumentDmi().h - wnd.offsetHeight) / 2);

        wnd.style.left = ((x < 0) ? 0 : x) + getDocumentScroll().x + "px";
        wnd.style.top  = ((y < 0) ? 0 : y) + getDocumentScroll().y  + "px";
    }
    catch (e) {}
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function getDocumentDmi()
{
    if (self.innerWidth)
    {
        return {
            w : self.innerWidth,
            h : self.innerHeight
        }
    }
    else if (document.documentElement && document.documentElement.clientWidth)
    {
        return {
            w : document.documentElement.clientWidth,
            h : document.documentElement.clientHeight
        }
    }
    else if (document.body)
    {
        return {
            w : document.body.clientWidth,
            h : document.body.clientHeight
        }
    }

    return { w : 0, h : 0 }
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function getDocumentScroll()
{
    var scrOfX = 0, scrOfY = 0;

    if( typeof( window.pageYOffset ) == 'number' )
    {
        return {
            y : window.pageYOffset,
            x : window.pageXOffset
        }
    }
    else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
    {
        return {
            y : document.body.scrollTop,
            x : document.body.scrollLeft
        }
    }
    else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
    {
        return {
            y : document.documentElement.scrollTop,
            x : document.documentElement.scrollLeft
        }
    }

    return { x : 0, y : 0 }
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function encodeURLParam(param)
{
    if (param === null | isUndefined(param))
        return '';
    return encodeURIComponent(param);
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function getStyleProp(element, property)
{
    var el = getObject(element), value;

    if (el.currentStyle)
        var value = el.currentStyle[styleProp];
    else if (window.getComputedStyle)
        var value = document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);

    return value;
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function htmlSpecialChars(aString)
{
    return (aString + "").replace('&','&amp;').replace('<', '&lt;').replace('>','&gt;');
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function hideElement(el)
{
    var obj = getObject(el);
    if (!obj) return;
    if (!obj.style) return
    obj.style.display = "none";
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function showElement(el, type)
{
    var obj = getObject(el);
    if (!obj) return;
    if (!obj.style) return
    obj.style.display = isUndefined(type) ? "block" : type;
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function regExpEscape(exp)
{
    if (!isString(exp)) return "";
    var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\'];
    var re = new RegExp('(\\' + specials.join('|\\') + ')', 'g');
    return exp.replace(re, '\\$1');
}


/*-------------------------------------------------------------------------------------*/
/**
 *
 */
var __atSign = '(malpa)', __dotSign = "(kropka)";
function decodeEmailLink(aElement)
{
    aElement = getObject(aElement);
    try
    {
        aElement.innerHTML = aElement.innerHTML.replace(new RegExp(regExpEscape(__atSign),'ig'), '@').replace(new RegExp(regExpEscape(__dotSign),'ig'), '.');
        aElement.href = aElement.href.replace(new RegExp(regExpEscape(encodeURIComponent(__atSign)),'ig'), '@').replace(new RegExp(regExpEscape(encodeURIComponent(__dotSign)),'ig'), '.');
    }
    catch (e) {}
}

/*-------------------------------------------------------------------------------------*/
/**
 *
 */
function decodeEmailLinks()
{
    var links = document.body.getElementsByTagName("a");
    try
    {
        for (i in links)
            if (links[i].href && links[i].href.substring(0, 7) == "mailto:")
                decodeEmailLink(links[i]);
    }
    catch (e) {}
}


/*-------------------------------------------------------------------------------------*/
function turnHiddenWYSIWYGOn(aContainer)
{
    if (document.all) return;

    var elements = getObject(aContainer ? aContainer : document.body), editor;
    if (!elements) return;
    elements = elements.getElementsByTagName("input");

    for (i in elements)
    {
        if (!isObject(elements[i])) continue;
        if (!getObject(elements[i].id + "___Frame")) continue;
        try
        {
            editor = FCKeditorAPI.GetInstance(elements[i].id);
            if (editor && editor.EditorDocument && editor.EditMode == FCK_EDITMODE_WYSIWYG)
                editor.EditorDocument.designMode = "on";
        }
        catch (e) { continue; }
    }
}


/*-------------------------------------------------------------------------------------*/
function changeTab(el)
{
    var container, tab = el.parentNode;

    with (container = tab.parentNode.parentNode.parentNode)
    {
        if (container._acttiveTab == tab)
            return;

        for (i = 0; i < container.rows[0].cells.length; i++)
        {
            if (container.rows[0].cells[i].className == 'tab selected')
            {
                container.rows[0].cells[i].className = "tab";
                container.rows[i + 1].className = "hidden";
            }
        }

        tab.className = "tab selected";
        container._activeTab = tab;
        container.rows[tab.cellIndex + 1].className = "content";
        turnHiddenWYSIWYGOn(container.rows[tab.cellIndex + 1]);
    }
}

/*-------------------------------------------------------------------------------------*/
function deleteUser()
{
    if (confirm("Czy na pewno usunąć użytkownika?"))
        document.location = "?a=deleteuser&uid=" + getObject("user_id").value;
}

/*-------------------------------------------------------------------------------------*/
function validatePassForm(form)
{
    if (isObject(form.pass_old) && form.pass_old.value == "") {
        alert("Stare hasło jest puste!");
        return false;
    }
    if (form.pass_new.value == ""){
        alert("Nowe hasło nie może być puste!");
        return false;
    }
    if (form.pass_new.value != form.pass_new_repeat.value) {
        alert("Proszę dokładnie powtórzyć nowe hasło!");
        return false;
    }
    return true;
}

/*-------------------------------------------------------------------------------------*/
function checkUserForm()
{
    var f = getObject('user_form');

    if (f.user_id.value == 0)
    {
        if (!checkEmailSyntax(f.user_login.value))
        {
            alert('Proszę wpisać poprawny adres e-mail jako login użytkownika.');
            f.user_login.focus();
            return false;
        }
    }
    return true;
}
function checkNewsletterForm() {
    var f = getObject('newsletter-form');
    if (!checkEmailSyntax(f.entry_email.value))
    {
        alert("Proszę wpisać poprawny adres e-mail.");
        f.entry_email.focus();
        return false;
    }    
    return true; 
}
/*-------------------------------------------------------------------------------------*/
function deleteArt(id)
{
    if (confirm("Usunąć artykuł?"))
        document.location = "?a=deleteart&aid=" + id;
}

/*-------------------------------------------------------------------------------------*/
function deleteBanner(id)
{
    if (confirm("Usunąć baner?"))
        document.location = "?a=deletebanner&bid=" + id;
}

/*-------------------------------------------------------------------------------------*/
function deleteCert(id)
{
    if (confirm("Usunąć certyfikat?"))
        document.location = "?a=deletecert&cid=" + id;
}
/*-------------------------------------------------------------------------------------*/
function deleteImage(id)
{
    if (confirm("Usunąć obraz?"))
        document.location = "?a=deleteimage&iid=" + id;
}

/*-------------------------------------------------------------------------------------*/
function deleteFile(id)
{
    if (confirm("Czy napewno usunąć wpis?"))
        document.location = "?a=deletefile&fid=" + id;
}
function deleteFileF(id,$name)
{
    if (confirm("Czy napewno usunąć plik?"))
        document.location = "?a=deletefilef&fid="+id+"&name="+$name;
}
function deleteFileNode(id)
{
    if (confirm("Usunąć Kategorię i wszystkie pliki do niej należące"))
        document.location = "?a=deletefilenode&nid="+id;
}


function showGalleryImage(imageURL, caption) {
/*
This routine creates a pop-up window, and ensures that it takes focus. It is
intended to be called from an anchor tag. The new window will resize itself to
the optimum size, so we make it as large as the largest required window to
overcome bugs in various manifestations of various browsers.

Author:   John Gardner
Written:  8th November 2003
Updated:  27th January 2004

Calling sequence: <a href="a.jpg" onClick="return openPopup('a.jpg','Caption');">

The first parameter is the URL of the image to be opened, and the second
parameter is the caption for the image which is displayed in the window title
and in the alt property of the image tag.

Note that the calling sequence will simply open the image in the main window if
JavaScript isn't enabled.

*/

  // Constants - change these to suit your requirements Note that the defaultWidth
  // and defaultHeight variables should be set to more than your largest image to
  // overcome a bug in Mozilla (at least up to Firefox 0.9).

  var windowTop = 100;                // Top position of popup
  var windowLeft = 100                // Left position of popup
  var defaultWidth = 550;             // Default width (for browsers that cannot resize)
  var defaultHeight = 400;            // Default height (for browsers that cannot resize)
  var onLoseFocusExit = true;         // Set if window to exit when it loses focus
  var undefined;

  // Set up the window open options
  var Options = "width=" + defaultWidth + ",height=" + defaultHeight + ",top=" + windowTop + ",left=" + windowLeft + ",resizable"

  // Now write the HTML markup to the new window, ensuring that we insert the
  // parameter URL of the image and the parameter description of the image in
  // the right place.
  var myScript = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n" +
    "<html>\n" +
    "<head>\n" +
    "<title>" + caption + "\</title>\n" +
    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n" +
    "<meta http-equiv=\"Content-Language\" content=\"en-gb\">\n" +
    "<script language=\"JavaScript\" type=\"text/javascript\">\n" +
    "function resizewindow () {\n" +
    "  var width = document.myimage.width;\n" +
    "  var height = document.myimage.height;\n";

  // Netscape
  if (navigator.appName.indexOf("Netscape") != -1) {
    myScript = myScript +  "  window.innerHeight = height;\n  window.innerWidth = width;\n"
  }

  // Opera
  else if (navigator.appName.indexOf("Opera") != -1) {
    myScript = myScript +  "  window.resizeTo (width+12, height+31);\n"
  }

  // Microsoft
  else if (navigator.appName.indexOf("Microsoft") != -1) {
    myScript = myScript + "  window.resizeTo (width+12, height+31);\n"
  }

  // Assume a frig factor for any other browsers
  else {
    myScript = myScript + "  window.resizeTo (width+14, height+34);\n"
  }

  myScript = myScript + "}\n" + "window.onload = resizewindow;\n" +
    "</script>\n</head>\n" + "<body ";

  // If the window is required to close when it loses focus.
  if (onLoseFocusExit) {myScript = myScript + "onblur=\"self.close()\" ";}

  myScript = myScript + "style=\"margin: 0px; padding: 0px;\">\n" +
    "<img src=\"" + imageURL + "\" alt=\"" + caption + "\" title=\"" + caption + "\" name=\"myimage\">\n" +
    "</body>\n" +  "</html>\n";

  // Diagnostic - uncomment the next line if you wish to see the script generated.
  //alert (myScript);

  // Create the popup window
  var imageWindow = window.open ("","imageWin",Options);
  imageWindow.document.write (myScript);
  imageWindow.document.close ();
  if (window.focus) imageWindow.focus();
  return false;
}


/*-------------------------------------------------------------------------------------*/
function checkEmailSyntax(aEmail)
{
    return /^\s*[a-z0-9]+[\w\-\.]*@([\w\-]+\.)+[a-z]+\s*$/.test(aEmail);
}
/*-------------------------------------------------------------------------------------*/
function checkContactForm()
{
    var f = getObject('contact-form');
    try {
        if (f.email_sender.value == '' || f.email_replyto.value == '' || f.email_msg.value == '' || f.email_subject.value == '')
        {
            alert("Proszę uzupełnić wymagane pola i spróbować ponownie.");
            return false;
        }
        if (!checkEmailSyntax(f.email_replyto.value))
        {
            alert("Proszę wpisać poprawny adres e-mail.");
            return false;
        }
    }
    catch (e) {}

    return true;
}
/*-------------------------------------------------------------------------------------*/
function deleteNewsletter(id)
{
    if (confirm("Czy na pewno usunąć adres?"))
        document.location = "?a=deletenewsletter&nid=" + id;
}

/*-------------------------------------------------------------------------------------*/
function deletePartner(id)
{
    if (confirm("Czy na pewno usunąć partnera?"))
        document.location = "?a=deletepartner&pid=" + id;
}

/*-------------------------------------------------------------------------------------*/
function deleteDist(id)
{
    if (confirm("Czy na pewno usunąć dystrybutora?"))
        document.location = "?a=deletedist&did=" + id;
}

/*-------------------------------------------------------------------------------------*/
function deleteNews(id)
{
    if (confirm("Czy na pewno usunąć?"))
        document.location = "?a=deletenews&nid=" + id;
}
function deleteEntry(id)
{
    if (confirm("Czy na pewno usunąć sybskrymenta?"))
        document.location = "?a=deleteentry&eid=" + id;
}
function saveEntry(){
    var form = getObject("entry-form");
    
            if (!checkEmailSyntax(form.entry_email.value))
            {
                alert("Proszę wpisać poprawny adres e-mail.");
                form.entry_email.focus();
                return false;
            }    
    
            if(form['asigned_groups[]'].length < 1 ) {
                alert("Subskryment musi przyneleżeć do co najmniej jednej grupy");
                form['asigned_groups[]'].focus();
                return false;
            }
                for (var i = form['asigned_groups[]'].length - 1; i >= 0; i--)
                    form['asigned_groups[]'].options[i].selected = true;
            return true;
}
function deleteGroup(id)
{
    if (confirm("Czy na pewno usunąć grupę?"))
        document.location = "?a=deletegroup&gid=" + id;
}
function loadNews(){
    id = getObject("news_id").value;
    if(!id)
        alert("Błąd, nie wybrano newsa");
    else
        document.location = "?v=newsletter&nid=" + id;     
}
function sendNewsletter(){
    var form = getObject("newsletter-form");
    
            if (form.news_title.value == "") {
                alert("Tytuł nie może być pusty.");
                return false;
            } 
            if(form['asigned_groups[]'].length < 1 ) {
                alert("Musisz wybrać co najmniej jedną grupę");
                form['asigned_groups[]'].focus();
                return false;
            }
                for (var i = form['asigned_groups[]'].length - 1; i >= 0; i--)
                    form['asigned_groups[]'].options[i].selected = true;
                    
            if (confirm("Wysłać wiadomość do subskrybentów należących do wybranycyh grup"))
                return true;
            return false;  
}
/*-------------------------------------------------------------------------------------*/         
function deleteJOrder(id)
{
    if (confirm("Czy na pewno usunąć?"))
        document.location = "?a=deletejorder&joid=" + id;
}
/*-------------------------------------------------------------------------------------*/           
function realJOrder(id)
{
    if (confirm("Czy na pewno zrealizować zamówienie?"))
        document.location = "?a=realjorder&joid=" + id;
}
/*-------------------------------------------------------------------------------------*/           
function sendMailJOrder(id)
{
    if (confirm("Czy na pewno wysłać zamówienie?"))
        document.location = "?a=send_mail_order&joid=" + id;
}

function deleteOffer(oid)
{
    if (confirm('Usunąć produkt?'))
        document.location = '?a=deletejproduct&jpid=' + oid;
}
function deleteEpsProduct(oid)
{
    if (confirm('Usunąć produkt?'))
        document.location = '?a=deleteepsproduct&epid=' + oid;
}
function deleteEpsProductImage(gid, iid)
{
    if (confirm('Usunąć obraz?'))
        document.location = '?a=deletetepsproductimage&gid=' + encodeURIComponent(gid) + "&iid=" + encodeURIComponent(iid) + "&tab=offer_gallery_tab";
}

function deleteArticle(aid, action)
{
    if (confirm('Usunąć artykuł?'))
        document.location = '?a='+action+'&aid=' + aid;
}
 

function deleteGalleryImage(gid, iid)
{
    if (confirm('Usunąć obraz?'))
        document.location = '?a=deletegalleryimage&gid=' + encodeURIComponent(gid) + "&iid=" + encodeURIComponent(iid) + "&tab=offer_gallery_tab";
}


function saveGalleryImage(gid, iid)
{
     document.location =
        '?a=savegalleryimage&gid=' + encodeURIComponent(gid) +
        "&iid=" + encodeURIComponent(iid) +
        "&icap=" + encodeURIComponent(document.getElementById("img_" + iid).value) +
        "&tab=offer_gallery_tab";
}
function deleteNewsImage(gid, iid)
{
    if (confirm('Usunąć obraz?'))
        document.location = '?a=deletenewsimage&nid=' + encodeURIComponent(gid) + "&iid=" + encodeURIComponent(iid) + "&tab=news_gallery_tab";
}
function saveNewsImage(gid, iid)
{
     document.location =
        '?a=savenewsimage&nid=' + encodeURIComponent(gid) +
        "&iid=" + encodeURIComponent(iid) +
        "&icap=" + encodeURIComponent(document.getElementById("img_" + iid).value) +
        "&tab=news_gallery_tab";
}
function showHideElement(el) {
    if (!getObject(el)) return;
    var el = getObject(el);
    el.style.display = (el.style.display == "none") ? "block" : "none";
}
function resetViewStats() {
    if (confirm('Czy na pewno wyczyścić bezpowrotnie statystyki przeglądania ofert?'))
        document.location = "?a=resetviewstats";
}
function resetPoll() {
    if (confirm('Czy na pewno wyczyścić bezpowrotnie statystyki sondy?'))
        document.location = "?a=resetpoll";
}
function setRate(fId, rate) {
    try {
        document.getElementById("commentRateImage_"+fId).innerHTML = document.getElementById("rateImage_"+fId+"_"+rate).innerHTML;
        document.forms["commentForm_"+fId].comment_rate.value = rate;
    }catch (e) {}
}
function sendContactEmail()
{
    var f = document.contactForm;
    if (f.email_sender.value == '' || f.email_contact.value == '') {
        alert("Proszę wypełnić pola oznaczone gwiazdką.");
        return false;
    }
    return true;
}
var galleryImageWnd; 
var _onLoadEvents = [];
var _onUnLoadEvents = [];
function evalEventsArray(aEvents) { try { for (i in aEvents) window.eval(aEvents[i]); } catch (e) {} }

