<!-- Hide from older browsers
function SwitchImg(){ //start
  var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
    for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3) {
    	store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
    if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
        (store.indexOf('document.all[')==0 && document.all==null))
         store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
         obj = eval(store);
    if (obj != null) {
   	   switcher[keep++] = obj;
      switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
      obj.src = SwitchImg.arguments[rem+2];
  } }
  document.Data = switcher;
} //end

function RestoreImg(){ //start
  if (document.Data != null)
    for (var rem=0; rem<(document.Data.length-1); rem+=2)
      document.Data[rem].src=document.Data[rem+1];
} //end

function Trim(TheString)
{
var len;
len = TheString.length;
while(TheString.substring(0,1) == " "){ //trim left
TheString = TheString.substring(1, len);
len = TheString.length;
}
while(TheString.substring(len-1, len) == " "){ //trim right
TheString = TheString.substring(0, len-1);
len = TheString.length;
}
return TheString;
}
/////////////////////do tagow
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); 
var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
                && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
                && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
var is_moz = 0;

var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
var is_mac = (clientPC.indexOf("mac")!=-1);
tagi = new Array('<b>','</b>','<i>','</i>','<u>','</u>','<div align=left>','</div>','<div align=center>','</div>','<div align=right>','</div>','[img:','\]','[img_left:','\]','[img_right:','\]','[link_txt:','\]','[link_img:','\]','[plik_txt:','\]','[plik_img:','\]');
kod = new Array();

function zmien(id,t){
var txtarea = t;
	txtarea.focus();
	donotinsert = false;
	theSelection = false;
	bblast = 0;
	if ((clientVer >= 4) && is_ie && is_win)
	{
		theSelection = document.selection.createRange().text; // zaznaczony tekst
		if (theSelection) {
			document.selection.createRange().text = tagi[id] + theSelection + tagi[id+1];
			txtarea.focus();
			theSelection = '';
	  		return;
    
		}
	}
	else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
	{
		mozWrap(txtarea, tagi[id], tagi[id+1]);
		return;
	}	

if (!theSelection) {
      sel=document.selection.createRange().text;
      document.selection.createRange().text=tagi[id]+sel+tagi[id+1];
 		return;
 		}		

	storeCaret(txtarea);	
 }
function storeCaret(textEl) {
	if (textEl.createTextRange) 
	   textEl.caretPos = document.selection.createRange().duplicate();
  
}

function usuntagi(){
      theSelection = document.selection.createRange().text; // zaznaczony tekst
		if (theSelection) {
			zm=document.selection.createRange().text;
         for(i=0;i<12;i++){
          while(zm.search(tagi[i])!=-1){
			  zm=zm.replace(tagi[i],'');
			  }
			  document.selection.createRange().text=zm;
         }			
			theSelection = '';
	  		return;
	  	}	
}
/////////////////////==================koniec tagow

function sprawdzf(f){
if(Trim(f.nazwisko.value)==''){
alert('Wpisz imię i nazwisko!');
f.nazwisko.focus();
return false;
}
if(Trim(f.telefon.value)==''){
alert('Wpisz numer telefonu!');
f.telefon.focus();
return false;
}
if (f.email.value !="" && (
f.email.value.indexOf( "@" ) == "-1" ||
f.email.value.indexOf( "." ) == "-1" || 
f.email.value.indexOf( "@" ))>f.email.value.lastIndexOf('.')){
  alert("Adres email niepoprawny. Wpisz ponownie!");
  f.email.focus();
  return false;
}
if(Trim(f.pytanie.value)==''){
alert('Wpisz treść pytania!');
f.pytanie.focus();
return false;
}

return true;
}

function wybierz() {
current = document.f.zdjecie.selectedIndex;
//alert(document.f.zdjecie[current].value);
if(document.f.zdjecie[current].value=='') document.f.zdjecie[current].value="blank.gif"; 
document.images.pokaz.src = document.f.zdjecie[current].value;
}
// end hiding contents -->

