/*
 * Optimus Prime extend thickbox.js
 * 
 * 
 */

function TB_init_url_opPos(urlLink, pTitle){  
  //$j("thickbox").click(function(event){
  // stop default behaviour
  //event.preventDefault();
  // remove click border
  //this.blur();
  // get caption: either title or name attribute  
  var caption = pTitle || this.title || this.name || "";
  
  // get rel attribute for image groups
  var group = this.rel || false;
  
  // display the box for the elements href
  TB_show_op(caption, urlLink, group);
  //});
}

// called when the user clicks on a thickbox link
function TB_show_op(caption, url, rel) {
  TB_show(caption, url, rel);  
  TB_position_op();
}

function TB_position_op() {       
  if(initTB_Width){
    var pagesize = TB_getPageSize();	
    var arrayPageScroll = TB_getPageScrollTop();
    
    var leftPos = TB_LEFTPOS;
    var topPos = TB_TOPPOS;
    var style = {width: TB_WIDTH, left: (leftPos), top: (topPos)};	
    if('' == topPos)//let thickbox to determine
      style = {width: TB_WIDTH, left: (leftPos)};
   
    $j("#TB_window").css(style);
  }
}

//default values
var TB_LEFTPOS = screen.width/4;
var TB_TOPPOS = screen.height/4;

