<!--
	// Date Display Function
    function displayDate(){
      var this_month = new Array(12);
      this_month[0]  = "stycznia";
      this_month[1]  = "lutego";
      this_month[2]  = "marca";
      this_month[3]  = "kwietnia";
      this_month[4]  = "maja";
      this_month[5]  = "czerwca";
      this_month[6]  = "lipca";
      this_month[7]  = "sierpnia";
      this_month[8]  = "września";
      this_month[9]  = "października";
      this_month[10] = "listopada";
      this_month[11] = "grudnia";
      var today = new Date();
      var day   = today.getDate();
      var month = today.getMonth();
      var year  = today.getYear();
      if (year < 1900){
         year += 1900;
      }
      return(day+" "+this_month[month]+" " +year);
    }
	//-->



function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ' resizable=0,scrollbars=no,menubar=no' );}

    
var bookmarkurl="http://www.wyczyn.republika.pl"
var bookmarktitle="Strona wędkarstwa wyczynowego"

function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}







 {



		// Calculate the values for the New Litres and New Butterfat columns and 

		// the Butterfat Gain based on the inputs to the Butterfat Bought column

		

		// Also format the Butterfat Bought and New Butterfat columns to six

		// places to align the decimals



		// - form:			object reference to the form containing the inputs



		form.ButterfatBought5.value = formatSixPlaces(round(form.ButterfatBought5.value, 6))

		form.ButterfatBought7.value = formatSixPlaces(round(form.ButterfatBought7.value, 6))

		form.NewTotalLitres7.value = checkNumber(form.LitresBought5.value) + checkNumber(form.LitresBought7.value)

		form.NewButterfat7.value = formatSixPlaces(round(checkNumber(((checkNumber(form.LitresBought5.value) * checkNumber(form.ButterfatBought5.value)) + (checkNumber(form.LitresBought7.value) * checkNumber(form.ButterfatBought7.value))) / checkNumber(form.NewTotalLitres7.value)), 6))

		

		for (var i = 9; i <= 21; i = i + 2) {	

			var thisLitresBought = eval("document.forms[0].LitresBought" + i)			

			var thisButterfatBought = eval("document.forms[0].ButterfatBought" + i)			

			var thisNewTotalLitres = eval("document.forms[0].NewTotalLitres" + i)			

			var lastNewTotalLitres = eval("document.forms[0].NewTotalLitres" + (i - 2))	

			var thisNewButterfat = eval("document.forms[0].NewButterfat" + i)		

			var lastNewButterfat = eval("document.forms[0].NewButterfat" + (i - 2))

			thisButterfatBought.value = formatSixPlaces(round(thisButterfatBought.value, 6))

			thisNewTotalLitres.value = checkNumber(thisLitresBought.value) + checkNumber(lastNewTotalLitres.value)			

			thisNewButterfat.value = formatSixPlaces(round(checkNumber(((checkNumber(lastNewTotalLitres.value) * checkNumber(lastNewButterfat.value)) + (checkNumber(thisLitresBought.value) * checkNumber(thisButterfatBought.value))) / checkNumber(thisNewTotalLitres.value)), 6))

		}

		

		form.NewTotalLitres23.value = form.NewTotalLitres21.value

		form.NewTotalLitres25.value = round(checkNumber(form.NewTotalLitres23.value), 0)

		form.NewButterfat23.value = formatSixPlaces(form.NewButterfat21.value)

		form.NewButterfat25.value = formatSixPlaces(round(checkNumber(form.NewButterfat23.value), 2))

		form.ButterfatGain.value = round(checkNumber(form.NewTotalLitres23.value) * (checkNumber(form.NewButterfat25.value) - round(checkNumber(form.ButterfatBought5.value), 2)) * 0.18, 0)



	}





	function checkNumber(valueToCheck) {



		// Convert the parameter (which may be a string input) to a floating point number 

		// - if it's not a number, return zero, otherwise return the value



		// - valueToCheck:	the input value to check (typically a string input)



		valueToCheck = parseFloat(valueToCheck)

		if (isNaN(valueToCheck)) {

			valueToCheck = 0

		}

		return valueToCheck

	}





	function round(valueToRound, precision) {



		// Round a number to a given number of decimal places



		// - valueToRound:	the number to be rounded

		// - precision:		the number of decimal places to round to



		return Math.round(valueToRound * Math.pow(10, precision)) / Math.pow(10, precision)



	}





	function formatSixPlaces(valueToFormat) {

	

		// Format a number to show six decimal places by adding zeros to the end of 

		// the number if it has less than six places - return the number as a string

		

		// - valueToFormat:	the number to the formatted

		

		// If the value is zero, return an empty string (this makes the form clearer)

		if (valueToFormat == 0) {

			return ""

		}

		

		valueToFormat = valueToFormat.toString()

		var decimalPosition = valueToFormat.indexOf(".")

		var sixZeros = "000000"

		if (decimalPosition > 0) {

			return valueToFormat + sixZeros.substring(valueToFormat.length - (decimalPosition + 1))

		} else {

			return valueToFormat + ".000000"

		}

	

	}

	



	function setCookie() {



		// Save the Litres Bought and Butterfat Bought values to a temporary cookie



		var cookieString = "ButterfatValues="

		for (var i = 5; i <= 21; i = i + 2) {

			var thisLitresBought = eval("document.forms[0].LitresBought" + i)			

			var thisButterfatBought = eval("document.forms[0].ButterfatBought" + i)

			cookieString += thisLitresBought.value + "*" + thisButterfatBought.value + "*"

		}

		document.cookie = cookieString



	}





	function clearValues() {



		// Re-initialise the form by clearing the Litres Bought and Butterfat Bought 

		// values and then recalculating the New Total Litres and New Butterfat



		for (var i = 5; i <= 21; i = i + 2) {

			var thisLitresBought = eval("document.forms[0].LitresBought" + i)			

			var thisButterfatBought = eval("document.forms[0].ButterfatBought" + i)

			thisLitresBought.value = ""

			thisButterfatBought.value = ""

		}

		calculateGain(document.forms[0])



	}




<!-- 



function Oblicz(Obiekt) {

	var str = Obiekt.expr.value;

    var re = /,/g;//wzorzec

    var wynstr = str.replace(re,".");

	Obiekt.Wynik.value = Math.round((wynstr/0.971)*1000)/1000

}



function ObliczZT(Obiekt) {

	var str1 = Obiekt.exprZT1.value;

	var str2 = Obiekt.exprZT2.value;

	var str3 = Obiekt.exprZT3.value;

	

    var re = /,/g;//wzorzec

    var wynstr1 = str1.replace(re,".");

    var wynstr2 = str2.replace(re,".");

    var wynstr3 = str3.replace(re,".");



	Obiekt.WynikZT.value = Math.round((wynstr1*0.18*(wynstr2-wynstr3)/0.1))/100

}



// -->


<!-- start of JavaScript



	function calculateGain(form) {



		// Calculate the values for the New Litres and New Butterfat columns and 

		// the Butterfat Gain based on the inputs to the Butterfat Bought column

		

		// Also format the Butterfat Bought and New Butterfat columns to six

		// places to align the decimals



		// - form:			object reference to the form containing the inputs



		form.ButterfatBought5.value = formatSixPlaces(round(form.ButterfatBought5.value, 6))

		form.ButterfatBought7.value = formatSixPlaces(round(form.ButterfatBought7.value, 6))

		form.NewTotalLitres7.value = checkNumber(form.LitresBought5.value) + checkNumber(form.LitresBought7.value)

		form.NewButterfat7.value = formatSixPlaces(round(checkNumber(((checkNumber(form.LitresBought5.value) * checkNumber(form.ButterfatBought5.value)) + (checkNumber(form.LitresBought7.value) * checkNumber(form.ButterfatBought7.value))) / checkNumber(form.NewTotalLitres7.value)), 6))

		

		for (var i = 9; i <= 21; i = i + 2) {	

			var thisLitresBought = eval("document.forms[0].LitresBought" + i)			

			var thisButterfatBought = eval("document.forms[0].ButterfatBought" + i)			

			var thisNewTotalLitres = eval("document.forms[0].NewTotalLitres" + i)			

			var lastNewTotalLitres = eval("document.forms[0].NewTotalLitres" + (i - 2))	

			var thisNewButterfat = eval("document.forms[0].NewButterfat" + i)		

			var lastNewButterfat = eval("document.forms[0].NewButterfat" + (i - 2))

			thisButterfatBought.value = formatSixPlaces(round(thisButterfatBought.value, 6))

			thisNewTotalLitres.value = checkNumber(thisLitresBought.value) + checkNumber(lastNewTotalLitres.value)			

			thisNewButterfat.value = formatSixPlaces(round(checkNumber(((checkNumber(lastNewTotalLitres.value) * checkNumber(lastNewButterfat.value)) + (checkNumber(thisLitresBought.value) * checkNumber(thisButterfatBought.value))) / checkNumber(thisNewTotalLitres.value)), 6))

		}

		

		form.NewTotalLitres23.value = form.NewTotalLitres21.value

		form.NewTotalLitres25.value = round(checkNumber(form.NewTotalLitres23.value), 0)

		form.NewButterfat23.value = formatSixPlaces(form.NewButterfat21.value)

		form.NewButterfat25.value = formatSixPlaces(round(checkNumber(form.NewButterfat23.value), 2))

		form.ButterfatGain.value = round(checkNumber(form.NewTotalLitres23.value) * (checkNumber(form.NewButterfat25.value) - round(checkNumber(form.ButterfatBought5.value), 2)) * 0.18, 0)



	}





	function checkNumber(valueToCheck) {



		// Convert the parameter (which may be a string input) to a floating point number 

		// - if it's not a number, return zero, otherwise return the value



		// - valueToCheck:	the input value to check (typically a string input)



		valueToCheck = parseFloat(valueToCheck)

		if (isNaN(valueToCheck)) {

			valueToCheck = 0

		}

		return valueToCheck

	}





	function round(valueToRound, precision) {



		// Round a number to a given number of decimal places



		// - valueToRound:	the number to be rounded

		// - precision:		the number of decimal places to round to



		return Math.round(valueToRound * Math.pow(10, precision)) / Math.pow(10, precision)



	}





	function formatSixPlaces(valueToFormat) {

	

		// Format a number to show six decimal places by adding zeros to the end of 

		// the number if it has less than six places - return the number as a string

		

		// - valueToFormat:	the number to the formatted

		

		// If the value is zero, return an empty string (this makes the form clearer)

		if (valueToFormat == 0) {

			return ""

		}

		

		valueToFormat = valueToFormat.toString()

		var decimalPosition = valueToFormat.indexOf(".")

		var sixZeros = "000000"

		if (decimalPosition > 0) {

			return valueToFormat + sixZeros.substring(valueToFormat.length - (decimalPosition + 1))

		} else {

			return valueToFormat + ".000000"

		}

	

	}

	



	function setCookie() {



		// Save the Litres Bought and Butterfat Bought values to a temporary cookie



		var cookieString = "ButterfatValues="

		for (var i = 5; i <= 21; i = i + 2) {

			var thisLitresBought = eval("document.forms[0].LitresBought" + i)			

			var thisButterfatBought = eval("document.forms[0].ButterfatBought" + i)

			cookieString += thisLitresBought.value + "*" + thisButterfatBought.value + "*"

		}

		document.cookie = cookieString



	}





	function clearValues() {



		// Re-initialise the form by clearing the Litres Bought and Butterfat Bought 

		// values and then recalculating the New Total Litres and New Butterfat



		for (var i = 5; i <= 21; i = i + 2) {

			var thisLitresBought = eval("document.forms[0].LitresBought" + i)			

			var thisButterfatBought = eval("document.forms[0].ButterfatBought" + i)

			thisLitresBought.value = ""

			thisButterfatBought.value = ""

		}

		calculateGain(document.forms[0])



	}



// end of JavaScript -->