/* # frontLeftNavi.js.php - to preload the left navi items */ function fillSubCatData(topNaviItemId,level_0_Id,level_1_Id,prodGenId){ var ajaxVar = new ajaxVars(); ajaxVar.vars['sql_type'] = "select"; ajaxVar.vars['sql_what'] = "n2.id as master_id"; ajaxVar.vars['sql_from'] = "navigation n1 left join navigation n2 on n1.general_id = n2.id"; ajaxVar.vars['sql_where'] = "n2.main_cat = 0 and n1.lang_id='" + "1" + "' and n2.lang_id='"+ "1" +"' and n1.active=1"; ajaxVar.vars['sql_order'] = "n2.global_order, n2.order_no"; ajaxVar.vars['action'] = "db_fetch_array"; ajaxVar.gotoFunction = 'getTopCats'; if (topNaviItemId > 0){ ajaxVar.fnVars['top_item'] = topNaviItemId; } if (topNaviItemId > 0){ ajaxVar.fnVars['level_0'] = level_0_Id; } if (level_1_Id > 0){ ajaxVar.fnVars['level_1'] = level_1_Id; } if (prodGenId > 0){ ajaxVar.fnVars['prod_id'] = prodGenId; } ajaxVar.AjaxPostSQL(); } function getTopCats(dataArr,fnVars){ if ( (dataArr) && (dataArr['master_id'])){ for(var i=0; i 0){ ajaxVar.vars['top_item'] = fnVars['top_item']; } if (fnVars['level_0'] > 0){ ajaxVar.vars['level_0'] = fnVars['level_0']; } if (fnVars['level_1'] > 0){ ajaxVar.vars['level_1'] = fnVars['level_1']; } if (fnVars['prod_id'] > 0){ ajaxVar.vars['prod_id'] = fnVars['prod_id']; } ajaxVar.vars['nosplit'] = 1; ajaxVar.fnVars['cat_id'] = dataArr['master_id'][i]; ajaxVar.gotoFunction = 'fillSubCatDiv'; ajaxVar.AjaxPostSQL(); } } } function fillSubCatDiv(data, fnVars){ // get the subcat div for this category if (fnVars['cat_id'] > 0){ var divObj = document.getElementById('ln_subcatof_' + fnVars['cat_id']); if ( (divObj) && (data != 'empty')){ divObj.innerHTML = data; divObj.innerHTML = replaceSpecialChars(divObj.innerHTML); } } } function topnaviClick(divObj,catId,topNaviItemId,level_0_Id,level_1_Id,prodGenId,hideDiv){ if (divObj){ var prevActiveCatObj = document.getElementById('tn_prevactive_cat'); var currActiveCatObj = document.getElementById('tn_active_cat'); if ((currActiveCatObj.value > 0) && (currActiveCatObj.value == catId)){ return false; } // if there was already an active before this click event store the value in prev div object prevActiveCatObj.value = (currActiveCatObj.value > '0')? currActiveCatObj.value : '0'; // assign the new active category value to the current active div object currActiveCatObj.value = catId; // create the current active div id var tempcurrActiveDivId = 'tn_item_div' + currActiveCatObj.value; // if you are clicking div which is already clicked do nothing, else do the following if (prevActiveCatObj.value > 0){ var prevActiveDiv = document.getElementById('tn_item_div' + prevActiveCatObj.value); prevActiveDiv.className = 'topclass'; var previmgObj = document.getElementById('top_arw_' + prevActiveCatObj.value); previmgObj.src = arrowImg.src; } // hide if there was any previous sub cat div open var prevdivObj = document.getElementById('ln_subcatof_' + prevActiveCatObj.value); if (prevdivObj){ prevdivObj.className = "hidden"; } // show the sub cat div corresponding to current active div var currdivObj = document.getElementById('ln_subcatof_' + catId); if (currdivObj){ currdivObj.className = "visible"; } // this is a special case if (hideDiv == "downloads"){ var downloadDivObj = document.getElementById('ln_subcat_download'); if ((downloadDivObj) && (downloadDivObj.className == "visible")){ downloadDivObj.className = "hidden"; } } } } function topnaviHover(divObj,catId){ if (divObj){ divObj.className = 'topclass1'; var imgObj = document.getElementById('top_arw_' + catId); imgObj.src = whitearrowImg.src; } } function topnaviOut(divObj,catId){ if (divObj){ divObj.className = 'topclass'; var imgObj = document.getElementById('top_arw_' + catId); imgObj.src = arrowImg.src; // If the mouse out item is the one which is clicked then do the following var currActiveCatObj = document.getElementById('tn_active_cat'); if (currActiveCatObj.value == catId){ topnaviHover(divObj,catId); } } } function topnaviNavigate(divObj,id,extLink){ if (id > 0){ location.href = "/articles.php?general_id=" + id; }else if (extLink){ location.href = extLink; } } function createSubCatDiv(subcatData,fnVars){ var naviObj = document.getElementById('lnavi_maindiv'); if (subcatData == "empty"){ naviObj.innerHTML = "\"\""; }else{ naviObj.innerHTML = subcatData; naviObj.innerHTML = replaceSpecialChars(naviObj.innerHTML); } } function level_0_mouseover(cat_id){ var catNameDiv = document.getElementById('level_0_cname' + cat_id); if (catNameDiv){ catNameDiv.className = 'smallblacktextHover'; } } function level_0_click(cat_id){ // show the child div showHideDiv('ln_level1_of_cat' + cat_id); // set the current active cat, prev active cat for level 0 var prevActiveCatObj = document.getElementById('ln_prevactive_cat_level0'); var currActiveCatObj = document.getElementById('ln_active_cat_level0'); // if someone tries to again click the category which is current the active one, then do nothing if (currActiveCatObj.value == cat_id){ }else{ prevActiveCatObj.value = (currActiveCatObj.value > '0') ? currActiveCatObj.value : '0' ; currActiveCatObj.value = cat_id; // if there are any prev clicked categorries if (prevActiveCatObj.value > 0){ var prevActCat = document.getElementById('level_0_cname' + prevActiveCatObj.value); var prevActChild = document.getElementById('ln_level1_of_cat' + prevActiveCatObj.value); if (prevActChild){ prevActChild.className = 'hidden'; } prevActCat.className = 'smallblacktextClass'; } } } function level_0_mouseout(cat_id){ var catNameDiv = document.getElementById('level_0_cname' + cat_id); // if the current category is not the mouse out category var currActiveCatObj = document.getElementById('ln_active_cat_level0'); var prevActiveCatObj = document.getElementById('ln_prevactive_cat_level0'); if (currActiveCatObj.value != cat_id){ catNameDiv.className = 'smallblacktextClass'; }else{ // Change the classname of the name div depending on the visibility of the child div var currchildDiv = document.getElementById('ln_level1_of_cat' + cat_id); if ( (currchildDiv) && (currchildDiv.className.indexOf('hidden') > -1)){ catNameDiv.className = 'smallblacktextClass'; }else{ catNameDiv.className = 'smallblacktextHover'; } } } function level_1_click(cat_id,redirect){ // show the child div showHideDiv('ln_prod_of_cat' + cat_id); // set the current active cat, prev active cat for level 1 var prevActiveCatObj = document.getElementById('ln_prevactive_cat_level1'); var currActiveCatObj = document.getElementById('ln_active_cat_level1'); // if someone tries to again click the category which is current the active one, then do nothing if (currActiveCatObj.value != cat_id){ prevActiveCatObj.value = (currActiveCatObj.value > '0') ? currActiveCatObj.value : '0' ; currActiveCatObj.value = cat_id; // if there are any prev clicked categorries if (prevActiveCatObj.value > 0){ var prevActCat1 = document.getElementById('level_1_cname1' + prevActiveCatObj.value); var prevActCat2 = document.getElementById('level_1_cname2' + prevActiveCatObj.value); var prevActChild = document.getElementById('ln_prod_of_cat' + prevActiveCatObj.value); if (prevActChild){ prevActChild.className = 'hidden'; } prevActCat1.className = 'leftblacktextClass'; prevActCat2.className = 'leftblacktextClass'; } } if (redirect == 1){ location.href = "Produktliste_"+ cat_id + ".html"; } } function level_1_mouseout(cat_id){ var catNameDiv1 = document.getElementById('level_1_cname1' + cat_id); var catNameDiv2 = document.getElementById('level_1_cname2' + cat_id); // if the current category is not the mouse out category var currActiveCatObj = document.getElementById('ln_active_cat_level1'); var prevActiveCatObj = document.getElementById('ln_prevactive_cat_level1'); if (currActiveCatObj.value != cat_id){ catNameDiv1.className = 'leftblacktextClass'; catNameDiv2.className = 'leftblacktextClass'; }else{ // Change the classname of the name div depending on the visibility of the child div var currchildDiv = document.getElementById('ln_prod_of_cat' + cat_id); if ( (currchildDiv) && (currchildDiv.className.indexOf('hidden') > -1)){ catNameDiv1.className = 'leftblacktextClass'; catNameDiv2.className = 'leftblacktextClass'; }else{ catNameDiv1.className = 'leftblacktextHover'; catNameDiv2.className = 'leftblacktextHover'; } } } function level_1_mouseover(item_id){ var item_link1 = document.getElementById('level_1_cname1' + item_id); var item_link2 = document.getElementById('level_1_cname2' + item_id); if (item_link1){ item_link1.className = 'leftblacktextHover'; item_link2.className = 'leftblacktextHover'; } } function level_1_mouseovera(item_id){ var item_link1 = document.getElementById('level_1_aname1' + item_id); var item_link2 = document.getElementById('level_1_aname2' + item_id); if (item_link1){ item_link1.className = 'leftblacktextHover'; item_link2.className = 'leftblacktextHover'; } } function level_1_mouseouta(id,aid){ var catNameDiv1 = document.getElementById('level_1_aname1' + id); var catNameDiv2 = document.getElementById('level_1_aname2' + id); if (id != aid){ catNameDiv1.className = 'leftblacktextClass'; catNameDiv2.className = 'leftblacktextClass'; } } function level_2_mouseover(item_id){ var item_link1 = document.getElementById('ln_prodlink_of_cat1' + item_id); var item_link2 = document.getElementById('ln_prodlink_of_cat2' + item_id); if (item_link1){ item_link1.className = 'smallblackprodPHover'; item_link2.className = 'smallblackprodPHover'; } } function level_2_mouseover_new(item_id){ var item_link1 = document.getElementById('prod_div1_' + item_id); var item_link2 = document.getElementById('prod_div2_' + item_id); item_link1.className = 'smallblacktextHover'; item_link2.className = 'smallblacktextHover'; } function level_2_mouseout_new(item_id){ var item_link1 = document.getElementById('prod_div1_' + item_id); var item_link2 = document.getElementById('prod_div2_' + item_id); var active_link = document.getElementById('ln_active_cat_level2'); if ((active_link.value > 0) && (active_link.value == item_id)){ item_link1.className = 'smallblacktextHover'; item_link2.className = 'smallblacktextHover'; }else{ item_link1.className = 'smallblacktextClass'; item_link2.className = 'smallblacktextClass'; } } function level_2_mouseout(item_id){ var item_link1 = document.getElementById('ln_prodlink_of_cat1' + item_id); var item_link2 = document.getElementById('ln_prodlink_of_cat2' + item_id); if (item_link1){ var activeItem = document.getElementById('ln_active_cat_level2'); if ( (activeItem.value > 0) && (activeItem.value == item_id)){ item_link1.className = 'smallblackprodPHover'; item_link2.className = 'smallblackprodPHover'; }else{ item_link1.className = 'smallblackprodtextP'; item_link2.className = 'smallblackprodtextP'; } } } function productPageShowNavi(topNaviItemId,level_0_Id,level_1_Id,prodGenId){ var divObj = document.getElementById('tn_item_div' + topNaviItemId); topnaviHover(divObj,topNaviItemId); fillSubCatData(topNaviItemId,level_0_Id,level_1_Id,prodGenId); topnaviClick(divObj,topNaviItemId,topNaviItemId,level_0_Id,level_1_Id,prodGenId); } function article_hover(item_id,hoverClass){ var item_link1 = document.getElementById('article_cname1' + item_id); var item_link2 = document.getElementById('article_cname2' + item_id); if (item_link1){ item_link1.className = hoverClass; item_link2.className = hoverClass; } } function article_out(item_id,outClass){ var item_link1 = document.getElementById('article_cname1' + item_id); var item_link2 = document.getElementById('article_cname2' + item_id); if (item_link1){ item_link1.className = outClass; item_link2.className = outClass; } } function highlightItem(itemId){ var divObj = document.getElementById('tn_item_div' + itemId); topnaviHover(divObj,itemId); }