var tmpImg = new Image();

function change_image(old_img, new_img)
{

    tmpImg.src  = old_img.src;
    old_img.src = new_img.src;

}

function change_image_back(img)
{

    img.src = tmpImg.src; 

}

function clear_default_value(obj, default_value)
{

    if (obj.value == default_value) {
        obj.value = '';
    }

}

function change_style_class(obj, newClass)
{

    if (typeof obj.className != 'undefined') {
        obj.className = newClass;
    }

}

function l(url)
{

    window.location = url;

}

function is_pos_int(value)
{

    return (    !(isNaN(value) || Math.round(value) != value || value < 1 )  );

}

function str_trim(str)
{

    return str.replace(/^\s+|\s+$/g,"");

}

function listfrm_submit(offset)
{

    document.listfrm.offset.value = offset;
    document.listfrm.submit();

}

function popup(url, width, height, name, rtn)
{
    var open_args="toolbar=0,location=0,directories=0,status=0,scrollbars=0,menubar=0,resizable=0,width="+width+",height="+height;
    var win = window.open(url,name,open_args);
    win.moveTo((screen.availWidth-width)/2,(screen.availHeight-height)/2);
    win.focus();
    if (rtn) {
        return false;
    }
}

