<!--

var bImage_i = 1;
var bImage = "";
var bImage_obj = "gImage";

function blendImages(){
   	if (bImage[bImage_i].indexOf("#")!=0){ 
		Blend(bImage[bImage_i]);
	}
	if( bImage_i == (bImage.length-1) ){
		bImage_i = 0;
	} else {
		bImage_i = bImage_i+1;
	}
	self.setTimeout('blendImages()', 5000);
}

function Blend(newsrc){	
	document.getElementById(bImage_obj).filters.blendTrans.Apply();
	document.getElementById(bImage_obj).src = newsrc;
	document.getElementById(bImage_obj).filters.blendTrans.Play()
}

function blending(){
    document.getElementById(bImage_obj).style.filter="blendTrans(duration=1.5)";
	bImage = blending.arguments;
	self.setTimeout('blendImages()', 5000);
}

var def_color1 = "#333333";
var act_color1 = "#0058B1";
var def_color = "#0058B1";
var act_color = "#333333";
var last;
var obji = new Array(5);
var objj = new Array(5);

var mTimer = null;


function linkuj(e) {
                if(document.getElementById(e).style.display == 'block') {
                        hideall();
                        return;
                } else 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('ul')
                        var max = Nodes.length
                        for(var i=0;i<max;i++) {
                                var nodeObj = Nodes.item(i);                                
                                if( nodeObj.id.indexOf('f17')!=-1 ) {
                                   nodeObj.style.display = 'none';                                
                                }
                        }
}   

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

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

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].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);     
   }

   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.background = def_color;
  }

  show(id, h);

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

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

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

   obj = document.getElementById(divmenu);
   if( h > 10 ) {
     pos = getAnchorPosition(id);
     document.getElementById(divmenu).style.left = parseFloat(document.getElementById('ma'+h).style.left) + parseFloat(document.getElementById('ma'+h).style.width)-1; 
     document.getElementById(divmenu).style.top = parseFloat(pos.y) - 2;
     hide_last();
     last = document.getElementById(divmenu);
   } else {
     pos = getAnchorPosition(id); 
     document.getElementById(divmenu).style.left= parseFloat(pos.x+168);
     document.getElementById(divmenu).style.top= parseFloat(pos.y-2);
   }
   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].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){
 if(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(url,tytul,szer,wys)
{  
if( parseInt(szer) > 800 || parseInt(wys) > 800 ){
    NoweOkienko=window.open(url,tytul);
}else {
	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 BGCOLOR=white LEFTMARGIN=0 TOPMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0>');
	NoweOkienko.document.write('<A HREF=# onclick="javascript:self.close();"><IMG SRC="'+url+'" BORDER=0 ALT="Zamknij"></A>');
	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);

// -->
