
  function imgShow(pc, doc_id, file, fix_height) {
	var url = '/pdf_preview?pc='+pc;
	if(file != null && file != '')
	{
		url += '&file='+file;	
	}
    //var url = '/pdf_preview?pc='+pc+'&doc_id='+doc_id+'&width='+IMG_HEIGHT;
    url += '&doc_id='+doc_id+'&width='+IMG_HEIGHT;
    if (NO_CACHE) { url += '&expire_cache=1'; }
    var el = document.getElementById('image');
    var pdf = document.getElementById('pdf_'+pc+'_'+doc_id);
	if(file != null && file != '')
	{
		pdf = document.getElementById('pdf_'+file);
	}
    el.innerHTML = '<img src="' + url + '" class="img" onLoad="shDiv()">';

	var isNetscape = navigator.appName=="Netscape";
    if (isNetscape) {
		if(fix_height != null && fix_height != '' ) {
			h = fix_height;
		} else {
   			var h = ( (window.pageYOffset+window.innerHeight) > (b_Pos(pdf,'Top')+IMG_HEIGHT+15) ) ?
			(b_Pos(pdf,'Top')+15) : (b_Pos(pdf,'Top')-(IMG_HEIGHT+5));
		}
	} else {
		var h;
		if( fix_height != null && fix_height != '' ) {
			h = fix_height;
		} else {
			h = ( (document.body.clientHeight+document.body.scrollTop) > (b_Pos(pdf,'Top')+IMG_HEIGHT+15) ) ?
            (b_Pos(pdf,'Top')+15) : (b_Pos(pdf,'Top')-(IMG_HEIGHT+5));
		}
  	}
    el.style.top = h+'px';
    var w=b_Pos(pdf,'Left')+25;	
    el.style.left = w+'px';
  }

  function shDiv() {
    var el = document.getElementById('image');
    el.style.visibility = 'visible';
	//var elf = document.getElementById('image-if');
	//elf.style.top = el.style.top;
	//elf.style.left = el.style.left;
	//elf.style.width = IMG_HEIGHT;
	//elf.style.height = IMG_HEIGHT;
	//elf.style.border = 'none';
	//elf.style.visibility = 'visible';

  }

  function imgHide() {
    var el = document.getElementById('image');
    el.innerHTML = '';
    el.style.visibility = 'hidden';
	//var elf = document.getElementById('image-if');
	//elf.style.visibility = 'hidden';
  }

  function b_Pos(element, offset) {
    var pos = 0;
    while (element != null) {
        pos += element["offset" + offset];
        element = element.offsetParent;
    }
    return pos;
  }

