function makeBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns6=(this.dom && !document.all)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5 && !this.ver.indexOf("Netscape6")) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
    	this.opera = (navigator.userAgent.indexOf("Opera") != -1);
	if (this.ie6) this.ie5=true;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5 || this.ns6 || this.opera)
	
	if (this.ie4) speed = 2;
	return this
}
bw=new makeBrowser()

function getLayerStyleRef (layername){
	if (bw.ns4)				
		return (document.layers[layername]);
	if (bw.ie5 || bw.ns6)
		if (document.getElementById(layername)) return (document.getElementById(layername).style);
	if (bw.ie4)				
		if (document.all[layername]) return (document.all[layername].style);
	return null;
}

function menuOver (x){
	if (!bw.ns4) {
		var id = getLayerStyleRef('ta'+x);
		var id2 = getLayerStyleRef('td'+x);		
		id.backgroundColor="#DEEBF7";
		id2.backgroundColor="#DEEBF7";		
	}
}	

function menuOut (x) {
	if (!bw.ns4) {
		var id = getLayerStyleRef('ta'+x);
		var id2 = getLayerStyleRef('td'+x);		
		id.backgroundColor="#ffffff";
		id2.backgroundColor="#ffffff";		
	}
}

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.0
  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 && document.getElementById) x=document.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];}
}

// wyskakujące okienka z flashami
function open_ph(zielurl) {
	ph_maker = window.open(zielurl,'ph','status=no,menubar=no,scrollbars=no,resizeable=no,width=720,height=350');
}

function open_f(w,h,zielurl) {
	ph_maker = window.open(zielurl,'ph','status=no,menubar=no,scrollbars=no,resizeable=no,width=' + w + ',height=' + h);
}


// porównanie dwóch produktów w wyskakującym oknie
function comparing(idproduktu,loc) {
	if(!window.comp || window.comp.closed || !window.comp.open){
		comp = window.open('porownanie.html','compare','status=yes,menubar=no,scrollbars=yes,resizable=yes,width=800,height=450');
	}
	furl = param_header_root + "pl/produkty/porownanie.asp?idproduktu=" + idproduktu;

	if (loc == 'left'){
		setTimeout("comp.compare_left.location.href = '" + furl + "'",1000);
	}
	if (loc == 'right'){
		setTimeout("comp.compare_right.location.href = '" + furl + "'",1000);
	}
	
	comp.focus();
}

// słownik terminów
function slownik(key) {
	glossarmaker = window.open(param_header_root + "pl/produkty/slownik.asp?key=" + key,'glossar_pdb','status=no,menubar=no,scrollbars=yes,resizable=yes,width=300,height=370');
}


function OpenView(theURL,winName,features, myWidth, myHeight, isCenter) {
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

// bukwa

// funkcja podświetlająca elementy głównego menu

function colorIt_menu(el,action){
	if (!document.getElementById) return; 

	if (action)
		el.style.background = "#1B528C";
	else	
		el.style.background = "#153B63";
}

function colorIt_menu_prawe(el,action){
	if (!document.getElementById) return; 

	if (action)
		el.style.background = "#a0b7cf";
	else	
		el.style.background = "#ffffff";
}

/*kursor nad #A0B7CF, bieżąca strona #8CA8C5, nagłówek #153B63, bez zaznaczenia #B4C6D9*/
function colorIt_menu_prawe_1(el,action){
	if (!document.getElementById) return; 

	if (action)
		el.style.background = "#A0B7CF";
	else	
		el.style.background = "#B4C6D9";
}

function okienko (o,tytul,w_o,h_o,w_p,h_p) { //o - obraz, tytuł w okienku, w_o/h_o - szerokość/wysokość okna, w_p/h_p - szerokość/wysokość obrazka
	left1 = "100";
	top1 = "200";
	scrollbars1 = 0;
	w_o += 16;
	h_o += 104;
		//onclick='window.close()' title='Kliknij aby zamknąć'
	windowprops = "toolbar=0,location=0,status=0,menubar=0,scrollbars="+scrollbars1+",resizable=0,left="+left1+",top="+top1+",width="+w_o+",height="+h_o+",scrolling=auto";
	text = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-2'><link rel='stylesheet' href='scripts/standard_first_page.css' type='text/css' /><title>Powiększenie</title></head><body style='background: #ffffff; margin:0; text-align:center')><div align='center'><table cellspacing='0' cellpadding='0' border='0' width='100%'><tr><td class='naglowek_okienka'>"+tytul+"</td><td align='right'><img src='grafika/logo_male.gif' width='122' height='40' border='0' alt='' title=''/></td></tr></table><img border='0' src='"+o+"' width="+w_p+" height="+h_p+"></div></body></html>";
	
	
	preview = window.open('', 'preview', windowprops);
	
	if (scrollbars1) {
		preview.resizeTo((w_o+28),(h_o));
	}
	else {
		preview.resizeTo(w_o,h_o);
	}
	
	preview.document.open();
	preview.document.write(text);
	preview.document.close();
	preview.focus();
}

function otworzKatalog() {
   var ExtraNetWindow;
   var myURL = "http://ecat-online.bosch.de/toc/enter?DEFAULT=30&COUNTRY=PL&LANGUAGE=PL";
   var windowWidth= screen.availWidth-10;
   var windowHeight = screen.availHeight-50;
   window.open(myURL,"ExtraNetWindow","toolbar=0,locationbar=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,hotkeys=no,left=0,top=0,width="+windowWidth+",height="+windowHeight);
}

