﻿trescMenu = '';
iMenu = 0;
gora = 133;

if(window.location.hostname == 'localhost')
{
	host = 'http://localhost';
}
else
{
	host = 'http://www.centrumxp.pl';
}

ie = true;
if(window.navigator.appName.toLowerCase().indexOf('explorer') == -1)
{
    ie = false;
	document.all = document.getElementsByTagName('*');
}
	
otwarteMenu = -1;


function podmiana(zmien, rate) {
            if (zmien == "nowe") {
                if(rate==1){
                    document.images.star_1.src=host+"/Img/kol_fill.gif";
                    document.getElementById("tekst").innerHTML = "Porażka";
                }
                if(rate==2){
                    document.images.star_1.src=host+"/Img/kol_fill.gif";
                    document.images.star_2.src=host+"/Img/kol_fill.gif";
                    document.getElementById("tekst").innerHTML = "Kiepski";
                }
                if(rate==3){
                    document.images.star_1.src=host+"/Img/kol_fill.gif";
                    document.images.star_2.src=host+"/Img/kol_fill.gif";
                    document.images.star_3.src=host+"/Img/kol_fill.gif";
                    document.getElementById("tekst").innerHTML = "Taki sobie";
                }
                if(rate==4){
                    document.images.star_1.src=host+"/Img/kol_fill.gif";
                    document.images.star_2.src=host+"/Img/kol_fill.gif";
                    document.images.star_3.src=host+"/Img/kol_fill.gif";
                    document.images.star_4.src=host+"/Img/kol_fill.gif";
                    document.getElementById("tekst").innerHTML = "Dobry";
                }
                if(rate==5){
                    document.images.star_1.src=host+"/Img/kol_fill.gif";
                    document.images.star_2.src=host+"/Img/kol_fill.gif";
                    document.images.star_3.src=host+"/Img/kol_fill.gif";
                    document.images.star_4.src=host+"/Img/kol_fill.gif";
                    document.images.star_5.src=host+"/Img/kol_fill.gif";
                    document.getElementById("tekst").innerHTML = "Super!";
                }
                
            }
            else if (zmien == "stare") {
                document.images.star_1.src=host+"/Img/kol.gif";
                document.images.star_2.src=host+"/Img/kol.gif";
                document.images.star_3.src=host+"/Img/kol.gif";
                document.images.star_4.src=host+"/Img/kol.gif";
                document.images.star_5.src=host+"/Img/kol.gif";
                document.getElementById("tekst").innerHTML = "Oceń artykuł...";
                
            }
    }

function na(id)
{
	if(otwarteMenu != -1)
	{
		z(otwarteMenu);
	}
	document.all['menu'+id].style.top = gora + 'px';
	document.all['menu'+id].style.display = 'block';
	document.all['MenuReklama'].style.display = 'none';
	document.all['tm'+id].style.color = '#ffffff';	
	document.all['tm'+id].style.backgroundColor = '#669BD7';
	otwarteMenu = id;
	document.all['tm'+id].style.backgroundImage = 'url("/Img/Int/r_c.gif")';
}

function z(id)
{
	document.all['menu'+id].style.display = 'none';
	document.all['MenuReklama'].style.display = 'block';
	document.all['menu'+id].style.top = -1000 + 'px';
	document.all['tm'+id].style.backgroundColor = '';
	document.all['tm'+id].style.color = '';
	document.all['tm'+id].style.backgroundImage = 'url("/Img/Int/r_b.gif")';
}

img1 = new Image();
img1.src = '/Img/Int/l_m1.gif';
img2 = new Image();
img2.src = '/Img/Int/l_m1.gif';
img3 = new Image();
img3.src = '/Img/Int/nic.gif';
img4 = new Image();
img4.src = '/Img/Int/r_c.gif';
img5 = new Image();
img5.src = '/Img/Int/r_b.gif';

function naM(id,p)
{
	if(p == 3)
	{
		p = 2;
	}
	document.all['T'+id].style.backgroundImage  = 'url("'+host+'/Img/Int/l_m'+p+'.gif")';
	window.status = document.all['A'+id].href;
}

function zM(id)
{
	document.all['T'+id].style.backgroundImage  = 'url("'+host+'/Img/Int/nic.gif")';
	window.status = '';
}

czasMenu = 0;
function wylCzas()
{
	clearTimeout(czasMenu);
	czasMenu = 0;
}

function klikM(id)
{
	location.href = document.all['A'+id].href;
}

function NoweMenu()
{
	trescMenu += '<div onmouseout="wlaCzas()" onmouseover="wylCzas()">';
	trescMenu += trescM[iMenu];
    trescMenu += '</div>';
}
iK = 0;
function wylCzas()
{
	clearTimeout(czasMenu);
	czasMenu = 0;
}

function wlaCzas()
{
	czasMenu = setTimeout('wylMenu()',100);
}

function wylMenu()
{
	z(otwarteMenu,1);
}
trescM = new Array();

iMenu++;
trescM[iMenu] = '<table cellSpacing="0" cellPadding="0" class="MMenu" id="menu'+ iMenu +'">'+
'	<tr>'+
'		<td width="298">&nbsp;</td>'+
'		<td valign="top">'+
'		<table class="WMenu" cellspacing="0" cellpadding="2">'+
'			<tr>'+
'				<td width="85" height="60" align="center" valign="top"><a href="http://www.centrumxp.pl/"><img src="'+host+'/Img/Int/Menu/m,home.gif" border="0"><br>Portal CentrumXP.pl</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="http://www.sklep-ms.pl/"><img src="'+host+'/Img/Int/Menu/m,programy.gif" border="0"><br>Sklep on-line</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="http://firma.centrumxp.pl/"><img src="'+host+'/Img/Int/Menu/m,firma.gif" border="0"><br>Komputer<br />w firmie</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="http://xboxspot.pl/"><img src="'+host+'/Img/Int/Menu/m,xbox.gif" border="0"><br>Xbox 360</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="http://forum.centrumxp.pl/"><img src="'+host+'/Img/Int/Menu/m,forum.gif" border="0"><br>Forum</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="http://live.centrumxp.pl/"><img src="'+host+'/Img/Int/Menu/m,windows.gif" border="0"><br>CentrumXP.pl Live Blog</a></td>'+

'			</tr>'+
'		</table>'+
'		</td>'+
'	</tr>'+
'</table>';
NoweMenu();

iMenu++;
trescM[iMenu] = '<table cellSpacing="0" cellPadding="0" class="MMenu" id="menu'+ iMenu +'">'+
'	<tr>'+
'		<td width="412" align="right"><table class="WMenu" cellpadding="2" cellPadding="0" style="position:relative; top: -5px; text-align: right">'+
'		<tr><td align="right"><b>Starsze wersje:</b></td><td rowspan="6" width="10"></td></tr>'+
'		<tr><td align="right"><a href="'+host+'/WindowsXP">Windows XP<img hspace="5" align="absmiddle" src="'+host+'/Img/Int/Menu/n,windows.gif" width="16" height="16" border="0"></a></td></tr>'+
'		<tr><td align="right"><a href="'+host+'/Office2003">Office 2003<img hspace="5" align="absmiddle" src="'+host+'/Img/Int/Menu/n,office.gif" width="16" height="16" border="0"></a></td>'+
'		<tr><td height="1"> </td></tr>'+
'		<tr><td align="right"></td></tr>'+
'		<tr><td align="right"><a href="'+host+'/Microsoft/315,1,kategoria,Aplikacje.aspx"><b>Inne aplikacje</b></a></td></tr>'+
'		</table></td>'+
'		<td valign="top">'+
'		<table class="WMenu" cellspacing="2" cellpadding="0" >'+
'			<tr>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/WindowsVista/"><img src="'+host+'/Img/Int/Menu/m,windows.gif" border="0"><br>Windows Vista</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/Office2007/"><img src="'+host+'/Img/Int/Menu/m,office.gif" border="0"><br>Office 2007</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/Windows7/"><img src="'+host+'/Img/Int/Menu/m,win7.png" border="0"><br>Windows 7</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/SkrzynkaPytan/"><img src="'+host+'/Img/Int/Menu/m,box.gif" border="0"><br>Skrzynka Pytań</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/dotNET/"><img src="'+host+'/Img/Int/Menu/m,dotnet.gif" border="0"><br>Microsoft .NET</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/WindowsMobile/"><img src="'+host+'/Img/Int/Menu/m,windowsmobile.gif" border="0"><br>Windows Mobile</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/Sprzet/"><img src="'+host+'/Img/Int/Menu/m,sprzet.gif" border="0"><br>Sprz&#281t</a></td>'+
'			</tr>'+
'		</table>'+
'		</td>'+
'	</tr>'+
'</table>';
NoweMenu();

iMenu++;
trescM[iMenu] = '<table cellSpacing="0" cellPadding="0" class="MMenu" id="menu'+ iMenu +'">'+
'	<tr>'+
'		<td width="502">&nbsp;</td>'+
'		<td valign="top">'+
'		<table class="WMenu" cellspacing="0" cellpadding="2" >'+
'			<tr>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/Programy/"><img src="'+host+'/Img/Int/Menu/m,programy.gif" border="0"><br>Programy</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/Uaktualnienia/"><img src="'+host+'/Img/Int/Menu/m,uaktualnienia.gif" border="0"><br>Uaktualnienia</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/Skiny/"><img src="'+host+'/Img/Int/Menu/m,skiny.gif" border="0"><br>Skiny</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/Sterowniki/"><img src="'+host+'/Img/Int/Menu/m,sterowniki.gif" border="0"><br>Sterowniki</a></td>'+
'			</tr>'+
'		</table>'+
'		</td>'+
'	</tr>'+
'</table>';
NoweMenu();

   
iMenu++;
trescM[iMenu] = '<table cellSpacing="0" cellPadding="0" class="MMenu" id="menu'+ iMenu +'">'+
'	<tr>'+
'		<td width="604">&nbsp;</td>'+
'		<td valign="top">'+
'		<table class="WMenu" cellspacing="0" cellpadding="2" >'+
'			<tr>'+
'				<td width="85" height="60" align="center" valign="top"><a href="http://forum.centrumxp.pl/"><img src="'+host+'/Img/Int/Menu/m,forum.gif" border="0"><br>Forum</a></td>'+
'			</tr>'+
'		</table>'+
'		</td>'+
'	</tr>'+
'</table>';
NoweMenu();

iMenu++;
trescM[iMenu] = '<table cellSpacing="0" cellPadding="0" class="MMenu" id="menu'+ iMenu +'">'+
'	<tr>'+
'		<td width="270">&nbsp;</td>'+
'		<td valign="top">'+
'		<table class="WMenu" cellspacing="0" cellpadding="2">'+
'			<tr>'+
'				<td width="85" height="60" align="center" valign="top"><a href="http://www.centrumxp.pl/Microsoft/1162,1,Test_Virtual_PC_2007.aspx"><img src="'+host+'/Img/Int/Menu/m,vpc.gif" border="0"><br>Microsoft Virtual PC</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="http://www.centrumxp.pl/Microsoft/1145,1,Test_Windows_Defender.aspx"><img src="'+host+'/Img/Int/Menu/m,def.gif" border="0"><br>Windows Defender</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="http://www.centrumxp.pl/Microsoft/1200,1,Srebrne_światełko_czy_też_może.aspx"><img src="'+host+'/Img/Int/Menu/m,sl.gif" border="0"><br>Microsoft Silverlight</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/Microsoft/494,1,kategoria,Microsoft_SysInternals.aspx"><img src="'+host+'/Img/Int/Menu/m,si.gif" border="0"><br>Microsoft SysInternals</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/InternetExplorer/"><img src="'+host+'/Img/Int/Menu/m,ie.gif" border="0"><br>Internet Explorer</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/WindowsMediaPlayer/"><img src="'+host+'/Img/Int/Menu/m,wmp.gif" border="0"><br>Windows Media Player</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/DirectX/"><img src="'+host+'/Img/Int/Menu/m,dx.gif" border="0"><br>Microsoft DirectX</a></td>'+
'			</tr>'+
'		</table>'+
'		</td>'+
'	</tr>'+
'</table>';
NoweMenu();

iMenu++;
trescM[iMenu] = ''+
'<table border="0" cellPadding="0" class="MMenu" id="menu'+ iMenu +'">'+
'	<tr>'+
'		<td width="360">&nbsp;</td>'+
'		<td valign="top">'+
'		<table class="WMenu" cellspacing="0" cellpadding="2">'+
'			<tr>'+
//'				<td width="85" height="60" align="center" valign="top"><a href="http://receptanasukces.com.pl"><img src="'+host+'/Img/Int/Menu/m,gry.gif" border="0"><br>Konkurs ReceptaNaSukces</a></td>'+    /*Wykomentowane w ramach poprawki. Grzesiek*/
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/WindowsLive/"><img src="'+host+'/Img/Int/Menu/m,live.gif" border="0"><br>Windows Live</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/Aktualnosci/"><img src="'+host+'/Img/Int/Menu/m,aktualnosci.gif" border="0"><br>Aktualności CentrumXP.pl</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/ImagineCup/"><img src="'+host+'/Img/Int/Menu/m,ic.gif" border="0"><br>Konkurs Imagine Cup</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/Slownik/"><img src="'+host+'/Img/Int/Menu/m,slownik.gif" border="0"><br>Słownik komputerowy</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/ASPX/Profil/Profil.aspx"><img src="'+host+'/Img/Int/Menu/m,profil.gif" border="0"><br>Profil na CentrumXP.pl</a></td>'+
'				<td width="85" height="60" align="center" valign="top"><a href="'+host+'/Home/515,1,Serwisy_specjalne_oraz_dodatki.aspx"><img src="'+host+'/Img/Int/Menu/m,serwisy.gif" border="0"><br>Serwisy specjalne</a></td>'+
'			</tr>'+
'		</table>'+
'		</td>'+
'	</tr>'+
'</table>';
NoweMenu();

otwarte = false;
function cwiczenie()
{
	if(otwarte)
	{
		cwiczenieZ.style.display = 'none';
		cwiczenieA.innerHTML = '<a href="javascript:cwiczenie()"><b>Pokaż rozwiązanie</b></a>';
	}
	else
	{
		cwiczenieZ.style.display = 'block';
		cwiczenieA.innerHTML = '<a href="javascript:cwiczenie()"><b>Ukryj rozwiązanie</b></a>';
	}
	otwarte = !otwarte;
}

function bold(id)
{
    document.all["T"+id].style.fontWeight = 'bold';
}

function Ulubione()
{
    window.external.addFavorite(this.location.href, this.document.title);
}

function Drukuj()
{
    url = location.href
    url = url.substring(url.lastIndexOf('/')+1);
    url = url.substring(0, url.indexOf(','));
    window.open('/Druk/'+url+'.aspx');
}

function DrukujAktualnosc()
{
    url = location.href
    url = url.substring(url.lastIndexOf('/')+1);
    url = url.substring(0, url.indexOf(','));
    window.open('/DrukAktualnosc/'+url+'.aspx');
}

function Link()
{
    wiadomosc  = "Hej!";
    wiadomosc += String.fromCharCode(13);
    wiadomosc += "Znalazlem strone, ktora moze Cie zainteresowac:";
    wiadomosc += String.fromCharCode(13)+String.fromCharCode(13);
    wiadomosc += document.title;
    wiadomosc += String.fromCharCode(13);
    wiadomosc += location.href;
    wiadomosc += String.fromCharCode(13)+String.fromCharCode(13);
    window.open('mailto:?subject=Link do portalu CentrumXP.pl&body='+escape(wiadomosc));
}

function initMenu()
{
	document.write(trescMenu);
}

kolory = new Array();
kolory[0] = '#D6E3EF';
kolory[1] = '#DBE7F0';
kolory[2] = '#E1EAF3';
kolory[3] = '#E7EEF5';
kolory[4] = '#EDF2F8';
kolory[5] = '#F3F7FA';
kolory[6] = '#F9FBFD';
kolory[7] = '#FFFFFF';

start = new Array();
czas = new Array();
inte = 50;

function tn_zmien(kierunek, id, czasL)
{
	if(start[id] == undefined)
	{
		start[id] = 0;
	}
	if(czasL == czas[id])
	{
		start[id] += kierunek;
		document.all['TN'+id].style.backgroundColor = kolory[start[id]];
		if(start[id] >= 0 && start[id] <= 7)
		{
			setTimeout('tn_zmien(' + kierunek + ', ' + id + ', ' + czasL + ')', inte);
		}
	}
}

function tn_na(id)
{
	if(czas[id] == undefined)
	{
		czas[id] = 0;
	}
	czas[id]++;
	tn_zmien(1, id, czas[id]);
	document.all['TN'+id].style.borderColor = '#B1BBC5';
}

function tn_z(id)
{
	if(czas[id] == undefined)
	{
		czas[id] = 0;
	}
	czas[id]++;
	tn_zmien(-1, id, czas[id]);
	document.all['TN'+id].style.borderColor = '#D6E3EF';
}

function sh_na(id)
{
    var i=1;
	for (i=1;i<=5;i++)
	{
		document.all['Div' + i].style.display="none";
	}
    
    document.all['Div' + id].style.display="block";
}


