<!--
   var kod_pocztowy = /^([0-9]{2})-([0-9]{3})$/; 

var def_color1 = "#ffffff";
var act_color1 = "#000000";
var def_color = "#5BA8E9";
var act_color = "#2985D2";
var def_cn = "menu2";
var act_cn = "menu";

try{ document.execCommand( 'BackgroundImageCache', false, true ) ;} catch (e) {}
	
var last = new Array(5);
var obji = new Array(5);
var objj = new Array(5);

var mTimer = null;

function showOpis( s ){
    var oid = 'w'+s.options[s.selectedIndex].value;
    hideall();
    if( document.getElementById(oid) )
      linkuj(oid);

}

function linkuj(e) {
				hideall();
                if (document.getElementById(e).style.display == 'none') {
                        document.getElementById(e).style.display = 'block';
                } else {
                        document.getElementById(e).style.display = 'none';
                }
}

function hideall() {
                        var Nodes = document.getElementsByTagName('div')
                        var max = Nodes.length
                        for(var i=0;i<max;i++) {
                                var nodeObj = Nodes.item(i);                                
                                if(nodeObj.id.indexOf('w')!=-1) {
                                   nodeObj.style.display = 'none';                                
                                }
                        }
}  

function setTimer(){
     clearTimeout(mTimer);
     mTimer = setTimeout("hide()" , 60000 );
}

function setFastTimer(){
     clearTimeout(mTimer);
     mTimer = setTimeout("hide()" , 1500 );
}

function seth(objs, c, id, h){
      if( h == 0 && id == 0)
         hide_last(c);
      set(objs, c, id, h);
}

function set(objs, c, id, h){
   setTimer();
   if( obji[c] != null && obji[c].style.background != def_color )
     unset(obji[c], c);
   obji[c] = objs;
   objs.style.background = act_color;

   if( id != null && h > 10 ){
       obji[c] = null;
       show(id, h, c);     
   }

   setTimer();
}

function unset(obju, c){
   setFastTimer();
   if( obji[c] != null )
      obji[c].style.background = def_color;
   obji[c] = obju;
}

function setp(obju, c, id, h){

  for (var i = 0;i<obji.length;i++)
  {
    if( obji[i] != null )
      obji[i].style.className = def_cn;
  }

  show(id, h, c);

  if( objj[c] != null )
     objj[c].className = def_cn;
  obju.className = act_cn;
  objj[c] = obju;
}

function unsetp(obju, c){
  hide();
  if( objj[c] != null )
     objj[c].className = def_cn;
  obju.className = act_cn;
  objj[c] = obju;
  setTimer();
}

function show(id, h, c){ 
   divmenu = 'm'+id;
   obj = document.getElementById(divmenu);
   if( h > 10 ) {
     pos = getAnchorPosition(id);
 
if( document.getElementById('ma'+h).clientWidth > 0 )
	ww = document.getElementById('ma'+h).clientWidth;
else if( document.getElementById('ma'+h).offsetWidth )
	ww = document.getElementById('ma'+h).clientWidth;
	
     document.getElementById(divmenu).style.left = parseFloat(document.getElementById('ma'+h).style.left) + parseFloat(ww); 
     document.getElementById(divmenu).style.top = parseFloat(pos.y) - 0;
     hide_last(c); 
	 last[c] = document.getElementById(divmenu);
   } else {
     pos = getAnchorPosition(id); 
     document.getElementById(divmenu).style.left= parseFloat(pos.x);
     document.getElementById(divmenu).style.top= parseFloat(pos.y+35);
   }
   if( h == 0 ) { hide(); }
   document.getElementById(divmenu).style.display='block';  
   setTimer();
}

function hide_last(c){
  for(i=0; i<last.length; i++){
	if( i >= c && last[i]){
		tmp = last[i]
		tmp.style.display='none'; 
		last[i] = '';
	} 
  }
}

function hide() {

  for (var i = 0;i<objj.length;i++)
  {
    if( objj[i] != null )
      objj[i].style.color = def_color1;
  }
 
     var Nodes = document.getElementsByTagName('div')
     var max = Nodes.length
     for(var i=0;i<max;i++) {
                 var nodeObj = Nodes.item(i);                                
                 if(nodeObj.id.indexOf('ma')!=-1 ) {
                    nodeObj.style.display = 'none';                                
                 }
     }
}    

function czysc(o){
  for (var i=0; i<o.length;i++) {
      if( o[i].type!= 'hidden' && o[i].type!= 'submit' && o[i].type!= 'button'){
        o[i].value = "";
      }
  }
}

function go(url){
  document.location.href = url;
}

function check(o){
  kRe = /(@)/;
  kRe_a = kRe.exec(o.email.value);
   var err = 0;
   if( kRe_a && kRe_a[1] ){ }
   else {
       err =1;
       alert("Musisz podać poprawny adres e-mail");
   }

   if( err == 0 ){
       o.submit();
   }
}

function check_en(o){
  kRe = /(@)/;
  kRe_a = kRe.exec(o.email.value);
   err = 0;
   if( kRe_a && kRe_a[1] ){ }
   else {
       err =1;
       alert("You have to write proper e-mail.");
   }

   if( kRe_a && kRe_a[1] && o.klient.checked ==false &&  o.agencja.checked == false ){
       alert("You have to choose agency or client.");
       err =1;
   }

   if( err == 0 ){
       o.submit();
   }
}

function daysElapsed(date1,date2) {
    var difference =
        Date.UTC(y2k(date1.getYear()),date1.getMonth(),date1.getDate(),0,0,0)
      - Date.UTC(y2k(date2.getYear()),date2.getMonth(),date2.getDate(),0,0,0);
    return difference/1000/60/60/24;
}

function y2k(number) { return (number < 1000) ? number + 1900 : number; }

function go_form(f, url){
   f.action = url;
   f.submit();
}

function selecturl(s) {
	var gourl = s.options[s.selectedIndex].value;	document.location.href = gourl;
}

function otworz( host, url, tytul, szer, wys, extra_foto ){
    if (parseInt(szer) > 800 || parseInt(wys) > 800){
        NoweOkienko=window.open(url, tytul);
    } else{
		if( extra_foto )
			wys = parseInt(wys)+50;
		if( parseInt(szer) < 150 )
			szer = 350;

        config='left=100,top=100,width='+szer+',height='+wys+',innerheight='+wys+',innerwidth='+szer+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no';
        NoweOkienko=window.open('', tytul, config);
        NoweOkienko.document.open();
        NoweOkienko.document.write('<HTML>');
        NoweOkienko.document.write('<HEAD>');
        NoweOkienko.document.write('<TITLE>'+tytul+'</TITLE>');
        NoweOkienko.document.write('</HEAD>');
        NoweOkienko.document.write('<body style="padding: 0px; margin: 0px;" bgcolor="#ffffff">');
        if( extra_foto )
			NoweOkienko.document.write('<table height="50" cellpadding="0" cellspacing="0" width="100%"><tr><td><img src="'+host+'/logo.gif"></td><td align="right"><img src="'+host+'/'+extra_foto+'"></td></tr></table>');
        NoweOkienko.document.write('<div align="center"><A HREF=# onclick="javascript:self.close();"><IMG SRC="'+host+'/'+url+'" BORDER=0 ALT="Zamknij"></A></div>');
        NoweOkienko.document.write('</BODY>');
        NoweOkienko.document.write('</HTML>');
        NoweOkienko.document.close();
        NoweOkienko.focus();
    }
}

function otworz_url(url,szer,wys)
{
	config='left=100,top=100,width='+szer+',height='+wys+',innerheight='+wys+',innerwidth='+szer+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no';
	NoweOkienko=window.open(url,'',config); 
}

function getAnchorPosition(anchorname) {
	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (document.getElementById) { use_gebi=true; }
	else if (document.all) { use_css=true; }
	else if (document.layers) { use_layers=true; }
	// Logic to find position
 	if (use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_gebi) {
		var o=document.getElementById(anchorname);
		x=AnchorPosition_getPageOffsetLeft(o);
		y=AnchorPosition_getPageOffsetTop(o);
		}
 	else if (use_css) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_layers) {
		var found=0;
		for (var i=0; i<document.anchors.length; i++) {
			if (document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
		}
	else {
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// getAnchorWindowPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the window
function getAnchorWindowPosition(anchorname) {
	var coordinates=getAnchorPosition(anchorname);
	var x=0;
	var y=0;
	if (document.getElementById) {
		if (isNaN(window.screenX)) {
			x=coordinates.x-document.body.scrollLeft+window.screenLeft;
			y=coordinates.y-document.body.scrollTop+window.screenTop;
			}
		else {
			x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
			y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
			}
		}
	else if (document.all) {
		x=coordinates.x-document.body.scrollLeft+window.screenLeft;
		y=coordinates.y-document.body.scrollTop+window.screenTop;
		}
	else if (document.layers) {
		x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
		y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// Functions for IE to get position of an object
function AnchorPosition_getPageOffsetLeft (el) {
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
	}
function AnchorPosition_getWindowOffsetLeft (el) {
	return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
	}	
function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
	}
function AnchorPosition_getWindowOffsetTop (el) {
	return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
	}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function mailer(pre, dom, c){
	document.write("<a href='mailto:"+pre+"@"+dom+"' "+c+">"+pre+"@"+dom+"</a>");
}

function voip_acces(f){

   //NA POCZATKU VALIDACJA WPROWADZONYCH DANYCH
    if (f.f1.value == 'noselect'){
	    alert('Proszę wybrać opcję.');
		f.f1.focus();
		return false;
	}

   //DANE PRZESLANE Z FORMULARZA
   var data = f.f1.value.split("^");
   var check_acces = parseFloat(data[0]);
   var acces_type = data[1];
   
   if (check_acces==0){
     f.f2.value='dostęp ' + acces_type + ':';
     f.f3.value='';
     f.f3.className='invisible_medium_red';
   }
   else if (check_acces==1){
     f.f2.value='dostęp ' + acces_type + ':';
     f.f3.value='';
     f.f3.className='invisible_medium_green';
   }
   return false;
}

function voip_box3(){
	var s1 = document.box3.s1.value.split(',');
	var s2 = document.box3.s2.value;	
	if( s1[s2] )
		document.box3.ext.value = s1[s2]+"%";
}

function loadQuestions(){
	var Nodes = document.getElementsByTagName('table')
    var max = Nodes.length;
    for(var i=0;i<max;i++) {
          var nodeObj = Nodes.item(i);                                
          if(nodeObj.id.indexOf('faq')!=-1) {
              nodeObj.style.display = 'none';
              document.getElementById('n'+nodeObj.id).onclick = pokazQuestion;
              document.getElementById('r'+nodeObj.id).style.display = 'none';
              document.getElementById('n'+nodeObj.id).style.cursor = "pointer";
          }
    }
}

function pokazQuestion(e){
	var Nodes = document.getElementsByTagName('table')
    var max = Nodes.length;
    for(var i=0;i<max;i++) {
          var nodeObj = Nodes.item(i);                                
          if(nodeObj.id.indexOf('faq')!=-1) {
              nodeObj.style.display = 'none';
              document.getElementById('r'+nodeObj.id).style.display = 'none';
          }
    }
    var aid = this.id;
    aid = aid.replace(/nfaq/, 'faq');
    document.getElementById(aid).style.display = 'block';
    document.getElementById('r'+aid).innerHTML = document.getElementById('rekl').innerHTML;
    document.getElementById('r'+aid).style.display = 'block';
              
}
function showSDiv(id, zdjecie){

	tmp = document.getElementById("db"+id).innerHTML;
	
	if( zdjecie && !tmp.match("table"+id)){
		tmp = '<table id="table'+id+'" width=300 cellpadding=0 cellspacing=0><tr><td width=110 align=left><img src="http://www.operatorzy.pl/data/foto.php?w=100&h=200&f='+escape(zdjecie)+'"></td><td>'+tmp+'</td></tr></table>';
		document.getElementById("db"+id).innerHTML = tmp;
	}
	
	pos = getAnchorPosition("dba"+id);
	document.getElementById("db"+id).style.left = pos.x+'px';
	document.getElementById("db"+id).style.top = (parseFloat(pos.y)+20)+'px';
	document.getElementById("db"+id).style.display = "block";
}
function hideSDiv(id){
	document.getElementById("db"+id).style.display = "none";
}
// -->
