/*--------------------------------------------------------------
* Copyright (c) 2006 TELUS Communications Inc.,
*
* All Rights Reserved.
* This document contains proprietary information that shall be
* distributed or routed only within TELUS, and its authorized
* clients, except with written permission of TELUS.
*
*--------------------------------------------------------------*/


///////////////////////////////////////////////////////////////////////////////
// 
/* NB: enlarge image */
function enlarge(w,h,url,n,t,l){
  var iW;
  var imgtxt = "Image from";
  var closetxt = "Close";
  if (typeof l != "undefined" && l == "fr") {
      imgtxt = "Image de";
      closetxt = "Fermer";
  }
  t = imgtxt+" \u201C"+t+"\u201D";
  n = "__"+n;
  var regex = /\W+/;
  if(regex.test(n)) { n = n.replace(/\W+/,'_'); }

  var scrolling = false;
  try {
    if( w>screen.availWidth ) {
      w = screen.availWidth;
      scrolling = true;
    }
    if(h>screen.availHeight) {
      h = screen.availHeight;
      scrolling = true;
    }
  }
  catch(e) {}
  
  iWw = eval(w)+20;
  var f = "width="+iWw+",height="+h;
  f += ",left=10,top=10,menubar=no,toolbar=no,status=no,screenX=0,screenY=0";
  f += (!scrolling) ? ",scrollbars=0" : ",scrollbars=1";
  (window.iW==null||iW.closed) ? iW=window.open("",n,f) : iW.location.href = ""; 
  iW.document.write("<html lang=\"en-ca\"><head><title>"+t+"</title></head><body style=\"margin:0px;padding:0px\"><div><table width='100%' height='100%'><tr><td valign=middle align=center><a style='border-style:none' href='javascript:window.close()'><img style='border-style:none' src=\""+url+"\" alt=\""+t+"\"><br>"+closetxt+"</a></td></tr></table></div></body></html>");
  iW.document.close();     
  iW.focus();

  return false;
}
