function helpPopup(file)
{
	if(typeof(myWindow)=='object')
		if(!myWindow.closed)	
			myWindow.close();
	myWindow = window.open(file, "help", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,top=10,left=10,location=no,width=771,height=550")
}

function createMenuLink(params,action,target)
{
if(params=="")
	return action;
  else
  {
	  var frmName="tcs"+mnuCnt;
	  var str=params;
	  var splitParams = str.split("&");
	  var paramNames = new Array();
	  var paramValues = new Array();
	  
	  for(k=0;k<splitParams.length;k++)
	  {
		 var tmp = splitParams[k];
		 var tmpSplt = tmp.split("=");
		 paramNames[k] = tmpSplt[0];
		 paramValues[k] = tmpSplt[1];
	  }
	
	if(typeof(action)=="undefined")
	{  
		if(typeof(target)=="undefined")
			temp="<form name='"+frmName+"' action='index.jsp' method='post'>";
		else
			temp="<form name='"+frmName+"' action='index.jsp' method='post' target='_new'>";
	}
	else
	{
		if(typeof(target)=="undefined")
			temp="<form name='"+frmName+"' action='"+action+"' method='post'>";
		else
			temp="<form name='"+frmName+"' action='"+action+"' method='post' target='_new'>";
	}
	  for(k=0;k<paramNames.length;k++)
	  {
	   temp+="<input type='hidden' name='"+paramNames[k]+"' value='"+paramValues[k]+"'>";
	  }
	  temp+="</form>";
	  document.write(temp);
	  //document.write("<a href='javascript:document."+frmName+".submit()'>"+txt+"</a>");
	  mnuCnt++;
	  return "javascript:document."+frmName+".submit()";
	}
}



/*function createMenuLink(params)
{
  var frmName="tcs"+mnuCnt;
  var str=params;
  var splitParams = str.split("&");
  var paramNames = new Array();
  var paramValues = new Array();
  
  for(k=0;k<splitParams.length;k++)
  {
     var tmp = splitParams[k];
     var tmpSplt = tmp.split("=");
     paramNames[k] = tmpSplt[0];
     paramValues[k] = tmpSplt[1];
  }

  temp="<form name='"+frmName+"' action='index.jsp' method='post'>";

  for(k=0;k<paramNames.length;k++)
  {
   temp+="<input type='hidden' name='"+paramNames[k]+"' value='"+paramValues[k]+"'>";
  }
  temp+="</form>";
  document.write(temp);
  //document.write("<a href='javascript:document."+frmName+".submit()'>"+txt+"</a>");
  mnuCnt++;
  return "javascript:document."+frmName+".submit()";
}*/

function createMenuPopup(params)
{
   return "javascript:helpPopup('"+params+"')";
}

str = "";
sm = 2;
function subMenu(name, array)
{
	stm_ai(name,[0,array[0],"","",-1,-1,0,"","_self","","","","",0,0,0,"images/arrow_r.gif","images/arrow_r.gif",0,0,0,0,1,"#f4f4f4",0,"#29306b",0,"","",3,3,0,0,"#fffff7","#000000","#000000","#ffffff","8pt 'Tahoma','Verdana','Arial'","8pt 'Tahoma','Verdana','Arial'",0,0]);
	//Sub menu for industry solutions
	stm_bpx("p"+sm,"p0",[1,2,1,5,1,2,3,3,100,"",-2,"",-2,50,0,0,"#fffff7","#ebebeb","",3,1,1,"#29306b"]);
	for(z=1;z<array.length;z++)
	{
		tmp = array[z];
		if(typeof(tmp)=='object')
		{
			sm++;
			subMenu('p'+sm+'i'+(z-1),tmp);			
		}
		else
		{
			tmpSplt = tmp.split("$");
			tmpSplt[0] = tmpSplt[0]+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
			x=tmpSplt[1];
			tmpSplt024=eval(x);
			if(z==1)
			s1 = 'stm_aix("p'+sm+'i'+(z-1)+'","p0i0",[0,"'+tmpSplt[0]+'","","",-1,-1,0,"'+tmpSplt024+'","_self","'+tmpSplt024+'","","","",0,0,0,"","",0,0,0,0,1,"#f4f4f4",0,"#29306b",0,"","",3,3,0,0,"#fffff7","#000000","#000000","#ffffff","8pt \'Tahoma\',\'Verdana\',\'Arial\'","8pt \'Tahoma\',\'Verdana\',\'Arial\'",0,0])';			
			else
			s1 = 'stm_aix("p'+sm+'i'+(z-1)+'","p'+sm+'i0",[0,"'+tmpSplt[0]+'","","",-1,-1,0,"'+tmpSplt024+'","_self","'+tmpSplt024+'","","","",0,0,0,"","",0,0,0,0,1,"#f4f4f4",0,"#29306b",0,"","",3,3,0,0,"#fffff7","#000000","#000000","#ffffff","8pt \'Tahoma\',\'Verdana\',\'Arial\'","8pt \'Tahoma\',\'Verdana\',\'Arial\'",0,0])';					
			eval(s1);
		}
	}
	stm_ep();
}

function createMenus(userType)
{
	var st = true;
	start=0;
	for(i=start;i<topRow[userType].length;i++)
	{
		if(i==0)
		{
			document.write('<td class="topDarkBlue">'); 
      		document.write('<table border="0" cellpadding="2" cellspacing="0">');
        	document.write('<tr align="center" valign="middle"> ');
		}
		else if (i==topRow[userType].length - 3)
		{
			document.write('<td align="right" class="topDarkBlue">'); 
      		document.write('<table border="0" cellpadding="2" cellspacing="0">');
        	document.write('<tr align="right" valign="middle"> ');
			st = false;
		}
		if(st == true)
			document.write('<td align="left" valign="middle">');
		else
			document.write('<td align="right" valign="middle">');
		
		stm_bm(["menu4f3a",400,"","images/blank.gif",0,"","",0,0,250,0,200,1,0,0]);
		stm_bp("p0",[0,4,0,0,0,0,0,0,100,"",-2,"",-2,50,0,0,"#fffff7","transparent","",3,0,0,"#000000"])
		if(topRow[userType][i].indexOf("$") >= 0) // no menus
		{
			tmp = topRow[userType][i];
			tmpSplt = tmp.split("$");
			
			if(i<topRow[userType].length-3)
				tmpSplt[0] = tmpSplt[0]+"&nbsp;&nbsp;&nbsp;&nbsp;";				
			else
				tmpSplt[0] = "&nbsp;&nbsp;&nbsp;&nbsp;"+tmpSplt[0];
			x=tmpSplt[1];
			tmpSplt024=eval(x);
			
			s1 = 'stm_ai("p0i0",[0,"'+tmpSplt[0]+'","","",-1,-1,0,"'+tmpSplt024+'","_self","'+tmpSplt024+'","","","",0,0,0,"","",-1,-1,0,0,1,"#93b5f7",1,"#b5bed6",1,"","",3,3,0,0,"#fffff7","#000000","#ffffff","#ffecb3","8pt \'Tahoma\',\'Verdana\',\'Arial\'","8pt \'Tahoma\',\'Verdana\',\'Arial\'",0,0])';
			eval(s1);
			
		}
		else
		{
			
			nTmp = topRow[userType][i];
			nTmp +="&nbsp;&nbsp;&nbsp;&nbsp;";
			s1 = 'stm_ai("p0i0",[0,"'+nTmp+'","","",-1,-1,0,"","_self","","","","",0,0,0,"","",-1,-1,0,0,1,"#93b5f7",1,"#b5bed6",1,"","",3,3,0,0,"#fffff7","#000000","#ffffff","#ffecb3","8pt \'Tahoma\',\'Verdana\',\'Arial\'","8pt \'Tahoma\',\'Verdana\',\'Arial\'",0,0])';
			eval(s1);
			stm_bp("p1",[1,4,0,5,1,2,3,3,100,"",-2,"",-2,50,0,0,"#fffff7","#ebebeb","",3,1,1,"#29306b"]);
			
			for(j=0;j<menuItems[userType][topRow[userType][i]].length;j++)
			{
				
				tmp = menuItems[userType][topRow[userType][i]][j];
				if(typeof(tmp)=="object")
				{
					subMenu("p1i"+j, tmp);
				}
				else
				{
					
					tmpSplt = tmp.split("$");
					tmpSplt[0] = tmpSplt[0]+"&nbsp;&nbsp;&nbsp;&nbsp;";
					x=tmpSplt[1];
					tmpSplt024=eval(x);
					if(j==0)
					s1 = 'stm_ai("p1i'+j+'",[0,"'+tmpSplt[0]+'","","",-1,-1,0,"'+tmpSplt024+'","_self","'+tmpSplt024+'","","","",0,0,0,"","",0,0,0,0,1,"#f4f4f4",0,"#29306b",0,"","",3,3,0,0,"#fffff7","#000000","#000000","#ffffff","8pt \'Tahoma\',\'Verdana\',\'Arial\'","8pt \'Tahoma\',\'Verdana\',\'Arial\'",0,0])';			
					else
					s1 = 'stm_aix("p1i'+j+'","p1i0",[0,"'+tmpSplt[0]+'","","",-1,-1,0,"'+tmpSplt024+'","_self","'+tmpSplt024+'","","","",0,0,0,"","",0,0,0,0,1,"#f4f4f4",0,"#29306b",0,"","",3,3,0,0,"#fffff7","#000000","#000000","#ffffff","8pt \'Tahoma\',\'Verdana\',\'Arial\'","8pt \'Tahoma\',\'Verdana\',\'Arial\'",0,0])';			
					eval(s1);
				}
			}
			
		}
		stm_ep();
		stm_ep();
		stm_em();
		document.write('</td>');
		document.write("<td><img src='images/transparent.gif' width='5' height='1'></td>");
		if(i==topRow[userType].length - 4 || i==topRow[userType].length-1)
		{
			document.write('</tr>'); 
      		document.write('</table>');
        	document.write('</td>');
		}
		
	}	
	
}

function createSideMenu()
{
	cnt=1;
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	for(m=0;m<sideMenu["main"].length;m++)
	{
		if(sideMenu["main"][m].indexOf("$") >= 0) // no menus
		{
			tmp=sideMenu["main"][m];
			tmpSplt= tmp.split("$");
			tmpSplt0=eval(tmpSplt[1]);
			if(m>0)
                       {
                       document.write('<tr>'); 
                       document.write('<td colspan="2" align="left" class="boldBlue">');
                       document.write('<br>');
                       document.write('</td></tr>');
                       }
			document.write('<tr><td width="8%" align="center">'); 
      		document.write('<img src="images/active.gif" width="11" height="11">'); 
    		document.write('</td>');
			document.write('<td colspan="2" align="left" class="boldBlue">');
       		if(cnt!=highlight)
				document.write('<a href="'+tmpSplt0+'" class="insideLink">'+tmpSplt[0]+'</a>');
			else
				document.write('<span class="redBoldM">'+tmpSplt[0]+'</span>');
    		document.write('</td></tr>');
		}
		else
		{
			cnt++;
			try
			{
				if(sideMenu["main"][m-1].indexOf("$") >= 0 )
			   	{
				   document.write('<tr>'); 
				   document.write('<td colspan="2" align="left" class="boldBlue">');
				   document.write('<br>');
				   document.write('</td></tr>');
			   	}
				else if(m>0)
				{
				   document.write('<tr>'); 
				   document.write('<td colspan="2" align="left" class="boldBlue">');
				   document.write('<br>');
				   document.write('</td></tr>');
				}
			}
			catch(e){}
			
			tmp=sideMenu["main"][m];
			document.write('<tr><td width="8%" align="center">'); 
      		document.write('<img src="images/active.gif" width="11" height="11">'); 
    		document.write('</td>');
			document.write('<td colspan="2" align="left" class="boldBlue">');
       		document.write(tmp);
			document.write('</td></tr>');
			for(n=0;n<subMenuItems["main"][sideMenu["main"][m]].length;n++)
			{
				document.write('<tr><td width="8%">');
				document.write('<img src="images/transparent.gif" width="2" height="6">'); 
    			document.write('</td>'); 
    			document.write('<td width="9%" align="right" valign="middle">');
      			document.write('<img src="images/start6gif.gif" width="7" height="1">'); 
    			document.write('</td>'); 
				tmp=subMenuItems["main"][sideMenu["main"][m]][n];
				tmpSplt= tmp.split("$");
				tmpSplt0=eval(tmpSplt[1]);
				if(cnt!=highlight)
    				document.write('<td width="83%"><a href="'+tmpSplt0+'" class="boldGray">'+tmpSplt[0]+'</a>'); 
				else
					document.write('<td width="83%"><span class="redBold">'+tmpSplt[0]+'</span>');
   				document.write('</td></tr>'); 
				cnt++;
			}
		}
	}
	document.write('<tr><td width="8%">'); 
    document.write('<img src="images/transparent.gif" width="2" height="6">'); 
    document.write('</td><td width="9%">');
    document.write('<img src="images/transparent.gif" width="2" height="12">'); 
    document.write('</td><td width="83%">');
    document.write('<img src="images/transparent.gif" width="2" height="6">'); 
    document.write('</td>');
  	document.write('</tr>');
	document.write('</table>'); 
}

