function displayAd(container, src, width, height)
{
    var playParam;
    
    if (getCookie(src) != "true")
    {
        setCookie(src, "true");
        playParam = "true";
    }
    else
    {
        playParam = "false";
    }
    
    setInterval("positionit('"+container+"')",100); 
    document.getElementById(container).innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='"+width+"' height='"+height+"' id='myflash' align='middle'><param name='play' value='"+playParam+"' /><param name='allowScriptAccess' value='always' /><param name='movie' value='"+src+"' /><param name='quality' value='high' /><param name='wmode' value='transparent'><embed play='"+playParam+"' src='"+src+"' quality='high' bgcolor='#ffffff' width='"+height+"' height='"+width+"' name='mymovie' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' wmode='transparent' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>";    
}

function positionit(container){
    var crossobj=document.all? document.all.staticVideo : document.getElementById(container)
    var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body
    var dsocleft=document.all ? iebody.scrollLeft : pageXOffset
    var dsoctop=document.all? iebody.scrollTop : pageYOffset
    if (document.all||document.getElementById){

    crossobj.style.top=document.documentElement.clientHeight-410+dsoctop+"px"
    crossobj.style.left=document.documentElement.clientWidth-300+dsocleft+"px"
    }
}

function closeFlash(){ 
    var crossobj=document.getElementById("staticVideo");
    crossobj.style.display="none";
}

function getCookie(key) {
  var search = key + "=";
  var returnvalue = "";
  var offset, end;
  
  if (document.cookie.length > 0) 
  {
    offset = document.cookie.indexOf(search);
    if (offset != -1) 
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      {
        returnvalue =unescape(document.cookie.substring(offset, end));
      }
    }
   }
  return returnvalue;
}

function setCookie(key, value)
{
    document.cookie=key + "=" + value;
}