function pokaz(ref) {
	if (ref) document.getElementById(ref).style.display = 'block';	
}

function ukryj(ref) {
	if (ref) document.getElementById(ref).style.display = 'none';	
}

function nS(user,domain) {
         locationstring = "mailto:" + user + "@" + domain;
         window.location = locationstring;
} 

function ai(id) {

	document.getElementById(id).value = '';
	document.getElementById(id).style.color='#8B8B8B';
}
function di(id, fraza) {
	if (document.getElementById(id).value == '') {
	document.getElementById(id).value = fraza;
	document.getElementById(id).style.color='#8B8B8B';
	}
}

function pageDown() {
	if (window.scrollBy)
	window.scrollBy(0, window.innerHeight ? window.innerHeight : 
	document.body.clientHeight);
}

function pageUp() {
	if (window.scrollBy)
	window.scrollBy(0, window.innerHeight ? -window.innerHeight : -
	document.body.clientHeight);
}

function wyczysc(id) {
	document.getElementById(id).innerHTML = '';
}

function markSize(id) {

	for (i=1; i<=3; i++) {
		hide = document.getElementById('size'+i);
		hide.style.background = "url('gfx/box_line.gif') no-repeat top left";
	}

	place = document.getElementById('size'+id);
	place.style.background = "url('gfx/upmenu_sub.gif') repeat-x";
}

function swapway(id) {

	for (i=0; i<=1; i++) {
		hide = document.getElementById('way'+i);
		hide.style.background = "url('gfx/input_box.png') no-repeat center left";
	}

	place = document.getElementById('way'+id);
	place.style.background = "url('gfx/input_box_hv.png') no-repeat center left";
	document.getElementById('way').value = id;
}

function bookmark() {

 title = "Indos - Przywracamy płynność finansową"; 

 url = "http://indos.pl.pl";

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
 }
 
 function switchDiv(id) {
	 if (id) {	 
		 if (document.getElementById(id).style.display == 'none') 
		 document.getElementById(id).style.display = 'block';
		 else
		 document.getElementById(id).style.display = 'none';
	 }
 }
 
function validateForm(AForm) {
    if (!AForm.email.value || AForm.email.value=='adres e-mail') {
        alert("Wypełnij pole 'Adres e-mail'");
        return false;
        }

    if (!AForm.from.value || AForm.from.value=='imię i nazwisko') {
        alert("Wypełnij pole 'Imię i nazwisko'");
        return false;
        	    }
    else {
        return true;
    }
}

function getmail() {
   
   	var alertMessage = '';
   
    if (!document.getElementById("msgAbout").value) { alertMessage = alertMessage + 'Proszę określić w jakiej sprawie mamy się skontaktować. '; }
    if (!document.getElementById("msgRefer").value) { alertMessage = alertMessage + 'Proszę podać źródło informacji o naszej firmie. '; }  
    if (!document.getElementById("msgFrom").value || document.getElementById("msgFrom").value == 'imię i nazwisko') { alertMessage = alertMessage + 'Proszę podać imię i nazwisko. '; } 
    if (!document.getElementById("msgEmail").value || document.getElementById("msgEmail").value == 'adres e-mail') { alertMessage = alertMessage + 'Proszę podać adres e-mail. '; } 
           
   	if (alertMessage == '') {
   	
   						get(document.getElementById('contactForm'));
						pokaz('contactPrelo'); 
						ukryj('contactForm');
	}
	else alert(alertMessage);
   }