function fix_linked_image_sizes_attach_thumb( attach_id, width, height, file_size ) { var _img = '<img src="' + ipb_var_image_url + '/img-resized.png" style="vertical-align:middle" border="0" alt="" />'; var img_obj = document.getElementById( 'ipb-attach-img-' + attach_id ); var div_obj = document.getElementById( 'ipb-attach-div-' + attach_id ); var ct_obj = document.getElementById( 'ipb-attach-ct-' + attach_id ); var cb_obj = document.getElementById( 'ipb-attach-cb-' + attach_id ); var url_obj = document.getElementById( 'ipb-attach-url-' + attach_id ); var tbl_obj = document.getElementById( 'ipb-attach-table-' + attach_id ); var _width = parseInt( img_obj.width ) ? parseInt( img_obj.width ) : parseInt( img_obj.style.width ); var _height = parseInt( img_obj.height ) ? parseInt( img_obj.height ) : parseInt( img_obj.style.height ); var _padding = 5; var _percent = 0; if ( is_ie ) { _width = parseInt( img_obj.currentStyle['width'] ); _height = parseInt( img_obj.currentStyle['height'] );} if ( is_safari ) { tbl_obj.style.display = 'inline-block';} if ( width && height ) { _percent = Math.ceil( 100 - parseInt( _width / width * 100 ) );} img_obj.className = 'ipb'; img_obj.title = ipb_global_lang['click_to_view']; img_obj.onmouseover = fix_attach_images_mouseover; img_obj.onclick = function(event) { ipsclass.pop_up_window( url_obj.href, width + 20, height + 20 ); ipsclass.cancel_bubble(event);}; div_obj.style.width = ( _width > 140 ? _width : 140 ) + 'px'; div_obj.style.height = _height + ( _padding * 2 ) + 28 + 'px'; div_obj.className = 'resized-linked-image'; div_obj.style.paddingTop = _padding + "px"; div_obj.style.paddingBottom = _padding + "px"; div_obj.style.paddingLeft = _padding + 3 + "px"; div_obj.style.paddingRight = _padding + 3 + "px"; div_obj.style.textAlign = 'center'; div_obj.title = ipb_global_lang['click_to_view']; ct_obj.style.fontSize = '9px'; cb_obj.style.fontSize = '9px'; cb_obj.style.textAlign = 'center'; if ( _percent > 0 ) { ct_obj.innerHTML = _img + '&nbsp;' + ipsclass.lang_build_string( ipb_global_lang['image_attach_percent'], _percent );} else { ct_obj.innerHTML = _img + '&nbsp;' + ipb_global_lang['image_attach_no_percent'];} cb_obj.innerHTML = ""; if ( width && height ) { cb_obj.innerHTML = ipsclass.lang_build_string( ipb_global_lang['image_attach_dims'], width, height );} cb_obj.innerHTML += ipsclass.lang_build_string( ipb_global_lang['image_attach_size'], file_size );} function fix_linked_image_sizes() { if ( ipsclass.settings['do_linked_resize'] != 1 ) { return true;} var images = document.getElementsByTagName( 'IMG' ); var _padding = 2; var _count = 0; var _img = '<img src="' + ipb_var_image_url + '/img-resized.png" style="vertical-align:middle" border="0" alt="" />'; var _img2 = '<img src="' + ipb_var_image_url + '/folder_attach_images/attach_zoom_in.png" style="vertical-align:middle" border="0" alt="" />'; var _sw = screen.width * ( parseInt( ipsclass.settings['resize_percent'] ) / 100 ); for ( var i = 0 ; i < images.length; i++ ) { if ( images[i].className == 'linked-image' ) { _count++; if ( images[i].width > _sw ) { var _width = images[i].width; var _height = images[i].height; var _percent = 0; images[i].width = _sw; if ( images[i].width < _width && _width > 0 && images[i].width > 0 ) { _percent = Math.ceil( parseInt( images[i].width / _width * 100 ) );} images[i].id = '--ipb-img-resizer-' + _count; images[i]._resized = 1; images[i]._width = _width; var div = document.createElement( 'div' ); div.innerHTML = _img + '&nbsp;' + ipsclass.lang_build_string( ipb_global_lang['image_resized'], _percent, _width, _height ); div.style.width = images[i].width - ( _padding * 2 ) + 'px'; div.className = 'resized-linked-image'; div.style.paddingTop = _padding + "px"; div.style.paddingBottom = _padding + "px"; div.style.paddingLeft = _padding + "px"; div.style.paddingRight = _padding + "px"; div._is_div = 1; div._resize_id = _count; div.onclick = fix_linked_images_onclick; div.onmouseover = fix_linked_images_mouseover; div.title = ipb_global_lang['click_to_view' ]; div._src = images[i].src; images[i].parentNode.insertBefore( div, images[i] );} } } } function fix_linked_images_onclick(e) { PopUp( this._src, 'popup',screen.width,screen.height,1,1,1); e = ipsclass.cancel_bubble_all( e ); return false;}; function fix_attach_images_mouseover(e) { try { this.style.cursor='pointer';} catch(acold) { } } function fix_linked_images_mouseover(e) { try { this.style.cursor='pointer';} catch(acold) { } }