function catalog__enlarge(f, id)
{
    h = fetch_object('cat_img_enl');
    
    h.innerHTML = '<img src="upload/img/2/' + f + '" onClick="cat__enlarge__max(' + id + ')">';
}

function cat__enlarge__max(img_id)
{
    wname = 'advert_edit_window';
    w = screen.width;
    h = screen.height;
    st = 1;
    tool = 0;
    scrolll = 1;
    resize = 1;
    
    wd = window.open('catalog__image.php5?id=' + img_id + '&sw=' + w + '&sh=' + h, wname, 'fullscreen=1, status=' + st + ', toolbar=' + tool + ', scrollbars=' + scrolll + ', resizable=' + resize);
}

function cat_print(id)
{
    w = 800;
    h = 600;            
    
    url = 'http://rbfinanses.lv/catalog__print.php5?oid=' + id;
    wname = 'advert_' + id;
    st = 1;
    tool = 0;
    scrolll = 0;
    resize = 0;
    
    window.open(url, wname, 'width=' + w + ', height=' + h + ', status=' + st + ', toolbar=' + tool + ', scrollbars=' + scrolll + ', resizable=' + resize);
}

function cat_contact_show(id)
{
    var h, s, ns;

    h = fetch_object('covcf' + id);
    
    s = h.style.display;
    
    if (s == 'block'){
        ns = 'none';
    } else {
        ns = 'block';
    }
    
    h.style.display = ns;
}

function cat_contact_send(id)
{
    var h, s;
    
    s = "sid=" + encodeURI('57') 
        + "&oid=" + encodeURI(fetch_object('oid').value) 
        + "&tid=" + encodeURI(id) 
        + "&txt=" + encodeURI(fetch_object('txt_' + id).value) 
        + "&nam=" + encodeURI(fetch_object('nam_' + id).value) 
        + "&phone=" + encodeURI(fetch_object('phone_' + id).value);
    
    ajax_post('user_messages_2.php5', s);
    
    cat_contact_show(id);
}

function cat_contact_cancel(id)
{
    fetch_object('txt_' + id).value='';
    fetch_object('nam_' + id).value='';
    fetch_object('phone_' + id).value='';
    
    cat_contact_show(id);
}

