
/*******************************************************************************
******************* requires /includes/js/flashdetect.js ***********************
*******************************************************************************/

function showHide(divname) {
  if (document.all) {
    if (document.all[divname].style.display==''||document.all[divname].style.display=='block') {
     document.all[divname].style.display='none';
    } 
    else {
     document.all[divname].style.display='';
    }
  } 
  else if (document.getElementById) {
    if (document.getElementById(divname).style.display=='block'||document.getElementById(divname).style.display=='') {
      document.getElementById(divname).style.display='none';
    } 
    else {
      document.getElementById(divname).style.display='block';
    }
  }
}
// called by flash movie to resize containing div 
// newSize ... string: small or large
function tearTrigger(newSize) {
  var datoX = 150;
  var datoY = 150;
  if (newSize == 'large') {
    datoX = 1090;
    datoY = 925;
    document.getElementById('tickleCT').style.border = '1px solid #a6cdf4';
  }
  else {
    document.getElementById('tickleCT').style.border = '0';
  }
  showHide('lrecad');
  document.getElementById('tickleCT').style.width = datoX+'px';
  document.getElementById('tickleCT').style.height = datoY+'px';
}
// writes out flash div, object and embed tags.
// required vars:
//   fl_url ......... url to flash movie
//   ad_url ......... advertiser supplied url
//   resizeSm2Lg_id ... tracking id on button to activate flash takeover
function writeTickleCT(fl_url,ad_url,resizeSm2Lg_id) {
   
  var flashHtml = '<div id="tickleCT" style="position:absolute;top:0;left:0;width:150px;height:150px;z-index:1000;">';
  flashHtml += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="100%" height="100%" id="corner_tear_template" align="top">';
  flashHtml +='<param name="allowScriptAccess" value="always" /><param name="movie" value="'+fl_url+'" /><param name="loop" value="false" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="salign" value="lt" /><param name="wmode" value="transparent" /><param name="FlashVars" value="clickTAG='+ad_url+'&resizeSm2Lg='+resizeSm2Lg_id+'" />';
 
  flashHtml +='<embed src="'+fl_url+'" FlashVars="clickTAG='+ad_url+'&resizeSm2Lg='+resizeSm2Lg_id+'" loop="false" quality="high" scale="noscale" salign="lt" wmode="transparent" width="100%" height="100%" name="corner_tear_template" align="top" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
  flashHtml +='</object>';
  flashHtml += '</div>';
 
  document.getElementById('cornertear').innerHTML = flashHtml;
}

var cornerTearPresent = true;

