// Delivery rate configuration
// var TC_PUN_Odds=0.25; // chgd to .25 Sept 2107; chgd to .3 June 21/07; chgd from .25 to .3 on June 6/07; chged from .10 to .25 Oct 5 likelihood that a link will have the onclick property
var TC_PUN_Odds=0.5; // Changed to 0.5 Jan 20 2010 for Shane.. Changed to 0.4 on Jan 14 2010, changed to 0.25 Dec 1, 2009 to re-enable. chgd to .001 July 7/09 to effectively disable. chgd to .25 Sept 2107; chgd to .3 June 21/07; chgd from .25 to .3 on June 6/07; chged from .10 to .25 Oct 5 likelihood that a link will have the onclick property
var TC_PUN_Delay=3*60*60*1000; // 2 hrs Sept 11; 2 hrs June 21/07; chgd from 3 hrs to 2 hrs on May 29th. chged from 6hr to 3hr Oct 5 milliseconds minimum between pun displays
var TC_PUN_Odds_adjust=0.10; // how much less likely to show PUN if cookies disabled
// end of configuration



var nocachedate=new Date(); var nocachenumber = nocachedate.getSeconds() * nocachedate.getMinutes();
var TC_PUN_URL='http://futures.tradingcharts.com/showpun.php?nocache='+nocachenumber;
var TC_Window_Options='width=700,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no';
var TC_PUN_cookiename='TCPUNShownbw7';
var TC_PUN_Shown=0;

function TC_configlinks(){
  var dc=document.cookie;
  if(!dc){
    var newcookie = 'TC_CC_accepted=1';
    TC_PUN_Odds=TC_PUN_Odds*TC_PUN_Odds_adjust;
  }
  if(dc.indexOf(TC_PUN_cookiename)<0){ // cookie not set
    for (var x = 0; x < document.links.length; x++) {
      if((Math.random()<TC_PUN_Odds) && (document.links[x].protocol=='http:') && (document.links[x].target!='wmark_lpwin')){ // no pun on watermark links
        document.links[x].onclick = TC_show_pun;
      }
    }
  }
}
function Create_TC_PopUnder_Win(){
  var expires = new Date();
  expires.setTime(expires.getTime() + TC_PUN_Delay);
  var newcookie = TC_PUN_cookiename + "=shown; expires=" + expires.toGMTString() + "; path=/; domain=.tradingcharts.com";
  document.cookie=newcookie;
  TC_PUN_Shown=1;
  var TC_Win_Hdl = eval("window.open (TC_PUN_URL, 'TC_PUN_Window', TC_Window_Options)");
  if (window.focus){
    self.focus();
  }
}
function TC_show_pun(){
  var dc=document.cookie;
  if((TC_PUN_Shown==0) && (dc.indexOf(TC_PUN_cookiename)<0)){ // cookie not set and pun not shown
    Create_TC_PopUnder_Win();
  }
}
