<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Cardo&display=swap" rel="stylesheet"> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script type="text/javascript">
function fcalc(){$(document).ready(function(e){
	$("#treatmentMethodSelection").on("change",function(){
		var selection=$("#treatmentMethodSelection").val();
		switch(selection){
			case 'ER':$("#treatmentMethod").html('<strong>Izberite datum punkcije:</strong>');
			break;
		case 'ET3':$("#treatmentMethod").html('<strong>Izberite datum prenosa:</strong>');
		break;
		case 'ET5':$("#treatmentMethod").html('<strong>Izberite datum prenosa:</strong>');break;
		case 'NTC':$("#treatmentMethod").html('<strong>Izberite prvi dan zadnje menstruacije:</strong>');
		break;}});
		
		$("#calcDates").on('click',function(){
			$("#result").show();
			var selection=$("#treatmentMethodSelection").val();
			var d=new Date($('#year').val(),$('#month').val(),$('#day').val());
		
		switch(selection){
			case 'NTC':var pregnancyElapsedTotalDays=daydiff(d,Date.now());
			
					var pregnancyElapsedWeeks=Math.floor(pregnancyElapsedTotalDays/7);
					var pregnancyElapsedDays=Math.floor(pregnancyElapsedTotalDays%7);
						$('#weeksGone').html(pregnancyElapsedWeeks);
						$('#daysGone').html(pregnancyElapsedDays);
						var d=new Date($('#year').val(),$('#month').val(),$('#day').val());
						var dd=d.getDate();
						d.setDate(dd+280);
							var dueDateSingle=d.getDate()+" "+getMonthName(d.getMonth())+" "+d.getFullYear();
								$('#single').html(dueDateSingle);
						var d=new Date($('#year').val(),$('#month').val(),$('#day').val());
						var dd=d.getDate();
						d.setDate(dd+259);

							var dueDateTwins=d.getDate()+" "+getMonthName(d.getMonth())+" "+d.getFullYear();
								$('#twins').html(dueDateTwins);
							var d=new Date($('#year').val(),$('#month').val(),$('#day').val());
						var dd=d.getDate();
						d.setDate(dd+231);
							var dueDateTriplets=d.getDate()+" "+getMonthName(d.getMonth())+" "+d.getFullYear();
								$('#triplets').html(dueDateTriplets);
			break;
			case 'ER':var pregnancyElapsedTotalDays=daydiff(d,Date.now())+14;
					var pregnancyElapsedWeeks=Math.floor(pregnancyElapsedTotalDays/7);
					var pregnancyElapsedDays=Math.floor(pregnancyElapsedTotalDays%7);
						$('#weeksGone').html(pregnancyElapsedWeeks);
						$('#daysGone').html(pregnancyElapsedDays);
						var d=new Date($('#year').val(),$('#month').val(),$('#day').val());
						var dd=d.getDate();
						d.setDate(dd+266);
							var dueDateSingle=d.getDate()+" "+getMonthName(d.getMonth())+" "+d.getFullYear();
								$('#single').html(dueDateSingle);
							var d=new Date($('#year').val(),$('#month').val(),$('#day').val());
						var dd=d.getDate();
						d.setDate(dd+245);
							var dueDateTwins=d.getDate()+" "+getMonthName(d.getMonth())+" "+d.getFullYear();
								$('#twins').html(dueDateTwins);
							var d=new Date($('#year').val(),$('#month').val(),$('#day').val());
						var dd=d.getDate();
						d.setDate(dd+217);
							var dueDateTriplets=d.getDate()+" "+getMonthName(d.getMonth())+" "+d.getFullYear();
								$('#triplets').html(dueDateTriplets);
			break;
			case 'ET3':var pregnancyElapsedTotalDays=daydiff(d,Date.now())+17;
					var pregnancyElapsedWeeks=Math.floor(pregnancyElapsedTotalDays/7);
					var pregnancyElapsedDays=Math.floor(pregnancyElapsedTotalDays%7);
						$('#weeksGone').html(pregnancyElapsedWeeks);
						$('#daysGone').html(pregnancyElapsedDays);
						d.setDate(d.getDate()+263);
							var dueDateSingle=d.getDate()+" "+getMonthName(d.getMonth())+" "+d.getFullYear();
								$('#single').html(dueDateSingle);d.setDate(d.getDate()-21);
							var dueDateTwins=d.getDate()+" "+getMonthName(d.getMonth())+" "+d.getFullYear();
								$('#twins').html(dueDateTwins);d.setDate(d.getDate()-28);
							var dueDateTriplets=d.getDate()+" "+getMonthName(d.getMonth())+" "+d.getFullYear();
								$('#triplets').html(dueDateTriplets);
			break;
			case 'ET5':var pregnancyElapsedTotalDays=daydiff(d,Date.now())+19;
					var pregnancyElapsedWeeks=Math.floor(pregnancyElapsedTotalDays/7);
					var pregnancyElapsedDays=Math.floor(pregnancyElapsedTotalDays%7);
						$('#weeksGone').html(pregnancyElapsedWeeks);
						$('#daysGone').html(pregnancyElapsedDays);
						d.setDate(d.getDate()+261);
							var dueDateSingle=d.getDate()+" "+getMonthName(d.getMonth())+" "+d.getFullYear();
								$('#single').html(dueDateSingle);d.setDate(d.getDate()-21);
							var dueDateTwins=d.getDate()+" "+getMonthName(d.getMonth())+" "+d.getFullYear();
								$('#twins').html(dueDateTwins);d.setDate(d.getDate()-28);
							var dueDateTriplets=d.getDate()+" "+getMonthName(d.getMonth())+" "+d.getFullYear();
								$('#triplets').html(dueDateTriplets);break;}});});}
function daydiff(first,second){return(second-first)/(1000*60*60*24)}
function getMonthName(monthNum){
	var month=new Array();
	month[0]="Januar";
	month[1]="Februar";
	month[2]="Marec";
	month[3]="April";
	month[4]="Maj";
	month[5]="Junij";
	month[6]="Julij";
	month[7]="Avgust";
	month[8]="September";
	month[9]="Oktober";
	month[10]="November";
	month[11]="December";
	var n=month[monthNum];return n;}
</script>
<script type="text/javascript">// <![CDATA[
fcalc();
// ]]></script>
<style type="text/css">
.small-disclaimer-text {
	font-size: 11px;
	font-style: italic;
}
.calculator-container {
	background-color: #bce8ff;
	padding: 15px;
	padding-top: 15px;
	border-radius: 5px;
	margin-bottom: 5px;
	width:480px;
	font-family: 'Cardo', serif;

}
.calculator-container br {
	display: none;
}
.calculator-results-container {
	background-color: #cd62a6;
	padding: 15px;
	padding-top: 15px;
	border-radius: 5px;
	width:480px;
		font-family: 'Cardo', serif;
		letter-spacing: 0px;
		font-size:14px;

}
.calculator-results-container p {
	color: #FFF;
	margin-top: 5px;
	margin-bottom: 0px;
}
.calculator-drop-down {
	padding: 8px;
	margin-right: 10px;
	margin-bottom: 10px;
}
.congratulations {
	font-size: 22px;
	margin-top: 0px;
}
.calc-label {
	font-size: 16px;
	color: #000000;
	line-height: 1.6em;
	margin-right: 10px;
	margin-bottom: 10px;
	font-family: 'Cardo', serif;
}
mrm {
	margin-right: 5px;
}
.calculator-button,.calculator-button:active,.calculator-button:focus {
	width: auto;
	height: auto;
	vertical-align: top;
	padding: 8px;
	background-color: #1396da;
	color: #FFF;
	border: solid 1px #1396da;
	border-radius: 5px;
}
</style>
</head>
<body>
<center>
<div class="calculator-container" style=" text-align:left">
  <form>
    <label class="calc-label mrm"><strong>Izberite način zanositve:</strong></label>
    <select id="treatmentMethodSelection" class="calculator-drop-down">
      <option value="NTC">Naravna zanositev </option>
      <option value="ER">IVF - sveži postopek</option>
      <option value="ET5">IVF-ET - prenos 5 dni starega zarodka</option>
       <option value="ET3">IVF-ET - prenos 3 dni starega zarodka</option>
     <!-- <option value="ER">Fresh donor-egg cycle</option>
      <option value="ER">Fresh donor-embryo cycle</option>-->
    </select>
    <p></p>
    <p id="treatmentMethod"><strong>Izberite prvi dan zadnje menstruacije:</strong></p>
    <p>
      <select id="day" class="calculator-drop-down">
        <option>1</option>
        <option>2</option>
        <option>3</option>
        <option>4</option>
        <option>5</option>
        <option>6</option>
        <option>7</option>
        <option>8</option>
        <option>9</option>
        <option>10</option>
        <option>11</option>
        <option>12</option>
        <option>13</option>
        <option>14</option>
        <option>15</option>
        <option>16</option>
        <option>17</option>
        <option>18</option>
        <option>19</option>
        <option>20</option>
        <option>21</option>
        <option>22</option>
        <option>23</option>
        <option>24</option>
        <option>25</option>
        <option>26</option>
        <option>27</option>
        <option>28</option>
        <option>29</option>
        <option>30</option>
        <option>31</option>
      </select>
      <select id="month" class="calculator-drop-down">
        <option value="0">Januar</option>
        <option value="1">Februar</option>
        <option value="2">Marec</option>
        <option value="3">April</option>
        <option value="4">Maj</option>
        <option value="5">Junij</option>
        <option value="6">Julij</option>
        <option value="7">Avgust</option>
        <option value="8">September</option>
        <option value="9">Oktober</option>
        <option value="10">November</option>
        <option value="11">December</option>
      </select>
      <select id="year" class="calculator-drop-down">
        <option>2017</option>
        <option selected="selected">2018</option>
        <option>2019</option>
        <option>2020</option>
        <option>2021</option>
        <option>2022</option>
        <option>2023</option>
        <option>2024</option>
        <option>2025</option>
        <option>2026</option>
      </select>
      <br>
      <input id="calcDates" class="calculator-button" type="button" value="IZRAČUNAJ PDP">
    </p>
  </form>
</div>
<div id="result" class="calculator-results-container" style="display: none; text-align:left">
  <p class="congratulations"><strong>ISKRENE ČESTITKE!</strong></p>
  <p>Noseči ste <strong><span id="weeksGone"></span> tednov in <span id="daysGone"></span> dni.</strong></p>
  <p>Če ste noseči z enim otrokom, bo vaš predvideni datum poroda <span id="single"></span></p>
  <p>Če ste noseči z dvojčkoma, bo vaš predvideni datum poroda <span id="twins"></span></p>
  <p>Če ste noseči s trojčki, bo vaš predvideni datum poroda <span id="triplets"></span></p>
</div>
</center>
</body>
</html>
Prijava na novice