// new magnify functions using cache servers (v3)
function magnify(file_name, image_desc, width, height) {
   // if (!window.cacheserver || cacheserver == '') cacheserver = 'http://';
    //var imgsrc = cacheserver + '/foto/' + supplier_name + '/' + cd_code + '/' + file_name + '.jpg';
    //var imgsrc = cacheserver + cd_code_url +'/foto/' + file_name;
    var imgsrc = file_name;

  //modified by js
   if (width == 0) var imgdiv = '<img src="' + imgsrc + '" style="min-width: 200px; min-height: 200px;" class="loading" />';
    else var imgdiv = '<img src="' + imgsrc + '" style="width: ' + width + '"; class="loading" />';

  //by lh
    //if (width == 0 || height ==0) var imgdiv = '<img src="' + imgsrc + '" style="min-width: 200px; min-height: 200px;" class="loading">';
    //else var imgdiv = '<img src="' + imgsrc + '" style="width: ' + width + '; height: ' + height + '"; class="loading">';


    var imgdesc = '<div style="font-size: 12px; margin-top: 2px; margin-bottom: 1px; color: #000;">' + image_desc + '</div>';
    //var imgphotog = '<div style="font-size: 1.1em; color: #DDD;"><img src="icon_photog.gif" style="margin-bottom: -1px; margin-right: 3px;" title="Photographer" alt="Photographer" border="0">' + supplier_name + '</div>';
    var imgphotog = '';

    return overlib(imgdiv + imgdesc + imgphotog, ABOVE, HAUTO, VAUTO, BGCOLOR, '#bdbd00', FGCOLOR, '#bdbd00');

    // if (width == 0 || height == 0) return overlib('<img src="' + imgsrc + '" style="min-width: 200px; min-height: 200px;" class="loading">' + image_desc, ABOVE, HAUTO, VAUTO, BGCOLOR, '#888888', FGCOLOR, '#888888');
    // else return overlib('<img src="' + imgsrc + '" style="width: ' + width + '; height: ' + height + '"; class="loading">' + image_desc, ABOVE, HAUTO, VAUTO, BGCOLOR, '#888888', FGCOLOR, '#888888');

    // return overlib('<img src="' + imgsrc + '" style="min-height: 150px;" class="loading">', HAUTO, VAUTO, BGCOLOR, '#AAAAAA', FGCOLOR, '#AAAAAA');
}

function $(v) { return(document.getElementById(v)); }
function $S(v) { return($(v).style); }
function agent(v) { return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0)); }
function isset(v) { return((typeof(v)=='undefined' || v.length==0)?false:true); }
function XYwin(v) { var z=agent('msie')?Array(document.body.clientHeight,document.body.clientWidth):Array(window.innerHeight,window.innerWidth); return(isset(v)?z[v]:z); }

function getY( oElement )
{
var iReturnValue = 0;
while( oElement != null ) {
iReturnValue += oElement.offsetTop;
oElement = oElement.offsetParent;
}
return iReturnValue;
}

//function sexyTOG() {$S('sexyBG').display='none'; $S('sexyBOX').display='none';}
//function sexyBOX(v,b) { setTimeout("sexyTOG()",8000); $S('sexyBG').height=(XYwin(0)*2.5)+'px'; $S('sexyBG').display='block'; $('sexyBOX').innerHTML=v+'<div class="sexyX"><br /><img src=./loading.gif style= "vertical-align:middle;">&nbsp; Preparing for your download...<br><br>'+"<\/div>"; $S('sexyBOX').left=Math.round((XYwin(1)-b)/2)+'px'; $S('sexyBOX').width=b+'px'; $S('sexyBOX').display='block'; }