<!--

//*****************************
// Copyright HumanMedia 2011
// July 2011
// http://www.HumanMedia.pl
//*****************************

// Global variables
var PageURI;
var MenuID;
var SectionNO;

var MENUITEM = 0;
var MENUSEP = 1;

var MAINMENU_MAIN = 1;
var MAINMENU_PRODUCTS= 2;
var MAINMENU_SUPPORT = 3;
var MAINMENU_SHOP = 4;

var PCH_NEWS = 0;
var PCH_AWARDS = 1;
var PCH_PRESS = 2
var PCH_ABOUT = 3;
var PCH_PARTNERS = 4;

var PCH_MAIN = 0;
var PCH_C300 = 2;
var PCH_A300 = 3;
var PCH_C200 = 4;
var PCH_A210 = 5;
var PCH_A200 = 6;
var PCH_V8 = 7;

var PCH_A210CH = 9;
var PCH_HBR200 = 10;
var PCH_BDR200 = 11;
var PCH_WN150 = 12;
var PCH_MN200 = 13;
var PCH_IRK200 = 14;

var PCH_S210 = 16;

var SUPP_DOCS = 0;
var SUPP_FIRMWARE = 1;
var SUPP_LINKS = 2;
var SUPP_MYIHOME = 3;
var SUPP_DIGSIGN = 4;

var menuSet =
[
	['Start','index.html', 55, '',
	        [
			[MENUITEM, 'Aktualności', 'index.html' ,'images/homebanner_c300.jpg'],
          		[MENUITEM, 'Recenzje', 'popcornhour_awards.html', 'images/homebanner_PopboxV8.jpg'],
          		[MENUITEM, 'Informacje prasowe', 'popcornhour_press.html', 'images/homebanner_a300.jpg'],
			[MENUITEM, 'O producencie', 'popcornhour_about.html', 'images/homebanner_s210.jpg'],
			[MENUITEM, 'Partnerzy', 'popcornhour_partners.html', 'images/homebanner_c300.jpg']
              	]
	],
        ['Produkty','popcornhour.html', 90, '',
       	        [
                        [MENUITEM, 'Informacje ogólne', 'popcornhour.html','images/banner_nmj.jpg',''],
                	[MENUSEP,  'Odtwarzacze sieciowe', '', ''],
                        [MENUITEM, 'Popcorn Hour C-300', 'popcornhour_C300.html','images/banner_c300.jpg', 'Najbardziej zaawansowany odtwarzaczy multimedialny<BR>dostępny na rynku. Oferuje wiele konfiguracji sprzętowych,<BR>niezrównaną jakość odtwarzania wszelkich materiałów<BR>audio i wideo oraz pełną obsługę płyt BD. Zaawansowane<BR>oprogramowanie obejmuje m.in market aplikacji i nową<BR>wersję NMJ JukeBox-a.'],
                        [MENUITEM, 'Popcorn Hour A-300', 'popcornhour_A300.html','images/banner_a300.jpg', 'Popcorn Hour A300 to zaawansowany odtwarzacz multimedialny<BR>zbudowany w oparciu o najnowszy, bardzo szybki procesor<BR>SIGMA SMP8647 800MHz.<BR>Zapewnia wydajną pracę w sieci 1Gbit i obsługę plików wideo<BR>z bitrate do 100Mbps. Nowa, wielojęzyczna aplikacja <I>Media<BR>Jukebox v2</I> automatycznie buduje, kataloguje i opisuje zbiory<BR>plików multimedialnych użytkownika, zapewniając komfort<BR>obsługi niespotykany w urządzeniach konkurencji.'],
                        [MENUITEM, 'Popcorn Hour C-200', 'popcornhour_C200.html','images/banner_c200.jpg', 'Jeden z najbardziej zaawansowanych odtwarzaczy<BR> multimedialnych na rynku. Jest najlepiej wyposażonym i<BR> najbardziej wszechstronnym modelem rodziny sieciowych<BR>odtwarzaczy Popcorn Hour.'],
			[MENUITEM, 'Popcorn Hour A-210', 'popcornhour_A210.html','images/banner_a210.jpg', 'Popcorn Hour A210 to zaawansowany odtwarzacz<BR>multimedialny zapewniający odtwarzanie wszelkich<BR>materiałów audio i wideo, pobieranych z wbudowanego<BR>dysku, pamięci USB, sieci lokalnej i internetu.<BR><BR>Model A210 wyróżnia elegancka czarna aluminiowa<BR>obudowa zapewniająca chłodzenie urządzenia bez<BR>użycia wentylatora.'],
                        [MENUITEM, 'Popcorn Hour A-200', 'popcornhour_A200.html','images/banner_a200.jpg', 'Popcorn Hour A200 to zaawansowany odtwarzacz<BR>multimedialny zapewniający odtwarzanie wszelkich<BR>materiałów audio i wideo, pobieranych z wbudowanego<BR>dysku, pamięci USB, sieci lokalnej i internetu.'],

			[MENUITEM, 'PopBox v8', 'popbox_V8.html','images/banner_v8.jpg', 'PopBox v8 to prosty w obsłudze i jednocześnie zaawansowany<BR>technologicznie sieciowy odtwarzacz multimedialny przeznaczony<BR>dla użytkowników rozpoczynających swoją przygodę z centrami<BR>multimedialnymi.<BR>Łatwa instalacja, przyjazne menu i swoboda w korzystaniu<BR> z sieciowych i internetowych zasobów multimedialnych,<BR> darmowych oraz płatnych, zapewnią wiele godzin doskonałej<BR>rozrywki dla wszystkich członków rodziny, bez względu na wiek.'],
			[MENUSEP,  'Akcesoria', '', ''],
			[MENUITEM, 'Obudowa <I>A-210-Chassis</I>', 'popcornhour_A210ch.html', 'images/banner_a210ch.jpg','Obudowa pozwalająca przekształcić odtwarzacz<BR>Popcorn Hour A200 w model A210.<BR>Zestaw do samodzielnego montażu.'],
			[MENUITEM, 'Ramka dysku <I>HBR-200</I>', 'popcornhour_HBR200.html','images/banner_hbr200.jpg','Ramka pozwala na równoczesną instalację napędu<BR> optycznego i dysku twardego 3.5" w odtwarzaczu<BR> Popcorn Hour C200.'],
			[MENUITEM, 'Napęd BD <I>BDR-200</I>', 'popcornhour_BDR200.html','images/banner_bdr200.jpg', ' Popcorn Hour BDR-200 to optyczny napęd typu slim,<BR>obłsugujący nośniki CD, DVD oraz BD.<BR>Pasuje do ramki BDR-200 instalowanej<BR> w odtwarzaczu Popcorn Hour C200 i C300'],
			[MENUITEM, 'Karta WiFi <I>WN-150</I>', 'popcornhour_WN150.html','images/banner_wn150.jpg', 'Popcorn Hour WN-150 to karta sieciowa pracująca w standardzie<BR>WiFi 802.11n, która pozwala na bezpieczne połączenie odtwarzaczy<BR>Popcorn Hour z komputerami pracującymi w sieci domowej<BR> i z internetem bez konieczności korzystania z kabli.'],
			[MENUITEM, 'Karta WiFi <I>MN-200</I>', 'popcornhour_MN200.html','images/banner_mn200.jpg','Popcorn Hour MN-200 to karta sieciowa w formacie Mini MII PCI,<BR>pracująca w standardzie WiFi 802.11n, która pozwala<BR>na bezprzewodowe połączenie odtwarzacza Popcorn Hour C200<BR>i C300 z internetem oraz z komputerami pracującymi w sieci domowej.'],
			[MENUITEM, 'Pilot IR <I>IRK-200</I>', 'popcornhour_IRK200.html','images/banner_irk200.jpg','Popcorn Hour IRK-200 to pilot zdalnego sterowania działający<BR>na podczerwień, przystosowany do pracy z odtwarzaczem<BR>Popcorn Hour C200 i C300.<BR>Pilot jest podświetlany i ma układ klawiszy taki sam jak<BR>oryginalny radiowy pilot znajdujący się w zestawie<BR> z odtwarzaczem C200/C300.'],

                        [MENUSEP,  'Odtwarzacze reklamowe', '', 'images/banner_s210.jpg'],
                        [MENUITEM, 'Popcorn Hour S-210', 'popcornhour_S210.html', 'images/banner_s210.jpg', 'Odtwarzacz multimedialny przeznaczony do zastosowań<BR>reklamowych <I>Digital Signage</I>. Odtwarza zdjęcia oraz<BR> filmowe materiały reklamowe w rozdzielczości FullHD.<BR>Jest zarządzany i programowany przez sieć komputerową.']
		]
	],
	['Wsparcie','dokumentacja.html', 90, '',
		[
			[MENUITEM, 'Dokumentacja', 'dokumentacja.html', ''],
	  		[MENUITEM, 'Firmware', 'firmware.html', ''],
			[MENUITEM, 'Linki i referencje', 'wsparcie.html', ''],
          		[MENUITEM, 'Serwer myIHome', 'myIHome.html', ''],
          		[MENUITEM, '<I>Digital Signage</I>', 'digital_signage.html', '']

		]
	],
 	['Gdzie kupić?','gdzie_kupic.html', 120, '',
		[
                        [MENUITEM, 'Partnerzy', '', ''],
			[MENUITEM, 'Sieci', '', ''],
			[MENUITEM, 'Sklepy internetowe', '', ''],
          		[MENUITEM, 'Dystrybucja', '', '']
		]
	]
];


function parseCommandLine() {

        SectionNO = 0;
	if (location.href.indexOf("?") == -1) {
	        PageURI = location.href;
		MenuID = 0;
 	} else {
		urlQuery = location.href.split("?");
		PageURI = urlQuery[0];
		urlTerms = urlQuery[1].split(",")
		if (urlTerms[0] != null) {
                	MenuID = parseInt(urlTerms[0]);
	        } else {
        	        MenuID = 0;
	        };
  	}
  	//alert("MenuID="+MenuID);
  	//alert("PageURI="+PageURI);
}

function OnMenuMouseOut(obj) {
	obj.style.color='#FFFFFF';
	//obj.style.fontSize='18';
}

function OnMenuMouseOver(obj) {
        obj.style.color='#87081b';
}

function OnSubMenuMouseOut(obj) {
        obj.style.color='#9090A0';
}

function OnSubMenuMouseOver(obj) {
        obj.style.color='#800090';
}

function insertMainLayout(sel, logoset) {
        document.write('<table cellpadding="0" cellspacing="0" border="0" width="100%"  height="100%" bgcolor="#989898">');
        document.write('<COLGROUP>');
        document.write('<COL width="*" />');
        document.write('<COL width="15" />');
        document.write('<COL width="400" />');
        document.write('<COL width="484" />');  //menu
        document.write('<COL width="140" />');
        document.write('<COL width="15" />');
        document.write('<COL width="*" />');
        document.write('</COLGROUP>');

	document.write('<tr height="97px">');
        document.write('<td>&nbsp;</td>');
        document.write('<td background="images/centerLeftShadow.jpg" >&nbsp;</td>');
        //document.write('<td background="images/bg_topmenu.jpg" >&nbsp;</td>');
        document.write('<td valign="top">');
        insertTopLogoMain(logoset);
	document.write('</td>');
        document.write('<td background="images/bg_topmenu1.jpg" >');
        insertMainMenu(sel);
	document.write('</td>');
        document.write('<td background="images/bg_topmenu_right.jpg" >&nbsp;</td>');
        document.write('<td background="images/centerRightShadow.jpg" >&nbsp;</td>');
        document.write('<td>&nbsp;</td>');

	document.write('<tr>');
	document.write('<td class="mainLayout_bottomLeft" ></td>');
        document.write('<td valign="bottom" background="images/centerLeftShadow.jpg"><img src="images/bottomLeftShadow.jpg" /></td>');
	document.write('<td colspan=3>');
}

function insertTopLogoMain(logoset) {

	var a_params = {
		'random' : false,       		// randomize the array each time page loads
		'steps' : 10,                   // number of transparency changes during the transition
		'transtime': 1,              // transition duration in seconds
  		'slidetime': 8,                 // slide time in seconds
  		'width' : 400,                  // width of the slide (optional)
  		'height': 97,                  // height of the slide (optional)
		'alt' : '',      		// alt text for the image (optional)
  		'css' : ''                      // css class assigned to the slide <img> (optional)
	};

	// list of images to display
	var a_pictures0 = [
		'images/bg_toplogoPCH.jpg',
		'images/bg_toplogoPB.jpg',
  		'images/bg_toplogoPCH.jpg'
	];
	
	var a_pictures1 = [
		'images/bg_toplogoPB.jpg',
  		'images/bg_toplogoPCH.jpg',
  		'images/bg_toplogoPB.jpg'
	];

	var mySlideShow;
	if (logoset == 1)
	        mySlideShow = new tFader (a_pictures1, a_params);
	else
		mySlideShow = new tFader (a_pictures0, a_params);
}

function insertMainMenu(sel) {
        var sSpaceWidth = '<COL width="13">';  //20
        
        //document.write('<div align="center">')
        document.write('<table height="27" align="center" cellpadding="0" cellspacing="0" border="0" width="100%">');
        document.write('<COLGROUP>');
        document.write('<COL width="13" />');


        document.write('<COLGROUP>');
        for (i=0; i<menuSet.length; i++) {
                document.write('<COL width="' + menuSet[i][2] + '">' + sSpaceWidth);
        }
        document.write('<COL width="16" />');  //prawe małe menu
        document.write('<COL width="100" />');  //youtube
        document.write('</COLGROUP>');
        
        document.write('<tr class="menuTableRow">');
        //document.write('<td><img src="images/header_01.png" /></td>');
        document.write('<td><img src="images/header_01.png" style="border:0; width:13px; height:27px;"></td>');

 	for (i=0; i<menuSet.length; i++) {
		if (i>0) {
			document.write('<td class="mainMenuCellSep">|</td>');
		}
		if (i+1 == sel) {
                        document.write('<td class="mainMenuCellSel"><a class="menuLinkSel"');
                        document.write('onclick="top.location.href =\'' + menuSet[i][1] + '\'">');
                        document.write('<B>' + menuSet[i][0] + '</B>');
                } else {
                        document.write('<td class="mainMenuCell"><a class="menuLink"');
                        document.write('onclick="top.location.href =\'' + menuSet[i][1] + '\'" onMouseOut="OnMenuMouseOut(this)" onMouseOver="OnMenuMouseOver(this)">');
                        document.write(menuSet[i][0]);
                }
                document.write('</a></td>');


        }
        document.write('<td><img src="images/header_03.png"></td>');
        document.write('<td align="right">&nbsp;&nbsp;&nbsp;<a target="_blank" href="http://www.youtube.com/user/SyabasTech"><img border="0" src="logo/youtube.png" alt="Kanał YouTube producenta" /></a></td>');

        document.write('</tr></table>');
}

function insertTopBaner(selMain, selSub) {
	if (selMain == MAINMENU_SUPPORT || selMain == MAINMENU_SHOP) {
 		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
		document.write('<tr height="78"><td background="images/bg_maincontent2a.jpg">&nbsp;</td></tr>');
		document.write('</table>');
 	} else if (selMain == MAINMENU_PRODUCTS && selSub == PCH_MAIN) {
	        insertTopBanerPCH();
	} else if (selMain == MAINMENU_MAIN) {
		insertTopBanerMain();
 	} else {

	        var subMenu = menuSet[selMain-1][4];
        	banner = subMenu[selSub][3];
	        if (banner == "")
        		banner = "images/banner_bg.jpg";
		desc = subMenu[selSub][4];
		if (desc == null)
	        	desc = "";
		
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
		document.write('<tr height="323px">');
		document.write('<td valign="top" width="1024" background="' + banner + '">');
 		document.write('<BR><div class="bannerHead">' + subMenu[selSub][1] + '<BR></div>');
		document.write('<div class="bannerBody"><BR>' + desc + '</div>');
		document.write('</td>');
	       	document.write('</tr>');
		document.write('<tr height="20"><td background="images/bg_maincontent2.jpg">&nbsp;</td></tr>');
		document.write('</table>');
	}

}

function insertTopBanerPCH() {

       	banner = "images/banner_nmj.jpg";
        desc = "Sieciowe odtwarzacze multimedialne <B>Popcorn Hour</B> to jedne z najlepiej rozpoznawalnych urządzeń na rynku. Budowane w oparciu o wydajne procesory SIGMA Designs pracują pod kontrolą oprogramowania firmy Syabas - jednego z czołowych producentów oprogramowania do odtwarzaczy multimedialnych.<BR>W roku 2011 na rynek europejski wprowadzono urządzenia <B>PopBox</B>, które wcześniej oferowane były wyłącznie na rynku amerykańskim.";

	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
	document.write('<tr height="323px">');
	document.write('<td valign="top" width="1024" background="' + banner + '">');
	document.write('<BR><div class="bannerHeadRight">Popcorn Hour i PopBox<BR></div>');
	document.write('<div class="bannerBodyRight">' + desc + '</div>');
	document.write('</td>');
       	document.write('</tr>');
	document.write('<tr height="20"><td background="images/bg_maincontent2.jpg">&nbsp;</td></tr>');
	document.write('</table>');

}

function insertTopBanerMain() {

	var a_params = {
		'random' : true,       		// randomize the array each time page loads
		'steps' : 10,                   // number of transparency changes during the transition
		'transtime': 0.25,              // transition duration in seconds
  		'slidetime': 6,                 // slide time in seconds
		'width' : 1024,                  // width of the slide (optional)
  		'height': 323,                  // height of the slide (optional)
		'alt' : '',      		// alt text for the image (optional)
  		'css' : ''                      // css class assigned to the slide <img> (optional)
	};

	// list of images to display
	var a_pictures = [
		'images/homebanner_PopboxV8.jpg',
		'images/homebanner_a300.jpg',
  		'images/homebanner_c300.jpg',
		'images/homebanner_s210.jpg'
	];
	
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
	document.write('<tr height="323px">');
	document.write('<td valign="top" width="1024">');
	var mySlideShow = new tFader (a_pictures, a_params);    	// fader initialization
	document.write('</td></tr>');
	document.write('<tr height="20"><td background="images/bg_maincontent2.jpg">&nbsp;</td></tr>');
	document.write('</table>');
}

function insertPageTableBegin(selMain, selSub) {
        insertTopBaner(selMain, selSub);
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" background="images/bg_maincontent3.jpg">');
	document.write('<tr>');
	document.write('<td class="subMenuContainer" >');
        insertLeftMenu(selMain, selSub);
	document.write('</td>');
	document.write('<td align="left" valign="top">');
	
	//body frame
	document.write('<table cellpadding="0" cellspacing="0" border="0" bgcolor="#fdc031">');
	
	document.write('<tr><td colspan=3>');
        document.write('<table height="22px" align="left" cellpadding="0" cellspacing="0" border="0" width="100%">');
     	document.write('<TR>');
        	document.write('<TD width="230px" background="images/main_content_top_left.jpg">&nbsp;</td>');
		document.write('<td background="images/main_content_top_mid.jpg">&nbsp;</td>');
	      	document.write('<TD width="197px" background="images/main_content_top_right.jpg">&nbsp;</td>');
        document.write('</TR></table>');
	document.write('</td></tr>');
	document.write('<tr>');
        document.write('<td width="14" background="images/nmj_border_left.jpg">&nbsp;</td>');
        document.write('<td width="735" class="content_cell">');
}

function insterPageTableEnd() {
        //for insertPageTableBegin (lower part of body frame)
	document.write('</td>');
        document.write('<td width="14" background="images/nmj_border_right.jpg">&nbsp;</td>');
	document.write('</tr>');
	document.write('<tr><td colspan=3>');
        document.write('<table height="36" align="left" cellpadding="0" cellspacing="0" border="0" width="100%">');
     	document.write('<TR>');
        	document.write('<TD width="29" background="images/main_content_bottom_left.jpg">&nbsp;</td>');
		document.write('<td background="images/main_content_bottom_mid.jpg">&nbsp;</td>');
	      	document.write('<TD width="197" background="images/main_content_bottom_right.jpg">&nbsp;</td>');
        document.write('</TR></table>');
	document.write('</td></tr>');
	document.write('</table>');
	document.write('<BR>');

 	//for insertPageTableBegin
        document.write('</td></tr>');
	document.write('</table>');

	///for  insertMainLayout
        document.write('<td valign="bottom" background="images/centerRightShadow.jpg"><img src="images/bottomRightShadow.jpg" /></td>');
	document.write('<td class="mainLayout_bottomRight" ></td>');
	document.write('</tr>');
	
	document.write('<tr height="60px">');
	document.write('<td background="images/footerLeft.jpg" ></td>');
        document.write('<td background="images/footerLeftShadow.jpg" ></td>');
        document.write('<td colspan=3 background="images/footer1.jpg" >');
        
	document.write('<div class="copyright">');
	document.write('Copyright  &copy; 2011 Human Media Spzoo, Wszelkie prawa zastrzeżone<BR>Logo <I>Popcorn Hour</I> oraz <I>NMT</I> są zastrzeżonymi znakami handlowym zarejestrowanym na terytorium USA.');
	//document.write('Copyright  &copy; 2011 Popcorn Hour, All Rights Reserved &nbsp;&nbsp;&nbsp;Popcorn Hour and NMT logo are trademarks of Syabas Technology Inc., Registered in the U.S.');
	document.write('</div>');
	
	document.write('</td>');
        document.write('<td background="images/footerRightShadow.jpg" ></td>');
	document.write('<td background="images/footerRight.jpg" ></td>');
        document.write('</tr>');

	document.write('</table>');
}


function insertLeftMenu(selMain, selSub) {
     var subMenu = menuSet[selMain-1][4];
     var subMenuItem; // = = new Array();


     document.write('<table width="180px" border="0" cellspacing="0" cellpadding="0">');
     document.write('<tr height="30px"><td>&nbsp;</td></tr>');
     
      if (subMenu == null) {
        	document.write('&nbsp;brak submenu');
	} else {
  		for (i=0; i<subMenu.length; i++) {
     			subMenuItem = subMenu[i];
     			if (i > 0) {
                        	//document.write('<tr height="3px"><td class="subMenuSep"></td></tr>');
       			}
			if (subMenuItem[0] == MENUITEM) {
			        document.write('<tr height="23px">');
				if (i == selSub) {
				        document.write('<td id="SubMenuTD_' + i + '" class="subMenuCellSel">');
				        document.write('<img id="SubMenuImg_' + i + '" src="images/product-arrow.png" />');
     				        document.write('<a id="SubMenuA_' + i + '" class="subMenuLinkSel"');
                		} else {
	                	        document.write('<td id="SubMenuTD_' + i + '" class="subMenuCell">');
	                	        document.write('<img id="SubMenuImg_' + i + '" src="images/product-arrow.png" style="visibility:hidden;width:0;"/>');
        	        	        document.write('<a id="SubMenuA_' + i + '" class="subMenuLink"');
	        	        }
				if (subMenuItem[2] == "") {
		                	document.write(' onclick="zmien_sekcje(' + i + ')">');
				} else {
        	                        document.write('onclick="top.location.href =\'' + subMenuItem[2] + '\'">');
				}
		      		document.write(subMenuItem[1] + '</a>');
				document.write('</td></tr>');
                	 } else {  //MENUSECTION
                                document.write('<tr height="30px">');
                                document.write('<td class="subMenuSection">');
                                document.write(subMenuItem[1]);
                                document.write('</td></tr>');
                	 }

		}
	}
     document.write('</table>');
}

function insertSubMenu(selMain, selSub) {
	var subMenu = menuSet[selMain-1][3];
	var subMenuItem; // = = new Array();

	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
    	document.write('<tr height="60">');
        document.write('<td class="subMenuCellSel">');
        if (subMenu == null) {
        	document.write('&nbsp;brak submenu');
	} else {
  		for (i=0; i<subMenu.length; i++) {
			if (i>0) {
				document.write('&nbsp;&nbsp;|&nbsp;&nbsp;');
    			}
			subMenuItem = subMenu[i];
     			if (i == selSub) {
     			        document.write('<a id="SubMenuA_' + i + '" class="subMenuLinkSel"');
        			document.write(' onclick="zmien_sekcje(' + i + ');">');
                	} else {
                	        document.write('<a id="SubMenuA_' + i + '" class="subMenuLink"');
	                        document.write(' onclick="zmien_sekcje(' + i + ');">');
	                        //document.write(' onclick="zmien_sekcje(' + i + ');" onMouseOut="this.style.color=\'#777777\'" onMouseOver="this.style.color=\'E00000\'">');
	                }
                	document.write(subMenuItem[1] + '</a>');
		}
	}
	document.write('</td>');
    	document.write('</tr></table>');
}


function insertPageFooter() {
        insertPageFooterIcons('pic/mbox_icons.jpg');
}
function insertPageFooterIcons(iconsFile) {
}

function insertPageMap() {
        var subMenu;
	var subMenuItem;
	//document.write('<BR>');
        document.write('<table border="0" cellspacing="10" cellpadding="0">');
        document.write('<tr>');
        for (i=0; i<menuSet.length; i++) {
                document.write('<td align="left" valign="top">');
                document.write('<a class="sitemap_L1" href="' + menuSet[i][1] + '">' + menuSet[i][0] + '</a><BR>');
                subMenu = menuSet[i][4];
                if (subMenu != null) {
                        for (j=0; j<subMenu.length; j++) {
                		subMenuItem = subMenu[j];
                		if (subMenuItem[0] == MENUITEM) {
	                		if (subMenuItem[2] == "") {
        	        			document.write('<a class="sitemap_L2" href="' + menuSet[i][1] + '?' + j + '">&nbsp;&nbsp;' + subMenuItem[1] + '</a><BR>');
					} else {
					        document.write('<a class="sitemap_L2" href="' + subMenuItem[2] + '">&nbsp;&nbsp;' + subMenuItem[1] + '</a><BR>');
					}
				}
                	}
               	}
                document.write('</td>');
                document.write('<td width="10px"></td>');
        }
        
        document.write('</tr>');
        document.write('</table>');
    	//document.write('mapa strony<BR>site map<BR>mapa strony<BR>site map<BR>mapa strony<BR>site map<BR>mapa strony<BR>site map<BR>');
}

//poziome menu na stronie przedmiotu

function insertProdSubMenu(sel) {
        var i;
        if (prodSubMenu.length == 0) {
                return 0;
        }
        document.write('<table cellpadding="0" cellspacing="0" border="0" width="100%">');
        document.write('<tr class="prodSubMenuTableRow"><td width=100% align="right">');

        document.write('<table cellpadding="0" cellspacing="0" border="0" class="prodSubMenuTableLayout">');
        document.write('<tr class="prodSubMenuTableRow">');
        document.write('<td width="10px" class="prodSubMenuCell">|</td>');
        for (i=0; i<prodSubMenu.length; i++) {
        	if (i == sel) {
                        document.write('<td id="ProdMenuTD_'+i+'" class="prodSubMenuCellSel"><a id="ProdMenuA_'+i+'" class="prodSubMenuLinkSel"');
                        document.write('onclick="zmien_subsekcje(' + i + ');">');
                } else {
                        document.write('<td id="ProdMenuTD_'+i+'" class="prodSubMenuCell"><a id="ProdMenuA_'+i+'" class="prodSubMenuLink"');
                        document.write('onclick="zmien_subsekcje(' + i + ');" onMouseOut="this.style.color=\'#600000\'" onMouseOver="this.style.color=\'red\'">');
                }
                document.write('&nbsp;' + prodSubMenu[i][0] + '&nbsp;</a>');
                document.write('</td><td class="prodSubMenuCell">|</td>');
        }
        document.write('<td class="prodSubMenuCell">&nbsp;&nbsp;&nbsp;</td>');
        document.write('</tr>');
        document.write('</table>');

        document.write('</td></tr>');
        document.write('</table>');
}

var colorFlip = "orange";

function insertComparationRow(caption, val0, val1, val2, val3, val4) {
	document.write('<tr height="45">');
	
        colorFlip = (colorFlip == "orange" ? "white" : "orange");

  	document.write('<td background="images/cp_'+colorFlip+'line_left.png">&nbsp;</td>');
  	document.write('<td background="images/cp_'+colorFlip+'line_mid.png" class="comparetable_head">' + caption + '</td>');

	  insertComparationCell(val0,1);
  	
	if (val2 == ".") {
	        if (val3 == ".")
                        if (val4 == ".")
                                insertComparationCell(val1,4);
			else {
				insertComparationCell(val1,3);
		                insertComparationCell(val4,1);
	                }
		else {
		        insertComparationCell(val1,2);
		        insertComparationCell(val3,1);
		        insertComparationCell(val4,1);
		}
	
	} else {
	    insertComparationCell(val1,1);
	    if (val3 == ".")
	                if (val4 == ".")
     				insertComparationCell(val2,3);
			else {
			        insertComparationCell(val2,2);
			        insertComparationCell(val4,1);
   			}
		else {
		        insertComparationCell(val2,1);
		        insertComparationCell(val3,1);
		        insertComparationCell(val4,1);
		}
	}

	document.write('<td background="images/cp_'+colorFlip+'line_right.png">&nbsp;</td>');
	document.write('</tr>');

	document.write('<tr height="5px"><td colspan=5></td></tr>');
}

function insertComparationCell(content, span) {
	if (content == 0)
  		document.write('<td colspan=' + span + ' background="images/cp_'+colorFlip+'line_mid.png" class="comparetable_text"><img src="http://www.popcornhour.com/onlinestore/images/cp_no.png" /></td>');
   	else if (content == 1)
  		document.write('<td colspan=' + span + ' background="images/cp_'+colorFlip+'line_mid.png" class="comparetable_text"><img src="http://www.popcornhour.com/onlinestore/images/cp_yes.png" /></td>');
   	else if (content == 2)
  		document.write('<td colspan=' + span + ' background="images/cp_'+colorFlip+'line_mid.png" class="comparetable_text"><img src="http://www.popcornhour.com/onlinestore/images/cp_note-coming-soon.png" /></td>');
  	else
	  	document.write('<td colspan=' + span + ' background="images/cp_'+colorFlip+'line_mid.png" class="comparetable_text">' + content + '</td>');
}



function insertInfoTable(infoContentTable) {

	document.write('<table align="center" cellpadding="1" cellspacing="10" border="0" width="90%">');
	document.write('<tr><td colspan=2><hr></td></tr>');
	for (i=0; i<infoContentTable.length; i++) {
		document.write('<tr><td class="prodText">');
	        document.write('<img border="0" src="images/product-arrow.png" />');
		document.write('<a target="_blank" href="' + infoContentTable[i][1] + '">' + infoContentTable[i][0] + '</a><BR>');
		document.write('<div class="firmwareInfo">');
 		document.write(infoContentTable[i][2]);
		document.write('</div>');
    		document.write('</td><td class="firmwareInfo" width="120px">');
   		document.write(infoContentTable[i][3]);
	   	document.write('</td></tr>');
	   	document.write('<tr><td colspan=2><hr></td></tr>');
   	};
	document.write('</table>');
}

function addPartnerRefRow(name, ref, pic, desc) {

	document.write('<tr>');
 	document.write('<td width="170px" align="left" valign="top">');
 	document.write('<a target="_blank" href="' + ref + '"><img border=0 src="' + pic +'" alt="' + name + '"></a>');
	document.write('</td>');
	document.write('<td class="prodText">');
 	document.write('<a target="_blank" href="' + ref + '"><B>' + name + '</B></a><BR>');
 	document.write('<a target="_blank" href="' + ref + '"></a><BR>');
        document.write(desc + '<BR>')
	document.write('</td>');
	document.write('</tr>');
	document.write('<tr><td colspan=2><hr></td></tr>');
}

function addPartnerRef(name, ref, pic) {

	document.write('<a target="_blank" href="' + ref + '"><img border=0 src="' + pic +'" alt="' + name + '"></a>');
	document.write('&nbsp;&nbsp;');

}

//============================================================================================
//YouTube

var cnt_YT;
function youTubeVideoTabStart(headText) {
        cnt_YT = 0;
	document.write('<table align="center" cellpadding="5" cellspacing="0" border="0"><tr>');
	if (headText != null && headText!= "") {
        	document.write('<td colspan=3 class="youTubeVideoHeadCell">');
                document.write(headText);
                document.write('</td></tr><tr>');
	}
}
function youTubeVideoTabEnd() {
        document.write('</tr></table>');
}

function insertYouTubeVideo(videoCode, videoTitle) {
        if (cnt_YT>0 && (cnt_YT % 3) == 0) {
                document.write('</tr><tr>');
        }
        cnt_YT++;
        insertYouTubeVideoCell(videoCode, videoTitle);
}


function insertYouTubeVideoCell(videoCode, videoTitle) {
        document.write('<td class="youTubeVideoCellText">');
	document.write('<a target="_blank" href="http://www.youtube.com/watch_popup?v=' + videoCode + '" title="' + videoTitle +'">');
	document.write('<img src="http://i3.ytimg.com/vi/' + videoCode + '/hqdefault.jpg" alt="' + videoTitle + '" width="200" border="0" />');
	document.write('</a><BR>');
	document.write(videoTitle);
        document.write('</td>');
}

function insertYouTubeVideoItem(videoCode, videoTitle) {
        document.write('<div class="youTubeVideoCellText">');
	document.write('<a target="_blank" href="http://www.youtube.com/watch_popup?v=' + videoCode + '" title="' + videoTitle +'">');
	document.write('<img src="http://i3.ytimg.com/vi/' + videoCode + '/hqdefault.jpg" alt="' + videoTitle + '" width="200" border="0" />');
	document.write('</a><BR>');
	document.write(videoTitle);
        document.write('</div>');
}

//============================================================================================

//galeria zdjęć

function insertGaleryTable(w) {
	var h;
	document.write('<table cellpadding="0" cellspacing="0" border="0" width="' + w + 'px">');
	document.write('<TR><TD class="prodThumbPic">');
	for (i=0; i<galeryTable.length; i++) {
	        w = galeryTable[i][2];
	        if (w==0) w=85;  //default
		document.write('<a onclick="changePhoto(' + i + ');" onMouseOut="highlightThumb(' + i + ',0)" onMouseOver="highlightThumb(' + i + ',1)">');
	        document.write('<img class="galeryThumbPic" id="galerythumb_' + i + '" width="' + w +'px" src="' + galeryTable[i][0] + '" alt="' + galeryTable[i][1] + '"></a>&nbsp;');
	        if ((i % 2) == 1) document.write('<BR>');
	}
	document.write('</TD>');
       	document.write('<TD class="prodTabPic">');
	document.write('<img id="galeryphoto" src="' + galeryTable[0][0] + '" alt="' + galeryTable[0][1] + '">');
	document.write('</TD></TR>');
	document.write('</table>');
}

function changePhoto(photoNo) {
	document.getElementById('galeryphoto').src = galeryTable[photoNo][0];
	document.getElementById('galeryphoto').alt = galeryTable[photoNo][1];
}

function highlightThumb(photoNo, onoff) {

	if (onoff) {
        	document.getElementById('galerythumb_' + photoNo).className = 'galeryThumbSel';
 	} else {
 	       document.getElementById('galerythumb_' + photoNo).className = 'galeryThumbPic';
  	}
}



function insertRowSeparator() {
        document.write('<div align="center">');
        document.write('<table cellpadding="0" cellspacing="0" border="0" width="100%">');
        document.write('<tr height="8px"></tr>');
        document.write('<tr height="5px">');
        document.write('<td width="62px" class="rowSepLeft"></td>');
        document.write('<td width="*" class="rowSepCenter">&nbsp;</td>');
        document.write('<td width="62px" class="rowSepRight"></td>');
        document.write('</tr></table>');
        document.write('</div>');
}

function switchSectionOn() {

	if (SectionNO != MenuID) {
                document.write('<DIV id="sekcja_'+SectionNO+'" class="sectionHidden">');
	} else {
	        document.write('<DIV id="sekcja_'+SectionNO+'" class="sectionVisible">');
 	}
 	SectionNO = SectionNO + 1;
}

function switchSectionOff() {
        document.write('</DIV>');
}

function zmien_sekcje(nowa) {
	document.getElementById('SubMenuA_' + MenuID).className = 'subMenuLink';
        document.getElementById('SubMenuA_' + nowa).className = 'subMenuLinkSel';
        document.getElementById('SubMenuTD_' + MenuID).className = 'subMenuCell';
        document.getElementById('SubMenuTD_' + nowa).className = 'subMenuCellSel';
        document.getElementById('SubMenuImg_' + MenuID).style.visibility='hidden';
        document.getElementById('SubMenuImg_' + MenuID).style.width='0px';
        document.getElementById('SubMenuImg_' + nowa).style.visibility='visible';
        document.getElementById('SubMenuImg_' + nowa).style.width='auto';
	document.getElementById('sekcja_' + MenuID).className = 'sectionHidden';
	document.getElementById('sekcja_' + nowa).className = 'sectionVisible';
	MenuID = nowa;
}

function zmien_subsekcje(nowa) {
	document.getElementById('ProdMenuTD_' + MenuID).className = 'prodSubMenuCell';
	document.getElementById('ProdMenuTD_' + nowa).className = 'prodSubMenuCellSel';
	document.getElementById('ProdMenuA_' + MenuID).className = 'prodSubMenuLink';
	document.getElementById('ProdMenuA_' + nowa).className = 'prodSubMenuLinkSel';

	document.getElementById('sekcja_' + MenuID).className = 'sectionHidden';
	document.getElementById('sekcja_' + nowa).className = 'sectionVisible';

	MenuID = nowa;
}

-->

