function stp(h,n,o){var i=(h+'').indexOf(n,o);return i===-1?false:i;}
function frameImages() {
for (var i=0; i<document.getElementsByTagName('IMG').length; i++)
  if (stp(document.getElementsByTagName('IMG')[i].className.toUpperCase(),'JSFRAMED') !== false) {
    var imgsize = new Array()
    var img = document.getElementsByTagName('IMG')[i]
    var halign = 'LEFT'
    var displ = 'INLINE'
    if (stp(document.getElementsByTagName('IMG')[i].className.toUpperCase(),'ALLEFT') !== false) halign = 'LEFT'
    else if (stp(document.getElementsByTagName('IMG')[i].className.toUpperCase(),'ALCENTER') !== false) halign = 'CENTER'
    else if (stp(document.getElementsByTagName('IMG')[i].className.toUpperCase(),'ALRIGHT') !== false) halign = 'RIGHT'
    if (stp(document.getElementsByTagName('IMG')[i].className.toUpperCase(),'BLOCKED') !== false) displ = 'BLOCK'
    var frame = document.createElement('DIV')
    var attr = ''
    for (var n=0; n<img.attributes.length; n++) {
      if (img.attributes[n].nodeName.toUpperCase() !== "CLASS" && img.attributes[n].nodeName.toUpperCase() !== "ALIGN")
      if (img.attributes[n].nodeName.toUpperCase() == "WIDTH") {
        imgsize['x'] = parseInt(img.attributes[n].nodeValue-0+18)
        } else
      if (img.attributes[n].nodeName.toUpperCase() == "HEIGHT") {
        imgsize['y'] = parseInt(img.attributes[n].nodeValue-0+18)
        } else
      attr += ' '+img.attributes[n].nodeName+'="'+img.attributes[n].nodeValue+'"'
      }
    var poStyle = ''
    switch (halign) {
      case 'LEFT' :
        frame.style['display'] = 'block'
        poStyle = 'float:left;'
        if (displ == 'BLOCK') frame.style['height'] = imgsize['y']+'px'
        break
      case 'RIGHT' :
        frame.style['display'] = 'block'
        poStyle = 'float:right;'
        if (displ == 'BLOCK') frame.style['height'] = imgsize['y']+'px'
        break
      case 'CENTER' :
        frame.style['display'] = 'block'
        frame.style['height'] = imgsize['y']+'px'
        poStyle = 'margin:0 auto;'
        break
      }
    frame.innerHTML = '<div class="regimage" style="'+poStyle+'width:'+imgsize['x']+'px;height:'+imgsize['y']+'px;"><div class="rib"><div class="ril"><div class="rir"><div class="ritl"><div class="ritr"><div class="ribl"><div class="ribr">'+
    '<img'+attr+' />'+
    '</div></div></div></div></div></div></div></div>'
    img.parentNode.insertBefore(frame,img)
    img.parentNode.removeChild(img)
    }
}