var browserType;

if (document.layers) {browserType = "nn4"}
if (document.all) {browserType = "ie"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {browserType= "gecko"}

/* ================================================================== */

var bo_ns_id = 0;

function startIeFix(){
  if(isIE()){
    document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!-- ');
  }
}

function endIeFix(){
  if(isIE()){
    document.write('</div>');
    var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
    var theCode = theObject.innerHTML;
    theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"))
    document.write(theCode);
  }
}

function isIE(){
  // only for Win IE 6+
  // But not in Windows 98, Me, NT 4.0, 2000
  var strBrwsr= navigator.userAgent.toLowerCase();
  if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0){
    if(parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6){
      return false;
    }
    if(strBrwsr.indexOf("win98") > -1 ||
       strBrwsr.indexOf("win 9x 4.90") > -1 ||
       strBrwsr.indexOf("winnt4.0") > -1 ||
       strBrwsr.indexOf("windows nt 5.0") > -1)
    {
      return false;
    }
    return true;
  }else{
    return false;
  }
}

/* ================================================== */


function include ( site )
{
    document.write( '<iframe src="'+site+'" marginwidth="0" marginheight="0" scrolling="" frameborder="1" width="70" height="100"></iframe>');
}

//**************************************************************************

function show_img(path,szer,wys)
{
  lewa=screen.width/2-szer/2;
  gora=screen.height/2-wys/2;
  param="'toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,width="+10+",height="+10+"',left="+lewa+",top="+gora;

  NoweOkienko=window.open('','',param);
  NoweOkienko.document.open(); //otwarcie dokumentu do edycji
  NoweOkienko.document.write ("<HTML><HEAD><TITLE>GALERIA</TITLE>\n<script language=\"JavaScript\">kroki=30;for(i=1;i<=kroki;i++){szerokosc=("+szer+"/kroki)*i;wysokosc=("+wys+"/kroki)*i;resizeTo(szerokosc,wysokosc);if(i==kroki){resizeTo("+szer+","+wys+");}}</script>\n<link rel='stylesheet' href='style.css' type='text/css'></HEAD><BODY bgcolor='#8CAFDC'><center><IMG SRC='"+path+"' onclick='javascript:window.close();' onmouseover='style.cursor=\"pointer\"'></center></BODY></HTML>");
  NoweOkienko.document.close(); //zakonczenie sesji wpisywania dokumentu
  NoweOkienko.focus(); //aby okno pojawilo sie na wierzchu
}
function show_form(nazwa)
{
var element_id=document.getElementById(nazwa);
  if(element_id.style.display=='none')
  {
   element_id.style.display='';
  }
  else
  {
   element_id.style.display='none';
  }
}
function wstaw_flash(id_div,plik,szer,wys,przezr)
{
    elem=document.getElementById(id_div);
    res='<object type="application/x-shockwave-flash" data="starter.swf?path='+plik+'" width="'+szer+'" height="'+wys+'">';
    res+='<param name="movie" value="starter.swf?path='+plik+'" />';
    res+='<param name="wmode" value="'+przezr+'" />';
    //alert(res);
    //document.write(res);
    elem.innerHTML = res;
}
function regulamin_spr(){
	chbox = document.getElementById('akceptuje');
	if(chbox.checked == false){
		alert('Aby dodać opinię musisz zaakceptować regulamin.');
		return false;
	}
	document.getElementById('ksiega_gosci').value='uslugi_detyktywistyczne';
	document.nowa_opinia.submit();
	return true;
}
