/********************************************/
/* BIBLIOTEKA Cross-Browser DHTML           */
/* wersja 2.1         1999-05-20            */
/********************************************/
/* onFocus Dynamic Web Design               */
/* Ania Kręglewska, Paweł Postupalski       */
/* mailto:onfocus@webmedia.pl               */
/* http://www.onfocus.com.pl                */
/********************************************/
/* Ta biblioteka moze byc wykorzystywana    */
/* bez zadnych ograniczen pod warunkiem     */
/* zachowania tej informacji                */
/********************************************/

/*************************/
/* Detekcja przegladarki */
/*************************/
nn4 = (document.layers) ? true:false;
ie4 = (document.all) ? true:false;

/**********************/
/* Pokaz blok 'ident' */
/**********************/
function show(ident) {
	if(nn4) {	
		document.layers[ident].visibility = "show";
	} else if(ie4) {	
		document.all[ident].style.visibility = "visible";
	}
}

/**********************/
/* Ukryj blok 'ident' */
/**********************/
function hide(ident,nest) {
	if(nn4) {	
		document.layers[ident].visibility = "hide";
	} else if(ie4) {
		document.all[ident].style.visibility = "hidden";
	}
}

/****************************************/
/* Przesun blok 'ident' do punktu (x,y) */
/****************************************/
function moveTo(ident,x,y,nest) {
	if(nn4) {
		nest ? document.layers[nest].document.layers[ident].left = x : document.layers[ident].left = x;
		nest ? document.layers[nest].document.layers[ident].top = y : document.layers[ident].top = y;
	} else if(ie4) {
		document.all[ident].style.left = x;
		document.all[ident].style.top = y;
	}
}

/*****************************************/
/* Przesun blok 'ident' o wektor [dx,dy] */
/*****************************************/
function moveBy(ident,dx,dy,nest) {
	if(nn4) {
		nest ? document.layers[nest].document.layers[ident].left += dx : document.layers[ident].left += dx;
		nest ? document.layers[nest].document.layers[ident].top += dy : document.layers[ident].top += dy;
	} else if(ie4) {
		document.all[ident].style.left = document.all[ident].offsetLeft + dx;
		document.all[ident].style.top = document.all[ident].offsetTop + dy;
	}
}

/************************************************/
/* Przytnij blok 'ident' do zadanego prostokata */
/*     t: top, r: right, b: bottom, l:left      */
/************************************************/
function clipTo(ident, t, r, b, l,nest) {
	if(nn4) {
		if(nest) {
			document.layers[nest].document.layers[ident].clip.top = t;
  	 	document.layers[nest].document.layers[ident].clip.right = r;
 			document.layers[nest].document.layers[ident].clip.bottom = b;
	   	document.layers[nest].document.layers[ident].clip.left = l;
		} else {
			document.layers[ident].clip.top = t;
  	 	document.layers[ident].clip.right = r;
 			document.layers[ident].clip.bottom = b;
	   	document.layers[ident].clip.left = l;
		}
	} else if(ie4) {
 		document.all[ident].style.clip = 
		"rect(" + t + " " + r + " " + b + " " + l + ")";
	}
}

/****************************************************/
/* Zmien przyciecie bloku 'ident' o zadane wartosci */
/*     t: top, r: right, b: bottom, l:left          */
/****************************************************/
function clipBy(ident, t, r, b, l,nest) {
	if(nn4) {
		if(nest) {
			document.layers[nest].document.layers[ident].clip.top += t;
			document.layers[nest].document.layers[ident].clip.right += r;
			document.layers[nest].document.layers[ident].clip.bottom += b;
			document.layers[nest].document.layers[ident].clip.left += l;
		} else {
			document.layers[ident].clip.top += t;
			document.layers[ident].clip.right += r;
			document.layers[ident].clip.bottom += b;
			document.layers[ident].clip.left += l;
		}
	} else if(ie4) {
		ie_clip = document.all[ident].style.clip;
		ie_clip = ie_clip.substring(5, ie_clip.length-1);
		ie_clip_wart = ie_clip.split("px");
		t += parseInt(ie_clip_wart [0]);
		r += parseInt(ie_clip_wart [1]);
		b += parseInt(ie_clip_wart [2]);
		l += parseInt(ie_clip_wart [3]);
			
		document.all[ident].style.clip = 
			"rect(" + t + "px " + r + "px " + b + "px " + l + "px)";
	}
}

/***********************************************************/
/* Zapisz pozycje bloku 'ident' do zmiennych l:left, t:top */
/***********************************************************/
function pozycja(ident,nest) {
	if(nn4) {
		l = nest ? document.layers[nest].document.layers[ident].left : document.layers[ident].left;
		t = nest ? document.layers[nest].document.layers[ident].top : document.layers[ident].top;
	} else if(ie4) {
		l = document.all[ident].offsetLeft;
		t = document.all[ident].offsetTop;
	}
}

/******************************************************/
/* Zapisz wysokosc bloku 'ident' do zmienej h: height */
/******************************************************/
function wysokosc(ident,nest) {
	if(nn4) {
		h = nest ? document.layers[nest].document.layers[ident].document.height : document.layers[ident].document.height;
	} else if(ie4) {
		h = document.all[ident].scrollHeight;	
	}
	return h;
}

/****************************************/
/* Sprawdz rozmiary okna                */
/*   oknoW: dostepna szerokosc          */
/*   oknoH: dostepna wysokosc           */
/****************************************/
function okno(){
	if(nn4){
		oknoW=window.innerWidth-16;
		oknoH=window.innerHeight
	}else if(ie4){
		oknoW=document.body.offsetWidth-20;
		oknoH=document.body.offsetHeight
	}
}

/*************************/
/* Przeladuj cala strone */
/*************************/
function reDo() {
	if(nn4) {
		if (innerWidth != oknoW+16 || innerHeight != oknoH) {
			location.reload();
		}
	} else location.reload();
}

/*************************/
/* Zmien zawartosc bloku */
/*************************/
function writeTo(ident, tekst, nest) {
	if(nn4) {
		if(nest) {
			document.layers[nest].document.layers[ident].document.open();
			document.layers[nest].document.layers[ident].document.write(tekst);
			document.layers[nest].document.layers[ident].document.close();
		} else {
			document.layers[ident].document.open();
			document.layers[ident].document.write(tekst);
			document.layers[ident].document.close();		
		}
	} else if(ie4) {
		document.all[ident].innerHTML = tekst;
	}
}


function status_txt(tekst) 
{
      window.status = eval(tekst + '_txt');}

function activate(obrazek) {
      imagesrc = eval(obrazek + '_on.src');
      document[obrazek].src = imagesrc;
      status_txt(obrazek);}

function deactivate(obrazek) {
      imagesrc = eval(obrazek + '_off.src');
      document[obrazek].src = imagesrc;
      window.status = root_txt;
}

function activate2(sors,target) {
      imagesrc = eval(sors + '_on.src');
      document[target].src = imagesrc;
      status_txt(sors);}

function deactivate2(sors,target) {
      imagesrc = eval(sors + '_off.src');
      imagetrg = eval(target);
      document[target].src = imagesrc;
}

function open_new_window(plik){
	alert_txt = 'Dokument: ' + plik + ' przeznaczony jest TYLKO DO ODCZYTU. \nWszelkie prawa zastrzeżone. (C) 2000 VOLVO POLSKA';
	alert(alert_txt);
                    nadysk = 'ftp://ftp.rubikon.pl/kreacja/volvo/buses/oferta/' + plik;
	window.open(plik, 'dane', 'toolbar=0,menubar=0,url=0,scrollbars,resizable');
}

function open_new(plik,x,y){
	strin='toolbar=0,menubar=0,url=0,scrollbars=0,resizable=0,width='+x+',height='+y;
	window.open(plik, 'okno'+x+y, strin);
}

function open_default(plik){
	strin='url,toolbar,menubar,scrollbars,resizable';
	window.open(plik,'OKNO','');
}

function makevisible(cur,which){
if (which==0)
cur.filters.alpha.opacity=100
else
cur.filters.alpha.opacity=10
}

/****************************************/
/* Rollover image                       */
/****************************************/
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/****************************************/
/* Otwórz nowe okno                     */
/****************************************/
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

/****************************************/
/* Pop-up masage                        */
/****************************************/
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}




