// main section

// end of main section

// not used section
var bUseLayers = (document.layers)?true:false; // Netscape
var bUseAll = (document.all) ? true : false; // IE
var bUseGetElement = (document.getElementById) ? true : false; // 

var indexMenuCaption = 0;
var indexMenuHREF = 1;
var indexMenuWidth = 2;
var indexMenuSubWidth = 3;
var indexMenuSub = 4;

var menuArray = new Array(
      new Array("Home", "index.html", 34, "", null),
      new Array("About Us", "companyprofile.html", 56, "", new Array(
          new Array ("Company Profile", "companyprofile.html", "", null),
          new Array ("History", "history.html", "", null),
          new Array ("Management", "management.html", "", null),
          new Array ("Clients", "customers.html", "", null),
          new Array ("GSA", "gsa.html", "", null))),
      new Array("Solutions", "idb_photoidbadging.html", 57, "", new Array(
          new Array("Digital I.D. Badging", "idb_photoidbadging.html", "", "", null),
          new Array("Access Control", "accesscontrol.html", "", "", null),
          new Array("Biometrics", "biometrictechnology.html", "", "", null),
          new Array("Turnstiles", "turnstilesgates.html", "", "", null),
          new Array("Digital Video Surveillance", "closedcircuittelevision.html", "", "", null),
          new Array("Visitor Management", "visitormanagement.html", "", "", null))),
      new Array("Services", "design.html", 48, "", new Array(
          new Array("Integration Design", "design.html", "", null),
          new Array("Service and Support", "serviceandsupport.html", "", "", null),
          new Array("Educational Seminars", "educationalseminars.html", "", "", null))),
      new Array("Partners", "partners.html", 51, "", null),
      new Array("News", "tradeshows.html", 31, "", new Array(
          new Array("Trade Shows", "tradeshows.html", "", "", null))),
      new Array("Support", "servicerequest.html", 50, "", new Array(
          new Array("General Service Request", "servicerequest.html", "", "", null),
          new Array("Printer Service Form", "svcauthform.php", "", "", null))),
      new Array("Contact", "contactus.html", 48, "", new Array(
          new Array("Customer Info Update", "update.html", "", "", null),
          new Array("Contact Us", "contactus.html", "", "", null),
          new Array("Information Request", "informationrequest.html", "", "", null),
          new Array("Employment", "employment.html", "", "", null))),
      new Array("Site Map", "sitemap.php", 53, "", null)
      );

var mainMenuBase = 'main_menu_';
var subMenuBase = 'sub_menu_';
var subMenuLevelOneBase = 'sub_menu_level_1_';
var subMenuImageBase = 'sub_menu_img_';
var mainMenuTableWidth = 700;

var hideTimeOut = 250;
var hideTimeOutBig = 250;
var hideTimeOutSmall = 250;

var bNoExpand = false

var menuTimerID = null;
var subMenuTimerID = null;
var noExpandTimerID = null;
var curMenuIndex = -1;
var curSubMenuIndex = -1;

var menuitemslen=getMenuItemsLength(menuArray,indexMenuWidth)+2*menuArray.length;
var leftmargin = Math.floor((700-menuitemslen)/(menuArray.length+1));
var posforplusone=700-menuitemslen-leftmargin*(menuArray.length+1);
var rightmargin=getMenuEmptyTDWidth(menuArray,menuArray.length,posforplusone);

var websitename='http://www.idesco.com/'

function getfullhref(fname)
{
	return websitename+fname;
}

function CreateMenu(activemenu) {
	var activecolor='#F4DF9E';
	var commoncolor='#FFFFFF';
	var curcolor='';
  //var menuitemslen=getMenuItemsLength(menuArray,indexMenuWidth)+2*menuArray.length;
  //leftmargin=Math.floor((700-menuitemslen)/(2*menuArray.length)+2);
  //var emptytd=Math.floor((700-menuitemslen-leftmargin*(menuArray.length))/(menuArray.length));
  //var posforplusone=700-menuitemslen-leftmargin*(menuArray.length)-emptytd*menuArray.length;
	var str = '<table border=0" cellpadding="0" cellspacing="0" width="' + mainMenuTableWidth  + '"><tr>';
	for(i = 0; i < menuArray.length; i++) {
		var widthPix = 0;
		//if (menuArray[i][indexMenuWidth] == "" || menuArray[i][indexMenuWidth] == null)
		//	widthPix = Math.floor(mainMenuTableWidth/menuArray.length);
		//else
	  widthPix = menuArray[i][indexMenuWidth]+2;
		widthStr = ' width="' + widthPix.toString() + '" ';
		if (i==activemenu)
			curcolor=activecolor;
		else
			curcolor=commoncolor;
      var td1width=Math.floor(getMenuEmptyTDWidth(menuArray,i,posforplusone)/2);
      var td2width=getMenuEmptyTDWidth(menuArray,i,posforplusone)-td1width;
      str+='<td height="25" width="'+td1width.toString()+'">&nbsp;</td>';
      str+='<td height="25" width="'+td2width.toString()+'">';
      //str+='<td height="25" align="center" width="'+getMenuEmptyTDWidth(menuArray,i,posforplusone).toString()+'">'
	  	str += '<div '  + 'id="' + mainMenuBase + i.toString() + '" '
		  	+ 'style="position: absolute" width="1" height = "1">'
			  + '</div>';
      str+='</td>';
		str += '<td height="17" align="center"' + widthStr + ' bgcolor="#000000" style="font-size:9pt;font-family:Tahoma,Helvetica,Verdana;font-weight:bolder">';
		str += '<a target="_top" href="' + websitename+menuArray[i][indexMenuHREF] + '" '+'class="mainmenuitem"'+' style="color:'+curcolor+'" '
			+ 'onmouseover="this.style.color=\''+curcolor+'\';ShowMenu(' + i.toString() + ')"'
			+ ' onmouseout=' + '"this.style.color=\''+curcolor+'\';MenuMouseOut(); ">' 
			+ menuArray[i][indexMenuCaption] + '</a>';
		str += '</td>'
    //if (i<=menuArray.length-posforplusone)
    //{
      ////str+='<td height="17" width="'+emptytd.toString()+'"></td>'
      //str+='<td height="17" width="'+leftmargin.toString()+'"></td>'
      //rightmargin=leftmargin;
    //}
    //else
    //{
      ////var ws=emptytd+1;
      //var ws=leftmargin+1;
      //str+='<td height="17" width="'+ws.toString()+'"></td>'
      //rightmargin=ws;
    //}
	}
  str+='<td height="17" width="'+rightmargin.toString()+'"></td>'
	str += '</tr>'
	str += '</table>';
	str += '<div id="submenu_div_id" style="position: absolute" width="1" height="1"></div>';
	document.write(str);
}

function getMenuEmptyTDWidth(ar,ind,posforplus)
{
  if (ind>ar.length-posforplus)
    return leftmargin;
  else
    return leftmargin+1;
}

function CreateSubMenu(index)
{
	document.write('<div  ' +  'style="left: 50; position: absolute" ' + 'id = ' + '"' + subMenuBase + index + '"');
	document.write(' OnMouseOut=' + '"MenuMouseOut();"');
	document.write(' OnMouseOver=' + '"ClearMenuTimer()">');
	document.write('<table bgcolor="#00AEEF" border="0" cellspacing=0 cellpadding=0');
	document.write(' OnMouseOver=' + '"ClearMenuTimer()">');
	var subMenuLength = (menuArray[index][indexMenuSub] == null)	? 0 : menuArray[index][indexMenuSub].length;
  var padd=Math.ceil(leftmargin/2);
	//document.write('<tr class="submenuitem"><td height="3"></td></tr>');
	for(i = 0; i < subMenuLength; i++) {
		var bHasSubmenu = (menuArray[index][indexMenuSub][i][indexMenuSub] == null) ? false : true;
 		document.write('<tr style="cursor:pointer;cursor:hand;" >');
    //alert(Math.floor(leftmargin/2))
		//if (i == 0 || i == subMenuLength-1)
		if (i == 0)
		{
  		document.write('<td height="20" width="'+ menuArray[index][indexMenuSubWidth] + '" align="left" nowrap style="padding-left:'+padd+';padding-right:'+padd+';padding-top:4" ');
		}
	  else
			if (i == subMenuLength-1)
   		  document.write('<td height="20" width="'+ menuArray[index][indexMenuSubWidth] + '" align="left" nowrap style="padding-left:'+padd+';padding-right:'+padd+';padding-bottom:5" ');
			else
			  document.write('<td height="16" width="'+ menuArray[index][indexMenuSubWidth] + '" align="left" nowrap style="padding-left:'+padd+';padding-right:'+padd+'" ');
		document.write(' OnMouseOver=' + '"this.style.background=' + "'#0098D1'" + '"');
		document.write(' OnMouseOut=' + '"this.style.background=' + "'#00AEEF'" + '"');
		document.write('onclick="window.top.location.href=\'' + websitename+menuArray[index][indexMenuSub][i][indexMenuHREF].toString()+'\'">');
		document.write('<span class=submenuitem ' + ' style="text-decoration:none"');
		document.write('>' + menuArray[index][indexMenuSub][i][indexMenuCaption] +'</span>');
	}
	//document.write('<tr class="submenuitem"><td height="9"></td></tr>');
	document.write('</table></div>\n');
	if (bUseLayers) {
		document.layers[subMenuBase+index].visibility='hide';
	}
	else if (bUseAll) {
		document.all[subMenuBase+index].style.visibility='hidden';
	}
	else if (bUseGetElement) {
		document.getElementById(subMenuBase+index).style.visibility='hidden';
	}

}

function ClearMenuTimer()
{
	if(menuTimerID) 
	{
		window.clearTimeout(menuTimerID);
		menuTimerID=null;
	}
	ClearSubMenuTimer();
}

function ClearSubMenuTimer()
{
	if(menuTimerID) 
	{
		window.clearTimeout(subMenuTimerID);
		subMenuTimerID=null;
	}
}

function ClearVMenuTimer()
{
	if(menuTimerID) 
	{
		window.clearTimeout(menuTimerID);
		menuTimerID=null;
	}
	ClearSubMenuTimer();
}

function ClearVSubMenuTimer()
{
	if(menuTimerID) 
	{
		window.clearTimeout(subMenuTimerID);
		subMenuTimerID=null;
	}
}


function MenuMouseOut() 
{
	if(!menuTimerID) 
	{
		ClearMenuTimer();
		menuTimerID = window.setTimeout("HideCurrentMenu()", hideTimeOut, "JavaScript")
	}
}

function SubMenuMouseOut() 
{
	if(!menuTimerID) 
	{
		ClearMenuTimer();
		menuTimerID = window.setTimeout("HideCurrentSubMenu()", hideTimeOut, "JavaScript")
	}
}

function ShowMenu(index) 
{
	ClearSubMenuTimer();
	if(index == curMenuIndex) return;
	HideCurrentMenu();
	var x,y;
	if (bUseLayers){
		x = document.layers[mainMenuBase + index].offsetLeft;
		y = document.layers['submenu_div_id'].offsetTop;
	}
	else if (bUseAll)	{
		x = document.all[mainMenuBase + index].offsetLeft;
		y = document.all['submenu_div_id'].offsetTop;
	}
	else //bUseGetElement
	{
		x = document.getElementById(mainMenuBase + index).offsetLeft;
		y = document.getElementById('submenu_div_id').offsetTop;
	}
	if (bUseLayers) {
		document.layers[subMenuBase+index].top=y;
		document.layers[subMenuBase+index].left=x;
		document.layers[subMenuBase+index].visibility="show";
  }
	else if (bUseAll){
		document.all[subMenuBase+index].style.top=y;
		document.all[subMenuBase+index].style.left=x;
		document.all[subMenuBase+index].style.visibility="visible";
		}
	else if (bUseGetElement){
		document.getElementById(subMenuBase+index).style.top=y;
		document.getElementById(subMenuBase+index).style.left=x;
		document.getElementById(subMenuBase+index).style.visibility="visible";
	}
	var bHasSubmenu = (menuArray[index][indexMenuSub] == null) ? false : (menuArray[index][indexMenuSub][0][indexMenuSub] == null) ? false : true;
	if (bHasSubmenu)
		ShowSubMenu(0);
	curMenuIndex = index;
}

function ShowSubMenu(index) 
{
	ClearMenuTimer();
	//|| bNoExpand
	if(index == curSubMenuIndex) return;
	curSubMenuIndexTmp = curSubMenuIndex;
	HideCurrentSubMenu();
	var x,y;
	/*
	if (bUseLayers){
		x = document.layers[mainMenuBase + index].offsetLeft;
		y = document.layers['submenu_div_id'].offsetTop;
	}
	else if (bUseAll)	{
		x = document.all[mainMenuBase + index].offsetLeft;
		y = document.all['submenu_div_id'].offsetTop;
	}
	else //bUseGetElement
	{
		
		x = document.getElementById(mainMenuBase + index).offsetLeft;
		y = document.getElementById('submenu_div_id').offsetTop;
	}*/
	if (bUseLayers) {
		//document.layers[subMenuBase+index].top=y;
		//document.layers[subMenuBase+index].left=x;
		document.layers[subMenuLevelOneBase+index].visibility="show";
		document.all[subMenuLevelOneBase+index].display="";
  }
	else if (bUseAll){
		//document.all[subMenuBase+index].style.top=y;
		//document.all[subMenuBase+index].style.left=x;
		document.all[subMenuLevelOneBase+index].style.display="";
		document.all[subMenuLevelOneBase+index].style.visibility="visible";
		if (index!=-1)
		document.all[subMenuImageBase+index].src='images/menu_arrow_up.gif';
		if (curSubMenuIndexTmp!=-1)
			document.all[subMenuImageBase+curSubMenuIndexTmp].src='images/menu_arrow_down.gif';
		}
	else if (bUseGetElement){
		//document.getElementById(subMenuBase+index).style.top=y;
		//document.getElementById(subMenuBase+index).style.left=x;
		document.getElementById(subMenuLevelOneBase+index).style.visibility="visible";
		document.getElementById(subMenuLevelOneBase+index).style.display='';
	}
	//if (curSubMenuIndexTmp == 0)
	//{
	//	bNoExpand = true;
	//	noExpandTimerID = window.setTimeout("bNoExpand = false;", 1000, "JavaScript");
	//}
	curSubMenuIndex = index;
}


function HideCurrentMenu() 
{
	HideCurrentSubMenu();
	if(curMenuIndex != -1) 
	{
		if(bUseLayers) document.layers[subMenuBase+curMenuIndex].visibility="hide";
        else if(bUseAll) document.all[subMenuBase+curMenuIndex].style.visibility="hidden";
					else if (bUseGetElement)
						document.getElementById(subMenuBase+curMenuIndex).style.visibility="hidden"
		curMenuIndex = - 1;
		if(menuTimerID)
		{
			window.clearTimeout(menuTimerID);
			menuTimerID = null;
		}
	}
}

function HideCurrentSubMenu() 
{
	if(curSubMenuIndex != -1) 
	{
		if(bUseLayers) document.layers[subMenuLevelOneBase+curSubMenuIndex].display='none';
        else if(bUseAll){
				document.all[subMenuLevelOneBase+curSubMenuIndex].style.display='none';
				document.all[subMenuImageBase+curSubMenuIndex].src='images/menu_arrow_down.gif';
				}
					else if (bUseGetElement)
						document.getElementById(subMenuLevelOneBase+curSubMenuIndex).style.display='none';
		
						
		curSubMenuIndex = - 1;
		if(subMenuTimerID)
		{
			window.clearTimeout(subMenuTimerID);
			subMenuTimerID = null;
		}
	}
}

//////// real functions ////////////////

//////////////////////////////////
function drawTopMenu(activepos)
{
  document.write('<table width="100%" class="globalmenu" height="15" border=0 cellpadding="0" cellspacing="0"><tr>');
  var menuclass0='globalmenu',
      menuclass1='globalmenu',
      menuclass2='globalmenu';
  if (activepos==0)
    menuclass0='globalmenuactive';
  if (activepos==1)
    menuclass1='globalmenuactive';
  if (activepos==2)
    menuclass2='globalmenuactive';
  document.write('<td width="140" align="right" valign="top"><a target="_top" href="http://idesco.thomasnet.com/category/all-categories" class="'+menuclass0+'">IDESCO Online Store</a></td>');
  document.write('<td width="8" align="left" valign="top" >&nbsp;</td>');
  document.write('<td width="90" align="right" valign="top"><a target="_top" href="'+websitename+'sp_safetyproducts.html" class="'+menuclass1+'">Safety Products</a></td>');
  document.write('<td width="10" align="left" valign="top" >&nbsp;</td>');
//  document.write('<td width="91" align="left" valign="top"><a target="_top" href="'+websitename+'idb_photoidbadging.html" class="'+menuclass2+'">Digital ID Badging</a></td>');
//  document.write('<td width="16" align="left" valign="top">&nbsp;</td>');
  document.write('</tr></table>')
}
/////////////////////////////////
function mainSite_drawLeftMenu(curIndex,curSubIndex,newProductVAlign)
{
	if (curIndex==null)
		return;
	document.write('<table border=0 width="100%" cellpadding="0" cellspacing="0">');
	if (menuArray[curIndex][indexMenuSub]!=null)
	{
		for (var i=0;i<menuArray[curIndex][indexMenuSub].length;i++)
  	{
  	  var styleStr;
      styleStr = (i==0) ? 'padding-top:17;' : 'padding-top:3;';
  		if (i==curSubIndex)
			{
				document.write('<tr><td style="cursor:hand;cursor:pointer">');
				document.write('<div onclick="window.location.href=\''+websitename+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'\'" style="background-image:url(images/leftmenuselection.gif)">');
				document.write('<table border=0 width="100%" height="100%" cellpadding="0" cellspacing="0"><tr>');
				document.write('<td style="padding-left:'+leftmargin.toString()+';'+styleStr+'padding-bottom:3px;padding-right:5px"><a class="leftpanelsubtitleselected" href="'+websitename+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'">'+menuArray[curIndex][indexMenuSub][i][indexMenuCaption]+'</a></td>');
				document.write('</tr></table>');
				document.write('</div>');
				document.write('</td></tr>');
			}
  		else
			{
				document.write('<tr><td style="cursor:hand;cursor:pointer">');
				document.write('<div onclick="window.location.href=\''+websitename+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'\'" onmouseout="this.style.backgroundImage=\'\';" onmouseover="this.style.backgroundImage=\'url(images/leftmenuselection.gif)\';">');
				document.write('<table border=0 width="100%" height="100%" cellpadding="0" cellspacing="0"><tr>');
				document.write('<td style="padding-left:'+leftmargin.toString()+';'+styleStr+'padding-bottom:3px;padding-right:5px"><a class="leftpanelsubtitlegray" href="'+websitename+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'">'+menuArray[curIndex][indexMenuSub][i][indexMenuCaption]+'</a></td>');
				document.write('</tr></table>');
				document.write('</div>');
				document.write('</td></tr>');
			}
  	}
  }
  else
    document.write('<tr><td style="font-size:7">&nbsp;</td></tr>');

  document.write('<tr><td style="font-size:5">&nbsp;</td></tr>');
  if (newProductVAlign=='bottom')
    document.write('<tr class="leftpanelplaintext"><td height="100%"></td></tr>');
  if (newProductVAlign=='bottom' || newProductVAlign=='top')
  {
    document.write('<tr><td align="left" width="100%">');
    drawNewProduct(leftmargin, null);
    document.write('</td></tr>');
  }
  if (newProductVAlign!='bottom')
    document.write('<tr class="leftpanelplaintext"><td height="100%"></td></tr>');
  document.write('</table>');
}// function drawLeftMenu_main(curIndex,curSubIndex)
function mainSite_drawLeftMenu_GSA(curIndex,curSubIndex)
{
  newProductVAlign='bottom';
	if (curIndex==null)
		return;
	document.write('<table border=0 width="100%" height="100%" cellpadding="0" cellspacing="0">');
	if (menuArray[curIndex][indexMenuSub]!=null)
	{
		for (var i=0;i<menuArray[curIndex][indexMenuSub].length;i++)
  	{
  	  var styleStr;
      styleStr = (i==0) ? 'padding-top:17;' : 'padding-top:3;';
  		if (i==curSubIndex)
			{
				document.write('<tr><td style="cursor:hand;cursor:pointer">');
				document.write('<div onclick="window.location.href=\''+websitename+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'\'" style="background-image:url(images/leftmenuselection.gif)">');
				document.write('<table border=0 width="100%" height="100%" cellpadding="0" cellspacing="0"><tr>');
				document.write('<td style="padding-left:'+leftmargin.toString()+';'+styleStr+'padding-bottom:3px;padding-right:5px"><a class="leftpanelsubtitleselected" href="'+websitename+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'">'+menuArray[curIndex][indexMenuSub][i][indexMenuCaption]+'</a></td>');
				document.write('</tr></table>');
				document.write('</div>');
				document.write('</td></tr>');
			}
  		else
			{
				document.write('<tr><td style="cursor:hand;cursor:pointer">');
				document.write('<div onclick="window.location.href=\''+websitename+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'\'" onmouseout="this.style.backgroundImage=\'\';" onmouseover="this.style.backgroundImage=\'url(images/leftmenuselection.gif)\';">');
				document.write('<table border=0 width="100%" height="100%" cellpadding="0" cellspacing="0"><tr>');
				document.write('<td style="padding-left:'+leftmargin.toString()+';'+styleStr+'padding-bottom:3px;padding-right:5px"><a class="leftpanelsubtitlegray" href="'+websitename+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'">'+menuArray[curIndex][indexMenuSub][i][indexMenuCaption]+'</a></td>');
				document.write('</tr></table>');
				document.write('</div>');
				document.write('</td></tr>');
			}
  	}
  }
  else
    document.write('<tr><td style="font-size:7">&nbsp;</td></tr>');

  document.write('<tr><td style="font-size:5">&nbsp;</td></tr>');
  if (newProductVAlign=='bottom')
    document.write('<tr class="leftpanelplaintext"><td height="100%"></td></tr>');
  if (newProductVAlign=='bottom' || newProductVAlign=='top')
  {
    //difference
    document.write('<tr><td align="center" width="100%">');
    document.write('<img src="images/gsalogo.gif" border=0>');
    document.write('</td></tr>');
    //difference
  }
  if (newProductVAlign!='bottom')
    document.write('<tr class="leftpanelplaintext"><td height="100%"></td></tr>');
  document.write('</table>');
}// function drawLeftMenu_main(curIndex,curSubIndex)


/////////////////////////////////
function drawBottomMenu(curIndex,enableTopRef)
{
	document.write('<table border=0 bgcolor="#0066B3" width="100%" height="100%" cellpadding="0" cellspacing="0" >')
  document.write('<tr>')
  document.write('<td width="150" height="14" bgcolor="#FFFFFF"></td>');
  document.write('<td width="450" height="14" bgcolor="#F6F6F6"></td>');
  document.write('<td rowspan=2 width="100" bgcolor="#F6F6F6" qbgcolor="#0066b3"><img src="'+websitename+'images/toparrow_ttmpl.gif" style="cursor:hand;cursor:pointer;" onclick="window.top.location.href=\'#top\'");" alt="Top of the page"><td>');
  document.write('</tr>')
  document.write('<tr>')
  document.write('<td width="150" bgcolor="004182">');
  document.write('<table border=0 width="100%" height="100%" cellpadding="0" cellspacing="0"><tr><td width="39"></td><td width="16" align="center"><a class="bottommenutext" href="javascript:history.back();">Back</a></td><td width="40"></td><td width="16" align="right"><a class="bottommenutext" target="_top" href="'+websitename+'index.html">Home</a></td><td width="39"></td></tr></table>');
	document.write('</td>');
  document.write('<td width="450">');
	//document.write('<td width=10></td>');
 	document.write('<table border=0 width="100%" height="17" cellpadding="2" cellspacing="0"><tr>')
	for (var i=1;i<menuArray.length;i++)
	{
	  var classStr;
		if (i==curIndex)
		  classStr='bottommenutextselected';
		else
			classStr='bottommenutext';
    document.write('<td align="center"><a target="_top" class="'+classStr+'" href="'+websitename+menuArray[i][indexMenuHREF]+'">'+menuArray[i][indexMenuCaption]+'</a></td>');
	}
  document.write('</tr>');
  document.write('</table>');
//  if (enableTopRef)
//    document.write('<td width=100></td>');
//  else
//    document.write('<td width=100></td>');
	//document.write('<td width=10></td>');
	document.write('</td></tr></table>');
}
/////////////////////////////////
function drawBottomMenu_ttmpl(curIndex,enableTopRef)
{
	document.write('<table border=0 bgcolor="#0066B3" width="100%" height="100%" cellpadding="0" cellspacing="0" >')
  document.write('<tr>')
  document.write('<td width="150" height="14" bgcolor="#FFFFFF"></td>');
  document.write('<td width="450" height="14" bgcolor="#FFFFFF"></td>');
  document.write('<td rowspan=2 width="100" bgcolor="#FFFFFF"><img src="'+websitename+'images/toparrow.gif" style="cursor:hand;cursor:pointer;" onclick="window.location.href=\'#top\'");" alt="Top of the page"><td>');
  document.write('</tr>')
  document.write('<tr>')
  document.write('<td width="150" bgcolor="004182">');
  document.write('<table border=0 width="100%" height="100%" cellpadding="0" cellspacing="0"><tr><td width="39"></td><td width="16" align="center"><a class="bottommenutext" href="javascript:history.back();">Back</a></td><td width="40"></td><td width="16" align="right"><a class="bottommenutext" href="'+websitename+'index.html">Home</a></td><td width="39"></td></tr></table>');
	document.write('</td>');
  document.write('<td width="450">');
	//document.write('<td width=10></td>');
 	document.write('<table border=0 width="100%" height="17" cellpadding="2" cellspacing="0"><tr>')
	for (var i=1;i<menuArray.length;i++)
	{
	  var classStr;
		if (i==curIndex)
		  classStr='bottommenutextselected';
		else
			classStr='bottommenutext';
    document.write('<td align="center"><a class="'+classStr+'" href="'+websitename+menuArray[i][indexMenuHREF]+'">'+menuArray[i][indexMenuCaption]+'</a></td>');
	}
  document.write('</tr>');
  document.write('</table>');
//  if (enableTopRef)
//    document.write('<td width=100></td>');
//  else
//    document.write('<td width=100></td>');
	//document.write('<td width=10></td>');
	document.write('</td></tr></table>');
}
/////////////////////////////////
function CreateVMenuVendorProducts(arItems,curIndex,curSubIndex)
{
  //if (curIndex==null)
	//  return;
  var curIndexStr = (curIndex==null) ? '' : curIndex.toString();
  document.write('<table border=0 width="100%" height="100%" cellpadding="0" cellspacing="0">');
 	for (var i=0;i<arItems.length;i++)
 	{
 	  var styleStr = (i==0) ? ' style="padding-top:17px;padding-bottom:3px;"' : 'style="padding-top:3px;padding-bottom:3px;" ';

  	if (i==curIndex && curSubIndex==null)
		{
      classStr='leftpanelsubtitleselected';
      if (i==0)
      {
        document.write('<tr id="lmtr_0_0" style="background:url(images/leftmenuselection.gif);cursor:arrow;cursor:hand;"><td '+styleStr+' width="'+leftmargin.toString()+'" align="center" valign="middle"><img src="images/minusmark.gif"></td><td '+styleStr+' width="'+(150-leftmargin-5).toString()+'" id="'+ 'lmtd_0_0" class="leftpanelsubtitleselected" height="17" valign="middle" onclick="window.location.href=\''+arItems[i][indexProd_ItemHREF]+'\'">'+arItems[i][indexProd_ItemDisplay]+'</td></tr>');
        var el=document.getElementById('leftmenutop');
        if (el!=null)
        {
          el.background='images/leftmenuselection.gif';
        }
      }
      else
        document.write('<tr style="background:url(images/leftmenuselection.gif);cursor:arrow;cursor:hand;"><td '+styleStr+' width="'+leftmargin.toString()+'" align="center" valign="middle"><img src="images/minusmark.gif"></td><td '+styleStr+' class="leftpanelsubtitleselected" height="17" valign="middle" onclick="window.location.href=\''+websitename+arItems[i][indexMenuHREF]+'\'">'+arItems[i][indexProd_ItemDisplay]+'</td></tr>');
		}
  	else
		{
      classStr='leftpanelsubtitlegray';
			var iconpath_normal = (i==curIndex) ? 'images/minusmark.gif' : 'images/plusmark.gif';
			//var iconpath_selected = (i==curIndex) ? 'images/minusmark_selected.gif' : 'images/plusmark_selected.gif';
      //var iconpath_selected = (i==curIndex) ? 'images/minusmark.gif' : 'images/plusmark.gif';
	    if (i==0)
      {
        //var str1 = 'el=getElementById(\'leftmenutop\');if (el!=null) el.background=\'images/leftmenuselection.gif\';'
        //var str2 = 'el=getElementById(\'leftmenutop\');if (el!=null) el.background=\'\'';
        //document.write('<tr><td id="'+ 'lmtd_'+curIndex +'_0" class="'+classStr+'" onmouseover="this.background=\'images/leftmenuselection.gif\';'+str1+'" onmouseout="this.background=\'\';'+str2+'" height="17" valign="middle" onclick="window.location.href=\''+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'\'">'+menuArray[curIndex][indexMenuSub][i][indexMenuCaption]+'</td></tr>');
        document.write('<tr id="lmtr_0_0" style="cursor:arrow;cursor:hand;" onmouseover="this.style.backgroundImage=\'url(images/leftmenuselection.gif)\';e2=getElementById(\'lpimg_'+i+'\');if (e2!=null) e2.src=\''+iconpath_normal+'\';" onmouseout="this.style.background=\'\';e2=getElementById(\'lpimg_'+i.toString()+'\');if (e2!=null) e2.src=\''+iconpath_normal+'\';"><td '+styleStr+' width="'+leftmargin.toString()+'" align="center"><img id="lpimg_'+i.toString()+'" src="'+iconpath_normal+'"></td><td '+styleStr+' id="'+ 'lmtd_0_0" class="leftpanelsubtitlegray" height="17" valign="middle" onclick="window.location.href=\''+arItems[i][indexProd_ItemHREF]+'\'">'+arItems[i][indexProd_ItemDisplay]+'</td></tr>');
      }
      else
        document.write('<tr style="cursor:arrow;cursor:hand;" onmouseover="this.style.backgroundImage=\'url(images/leftmenuselection.gif)\';e2=getElementById(\'lpimg_'+i+'\');if (e2!=null) e2.src=\''+iconpath_normal+'\';" onmouseout="this.style.background=\'\';e2=getElementById(\'lpimg_'+i+'\');if (e2!=null) e2.src=\''+iconpath_normal+'\';" ><td '+styleStr+' width="'+leftmargin.toString()+'" align="center"><img  id="lpimg_'+i+'" src="'+iconpath_normal+'"></td><td '+styleStr+' class="leftpanelsubtitlegray" height="17" onclick="window.location.href=\''+arItems[i][indexProd_ItemHREF]+'\'">'+arItems[i][indexProd_ItemDisplay]+'</td></tr>');
    }
    if ((i==curIndex) && (arItems[i][indexProd_SubItems] != null) )
    {
      arSubitems=arItems[i][indexProd_SubItems];
      for (j=0;j<arSubitems.length;j++)
      {
			  if (arSubitems[j][indexProd_ItemHREF]==null)
					continue;
        if (j==curSubIndex) //(i==curIndex && j=curSubIndex)
          document.write('<tr style="background-image:url(images/leftmenuselection.gif);cursor:arrow;cursor:hand;" ><td width="'+leftmargin.toString()+'" align="center"></td><td class="leftpanelsubtitleselected" height="17" valign="middle" onclick="window.location.href=\''+websitename+arSubitems[j][indexMenuHREF]+'\'" style="font-weight:normal">'+arSubitems[j][indexProd_ItemDisplay]+'</td></tr>');
        else
          document.write('<tr style="cursor:arrow;cursor:hand;" onmouseover="this.style.backgroundImage=\'url(images/leftmenuselection.gif)\'" onmouseout="this.style.backgroundImage=\'\'"><td width="'+leftmargin.toString()+'" align="center"></td><td class="leftpanelsubtitlegray" height="17" valign="middle" onclick="window.location.href=\''+arSubitems[j][indexProd_ItemHREF]+'\'" style="font-weight:normal">'+arSubitems[j][indexProd_ItemDisplay]+'</td></tr>');        
      }
    }
  }
  document.write('<tr class="leftpanelplaintext"><td height="100%"></td></tr>');
  document.write('</table>');
}

function CreateVMenuVendorProducts_L1(menuProd,subMenuProd,menuVendor)
{
  if (arProd_PhotoIDBadging[menuProd][indexProd_SubItems]!=null)
  {
    CreateVMenuVendorProducts(arProd_PhotoIDBadging[menuProd][indexProd_SubItems],subMenuProd,menuVendor);
  }
}

function CreateVMenuVendorProducts3rdLevel(arItems,curIndex,curSubIndex,curModel)
{
  //if (curIndex==null)
	//  return;
  var curIndexStr = (curIndex==null) ? '' : curIndex.toString();
  document.write('<table border=0 width="100%" height="100%" cellpadding="0" cellspacing="0">');
 	for (var i=0;i<arItems.length;i++)
 	{
 	  var styleStr = (i==0) ? ' style="padding-top:17px;padding-bottom:3px;"' : 'style="padding-top:3px;padding-bottom:3px;" ';

  	if (i==curIndex && curSubIndex==null)
		{
      classStr='leftpanelsubtitleselected';
      if (i==0)
      {
        document.write('<tr id="lmtr_0_0" style="background:url(images/leftmenuselection.gif);cursor:arrow;cursor:hand;"><td '+styleStr+' width="'+leftmargin.toString()+'" align="center" valign="middle"><img src="images/minusmark.gif"></td><td '+styleStr+' width="'+(150-leftmargin-5).toString()+'" id="'+ 'lmtd_0_0" class="leftpanelsubtitleselected" height="17" valign="middle" onclick="window.location.href=\''+arItems[i][indexProd_ItemHREF]+'\'">'+arItems[i][indexProd_ItemDisplay]+'</td></tr>');
        var el=document.getElementById('leftmenutop');
        if (el!=null)
        {
          el.background='images/leftmenuselection.gif';
        }
      }
      else
        document.write('<tr style="background:url(images/leftmenuselection.gif);cursor:arrow;cursor:hand;"><td '+styleStr+' width="'+leftmargin.toString()+'" align="center" valign="middle"><img src="images/minusmark.gif"></td><td '+styleStr+' class="leftpanelsubtitleselected" height="17" valign="middle" onclick="window.location.href=\''+websitename+arItems[i][indexMenuHREF]+'\'">'+arItems[i][indexProd_ItemDisplay]+'</td></tr>');
		}
  	else
		{
      classStr='leftpanelsubtitlegray';
			var iconpath_normal = (i==curIndex) ? 'images/minusmark.gif' : 'images/plusmark.gif';
			//var iconpath_selected = (i==curIndex) ? 'images/minusmark_selected.gif' : 'images/plusmark_selected.gif';
      //var iconpath_selected = (i==curIndex) ? 'images/minusmark.gif' : 'images/plusmark.gif';
	    if (i==0)
      {
        //var str1 = 'el=getElementById(\'leftmenutop\');if (el!=null) el.background=\'images/leftmenuselection.gif\';'
        //var str2 = 'el=getElementById(\'leftmenutop\');if (el!=null) el.background=\'\'';
        //document.write('<tr><td id="'+ 'lmtd_'+curIndex +'_0" class="'+classStr+'" onmouseover="this.background=\'images/leftmenuselection.gif\';'+str1+'" onmouseout="this.background=\'\';'+str2+'" height="17" valign="middle" onclick="window.location.href=\''+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'\'">'+menuArray[curIndex][indexMenuSub][i][indexMenuCaption]+'</td></tr>');
        document.write('<tr id="lmtr_0_0" style="cursor:arrow;cursor:hand;" onmouseover="this.style.backgroundImage=\'url(images/leftmenuselection.gif)\';e2=getElementById(\'lpimg_'+i+'\');if (e2!=null) e2.src=\''+iconpath_normal+'\';" onmouseout="this.style.background=\'\';e2=getElementById(\'lpimg_'+i.toString()+'\');if (e2!=null) e2.src=\''+iconpath_normal+'\';"><td '+styleStr+' width="'+leftmargin.toString()+'" align="center"><img id="lpimg_'+i.toString()+'" src="'+iconpath_normal+'"></td><td '+styleStr+' id="'+ 'lmtd_0_0" class="leftpanelsubtitlegray" height="17" valign="middle" onclick="window.location.href=\''+arItems[i][indexProd_ItemHREF]+'\'">'+arItems[i][indexProd_ItemDisplay]+'</td></tr>');
      }
      else
        document.write('<tr style="cursor:arrow;cursor:hand;" onmouseover="this.style.backgroundImage=\'url(images/leftmenuselection.gif)\';e2=getElementById(\'lpimg_'+i+'\');if (e2!=null) e2.src=\''+iconpath_normal+'\';" onmouseout="this.style.background=\'\';e2=getElementById(\'lpimg_'+i+'\');if (e2!=null) e2.src=\''+iconpath_normal+'\';" ><td '+styleStr+' width="'+leftmargin.toString()+'" align="center"><img  id="lpimg_'+i+'" src="'+iconpath_normal+'"></td><td '+styleStr+' class="leftpanelsubtitlegray" height="17" onclick="window.location.href=\''+arItems[i][indexProd_ItemHREF]+'\'">'+arItems[i][indexProd_ItemDisplay]+'</td></tr>');
    }
    if ((i==curIndex) && (arItems[i][indexProd_SubItems] != null) )
    {
      arSubitems=arItems[i][indexProd_SubItems];
      for (j=0;j<arSubitems.length;j++)
      {
			  if (arSubitems[j][indexProd_ItemHREF]==null)
					continue;
        if (j==curSubIndex) //(i==curIndex && j=curSubIndex)
          document.write('<tr style="background-image:url(images/leftmenuselection.gif);cursor:arrow;cursor:hand;" ><td width="'+leftmargin.toString()+'" align="center"></td><td class="leftpanelsubtitleselected" height="17" valign="middle" onclick="window.location.href=\''+websitename+arSubitems[j][indexMenuHREF]+'\'" style="font-weight:normal">'+arSubitems[j][indexProd_ItemDisplay]+'</td></tr>');
        else
          document.write('<tr style="cursor:arrow;cursor:hand;" onmouseover="this.style.backgroundImage=\'url(images/leftmenuselection.gif)\'" onmouseout="this.style.backgroundImage=\'\'"><td width="'+leftmargin.toString()+'" align="center"></td><td class="leftpanelsubtitlegray" height="17" valign="middle" onclick="window.location.href=\''+arSubitems[j][indexProd_ItemHREF]+'\'" style="font-weight:normal">'+arSubitems[j][indexProd_ItemDisplay]+'</td></tr>');
        //3rd level
        if ((j==curSubIndex) && (arSubitems[j][indexProd_SubItems] != null) )
        {
          var arSubitemsL3=arSubitems[j][indexProd_SubItems];
          for (k=0;k<arSubitemsL3.length;k++)
          {
    			  if (arSubitemsL3[k][indexProd_ItemHREF]==null)
    					continue;
            if (k==curModel) //(i==curIndex && j=curSubIndex)
              document.write('<tr style="background-image:url(images/leftmenuselection.gif);cursor:arrow;cursor:hand;" ><td width="'+leftmargin.toString()+'" align="center"></td><td class="leftpanelsubtitleselected" height="17" valign="middle" onclick="window.location.href=\''+websitename+arSubitemsL3[k][indexMenuHREF]+'\'" style="font-weight:normal;padding-left:8;">'+arSubitemsL3[k][indexProd_ItemDisplay]+'</td></tr>');
            else
              document.write('<tr style="cursor:arrow;cursor:hand;" onmouseover="this.style.backgroundImage=\'url(images/leftmenuselection.gif)\'" onmouseout="this.style.backgroundImage=\'\'"><td width="'+leftmargin.toString()+'" align="center"></td><td class="leftpanelsubtitlegray" height="17" valign="middle" onclick="window.location.href=\''+arSubitemsL3[k][indexProd_ItemHREF]+'\'" style="font-weight:normal;padding-left:8;">'+arSubitemsL3[k][indexProd_ItemDisplay]+'</td></tr>');
          }
        }
        //--3rd level
      }
    }
  }
  document.write('<tr class="leftpanelplaintext"><td height="100%"></td></tr>');
  document.write('</table>');
}


//////// end of real functions ////////////////













//!!!!!!!!!!!!!!!!!!!!!!
function main(){
	var msie = (navigator.userAgent && ( parseFloat( navigator.appVersion )  >=4 ) 	&& ( navigator.userAgent.indexOf("Opera") < 0 ) && ( navigator.userAgent.indexOf("MSIE 4") < 0 ) && ( navigator.userAgent.indexOf( "MSIE" ) >=0) );
	var win = (navigator.userAgent && ((navigator.userAgent.indexOf( "Windows 95" ) >=0) || (navigator.userAgent.indexOf("Windows NT") >=0 ) || (navigator.userAgent.indexOf("Windows 98") >=0) ) );
	var mac = (navigator.platform && (navigator.platform.indexOf('Mac')!=-1));
	haveFlash = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if( haveFlash ){
		haveFlash = (parseInt(haveFlash.description.substring(haveFlash.description.indexOf(".")-1))>=5);
	}else if ( msie && win ){
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
		document.write(' on error resume next \n');
		document.write(' haveFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
		document.write('</SCR' + 'IPT\> \n');
	}

	if ( haveFlash && msie && win && !mac){
		document.write( '<div id="adwatch_banner" style="width:' + adw_w + ';height:' + adw_h + '"> </div>' );
		adimg.onload = adimg_onload;
		adimg.src = "http://" + server + "/3/" + section + "/" + wh + ".?0-0-" + seed;
	}else if( haveFlash ){
		writeSWF();
 		document.write( html );
	}else{
        	document.write( '<a href=http://' + server + '/1/' + section + '/' + wh + '.gif?' + 'timestamp=' + seed + ' target=_blank >'
			+ '<img src=http://' + server + '/0/' + section + '/' + wh + '.gif?0-0-' + seed + '0-&' + 'timestamp=' + seed
			+ ' width=' + adw_w + ' height=' + adw_h+  ' border=0></a>' );
	}
}

function drawMainMenu(indexMenu)
{
	for(count = 0; count < menuArray.length; count++) 
	{
		CreateSubMenu(count);
	}
	CreateMenu(indexMenu);
}

function drawProdMenuArrayItems(arItems,curIndex,curSubIndex,index3)
{
  var arit=arItems[curIndex][curSubIndex];
  if (arit!=null)
  {//leftmenutop
  	for (var i=0;i<arit.length;i++)
  	{
  	  var styleStr;
      styleStr = (i==0) ? ' style="padding-top:17;"' : 'style="padding-top:3;" ';
  	  var classStr;
  		if (i==curSubIndex)
			{
  		  classStr='leftpanelsubtitleselected';
        if (i==0)
        {
          document.write('<tr><td '+styleStr+' id="'+ 'lmtd_'+curIndex +'_0" class="'+classStr+'" background="images/leftmenuselection.gif" height="17" valign="middle" onclick="window.location.href=\''+websitename+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'\'">'+menuArray[curIndex][indexMenuSub][i][indexMenuCaption]+'</td></tr>');
          var el=document.getElementById('leftmenutop');
          if (el!=null)
          {
            el.background='images/leftmenuselection.gif';
          }
        }
        else
        document.write('<tr><td '+styleStr+' class="'+classStr+'" background="images/leftmenuselection.gif" height="17" valign="middle" onclick="window.location.href=\''+websitename+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'\'">'+menuArray[curIndex][indexMenuSub][i][indexMenuCaption]+'</td></tr>');
			}
  		else
			{
        styleStr = (i==0) ? ' style="padding-top:17;" ' : ' style="padding-top:3;" ';
  			classStr='leftpanelsubtitlegray';
        if (i==0)
        {
          var str1 = 'el=getElementById(\'leftmenutop\');if (el!=null) el.background=\'images/leftmenuselection.gif\''
          var str2 = 'el=getElementById(\'leftmenutop\');if (el!=null) el.background=\'\'';
          //document.write('<tr><td id="'+ 'lmtd_'+curIndex +'_0" class="'+classStr+'" onmouseover="this.background=\'images/leftmenuselection.gif\';'+str1+'" onmouseout="this.background=\'\';'+str2+'" height="17" valign="middle" onclick="window.location.href=\''+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'\'">'+menuArray[curIndex][indexMenuSub][i][indexMenuCaption]+'</td></tr>');
          document.write('<tr><td '+styleStr+' id="'+ 'lmtd_'+curIndex +'_0" class="'+classStr+'" onmouseover="this.background=\'images/leftmenuselection.gif\';'+str1+'" onmouseout="this.background=\'\';'+str2+'" height="17" valign="middle" onclick="window.location.href=\''+websitename+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'\'">'+menuArray[curIndex][indexMenuSub][i][indexMenuCaption]+'</td></tr>');
        }
        else
				  document.write('<tr><td '+styleStr+' class="'+classStr+'" onmouseover="this.background=\'images/leftmenuselection.gif\'" onmouseout="this.background=\'\'" height="17" valign="middle" onclick="window.location.href=\''+websitename+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'\'">'+menuArray[curIndex][indexMenuSub][i][indexMenuCaption]+'</td></tr>');
			}
      //document.write('<tr><td class="'+classStr+'" onmouseover="this.background=\'images/leftmenuselection.gif\'" onmouseout="this.background=\'\'" height="17" valign="middle" onclick="window.location.href=\''+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'\'">'+menuArray[curIndex][indexMenuSub][i][indexMenuCaption]+'</td></tr>');
      //document.write('<tr><td height="1" width="100%"></td></tr>');
  	}
	}
}


function showSelectedName(ind1,ind2)
{
  var el=window.document.getElementById('pageNameTD');
	if (el!=null)
	{
	  el.style.letterSpacing=1;
	  if (menuArray[ind1][indexMenuSub]!=null && ind2!=null)
  	{
	  	 el.innerText=menuArray[ind1][indexMenuSub][ind2][indexMenuCaption];
	  }
  	else
  	{
    	el.innerText=menuArray[ind1][indexMenuCaption];
  	}
	}
}

function getPageName(ind1,ind2)
{
  if (ind1==null)
    return '';
  return (menuArray[ind1][indexMenuSub]!=null && ind2!=null) ? menuArray[ind1][indexMenuSub][ind2][indexMenuCaption] : menuArray[ind1][indexMenuCaption];
}

function getMenuItemsLength(ar,index)
{
  var arlen=0;
  for (i=0;i<ar.length;i++)
    arlen=arlen+ar[i][index];
  return arlen;
}
function drawLeftMenuTop()
{
  if (constCurrentSubMenu!=null && menuArray[constCurrentMenu][indexMenuSub]!=null)
  {
    document.write('<td width="150" height="12" bgcolor="FFFFFF" id="leftmenutop" ');
    document.write(' onclick="window.location.href=\''+websitename+menuArray[constCurrentMenu][indexMenuSub][0][indexMenuHREF]+'\'" ');
    document.write(' onmouseover="document.getElementById(\'lmtd_'+constCurrentMenu+'_0\').background=\'images/leftmenuselection.gif\';this.background=\'images/leftmenuselection.gif\'" ');
    if (constCurrentSubMenu!=0)
      document.write(' onmouseout="document.getElementById(\'lmtd_'+constCurrentMenu+'_0\').background=\'\';this.background=\'\'" ');
    document.write(' style="cursor:hand;cursor:pointer" ');
    document.write('></td>');
  }
  else
  {
    document.write('<td width="150" height="12" bgcolor="FFFFFF" id="leftmenutop" ');
    document.write('></td>');
  }
}

function drawLeftMenuTop1()
{
/*
  document.write('<td width="150" height="12" bgcolor="FFFFFF" id="leftmenutop" ');
  document.write(' onclick="window.location.href=\''+arProd_PhotoIDBadging[constCurrentMenu_Prod][indexProd_SubItems][constCurrentSubMenu_Prod][indexProd_SubItems][0][indexMenuHREF]+'\'" ');
    document.write(' onmouseover="document.getElementById(\'lmtd_0_0\').background=\'images/leftmenuselection.gif\';this.background=\'images/leftmenuselection.gif\'" ');
    document.write(' onmouseout="document.getElementById(\'lmtd_0_0\').background=\'\';this.background=\'\'" ');
    document.write(' style="cursor:hand;cursor:pointer" ');
    document.write('></td>');
  }
*/
}

function drawLeftMenuTopProducts()
{
    document.write('<td width="150" height="12" bgcolor="FFFFFF" id="leftmenutop" ');
    document.write(' onclick="window.location.href=\''+arProd_PhotoIDBadging[0][indexProd_ItemHREF]+'\'" ');
    document.write(' onmouseover="document.getElementById(\'lmtr_0_0\').style.backgroundImage=\'url(images/leftmenuselection.gif)\';this.style.backgroundImage=\'url(images/leftmenuselection.gif)\'" ');
    document.write(' onmouseout="document.getElementById(\'lmtr_0_0\').style.backgroundImage=\'\';this.style.backgroundImage=\'\'" ');
    document.write(' style="cursor:hand;cursor:pointer" ');
    document.write('></td>');
}


var arrayNewProductsSafety=[['Printer/encoders HDP 600','images/newproduct.gif','newproduct.html']]





function writePageTitle(arItems,curMenu,curSubMenu)
{
  return ( (curSubMenu==null) ? arItems[curMenu][indexProd_ItemDisplay] : arItems[curMenu][indexProd_SubItems][curSubMenu][indexProd_ItemDisplay] )
}





function CreateVMenuVendorProductsLevel3(arItems,curIndex,curSubIndex,index3)
{
  //if (curIndex==null)
	//  return;
  if (arItems[curIndex][indexProd_SubItems][curSubIndex][indexProd_SubItems]==null)
  return;
  var index3Str = (index3==null) ? '' : index3.toString();
  document.write('<table border=0 width="100%" height="100%" cellpadding="0" cellspacing="0">');
  var arit=arItems[curIndex][indexProd_SubItems][curSubIndex][indexProd_SubItems];
 	for (var i=0;i<arit.length;i++)
 	{
  	if (i==index3)
		{
      classStr='leftpanelsubtitleselected';
      if (i==0)
      {
        document.write('<tr id="lmtr_0_0" style="background:url(images/leftmenuselection.gif);cursor:arrow;cursor:hand;"><td width="'+leftmargin.toString()+'" align="center" valign="middle"></td><td width="'+(150-leftmargin-5).toString()+'" id="'+ 'lmtd_0_0" class="leftpanelsubtitleselected" height="17" valign="middle" onclick="window.location.href=\''+arit[i][indexProd_ItemHREF]+'\'">'+arit[i][indexProd_ItemDisplay]+'</td></tr>');
        var el=document.getElementById('leftmenutop');
        if (el!=null)
        {
          el.background='images/leftmenuselection.gif';
        }
      }
      else
        document.write('<tr style="background:url(images/leftmenuselection.gif);cursor:arrow;cursor:hand;"><td width="'+leftmargin.toString()+'" align="center" valign="middle"></td><td class="leftpanelsubtitleselected" height="17" valign="middle" onclick="window.location.href=\''+websitename+arit[i][indexMenuHREF]+'\'">'+arit[i][indexProd_ItemDisplay]+'</td></tr>');
		}
  	else
		{
      classStr='leftpanelsubtitlegray';
			var iconpath_normal = (i==curIndex) ? '' : '';
			var iconpath_selected = (i==curIndex) ? '' : '';
	    if (i==0)
      {
        var str1 = 'el=getElementById(\'leftmenutop\');if (el!=null) el.background=\'images/leftmenuselection.gif\';'
        var str2 = 'el=getElementById(\'leftmenutop\');if (el!=null) el.background=\'\'';
        //document.write('<tr><td id="'+ 'lmtd_'+curIndex +'_0" class="'+classStr+'" onmouseover="this.background=\'images/leftmenuselection.gif\';'+str1+'" onmouseout="this.background=\'\';'+str2+'" height="17" valign="middle" onclick="window.location.href=\''+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'\'">'+menuArray[curIndex][indexMenuSub][i][indexMenuCaption]+'</td></tr>');
        document.write('<tr id="lmtr_0_0" style="cursor:arrow;cursor:hand;" onmouseover="this.style.backgroundImage=\'url(images/leftmenuselection.gif)\';e2=null;if (e2!=null) e2.src=\''+iconpath_selected+'\';'+str1+'" onmouseout="this.style.background=\'\';e2=null;if (e2!=null) e2.src=\''+iconpath_normal+'\';'+str2+'"><td width="'+leftmargin.toString()+'" align="center"></td><td id="'+ 'lmtd_0_0" class="leftpanelsubtitlegray" height="17" valign="middle" onclick="window.location.href=\''+arit[i][indexProd_ItemHREF]+'\'">'+arit[i][indexProd_ItemDisplay]+'</td></tr>');
      }
      else
        document.write('<tr style="cursor:arrow;cursor:hand;" onmouseover="this.style.backgroundImage=\'url(images/leftmenuselection.gif)\';" onmouseout="this.style.background=\'\';" ><td width="'+leftmargin.toString()+'" align="center"></td><td class="leftpanelsubtitlegray" height="17" onclick="window.location.href=\''+arit[i][indexProd_ItemHREF]+'\'">'+arit[i][indexProd_ItemDisplay]+'</td></tr>');
    }
  }
  document.write('<tr class="leftpanelplaintext"><td height="100%"></td></tr>');
  document.write('</table>');
}

function CreateVMenuVendorProductsLevel4(arItems,curIndex,curSubIndex,index3,index4)
{
  //if (curIndex==null)
	//  return;
  if (arItems[curIndex][indexProd_SubItems][curSubIndex][indexProd_SubItems]==null)
	  return;
	CreateVMenuLevelX(arItems[curIndex][indexProd_SubItems][curSubIndex][indexProd_SubItems][index3][indexProd_SubItems],index4);
}

function CreateVMenuLevelX(arit,indexToSelect)
{
  //if (curIndex==null)
	//  return;
  if (arit==null)
	  return;
  var indexStr = (indexToSelect==null) ? '' : indexToSelect.toString();
  document.write('<table border=0 width="100%" height="100%" cellpadding="0" cellspacing="0">');
 	for (var i=0;i<arit.length;i++)
 	{
  	if (i==indexToSelect)
		{
      classStr='leftpanelsubtitleselected';
      if (i==0)
      {
        document.write('<tr id="lmtr_0_0" style="padding-top:3px;padding-bottom=3px;background:url(images/leftmenuselection.gif);cursor:arrow;cursor:hand;"><td width="'+leftmargin.toString()+'" align="center" valign="middle"></td><td width="'+(150-leftmargin-5).toString()+'" id="'+ 'lmtd_0_0" class="leftpanelsubtitleselected" height="17" valign="middle" onclick="window.location.href=\''+arit[i][indexProd_ItemHREF]+'\'">'+arit[i][indexProd_ItemDisplay]+'</td></tr>');
        var el=document.getElementById('leftmenutop');
        if (el!=null)
        {
          el.background='images/leftmenuselection.gif';
        }
      }
      else
        document.write('<tr style="padding-top:3px;padding-bottom=3px;background:url(images/leftmenuselection.gif);cursor:arrow;cursor:hand;"><td width="'+leftmargin.toString()+'" align="center" valign="middle"></td><td class="leftpanelsubtitleselected" height="17" valign="middle" onclick="window.location.href=\''+websitename+arit[i][indexMenuHREF]+'\'">'+arit[i][indexProd_ItemDisplay]+'</td></tr>');
		}
  	else
		{
      classStr='leftpanelsubtitlegray';
	    if (i==0)
      {
        var str1 = 'el=getElementById(\'leftmenutop\');if (el!=null) el.background=\'images/leftmenuselection.gif\';'
        var str2 = 'el=getElementById(\'leftmenutop\');if (el!=null) el.background=\'\'';
        //document.write('<tr><td id="'+ 'lmtd_'+curIndex +'_0" class="'+classStr+'" onmouseover="this.background=\'images/leftmenuselection.gif\';'+str1+'" onmouseout="this.background=\'\';'+str2+'" height="17" valign="middle" onclick="window.location.href=\''+menuArray[curIndex][indexMenuSub][i][indexMenuHREF]+'\'">'+menuArray[curIndex][indexMenuSub][i][indexMenuCaption]+'</td></tr>');
        document.write('<tr id="lmtr_0_0" style="padding-top:3px;padding-bottom=3px;cursor:arrow;cursor:hand;" onmouseover="this.style.backgroundImage=\'url(images/leftmenuselection.gif)\';'+str1+'" onmouseout="this.style.background=\'\';'+str2+'"><td width="'+leftmargin.toString()+'" align="center"></td><td id="'+ 'lmtd_0_0" class="leftpanelsubtitlegray" height="17" valign="middle" onclick="window.location.href=\''+arit[i][indexProd_ItemHREF]+'\'">'+arit[i][indexProd_ItemDisplay]+'</td></tr>');
      }
      else
        document.write('<tr style="padding-top:3px;padding-bottom=3px;cursor:arrow;cursor:hand;" onmouseover="this.style.backgroundImage=\'url(images/leftmenuselection.gif)\';" onmouseout="this.style.background=\'\';" ><td width="'+leftmargin.toString()+'" align="center"></td><td class="leftpanelsubtitlegray" height="17" onclick="window.location.href=\''+arit[i][indexProd_ItemHREF]+'\'">'+arit[i][indexProd_ItemDisplay]+'</td></tr>');
    }
  }
  document.write('<tr class="leftpanelplaintext"><td height="100%"></td></tr>');
  document.write('</table>');
}
/*
function CreateVMenuAdv(arItems)
{
	document.write('<table width="100%" border=1 cellspacing=1 cellpadding=1>');
	var menuLength = arItems.length;
	for(index = 0; index < menuLength ; index++) {
	  alert(index);
		var bHasSubmenu = (arItems[index][indexProdSubItems] == null) ? false : true;
 		document.write('<tr class="leftpanelsubtitle" >');
		if (bHasSubmenu)
		{
			document.write('<td width="13"><img width="13" ' + ' id="'+subMenuImageBase+index+'" ' + ' height="8" src="images/menu_arrow_down.gif"></td>');
			//document.write('<td width="13"><img width="13" ' + ' height="8" src="images/menu_arrow_down.gif"></td>');
		}
		document.write('<td align="left" nowrap ');
		if (bHasSubmenu)
			document.write(' OnMouseOver=' + '"ShowSubMenu(' + index.toString() + ');this.style.background=' + "'#0CA5DE'" + '"');
		else
			document.write(' OnMouseOver=' + '"this.style.background=' + "'#0CA5DE'" + '"');
		document.write(' OnMouseOut=' + '"this.style.background=' + "'#02BAF7'" + '">');
		document.write('<a href="' + arItems[index][indexProdItemHREF] + '" class="menulinks" style="text-decoration:none"');
		document.write('><font color="#FFFFFF">' + arItems[index][indexProdItemDisplay] +'</font></a>');
		document.write('</td></tr>');
		if (bHasSubmenu){
			document.write('<tr><td></td><td>');
			document.write('<div  ' +  '' + 'id = ' + '"' + subVMenuLevelOneBase + index.toString() + '"');
			//document.write(' OnMouseOut=' + '"SubMenuMouseOut()"');
			document.write(' OnMouseOver=' + '"ClearMenuTimer();">');
			document.write('<table>');
			for(j=0; j < arItems[index][indexProdSubItems].length;j++){
					document.write('<tr class="submenuitem"');
				document.write(' OnMouseOver=' + '"this.style.background=' + "'#0CA5DE'" + '"');
				document.write(' OnMouseOut=' + '"this.style.background=' + "'#02BAF7'" + '">');
				//document.write('<td width="13"><img width="13" height="8" src="images/menu_arrow_up.gif"></td>');
				//document.write(' <td width="6">&nbsp;</td>;
				document.write(' <td align=left nowrap> ')
				document.write('<a href="' + arItems[index][indexProdSubItems][j][indexMenuHREF] + '" class="menulinks" style="text-decoration:none"');
				document.write('><font color="#FFFFFF">' + arItems[index][indexProdSubItems][j][indexProdItemDisplay] +'</font></a>');
				document.write('</td></tr>');
			}
			//alert(subMenuImageBase+i);
			//for (jj=j;jj<7;jj++)
			//	document.write(' <tr class="submenuitem"><td width="6">&nbsp;</td><td>&nbsp;</td></tr>');
			document.write('</table>');
			document.write('</div>');
			document.write('</td></tr>');
			if (false)
			{
			if (bUseLayers) {
				document.layers[subVMenuLevelOneBase+i].visibility='hide';
				document.layers[subVMenuLevelOneBase+i].display='none';
			}
			else if (bUseAll) {
				document.all[subVMenuLevelOneBase+i].style.visibility='hidden';
				document.all[subVMenuLevelOneBase+i].style.display='none';
			}
			else if (bUseGetElement) {
				document.getElementById(subVMenuLevelOneBase+i).style.visibility='hidden';
				document.getElementById(subVMenuLevelOneBase+i).style.display='none';
			}
			}
		}
	}
	document.write('</table>\n');
}
*/
// end of not used section