/* 
LEAVE THESE CREDITS IN PLACE 
Forum Images Expand & Hilight control for Divs 
Version 1.1 re-coded by SamG 05-04-03 
Version 2 expand control re-coded by Daz 18-07-03 
Version 2.1 expand control re-written by Daz 26-08-03 
Please see the ForumImages.com web site for distribution terms; 
http://www.forumimages.com/terms.php 
*/ 

function fiSelectEl(elId) { 
var element = document.getElementById(elId); 
if ( document.selection ) { 
   var range = document.body.createTextRange(); 
   range.moveToElementText(element); 
   range.select(); 
   } 
if ( window.getSelection ) { 
   var range = document.createRange(); 
   range.selectNodeContents(element); 
   var blockSelection = window.getSelection(); 
   blockSelection.removeAllRanges(); 
   blockSelection.addRange(range); 
   } 
} 

function fiResizeEl(elId,elState) { 
divId = document.getElementById(elId); 
divExpId = document.getElementById('ex' + elId); 
divLnkCntrct = '<a href="#" onclick="fiResizeEl(\'' + elId + "');return false;\">" + Cntrct + "</a>"; 
divLnkExpnd = '<a href="#" onclick="fiResizeEl(\'' + elId + "','1');return false;\">" + ExPnd + "</a>"; 
if (!elState) { 
   divId.style.height = '40px'; 
   divExpId.innerHTML = divLnkExpnd; 
} else if (divId.scrollHeight > 40) { 
   divId.style.height = divId.scrollHeight + 3 + 'px'; 
   divExpId.innerHTML = divLnkCntrct; 
   } 
}