var defhovClr = "#CED3A1";
var defoffClr = "#FFFFFF";

function openPopup(theURL) {
    popupWindow = window.open(theURL,"Microsite","scrollbars=yes,resizable=yes,width=640,height=480");
    popupWindow.focus();	
}

function changeBG() 
{
	if ( document.body ) { // ie +
		document.body.bgColor = "#FFCC99";
  		document.body.background = "https://content.clarica.com/canada/images/v3/clarica/microsite/women/english/background.jpg";
	} else { // netscape
		var BG = document.getElementById("BG_div");
		BG.style.display = "";
		BG.style.width = window.innerWidth + "px";
		BG.style.height = window.innerHeight + "px";
	}
}

function hover_on(layerNum)
{
	document.getElementById("leftnav"+layerNum).style.backgroundColor = defhovClr;
  document.getElementById("details"+layerNum).style.display = "";

  if (navigator.userAgent.indexOf("Firefox")!=-1) {
    document.getElementById("details"+layerNum).style.left = document.getElementById("leftnav"+layerNum).offsetLeft + document.getElementById("leftnav"+layerNum).offsetWidth + 10;
  }
	else {
    document.getElementById("details"+layerNum).style.left = document.getElementById("leftnav"+layerNum).offsetParent.offsetLeft + document.getElementById("leftnav"+layerNum).offsetWidth + 10;
	}

  if (navigator.userAgent.indexOf("Firefox")!=-1) {
	  document.getElementById("details"+layerNum).style.top = document.getElementById("leftnav"+layerNum).offsetTop;
	}
	else {
	  document.getElementById("details"+layerNum).style.top = document.getElementById("leftnav"+layerNum).offsetParent.offsetTop + document.getElementById("leftnav"+layerNum).offsetTop;
	}
}

function hover_off(layerNum)
{
  document.getElementById("leftnav"+layerNum).style.backgroundColor = defoffClr;
   document.getElementById('details'+layerNum).style.display = "none";
}

function tell_a_friend() 
{
  var mailStr ="mailto:?subject=Thought you would find this website interesting. Live Well - recovery planning for women.&body=Hi. There's some interesting stuff here. Really gets you thinking. You can request a free book too. www.toLiveWell.ca";

  window.location.href=mailStr;
}

function drawTell_a_friend()
{
  document.write("<DIV id='dlgTell_a_friend' style='left:50%;top:50%;margin-top:-106px;margin-left:-222px;background-color:#FFFFFF;display:none;z-index:10;position:absolute;width:445px;text-align:center;border:#845984 solid 2px;padding:6px;'>");
  document.write("<FORM name='frmTell_a_friend' method='GET' enctype='text/plain'>");
  document.write("  <TABLE cellpadding='3' cellspacing='0' style='width:445;border:0px;'>");
  document.write("    <TR>");
  document.write("      <TD style='padding:0px;height:25px;vertical-align:middle;background-image:url(http://content.clarica.com/canada/images/v3/clarica/microsite/women/english/title_Tell_a_friend.jpg);' colspan='4'>");
  document.write("        <TABLE style='height:25px;width:100%;border:0px;' cellspacing='0' cellpadding='0'>");
  document.write("          <TR>");
  document.write("            <TD style='font-size:9pt;font-weight:bold;color:#FFFFFF;font-family:Verdana;vertical-align:middle;'>&nbsp;&nbsp;Use this form to send your friends a link to Live Well.</TD>");
  document.write("            <TD style='vertical-align:middle;'><A href='javascript:closeTell_a_friend();'><IMG src='http://content.clarica.com/canada/images/v3/clarica/microsite/women/english/btnClose.gif' style='border:0px;width:29px;height:22px;'></A></TD>");
  document.write("          </TR>");
  document.write("        </TABLE>");
  document.write("      </TD>");
  document.write("    </TR>");
  document.write("    <TR>");
  document.write("      <TD colspan='4' style='font-size:8pt;color:#000000;font-family:Verdana;vertical-align:top;'>&nbsp;</TD>");
  document.write("    </TR>");
  document.write("    <TR>");
  document.write("	  <TD rowspan='2' style='width:10px;'>&nbsp;</TD>");
  document.write("      <TD style='width:265px;font-size:8pt;color:#000000;font-family:Verdana;vertical-align:top;'>");
  document.write("	    Your friend's e-mail address(es): <BR>");
  document.write("        <INPUT type='text' name='txtEmail01' style='width:250px;background-color:#FFFFFF;'><BR>");
  document.write("        <INPUT type='text' name='txtEmail02' style='width:250px;background-color:#FFFFFF;'><BR>");
  document.write("        <INPUT type='text' name='txtEmail03' style='width:250px;background-color:#FFFFFF;'><BR>");
  document.write("        <INPUT type='text' name='txtEmail04' style='width:250px;background-color:#FFFFFF;'>");
  document.write("      </TD>");
  document.write("      <TD style='width:160px;vertical-align:top;text-align:center;' rowspan='2'><IMG src='http://content.clarica.com/canada/images/v3/clarica/microsite/women/english/mauve_flowers.JPG' alt='' style='width:68;height:123;'></TD>");
  document.write("	  <TD rowspan='2' style='width:10px;'>&nbsp;</TD>");
  document.write("    </TR>");
  document.write("    <TR>	  ");
  document.write("	  <TD style='text-align:center;height:40px;'><IMG  src='http://content.clarica.com/canada/images/v3/clarica/microsite/women/english/btnSend.gif' onclick='tell_a_friend()' style='width:83px;height:20px;cursor:hand;cursor:pointer;'></TD>	     </TR>");
  document.write("  </TABLE>");
  document.write("</FORM>");
  document.write("</DIV>");
}

function openTell_a_friend()
{
  document.getElementById('dlgTell_a_friend').style.display = "";
  return;
}

function closeTell_a_friend()
{
  document.getElementById('dlgTell_a_friend').style.display = "none";
  document.frmTell_a_friend.txtEmail01.value = "";
  document.frmTell_a_friend.txtEmail02.value = "";
  document.frmTell_a_friend.txtEmail03.value = "";
  document.frmTell_a_friend.txtEmail04.value = "";
  return;
}