<!--

//*****************************
// Copyright HumanMedia 2010
// Jan 2010
// http://www.HumanMedia.pl
//*****************************

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

var MENUITEM = 0;
var MENUSEP = 1;

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

var MBOX_MAIN = 0;
var MBOX_K3TR11 = 2;
var MBOX_R600 = 3;
var MBOX_R650 = 4;
var MBOX_R500 = 5;

var MBOX_R3250S = 7;
var MBOX_R3150S = 8;
var MBOX_R3050S = 9;
//var MBOX_R3050S = 12;
//var MBOX_P3100S = 13;
var MBOX_P500 = 11;
var MBOX_K3TP01 = 12;

var MBOX_L110 = 14;


var menuSet =
[
	['Start','index.html', 60, 'data/mStart.png',
	        [
			[MENUITEM, 'Aktualności', ''],
          		[MENUITEM, 'Recenzje', ''],
          		[MENUITEM, 'Wystawy i targi', ''],
			[MENUITEM, 'O producencie', '']
              	]
	],
        ['Odtwarzacze','mbox.html', 150, 'data/mMBox.png',
       	        [
                        [MENUITEM, 'Serie i modele', 'mbox.html'],
                	[MENUSEP,  'Seria R (recorder)', ''],
                	[MENUITEM, 'MBox TR11', 'mBox_K3-TR11.html'],
                        [MENUITEM, 'MBox R600', 'mBox_R600.html'],
                        [MENUITEM, 'MBox R650', 'mBox_R650.html'],
			[MENUITEM, 'MBox R500', 'mBox_R500.html'],
                        [MENUSEP,  'Seria S (slim)', ''],
                        [MENUITEM, 'MBox R3250S', 'mBox_R3250S.html'],
                        [MENUITEM, 'MBox R3150S', 'mBox_R3150S.html'],
                        [MENUITEM, 'MBox R3050S', 'mBox_R3050S.html'],
			//[MENUITEM, 'MBox P3100S', 'mBox_P3100S.html'],
			[MENUSEP,  'Seria P (player)', ''],
			[MENUITEM, 'MBox TP01', 'mBox_K3-TP01.html'],
			[MENUITEM, 'MBox P500', 'mBox_P500.html'],
			//[MENUITEM, 'MBox P550', 'mBox_P550.html'],
			[MENUSEP,  'Seria L (light)', ''],
			[MENUITEM, 'MBox L110', 'mBox_L110.html']
		]
	],
	['Wsparcie','wsparcie.html', 110, 'data/mWsparcie.png',
		[
          		[MENUITEM, 'seria MBox R', ''],
          		[MENUITEM, 'seria MBox S', ''],
			[MENUITEM, 'seria MBox P', ''],
          		[MENUITEM, 'seria MBox L', ''],
          		[MENUITEM, 'Dodatki', ''],
          		[MENUITEM, 'Serwisy IMS', ''],
          		[MENUITEM, 'Podpowiedzi', '']
		]
	],
 	['Gdzie kupić?','gdzie_kupic.html', 140, 'data/mGdzieKupic.png',
		[
          		[MENUITEM, 'Sklepy', ''],
          		[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='#FFFF70';
}

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

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

function insertMainMenu(sel) {
        var sSpaceWidth = '<COL width="13">';  //20
        
        //document.write('<div align="center">')
        document.write('<table height="158" align="center" cellpadding="0" cellspacing="0" border="0" width="100%">');
        document.write('<COLGROUP>');
        document.write('<COL width="240" />');
        document.write('<COL width="103" />');
        document.write('<COL width="10" />');
        for (i=0; i<menuSet.length; i++) {
                document.write('<COL width="' + menuSet[i][2] + '">'); // + sSpaceWidth);
        }
        document.write('<COL width="95" />');  //prawe małe menu
        document.write('<COL width="*" />');
        document.write('<COL />');
        document.write('</COLGROUP>');
        
        document.write('<tr class="menuTableRow">');
        //document.write('<td background="data/menu_logo.png">&nbsp;</td>');
        document.write('<td><img src="data/menu_logo.png"></td>');
        document.write('<td><img src="data/menu_left.png"></td>');
        document.write('<td background="data/menu_back.png">&nbsp;</td>');

 	for (i=0; i<menuSet.length; i++) {
	        if (i+1 == sel) {
                        document.write('<td class="mainMenuCellSel"><a class="menuLinkSel"');
                        document.write('onclick="top.location.href =\'' + menuSet[i][1] + '\'">');
                        document.write(menuSet[i][0]);
                } 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 class="mainMenuShortcuts">');
        //document.write('<a class="menuLink" href="index.html"> mapa strony</a><BR>');
        document.write('<a class="menuLink" href="mailto:kontakt@hyundaimbox.pl">kontakt</a><BR>');
        document.write('<a class="menuLink" target="_blank" href="http://www.hyundaimbox.co.kr">hyundaimbox.co.kr</a><BR>');
	document.write('</td>');
  	document.write('<td background="data/menu_back.png">&nbsp;</td>');
        document.write('</tr></table>');
        //document.write('</div>');
}

function insertPageTableBegin(selMain, selSub) {
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
	document.write('<tr>');
	document.write('<td width="242px" class="subMenuContainer">');
        insertLeftMenu(selMain, selSub);
	document.write('</td><td align="center">');
}

function insterPageTableEnd() {
	document.write('</td>');
	document.write('</tr>');
	document.write('<tr height="29px">');
	document.write('<td class="subMenuContainerSep"></td>');
	document.write('<td></td>');
	document.write('</tr>');
	document.write('</table>');
}




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

     document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
     document.write('<tr height="19px">');
     document.write('<td>');
     document.write('<img src="data/submenu_top.png">');
     document.write('</td></tr>');
     document.write('<tr height="45px">');
     document.write('<td class="subMenuHead">');
     document.write('<img src="' + menuSet[selMain-1][3] + '" />');
     document.write('</td>');

      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="25px">');
				if (i == selSub) {
				        document.write('<td id="SubMenuTD_' + i + '" class="subMenuCellSel">');
     				        document.write('<a id="SubMenuA_' + i + '" class="subMenuLinkSel"');
                		} else {
	                	        document.write('<td id="SubMenuTD_' + i + '" class="subMenuCell">');
        	        	        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] + '\'">');
				}
				if (indent>0) {
				        document.write('&nbsp;&nbsp;');
				}
		      		document.write(subMenuItem[1] + '</a>');
				document.write('</td></tr>');
                	 } else {  //MENUSECTION
                                document.write('<tr height="25px">');
                                document.write('<td class="subMenuSection">');
                                document.write(subMenuItem[1]);
                                document.write('</td></tr>');
                                indent = 1;
                	 }

		}
	}
     document.write('<tr height="17px">');
     document.write('<td class="subMenuBottom">');
     document.write('<img src="data/submenu_bottom.png">');
     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) {
        document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
    	document.write('<tr><td width="253px" valign="bottom" class="footerLeft">');
        document.write('<img src="data/footer_left1.png"></td>');
	//document.write('<td colspan=2 class="footerSeparatorRow" height="13px">');
    	//document.write('</td>'); //</tr>');
    	//document.write('<tr><td colspan=2 align="center">');
    	document.write('<td class="sitemapCell">');
 	insertRowSeparator();
    	insertPageMap();
    	document.write('</td><td width="150px" class="sitemapCell">');
    	document.write('</td></tr>');
    	document.write('<tr><td>');
    	//document.write('<tr><td width="40%" align="right" class="copyright_notes">');
    	document.write('<img src="data/footer_left2.png">');
    	//document.write('<img src="data/hyundaimbox_logo.jpg" />');
    	document.write('</td><td align="center" class="copyright_notes">');
    	document.write('<img src="data/copyright_logo.png">');
    	//document.write('Copyright 2010 - Human Media. Wszelkie prawa zastrzeżone.<BR>');
	//document.write('Logo i znaki towarowe Hyundai są zastrzeżonymi znakami handlowym.<BR><BR>');
	document.write('</td><td class="copyright_notes">');
	document.write('</td></tr>');
	//document.write('<tr height="26px"><td colspan="3" class="pageEnd">');
	//document.write('</td></tr>');
    	document.write('</table>');
}

function insertPageMap() {
        var subMenu;
	var subMenuItem;
	//document.write('<BR>');
        document.write('<table border="0" cellspacing="10" cellpadding="0" align="center">');
        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="left">');

        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=\'navy\'" onMouseOver="this.style.color=\'red\'">');
                }
                document.write('&nbsp;&nbsp;' + prodSubMenu[i][0] + '&nbsp;&nbsp;</a>');
                document.write('</td><td class="prodSubMenuCell">|</td>');
        }
        document.write('</tr>');
        document.write('</table>');

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

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('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;
}

-->

