<?xml version="1.0" encoding="UTF-8"?>
<Module>
	<ModulePrefs author="LabPixies"
	author_email="info@labpixies.com"
	description="__MSG_desc__"
	screenshot="http://www.labpixies.com/campaigns/pregnancy/images/screenshot.jpg"
	title="__MSG_title__"
	title_url="http://www.labpixies.com"
	category="tools"             
	thumbnail="http://www.labpixies.com/campaigns/pregnancy/images/thumbnail.jpg" 
	height="195" 
	render_inline="never">
	
    <Locale messages="http://www.labpixies.com/campaigns/pregnancy/i19/all_all.xml"/>
    <Locale lang="es" messages="http://www.labpixies.com/campaigns/pregnancy/i19/es_all.xml"/>
    <Locale lang="de" messages="http://www.labpixies.com/campaigns/pregnancy/i19/de_all.xml"/>
    <Locale lang="fr" messages="http://www.labpixies.com/campaigns/pregnancy/i19/fr_all.xml"/>
    <Locale lang="it" messages="http://www.labpixies.com/campaigns/pregnancy/i19/it_all.xml"/>
    <Locale lang="ja" messages="http://www.labpixies.com/campaigns/pregnancy/i19/ja_all.xml"/>
    <Locale lang="nl" messages="http://www.labpixies.com/campaigns/pregnancy/i19/nl_all.xml"/>
    <Locale lang="pl" messages="http://www.labpixies.com/campaigns/pregnancy/i19/pl_all.xml"/>
    <Locale lang="pt-PT" messages="http://www.labpixies.com/campaigns/pregnancy/i19/pt_all.xml"/>
    <Locale lang="pt-BR" messages="http://www.labpixies.com/campaigns/pregnancy/i19/pt_all.xml"/>
    <Locale lang="zh-CN" messages="http://www.labpixies.com/campaigns/pregnancy/i19/zh_cn_all.xml"/>
	<Require feature="setprefs"/>
	<Require feature="analytics"/>
  </ModulePrefs>
  
  <UserPref name="lp_preg_settings" default_value="" datatype="hidden"/>
  
<Content type="html">
<![CDATA[
<title>Pregnancy Calendar</title>
<style type="text/css">
<!--
body, html {
	margin: 0;
	padding: 0;
}
.style7 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-weight: bold;
	color: #FFFFFF;
}
.style9 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 18px;
	font-weight: bold;
	color: #FFFFFF;
}
.table_0 {
	background-color: #f9d7e9;
	border: 1px solid #d63b7a;
}
.style10 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #d63b7a;
	font-weight: bold;
}
.dropdown {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: bold;
	color: #000000;
}
.style13 {font-family: Arial, Helvetica, sans-serif; font-size: 11px; }
.style14 {vertical-align: bottom; font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: #d63b7a; font-weight: bold; }
.style14 a:visited {vertical-align: bottom; font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: #d63b7a; font-weight: bold; }

.table_1 {
	background-color: #d2ecfa;
	border: 1px solid #225fc6;
}
.table_3 {
	background-color: #e7fedf;
	border: 1px solid #21a818;
	
}
.table_2 {
	background-color: #f8edc6;
	border: 1px solid #db7318;
}
-->
</style>

<!-- PUT THIS TAG IN THE head SECTION -->
<script type="text/javascript" src="http://partner.googleadservices.com/gampad/google_service.js">
</script>
<script type="text/javascript">
  GS_googleAddAdSenseService("ca-pub-8123415297019784");
  GS_googleEnableAllServices();
</script>
<script type="text/javascript">
  GA_googleAddSlot("ca-pub-8123415297019784", "pregnancy_calendar_txt");
</script>
<script type="text/javascript">
  GA_googleFetchAds();
</script>
<!-- END OF TAG FOR head SECTION -->

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>

<script type="text/javascript">
var $lp=jQuery.noConflict();
var _gadgetID=55;

var pageTracker;

var IMAGES_BASE = 'http://cdn.labpixies.com/campaigns/pregnancy/'

function get_image(src)
{
	return _IG_GetImageUrl(IMAGES_BASE + src);
}

var prefs = new _IG_Prefs();

var didyou = ["Most doctors calculate 40 weeks of pregnancy from the first day of your last period.",
                "A blood-rich lining of tissue in your uterus is waiting to support a potential fertilized egg",
                "The placenta starts producing the pregnancy hormone HCG which tells your ovaries to stop releasing eggs",
                "This is the beginning of the embryonic period. This week, you should be able to find out if you're pregnant.",
                "Most women feel nausea, sore breasts, fatigue and frequent urination. Don't worry... It won't last forever",
                "Your baby begins to take shape. Ears, legs, feet start to develop and it's heart is beating almost twice as fast as yours!",
                "Your face might get oily and pimples may appear (Acne). This is normal due to hormonal changes. ",
                "If you have an ultrasound, you could hear and see a heartbeat this week!",
                "The baby's kidneys actually begin to function for the first time at this week of pregnancy.",
                "Your baby is no longer an embryo. This week marks the beginning of the fetal period!",
                "Many women say that hearing the beating of their baby's tiny heart for the first time is one of the greatest joys of the first trimester!",
                "Fingers and toes have separated and hair and nails begin to grow. The genitals begin to take on their gender characteristics!",
                "Welcome to the second trimester! This is the most comfortable and enjoyable stage of pregnancy",
                "The areola (the dark part of your nipple area) may have gotten darker and larger. This is normal as your body readies itself for breastfeeding.",
                "Your regular clothes may begin to feel a little snug now so don't try to force your body into them...",
                "If you are having an ultrasound, you may find out whether you are having a boy or a girl!",
                "Your baby begins to form fat. The fat begins to deposit under his skin and is important in heat production and metabolism.",
                "Have people been telling you how wonderful you look? The \"glow of pregnancy\" is real, thanks to increased blood flow to the skin!",
                "Sleeping may be difficult as your body grows. Try propping yourself with pillows to help you find a more comfortable sleeping position.",
                "By now, Your baby has as much sleep and awake time as a newborn...",
                "By now, you can certainly experience one of the most wonderful moments of pregnancy - feeling your baby move!",
                "Your baby now looks like a miniature newborn, and is about 11 inches and weighs almost 1 pound.",
                "Your baby still has lots of room to move around, so the kicks, punches and movements you had felt before will continue.",
                "Your baby will soon put on more baby fat, so for now your baby's skin is thin, translucent, and wrinkled",
                "You may notice darker or thicker body hair. It will return to normal in the weeks after you give birth.",
                "If you're having a boy, his testicles are beginning to descend into his scrotum - a trip that will take about two to three days.",
                "Your baby can now open and close his eyes, and he sleeps and wakes at regular intervals.",
                "The baby's eyesight is developing, and he may be able to see the light that filters in through your womb.",
                "With more brain tissue developing, your baby's brain is very active now.",
                "During this trimester, about 250 milligrams of calcium are deposited in your baby's hardening skeleton each day.",
                "Laying or sleeping on your left side as much as possible ensures a clear blood flow to your organs and extremities.",
                "Your baby now has toenails, fingernails, and there may be a lot of hair on his head",
                "Your baby continues to develop fat deposits under the skin, changing the color of his skin from red to pink.",
                "Your baby responds as a newborn with its eyes open while awake and closed while sleeping.",
                "Your baby is taking up most of the room in your uterus, so there is a lot less room to move around.",
                "Your baby is shedding the vernix caseosa, the creamy substance that covered and protected the skin during its submersion in amniotic fluid.",
                "By now, your baby will turn his head toward light and sound just as a newborn would.",
                "Your pregnancy is now considered full term - he is developmentally ready to handle life outside the womb",
                "The average size baby is over seven pounds at this point.",
                "Babies have their own time sense. If your due date has passed, don't worry. It's normal for due dates to be off..."];

    var theme = 0;
    var dueMonth = 0;
    var dueDay = 0;
    var dueYear = 0;
    
    function changeSkin(idx, shouldSave){
        theme = idx;
        document.getElementById("settingTbl").className = ("table_"+idx);
        document.getElementById("infoTbl").className = ("table_"+idx);
        document.getElementById("mainBg").style.backgroundImage = "url("+get_image("images/"+idx+".jpg")+")";
        		
        if (shouldSave)
            saveSettings();
    }
  
    function getDueDate(m,d,y,isLMP){
        
        dueMonth = parseInt(m);
        dueDay = parseInt(d);
        dueYear = parseInt(y);
   
        if(isLMP){
          var lmp = new Date();
          lmp.setFullYear(y,m-1,d);
          lmp.setHours(0,0,0,0);
          
          var du = new Date(lmp.getTime()+(1000*60*60*24*280));
          dueYear = du.getFullYear();
          dueMonth = du.getMonth()+1;
          dueDay = du.getDate();
        }
        
        var due = new Date();
        due.setFullYear(dueYear,dueMonth-1,dueDay);
        var today = new Date();
        today.setHours(0,0,0,0);
		    due.setHours(0,0,0,0);

		
        var diffMilli = due.getTime() - today.getTime();
		
        if(diffMilli < 0 ){
            diffMilli = 0;
        }
                
        var daysLeft = Math.round(diffMilli/(1000*60*60*24));
		    if(daysLeft > 280)daysLeft=280;
        if (isNaN(daysLeft))
    			daysLeft = 0;
          
        var daysGone = 280-daysLeft;
        if (isNaN(daysGone))	
    			daysGone = 0;
          		
        var weekNum = Math.floor(daysGone/7);		
    		if (isNaN(weekNum))
    			weekNum = 0;
    		
    		if ((weekNum==40) && (daysLeft==0))
    			weekNum = 0;
			
        document.getElementById("week").innerHTML = weekNum;
        document.getElementById("day").innerHTML = parseInt((daysGone%7));
        document.getElementById("left").innerHTML = daysLeft;
        document.getElementById("didyou").innerHTML = didyou[(weekNum < 40 ? weekNum : 39)];
        document.getElementById("infoTitle").innerHTML = "Week "+weekNum;
    }
    
    function toggleSettings(){
        if(document.getElementById("settingTbl").style.display != "none"){
            document.getElementById("settingTbl").style.display = "none";
            
            var month = document.getElementById("monSel").value;
            var day = document.getElementById("daySel").value;
            var year = document.getElementById("yearSel").value;
            var isLMP = document.getElementById("radio2").checked;
            
            var dueDate = getDueDate(month,day,year,isLMP);
            saveSettings();
            
        }else{
			//if (jQuery.browser.safari)
			//	$lp('#settingTbl').css('top','-140px');
            document.getElementById("settingTbl").style.display = "";
        }
    }
    
    function toggleInfo(){
      if(document.getElementById("infoTbl").style.display != "none"){
        document.getElementById("infoTbl").style.display = "none";
      }else{
        //if (jQuery.browser.safari)
        //  $lp('#infoTbl').css('top','-140px');
        document.getElementById("infoTbl").style.display = "";
        pageTracker._trackEvent('PregnancyCalendar','DidYouKnow');	
      }
    }
    
    function loadSettings(){
  		
      pageTracker = _gat._getTracker("UA-345375-1");
  		pageTracker._initData();
  			
  		$lp('#mainBg').css('background',"url("+get_image('images/0.jpg')+")");
  		
  		var off=$lp('#mainBg').offset();
  		
  		$lp('#week_holder').css({left:(off.left+104)+"px",top:(off.top+20)+"px"});
  		$lp('#day_holder').css({left:(off.left+65)+"px",top:(off.top+43)+"px"});
  		$lp('#left_holder').css({left:(off.left+66)+"px",top:(off.top+68)+"px"});
  		
  		var setStr = prefs.getString('lp_preg_settings');
          
  		if(setStr.length == 0){
  			toggleSettings();
  			return;
  		}
  				
  		var arr = setStr.split(",");
      
        changeSkin(arr[0],false);
        getDueDate(arr[1],arr[2],arr[3],false);
        document.getElementById("monSel").value = arr[1];
        document.getElementById("daySel").value = arr[2];
        document.getElementById("yearSel").value = arr[3];
        document.getElementById("radio2").checked = false;
        document.getElementById("radio1").checked = true;
    }
    
    function saveSettings(){
        var setStr = theme+","+dueMonth+","+dueDay+","+dueYear;
			
		prefs.set("lp_preg_settings",setStr);
		pageTracker._trackEvent('PregnancyCalendar','SetSettings');
    }
    
</script>

<center>
<div style='height:10px;font-size:1px;'></div>
<div style="height:140px;width:214px;margin-top:5px;" id="mainBg">
	<table id="mainTbl" width="214" height="112" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td height="10">
				<table width="214" height="11" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td width="150" height="11" style="font-size:1px;">&nbsp;</td>
						<td width="13" height="11" style="cursor:pointer;font-size:1px;" title="Change Theme" onclick="changeSkin(3,true);">&nbsp;</td>
						<td width="13" height="11" style="cursor:pointer;font-size:1px;" title="Change Theme" onclick="changeSkin(2,true);">&nbsp;</td>
						<td width="13" height="11" style="cursor:pointer;font-size:1px;" title="Change Theme" onclick="changeSkin(1,true);">&nbsp;</td>
						<td width="13" height="11" style="cursor:pointer;font-size:1px;" title="Change Theme" onclick="changeSkin(0,true);">&nbsp;</td>
						<td width="12" height="11" style="font-size:1px;" >&nbsp;</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td height="83"></td>
		</tr>
		<tr>
			<td height="19">
				<table width="214" border="0" cellspacing="0" cellpadding="0">
					<tr>
					<td width="50" style="height:5px;cursor:pointer" onclick="toggleSettings();">&nbsp;</td>
					<td width="80" style="height:5px;">&nbsp;</td>
					<td width="84" style="height:5px;cursor:pointer" onclick="toggleInfo();">&nbsp;</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</div>
<table cellpadding="0" cellspacing="0"><tr><td>
<div style="width:100%">
	<!-- PUT THIS TAG IN DESIRED LOCATION OF SLOT pregnancy_calendar_txt -->
	<script type="text/javascript">
	  GA_googleFillSlot("pregnancy_calendar_txt");
	</script>
	<!-- END OF TAG FOR SLOT pregnancy_calendar_txt -->	
</div>
</td></tr></table>

<!-- LP footer -->
<div>
	<script type="text/javascript">
    var mMENU = _IG_GetCachedUrl("http://cdn.labpixies.com/infra/js/lp_footer.js");
    document.write('<scr'+'ipt type="text/javascript" src="'+mMENU+'"></scr'+'ipt>');
  </script>
</div>

<div style="width:22px;text-align:center;position:absolute;" id="week_holder"><span id="week" class="style7">0</span></div>
<div style="text-align:center;width:17px;position:absolute;" id="day_holder"><span id="day" class="style7">0</span></div>
<div style="width:37px;text-align:center;position:absolute;" id="left_holder"><span id="left" class="style9">0</span></div>	
<table style="position:relative; top:-162px;  display:none;" id="settingTbl" width="195" height="100" border="0" cellpadding="5" cellspacing="0" class="table_0">
  <tr>
    <td><table width="175" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td><span class="style10">Enter Date </span></td>
      </tr>
      <tr>
        <td align="left"><select id="monSel" class="dropdown" name="select">
          <option value="1" selected="selected">Jan</option>
          <option value="2">Feb</option>
          <option value="3">Mar</option>
          <option value="4">Apr</option>
          <option value="5">May</option>
          <option value="6">Jun</option>
          <option value="7">Jul</option>
          <option value="8">Aug</option>
          <option value="9">Sep</option>
          <option value="10">Oct</option>
          <option value="11">Nov</option>
          <option value="12">Dec</option>
        </select>
          <select id="daySel" class="dropdown" name="select2">
            <option  value="1" selected="selected">1</option>
            <option  value="2">2</option>
            <option  value="3">3</option>
            <option  value="4">4</option>
            <option  value="5">5</option>
            <option  value="6">6</option>
            <option  value="7">7</option>
            <option  value="8">8</option>
            <option  value="9">9</option>
            <option  value="10">10</option>
            <option  value="11">11</option>
            <option  value="12">12</option>
            <option  value="13">13</option>
            <option  value="14">14</option>
            <option  value="15">15</option>
            <option  value="16">16</option>
            <option  value="17">17</option>
            <option  value="18">18</option>
            <option  value="19">19</option>
            <option  value="20">20</option>
            <option  value="21">21</option>
            <option  value="22">22</option>
            <option  value="23">23</option>
            <option  value="24">24</option>
            <option  value="25">25</option>
            <option  value="26">26</option>
            <option  value="27">27</option>
            <option  value="28">28</option>
            <option  value="29">29</option>
            <option  value="30">30</option>
            <option  value="31">31</option>
          </select>
          <select id="yearSel" class="dropdown" name="select3" >
            <option value="2008">2008</option>
            <option value="2009" selected="selected">2009</option>
            <option value="2010">2010</option>
      			<option value="2011">2011</option>
      			<option value="2012">2012</option>
          </select></td>
      </tr>
      <tr>
        <td align="left"><span class="style13">
          <input id="radio1" name="radiobutton" type="radio" value="radiobutton" />
          Due date </span></td>
      </tr>
      <tr>
        <td align="left"><span class="style13">
          <input id="radio2"  name="radiobutton" type="radio" value="radiobutton" checked/>
          First day of last period </span></td>
      </tr>
      <tr>
        <td class="style14" align="right">
			<table  border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td align="left"><a align="left" class="style14" target="_blank" href="http://www.labpixies.com/gadget_page.php?id=55">Disclaimer</a> </td>
					<td><div align="right" ><span style="cursor:pointer" class="style14" onclick="toggleSettings();">Save</span></div></td>
				</tr>
			</table>
		</td>
      </tr>
    </table></td>
  </tr>
</table>

<table style="position:relative; top:-162px;  display:none;"  id="infoTbl" width="195" height="100" border="0" cellpadding="5" cellspacing="0" class="table_0">
  <tr>
    <td><table width="175" height="90" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="15"><div align="center"><span id="infoTitle" class="style10">Week 0</span></div></td>
      </tr>
      <tr></tr>
      <tr>
        <td height="60"><div align="center"><span class="style13" id="didyou"></span></div></td>
      </tr>
      <tr></tr>
      <tr>
        <td height="15" class="style14"><div align="center" onclick="toggleInfo();" style="cursor:pointer">Close Window</div></td>
      </tr>
    </table></td>
  </tr>
</table>

</center>

<iframe width="1" height="1" style="width:1px; height:1px; overflow:hidden; position:absolute; visibility:hidden;" src="http://static.labpixies.com/campaigns/pregnancy/analytics.html"></iframe>
<script type="text/javascript">
_IG_RegisterOnloadHandler(loadSettings);
</script>

<script>
	_IG_Analytics("UA-345375-1", "/pregnancy");
</script>

]]>
</Content>
</Module>