function $$(id){return document.getElementById(id);} 

function Contact_launch(strAgentID,strMLS)
{
  var d = document;
  var _docW = (d.width != undefined) ? d.width : d.body.offsetWidth;
  var _docH = Math.max(d.documentElement.clientHeight, d.documentElement.scrollHeight);
  if(window.innerHeight > _docH){ _docH = window.innerHeight;}
  _docH = Math.max(_docH,d.body.scrollHeight);
  if(d.documentElement.clientHeight > 0){_docW = d.documentElement.scrollWidth;}else{_docW = d.body.scrollWidth;}
  var _docS = (d.all ? Math.max(d.body.scrollTop,d.documentElement.scrollTop) : window.pageYOffset);
  var _docPH = (d.all ? Math.max(d.body.clientHeight,d.documentElement.clientHeight) : window.innerHeight);
  if(d.all){if(d.documentElement.clientHeight > 0){_docPH = d.documentElement.clientHeight;}}
  if(window.opera){_docPH = window.innerHeight;}

  
  
  if(!$$('BackgroundDiv'))
  {
    var Bg_div = d.createElement('div');
    Bg_div.style.display = 'none';
    Bg_div.id = 'BackgroundDiv';
    d.getElementsByTagName('body').item(0).appendChild(Bg_div);
  }
  else
  {
    var Bg_div = $$('BackgroundDiv');
  }
    
  with (Bg_div.style)
  {
    position = 'absolute';
    backgroundColor = '#000';
    left = '0px';
    top = '0px';
    zindex = 999;
    filter = 'alpha(opacity=55)';
    opacity = .55;
    width = _docW +'px';
    height = _docH +'px';
    display = 'block';
  }


  if(!$$('MainArea'))
  {
    var PDF_c = d.createElement('div');
    PDF_c.style.display = 'none';
    PDF_c.id = 'MainArea';
    d.getElementsByTagName('body').item(0).appendChild(PDF_c);
  }
  else
  {
    var PDF_c = $$('MainArea');
  }

  with (PDF_c.style)
  {
    width = '800px';
    height = '590px';
    position = 'absolute';
    top = (((_docPH-500)/2) + _docS) + 'px';
    left =  (((_docW - 800)/2) > 0 ? (((_docW - 800)/2) - 50) + 'px' : '10px');
    backgroundColor = '#000';
    zindex = 10003;
  }
  PDF_c.innerHTML = '<div style="margin:8px 0px 0px 10px;float:left;font-family:verdana;color:#fff;font-size:10px;"></div><a href="javascript:PDF_close();"><img src="/webimages/Close.gif" border="0" title="Close"  style="float:right;margin:5px 10px 0px 0px;" /></a>';
  PDF_c.style.display = 'block';

  if(!$$('iFrameDiv'))
  {
    var PDF_i = d.createElement('iframe');
    PDF_i.id = 'iFrameDiv';
    d.getElementsByTagName('body').item(0).appendChild(PDF_i);
  }
  else
  {
    var PDF_i = $$('iFrameDiv');
  }

  if(document.all){PDF_i.scrolling = 'yes'};
  PDF_i.src = '/AgentContact.asp?ID='+strAgentID+'&MLS='+strMLS;
  
  with (PDF_i.style)
  {
    position = 'absolute';
	background = '#FFFFFF';
    height = '550px';
    display = 'none';
    margin = '0px';
    padding = '0px';
    width = '780px';
    border = '0px';
    top = (((_docPH-480)/2) + _docS + 20) + 'px';
    left =  (((_docW - 780)/2) > 0 ? (((_docW - 780)/2) - 50) + 'px' : '10px');
    zindex = 10005;
  }

  PDF_i.style.display = 'block';
}


function PDF_close()
{
  $$('BackgroundDiv').style.display = 'none';
  $$('iFrameDiv').style.display = 'none';
  $$('MainArea').style.display = 'none';
}
