  var subpromo = 0;
  function checkTransparentFlash()
  {
  	var userAgent = navigator.userAgent.toLowerCase();
	isWindows  = ((userAgent.indexOf('win') != -1) && ( userAgent.indexOf('95') != -1 || userAgent.indexOf('98') != -1 || userAgent.indexOf('nt') != -1 || userAgent.indexOf('win32') != -1 || userAgent.indexOf('32bit') != -1 || userAgent.indexOf('xp') != -1) );
	isIE          = (userAgent.indexOf('msie') != -1 && (userAgent.indexOf('opera') == -1)); 
	isMozilla     = ((userAgent.indexOf('gecko') != -1) && userAgent.indexOf('gecko/') + 14 == userAgent.length);
	this.versionMinor = parseFloat(navigator.appVersion); 
	if(isMozilla)
		versionMinor = parseFloat( userAgent.substring( userAgent.indexOf('rv:') + 3 ) );
	else if (isIE && versionMinor >= 4)
      	versionMinor = parseFloat( userAgent.substring( userAgent.indexOf('msie ') + 5 ) );
    versionMajor = parseInt(versionMinor); 
	isIE5up = isIE && (versionMajor == 5 || versionMajor == 6);
	isMozilla14up = isMozilla && (versionMinor >= 1.4);
    return (isWindows) && (isIE5up || isMozilla14up);
  }
  
   
  with (navigator) if (appName.indexOf('Microsoft')!=-1 && appVersion.indexOf('Mac')==-1)
	{
		document.write('<scr'+'ipt language="VBScript">\nMM_flash = NOT IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash"))\n</scr'+'ipt>');
	}

  function MM_checkPlugin(plgIn)
  {
  		var result = false;
 		if (navigator.appName.indexOf('Microsoft')==-1 || (navigator.plugins && navigator.plugins.length))
  		{
  			result = navigator.plugins[plgIn] != null ? true : false;
  		}
  		else
  		{
  			if (navigator.appName.indexOf('Microsoft')!=-1 && navigator.appVersion.indexOf('Mac')==-1)
			{
				result = MM_flash;
			}
  		}
  		result = result == true ? true : false;
  		return result;  		
	}
    
    var jestFlaszyk = MM_checkPlugin("Shockwave Flash");
    
	function showTopFlash(file)
	{
		if(jestFlaszyk)
		{
			document.write(''+
			'<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+
			'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"'+
			'WIDTH="746" HEIGHT="113" id="flash_home" ALIGN="">'+
			'<PARAM NAME=movie VALUE="'+file+'"> <param name="wmode" value="transparent"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="'+file+'" quality=high bgcolor=#FFFFFF  WIDTH="746" HEIGHT="113" NAME="flash_home" ALIGN=""'+
  			'TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" swLiveConnect=true wmode="transparent"></EMBED>'+
  			'</OBJECT>');
		}
		else
		{
			file = file.substring(0, file.length-3)+'jpg';
			document.write(''+
			'<map name=mapTop>'+
			'<area shape="rect" coords="43,11,116,92" href="index.php">'+
			'</map>'+
			'<img src="'+file+'" usemap="#mapTop" border=0>');
		}
	}
	
	function showInternetMenu(file)
	{
		if (jestFlaszyk)
		{
			document.write(''+
			'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="187" height="170">'+
			'<param name="movie" value="'+file+'">'+
			'<param name="quality" value="high">'+
			'<param name="wmode" value="transparent">'+
			'<embed src="'+file+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" type="application/x-shockwave-flash" width="187" height="170"></embed></object>'
			);
		}
		else
		{
			file = file.substring(0, file.length-3)+'jpg';
			document.write(''+
			'<map name="Map">'+
			'<area shape="rect" coords="10,21,181,53" href="index.php?section=internet&id=2">'+
			'<area shape="rect" coords="10,58,181,88" href="index.php?section=internet&id=3">'+
			'<area shape="rect" coords="10,92,181,124" href="index.php?section=internet&id=4">'+
			'<area shape="rect" coords="10,127,181,157" href="index.php?section=internet&id=5">'+
			'</map>'+
			'<img src="'+file+'" usemap="#Map" border="0">');
		}
	}
	
	function printHPBanner(file, href)
	{
		if (jestFlaszyk)
		{
			document.write(''+
			'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="273" height="66">'+
			'<param name="movie" value="'+file+'">'+
			'<param name="quality" value="high">'+
			'<embed src="'+file+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="273" height="66"></embed></object>');
		}
		else
		{
			file = file.substring(0, file.length-3)+'gif';
			document.write('<a href="'+href+'"><img src="'+file+'" border="0"></a>');
		}
	}

	function printSubBanner(file, href)
	{
		if (jestFlaszyk)
		{
			document.write(''+
			'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="152" height="65">'+
			'<param name="movie" value="'+file+'">'+
			'<param name="quality" value="high">'+
			'<embed src="'+file+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="152" height="65"></embed></object>');
		}
		else
		{
			file = file.substring(0, file.length-3)+'jpg';
			document.write('<a href="'+href+'" style="margin:0px"><img src="'+file+'" border="0" style="display:inline"></a>');
		}
	}
	
	function printMap(file)
	{
  	if (jestFlaszyk)
		{
			document.write(''+
			'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="300" height="230">'+
			'<param name="movie" value="'+file+'">'+
			'<param name="quality" value="high">'+
			'<embed src="'+file+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="230"></embed></object>'
			);
		}
		else		
		{		
		  file = file.substring(0, file.length-3)+'gif';
			document.write('<img src="'+file+'" border="0" usemap="#MapkaMap">');			
			document.write('<map name="MapkaMap" id="MapkaMap">'+
      '<area shape="poly" coords="90,24,98,55,89,62,94,66,78,75,74,72,42,89,35,82,41,70,40,42" href="javascript:showMiasta(1)" alt="zachodnio-pomorskie">'+
      '<area shape="poly" coords="97,57,109,58,124,51,145,58,156,49,150,38,159,29,123,14,91,25" href="javascript:showMiasta(2)" alt="pomorskie">'+
      '<area shape="poly" coords="147,58,161,65,164,72,177,69,211,60,226,50,221,34,229,28,159,28,152,38,156,47" href="javascript:showMiasta(3)" alt="warminsko-mazurskie">'+
      '<area shape="poly" coords="231,28,246,38,250,61,258,72,259,88,248,95,246,103,226,97,222,85,204,65,226,51,220,35" href="javascript:showMiasta(4)" alt="podlaskie">'+
      '<area shape="poly" coords="42,90,74,72,76,84,72,90,74,112,86,120,76,122,59,131,49,135,42,122" href="javascript:showMiasta(5)" alt="lubuskie">'+
      '<area shape="poly" coords="75,76,92,67,92,62,98,57,107,59,112,88,146,102,124,142,117,142,108,126,99,130,84,120,73,111" href="javascript:showMiasta(6)" alt="wielkopolskie">'+
      '<area shape="poly" coords="159,64,163,72,148,104,112,89,109,59,123,52" href="javascript:showMiasta(7)" alt="kujawsko-pomorskie">'+
      '<area shape="poly" coords="163,73,204,64,221,85,225,97,239,101,235,109,212,114,208,124,211,147,181,139,178,125,185,123,174,115,168,103,163,105,151,101" href="javascript:showMiasta(8)" alt="mazowieckie">'+
      '<area shape="poly" coords="211,156,210,126,211,114,236,109,239,102,253,109,253,127,255,136,267,153,267,167,258,173,252,168,240,171,228,169,233,163" href="javascript:showMiasta(9)" alt="lubelskie">'+
      '<area shape="poly" coords="127,142,143,104,150,101,168,105,182,124,177,128,179,139,166,144,164,152,149,147" href="javascript:showMiasta(11)" alt="łódzkie">'+
      '<area shape="poly" coords="168,144,165,152,164,162,174,167,181,176,205,165,212,157,209,148,180,140" href="javascript:showMiasta(13)" alt="świętokrzyskie">'+
      '<area shape="poly" coords="50,136,46,150,54,150,56,157,80,162,76,167,87,181,96,176,96,166,116,143,108,126,99,131,85,119" href="javascript:showMiasta(10)" alt="dolnośląskie">'+
      '<area shape="poly" coords="97,166,115,143,129,142,132,148,137,167,129,176,124,177,124,185,121,189,111,182,112,177,104,177" href="javascript:showMiasta(12)" alt="opolskie">'+
      '<area shape="poly" coords="128,142,163,152,162,162,168,165,162,171,154,175,148,183,157,199,146,207,125,187,124,178,130,176,137,166" href="javascript:showMiasta(15)" alt="śląskie">'+
      '<area shape="poly" coords="213,158,232,164,227,170,240,172,250,168,256,173,233,201,241,217,215,213,216,209,202,204,196,169" href="javascript:showMiasta(14)" alt="podkarpackie">'+
      '<area shape="poly" coords="157,201,149,181,169,164,181,176,195,170,201,204,190,208,177,206,171,213,163,212" href="javascript:showMiasta(16)" alt="małopolskie">'+
      '</map>');
		}	
	}

function printContent()
	{
	  iWidth = window.screen.width;
	  iHeight = window.screen.height;
      wt = 425;
      ht = 460;
      lt = (iWidth - wt) / 2;
      tp = (iHeight - ht) / 2;
      window.open('print.php', '', 'height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,resizable=no,scrollbars=yes');
	}
	
	function changeHeight()
	{
	var sp1 = document.getElementById('sp1');
	var sp0 = document.getElementById('sp0');
	var gg=sp0.offsetHeight-28;
	if (sp1.offsetHeight<gg)
	{
		sp1.style.height=gg+"px";
		sp1.height=gg+"px";
	}
	}


function cennikDodanej(id)
{
  iWidth = window.screen.width;
  iHeight = window.screen.height;
  wt = 425;
  ht = 460;
  lt = (iWidth - wt) / 2;
  tp = (iHeight - ht) / 2;
  window.open('cennik_dodanej.php?id='+id, '', 'height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,resizable=no,scrollbars=yes');
}

function setPathHeight()
{
	var obj = null;
    if (document.getElementById)
       obj = document.getElementById("path");  
    else if (document.all)
      obj = document.all("path");
      
	if (obj!=null)
	{
		//alert(obj.offsetHeight);
		if (obj.offsetHeight>23)
		{
			obj.height = "23";
			obj.style.height="23";
			//alert(obj.offsetHeight);
		}
		
	}
}	
	
//otworz popup z kalkulatorem
function popupKalkulator() {
  iWidth = window.screen.width;
  iHeight = window.screen.height;
  wt = 760;
  ht = 490;
  lt = (iWidth - wt) / 2;
  tp = (iHeight - ht) / 2;
  window.open('kalkulator/kalkulator.php', '', 'height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,resizable=no,scrollbars=yes');
}

//otworz popup z kreatorem
function popupKreator() {
  iWidth = screen.width;
  iHeight = screen.height;
  wt = 760;
  ht = 500;
  lt = (iWidth - wt) / 2;
  tp = (iHeight - ht) / 2;
  window.open('kreator/kreator.php', '', 'height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,resizable=no,scrollbars=yes');
}


function showRegulamin()
{
    url = "index.php?section=obsluga_klienta&id=7";
    location=url;
}

//otworz popup do sprawdzania strefy
function popupStrefa(typ) {
  if(typ==null)
  	typ = 0;
  iWidth = screen.width;
  iHeight = screen.height;
  wt = 320;
  ht = 165;
  lt = (iWidth - wt) / 2;
  tp = (iHeight - ht) / 2;
  window.open('strefa.php?typ='+typ+'&plan_id='+plan_id_, '', 'height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,resizable=no,scrollbars=yes');
}

//otworz popup z krajami strefy
function popupStrefaKraje(id, wt, ht, typ) {
  if(typ==null)
  	typ = 0;
  iWidth = screen.width;
  iHeight = screen.height;
  //wt = 300;
  //ht = 250;
  lt = (iWidth - wt) / 2;
  tp = (iHeight - ht) / 2;
  window.open('strefa_kraje.php?id=' + id + '&typ='+typ, '', 'height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,resizable=no,scrollbars=yes');
}

function karteczka() {
	var kartTd = document.getElementById("karteczkaTd");
	var kartDiv = document.getElementById("karteczkaDiv");
	if (kartTd!=null && kartDiv!=null) {
		kartDiv.style.top = kartTd.offsetHeight+101+"px";
	}
}

function preview(file, desc, width, height)
{
 if (desc == null) {
   desc = '';
 }
 var left = (screen.width - width) / 2;
 var top = (screen.height - height + 20) / 2;
 window.open("imgpreview.php?file="+file+"&desc="+desc, "_preview_", "width="+width+",height="+height+",top="+top+",left="+left);
}


function printKarteczka(file, href)
	{
		if (jestFlaszyk)
		{
			document.write(''+
			'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="143" height="101">'+
			'<param name="movie" value="'+file+'">'+
			'<param name="quality" value="high">'+
			'<embed src="'+file+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="143" height="101"></embed></object>');
		}
		else
		{
			file = file.substring(0, file.length-3)+'gif';
			document.write('<a href="'+href+'"><img src="'+file+'" border="0"></a>');
		}
		
		/*if (sub==1) {
			var kartTd = document.getElementById("sp0");
			var kartDiv = document.getElementById("karteczkaDiv");
			if (kartTd!=null && kartDiv!=null) {
				//kartDiv.style.top = kartTd.offsetHeight+137+"px";
				kartTd.style.height=kartTd.style.height +101 + 'px';
			}
		}*/
	}
	
function popupLocal() {
	iWidth = screen.width;
	iHeight = screen.height;
  	wt = 600;
	ht = 486; //466;
	lt = (iWidth - wt) / 2;
	tp = (iHeight - ht) / 2;
	window.open('lokalne.php','', 'height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,resizable=no,scrollbars=no');
}

function printPromoBanner(file, href,sub)
	{
		subpromo  = sub;
		if (jestFlaszyk)
		{
			document.write(''+
			'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="321" height="112">'+
			'<param name="movie" value="'+file+'">'+
			'<param name="quality" value="high">'+
			'<embed src="'+file+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="321" height="112"></embed></object>');
		}
		else
		{
			file = file.substring(0, file.length-3)+'gif';
			//document.write('<a href="'+href+'" style="margin:0px"><img src="'+file+'" border="0" style="display:inline"></a>');
		}
		
			var promo = document.getElementById("promo");
			//iWidth = screen.width;
			if(isIE) {
				iWidth =document.body.clientWidth;
			} else {
				iWidth =document.documentElement.clientWidth;
			}
			promo.style.top = 65+'px';
			promo.style.width = 321+'px';
			promo.style.height = 112+'px';
			var userAgent = navigator.userAgent.toLowerCase();
			var isOpera = userAgent.indexOf('opera');
			if(isIE) {
				if(sub==1) {
					if(isOpera!=-1) {
						var lt = (iWidth - 745) / 2 + 744-321;
					} else {
						var lt = (iWidth - 745) / 2 + 761-321;
					}
				} else {
					if(isOpera!=-1) {
						var lt = (iWidth - 745) / 2 + 730-321;
					} else {
						var lt = (iWidth - 745) / 2 + 745-321;
					}
				}
			} else {
				if(sub==1) {
					var lt = (iWidth - 745) / 2 + 751-321;
				} else {
					var lt = (iWidth - 745) / 2 + 744-321;
				}
			}
			
			if(isOpera!=-1) {
				if (sub==1) {
					var lt = (iWidth - 745) / 2 + 753-321;
				} else {
					var lt = (iWidth - 745) / 2 + 745-321;
				}
			}
			
			promo.style.left = lt+'px';			
			if((isOpera!=-1) && (sub==1)) {
					promo.style.top = 73+'px';
			}
	}
	
	function resize() {
		sub = subpromo;
		var userAgent = navigator.userAgent.toLowerCase();
		isIE  = (userAgent.indexOf('msie') != -1 && (userAgent.indexOf('opera') == -1)); 
		var promo = document.getElementById("promo");
		if(isIE!=-1) {
			iWidth =document.body.clientWidth;
		} else {
			iWidth =document.documentElement.clientWidth;
		}
		
			var isOpera = userAgent.indexOf('opera');
			if(isIE) {
				if(sub==1) {
					if(isOpera!=-1) {
						var lt = (iWidth - 745) / 2 + 744-321;
					} else {
						var lt = (iWidth - 745) / 2 + 761-321;
					}
				} else {
					if(isOpera!=-1) {
						var lt = (iWidth - 745) / 2 + 730-321;
					} else {
						var lt = (iWidth - 745) / 2 + 745-321;
					}
				}
			} else {
				if(sub==1) {
					var lt = (iWidth - 745) / 2 + 761-321;
				} else {
					var lt = (iWidth - 745) / 2 + 744-321;
				}
			}
			
			if(isOpera!=-1) {
				if (sub==1) {
					var lt = (iWidth - 745) / 2 + 761-321;
				} else {
					var lt = (iWidth - 745) / 2 + 745-321;
				}
			}
			
			promo.style.left = lt+'px';			
			if((isOpera!=-1) && (sub==1)) {
					promo.style.top = 73+'px';
			}
	}
	
