function showElm() {
  function hideElm(selector) {
    $(selector).slideUp('fast', function(){$(selector).remove();});
    var threeMonths = new Date();
    threeMonths.setMonth(threeMonths.getMonth()+3);
    document.cookie = 'survey=1; expires='+threeMonths.toGMTString()
                      +'; path=/';
  }
  $('#wrapper-subnav').after(
    '<div id="wrapper-survey" style="background:#fff1cc none; border-style:solid; border-color:#BCB7B8; border-width:0 0 1px 0; text-align: center; padding: 3px 0 4px 0;">'
    +'<div id="survey" style="text-align:left; margin:0 auto; width:729px;">'
    +'<h4 style="background:transparent none; color:#D89F17; font-family:Arial,Helvetica,Sans-serif; font-weight:bold; line-height: 1.6em; padding: 0 0.4em 0 0; float: left;">Win a BlackBerry&reg; Storm&trade;!</h4>'
    +'<p style="line-height:1.6em; padding:0; float:left;">Help us to help you by taking part in '
    +'our customer survey for mobile users.</p>'
    +'<p id="survey-buttons" style="text-align:right; white-space:nowrap; line-height:1.6em; padding:0;">'
    +'<input type="button" id="survey-yes" value="Start the survey" style="font:inherit; cursor:pointer; width:7.8em;" /> '
    +'<input type="button" id="survey-no" value="No thanks" style="font:inherit; cursor:pointer; width:5.3em;" />'
    +'</p></div></div>').next().hide();
  $('#survey-yes').click(function(){
    hideElm('#wrapper-survey');
    window.open('http://www.marketworld.co.uk/IOM/iom.htm','_blank');
  });
  $('#survey-no').click(function(){
    hideElm('#wrapper-survey');
  });
  $('#wrapper-survey').slideDown('normal');
}


$(document).ready(function(){
  if(document.cookie.indexOf('survey=1')!=-1) return;

  window.setTimeout('showElm()', 300);
});

