// JavaScript Document

function galeria1 (imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
	newWindow1 = window.open("","galeriaWindow1","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
	newWindow1.document.open();
	newWindow1.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" >'); 
	newWindow1.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>' ); 
	newWindow1.document.write('</body></html>');
	newWindow1.document.close();
	newWindow1.focus();
}

function galeria (imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
	newWindow = window.open("","galeriaWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" >'); 
	newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

// function demo1() {  
	//var noweOkno = window.open ("http://bssafe.pl/prezentacja/index.html", "prezentacja", "status, menubar, height=800, width=1000");
//}



function noweOkno() {
	newWindow = window.open('podlogi_scieralnosc.html', 'oknoRys', 'width=340, height=300, location=no, scrollars=yes');
	newWindow.focus();
}



// REALIZACJE - miniaturki str-glowan ---------------------------------

var currentDiv = 1;
var countDiv = 8;


function hideAllDivs() {
	for (i=1; i<=countDiv; i++) {
		document.getElementById('r_'+i).style.display='none';
	}
}

function showDiv(divID) {
	hideAllDivs();
	document.getElementById('r_'+divID).style.display='block';
	currentDiv = divID;
}

function nextDiv() {
	if (currentDiv == countDiv) {
		divID = 1;
	} else {
		divID = currentDiv+1;
	}
	showDiv(divID);
}

function prevDiv() {
	if (currentDiv == 1) {
		divID = countDiv;
	} else {
		divID = currentDiv-1;
	}
	showDiv(divID);
}


// menu glowna-mapa-kontakt - pojawiajace sie podpisy przy przyciskach
// przyciski ---------------------------------
ico_home_on = new Image();
ico_home_on.src = "images/ikony/ico_glowna_Up.gif";
ico_home_off = new Image();
ico_home_off.src = "images/ikony/ico_glowna_Over.gif"; 

ico_email_on = new Image();
ico_email_on.src = "images/ikony/ico_kontakt_Up.gif";
ico_email_off = new Image();
ico_email_off.src = "images/ikony/ico_kontakt_Over.gif"; 

ico_mapa_on = new Image();
ico_mapa_on.src = "images/ikony/ico_mapa_Up.gif";
ico_mapa_off = new Image();
ico_mapa_off.src = "images/ikony/ico_mapa_Over.gif"; 

// podpisy przy przyciskach ----------------------
napis_home = new Image();
napis_home.src = "images/ikony/ico_glowna_napis.gif";

napis_email = new Image();
napis_email.src = "images/ikony/ico_kontakt_napis.gif";

napis_mapa = new Image();
napis_mapa.src = "images/ikony/ico_mapa_napis.gif";

napis_blank = new Image();
napis_blank.src = "images/ikony/ico_blank.gif";

// funkcje obslugujace przyciski ------------------
function select(imgName) {
	imgOn = eval(imgName + "_on.src");
	document[imgName].src = imgOn;
}

function unselect(imgName) {
	imgOff = eval(imgName + "_off.src");
	document[imgName].src = imgOff;
}

function changeImg(imgName,dest) {
	document[dest].src = eval(imgName + ".src");
}




// roolover ----------------------------------------------------------------------
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




//sprawdzenie formularza - zadaj pytanie  --------------------------------------------
function pytanie (frm)
                      		{
			  
					  		if (frm.nazwisko.value == "")
                      			{
                      			alert("Podanie imienia i nazwiska jest wymagane.");
                      			frm.nazwisko.focus();
                      			return(false);
                      			}
								
							if (frm.tel.value == "")
                      			{
                      			alert("Podanie telefonu jest wymagane.");
                      			frm.tel.focus();
                      			return(false);
                      			}
			                    							
					    	if (frm.pytanie1.value == "")
                      			{
                      			alert("Podanie tresci pytania jest wymagane.");
                      			frm.pytanie1.focus();
                      			return(false);
                      			}
							
                      		return(true);
                      		}




//sprawdzenie formularza - rejestracja  --------------------------------------------
function rejestracja (frm)
                      		{
			  
					  		if (frm.nazwisko.value == "")
                      			{
                      			alert("Podanie imienia i nazwiska jest wymagane.");
                      			frm.nazwisko.focus();
                      			return(false);
                      			}
								
							if (frm.tel.value == "")
                      			{
                      			alert("Podanie telefonu jest wymagane.");
                      			frm.tel.focus();
                      			return(false);
                      			}

							if (frm.termin.value == "")
                      			{
                      			alert("Podanie celu wizyty jest wymagane.");
                      			frm.termin.focus();
                      			return(false);
                      			}
							
                      		return(true);
                      		}

					
					

//sprawdzenie formularza - lekarze  --------------------------------------------
function lekarz(frm)
 {
 return(true);
 }

						
