<!--

var def_color1 = "menu";
var act_color1 = "menu2";
var def_color = "menu";
var act_color = "menu2";
var wysokosc_menu_level_1 = 30;
var przesuniecie_level_1 = 0;

var last;
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();
      set(objs, c, id, h);
}

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

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

   setTimer();
}

function unset(obju, c){
   setFastTimer();
   if( obji[c] != null )
      obji[c].className = 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].className = def_color;
  }

  show(id, h);

  if( objj[c] != null )
     objj[c].className = def_color1;
  obju.className = act_color1;
  objj[c] = obju;
}

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

function show(id, h){ 
   divmenu = 'm'+id;

   obj = document.getElementById(divmenu);
   if( h > 10 ) {
     pos = getAnchorPosition(id);
	 if( document.getElementById('ma'+h) && document.getElementById('ma'+h).clientWidth > 0 )
		ww = document.getElementById('ma'+h).clientWidth;
	 else if( document.getElementById('ma'+h) && document.getElementById('ma'+h).offsetWidth )
		ww = document.getElementById('ma'+h).clientWidth;
     document.getElementById(divmenu).style.left = parseFloat(parseFloat(document.getElementById('ma'+h).style.left) + parseFloat(ww)-1)+'px'; 
     document.getElementById(divmenu).style.top = parseFloat(parseFloat(pos.y) - 4)+'px';
     hide_last();
     last = document.getElementById(divmenu);
   } else {
     pos = getAnchorPosition(id); 
     document.getElementById(divmenu).style.left= parseFloat(pos.x+przesuniecie_level_1)+'px';
     document.getElementById(divmenu).style.top= parseFloat(pos.y+wysokosc_menu_level_1)+'px';
   }
   if( h == 0 ) { hide(); }
   document.getElementById(divmenu).style.display='block';  
   setTimer();
}

function hide_last(){
  if( last ){
    last.style.display='none'; 
  }
}

function hide() {

  for (var i = 0;i<objj.length;i++)
  {
    if( objj[i] != null )
      objj[i].className = 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,tytul,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,tytul,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>");
}

// -->
