function getWindowHeight() {
	if(parseInt(navigator.appVersion)>3) {
 		if(navigator.appName.indexOf("Microsoft")!=-1) {
			winH = document.documentElement.clientHeight;
 		}
 		else {
 			winH = window.innerHeight;
 		}
	}

	var docHeight;
	
	if (typeof document.height != 'undefined') {
		docHeight = document.height;
	}
	else if (document.compatMode && document.compatMode != 'BackCompat') {
		docHeight = document.documentElement.scrollHeight;
	}
	else if (document.body && typeof document.body.scrollHeight != 'undefined') {
		docHeight = document.body.scrollHeight;
	}

	if(winH > docHeight) {
		docHeight = winH - 15;
	}

	return docHeight;
}

function getWindowWidth() {
	var winW;
	var docWidth;

	if(parseInt(navigator.appVersion)>3) {
 		if(navigator.appName.indexOf("Microsoft")!=-1) {
			winW = document.documentElement.clientWidth;
 		}
 		else {
 			winW = window.innerWidth;
 		}
	}

	if (typeof document.width != 'undefined') {
		docWidth = document.width;
	}
	else if (document.body && typeof document.body.scrollWidth != 'undefined') {
		docWidth = document.body.scrollWidth;
	}

	if(winW > docWidth) {
		docWidth = winW;
	}

	return docWidth;
}

function zaslonEkran(id) {
	if(parseInt(navigator.appVersion)>3) {
 		if(navigator.appName.indexOf("Microsoft")!=-1) {
			winH = document.documentElement.clientHeight;
 		}
 		else {
 			winH = window.innerHeight;
 		}
	}

	var docHeight = getWindowHeight();
	var docWidth = getWindowWidth();

  if (id == 'mail') {
  	var hideDiv = document.getElementById("hideScreenMail");
	  var formDiv = document.getElementById("some_formMail");  
  } else {
 	  var hideDiv = document.getElementById("hideScreen");
	  var formDiv = document.getElementById("some_form");  
  }

	hideDiv.style.height = (docHeight + 15) + "px";
	hideDiv.style.width = docWidth + "px";
	hideDiv.style.display = "block";

	formDiv.style.display = "block";
	formDiv.style.left = (docWidth/2 - 200) + "px";
}

function pokazEkran() {
	var hideDiv = document.getElementById("hideScreen");
	var formDiv = document.getElementById("some_form");

  if (hideDiv != null) {
	 hideDiv.style.display = "none";
	 formDiv.style.display = "none";
  }

	var hideDiv = document.getElementById("hideScreenMail");
	var formDiv = document.getElementById("some_formMail");

	hideDiv.style.display = "none";
	formDiv.style.display = "none";	
	
}

function changeHideDiv() {
	var hideDiv = document.getElementById("hideScreen");
	var formDiv = document.getElementById("some_form");

	if(hideDiv.style.display == "block") {
		var docHeight = getWindowHeight();
		var docWidth = getWindowWidth();

 		hideDiv.style.height = (docHeight + 15) + "px";
 		hideDiv.style.width = docWidth + "px";

 		formDiv.style.left = (docWidth/2 - 200) + "px";
	}
}

function trackSend(){
  zaslonEkran('mail');
}

//kopiuje informacje o trasie do magicznego diva od maila
function copyValuesToMail(){
  trackSend('mail');
}

function messageSent(lang){
    alert("Your mail was sent succesfully");
}

function wiadomoscWyslano(){
    alert("Mail zostal wyslany do adresata");  
}
   