if (document.all)    {n=0;ie=1;ns6=0;fShow="visible";fHide="hidden";}
if (document.getElementById&&!document.all)    {n=0;ie=0;ns6=1;fShow="visible";fHide="hidden";}
if (document.layers) {n=1;ie=0;ns6=0;fShow="show";fHide="hide";}

opr6=ie&&navigator.userAgent.indexOf("Opera")!=-1;

//window.onerror=new Function("return true")
////////////////////////////////////////////////////////////////////////////
// Function buildMainMenu()                                                        //
////////////////////////////////////////////////////////////////////////////
	rightX = 0;
	rightY = 0;
	leftY = 0;
	leftX = 0;
	lastRightX = 0;
	lastRightY = 0;
	lastMenuItem = null;
	lastMenu = null;
	lastSubMenu = null;

						function buildMainMenu(tableId, menuArrayName) {

							var menuClasses = ["mmItemStrongWS","mmItemWS"];
							var itemIdName = "mmIdNum";
							var subItemIdName = "mmsIdNum";
							var subMenuCounter = 0;
							var subMenuWidth = subMenuWidth;

							function buildSubMenu(arrayItem, parentId, subMenu) {
								var MENUitem = "";
								MENUitem += "\n";
								MENUitem += "<div id='"+parentId+"_sub' onmouseout=operahide() style='position:absolute; visibility: hidden; z-index:100; width: "+this.subMenuWidth+"; top: -300;'>\n";
								MENUitem += "<table cellspacing='0' cellpadding='0' border='0' width='156' class='dropDown'><tr><td>\n";
								MENUitem += "<table cellspacing='0' cellpadding='0' border='0' width='152' class='dropDownContent'>\n";
								MENUitem +=	"<tr><td class='topPadding'><img src='images/spacer.gif' width='1' height='1' border='0'></td></tr>";
								for(var i=0; i<arrayItem.length; i++) {
									MENUitem += "<tr><td";
									if(arrayItem[i].childMenu) MENUitem += " class='subMenu'";
									MENUitem += "><a href='"+arrayItem[i].hrefLink+"' ";
									if(arrayItem[i].childMenu) {
										MENUitem += "id='"+parentId+"_sub"+i+"' ";
										MENUitem += "onmouseover=\"displaySubSubMenu('"+parentId+"_sub"+i+"');\" ";
										buildSubMenu(arrayItem[i].childMenu, parentId+"_sub"+i, true);
									}
									if(!subMenu) MENUitem += "onmouseover=\"hideSubSubMenu()\" ";
									MENUitem += ">"+arrayItem[i].title+"</a><br></td></tr>\n";
								}
								MENUitem +=	"<tr><td class='bottomPadding'><img src='images/spacer.gif' width='1' height='1' border='0'></td></tr>";
								MENUitem += "</table>\n";
								MENUitem += "</td></tr></table>\n";
								MENUitem += "</div>\n";
								MENUitem += "\n";
								MENUitem += "<!-- SUB_MENU -->\n";
								HTMLstr = HTMLstr.replace("<!-- SUB_MENU -->\n", MENUitem);
							}


							HTMLstr = "";
							HTMLstr += "<!-- MENU PANE DECLARATION BEGINS -->\n";
							HTMLstr += "\n";
							HTMLstr += "<!-- SUB MENU STARTS -->\n";
							HTMLstr += "<!-- SUB_MENU -->\n";
							HTMLstr += "<!-- SUB MENU ENDS -->\n";
							HTMLstr += "\n";
							HTMLstr += "<table cellpadding='0' cellspacing='0' id='"+tableId+"' border='0'>\n";
							HTMLstr += "<tr>";
							HTMLstr += "<td class='mmBreak'><img src='images/scpacer.gif' width='1' height='1' border='0'></td>\n";
							HTMLstr += "<!-- MAIN MENU STARTS -->\n";
							HTMLstr += "<!-- MAIN_MENU -->\n";

							for(var i=0; i<menuArrayName.length; i++){
								HTMLstr += "\n<!-- ITEM "+itemIdName+i+" -->\n";

								HTMLstr += "<td>\n";
								HTMLstr += "<div id='"+itemIdName+i+"' ";

								if(menuArrayName[i].isStrong) HTMLstr += "class='"+menuClasses[0]+"'>\n";
								else HTMLstr += "class='"+menuClasses[1]+"'>\n";

								HTMLstr += "<a ";

								if(menuArrayName[i].hrefLink) HTMLstr += "href='"+menuArrayName[i].hrefLink+"' ";
								else HTMLstr += "href='.' ";

								if(menuArrayName[i].childMenu) {
									HTMLstr += "onmouseover=\"displaySubMenu('"+itemIdName+i+"')\" ";
									if(!menuArrayName[i].hrefLink) HTMLstr += "onclick=\"return false;\" ";
									buildSubMenu(menuArrayName[i].childMenu, itemIdName+i);
								} else {
									HTMLstr += "onmouseover=\"displayOnlyMenuItem('"+itemIdName+i+"')\" ";
								}

								HTMLstr += ">";
								HTMLstr += menuArrayName[i].title;
								HTMLstr += "</a>\n";
								HTMLstr += "</div>\n";
								HTMLstr += "</td>\n";
								HTMLstr += "<td class='mmBreak'><img src='images/scpacer.gif' width='1' height='1' border='0'></td>\n";

								HTMLstr += "<!-- END OF ITEM "+itemIdName+i+" -->\n\n";
							}

							HTMLstr += "<!-- MAIN MENU ENDS -->\n";
							HTMLstr += "</tr>\n";
							HTMLstr += "</table>\n";
							HTMLstr += "\n";
							HTMLstr += "<!-- MENU PANE DECALARATION ENDS -->\n";
							document.writeln(HTMLstr);
						}

						function buildLeftMenu(arrayName, itemURL){
							var leftMenuStr = "";
							var parentArrayItem = null;

							function buildSubMenu(arrayItem, parentId) {
								var MENUitem = "";
								MENUitem += "\n";
								MENUitem += "<div id='"+parentId+"_sub' onmouseout=operahide() style='position:absolute; visibility: hidden; z-index:100; width: "+this.subMenuWidth+"; top: -300;'>\n";
								MENUitem += "<table cellspacing='0' cellpadding='0' border='0' width='156' class='dropDown'><tr><td>\n";
								MENUitem += "<table cellspacing='0' cellpadding='0' border='0' width='152' class='dropDownContent'>\n";
								MENUitem +=	"<tr><td class='topPadding'><img src='images/spacer.gif' width='1' height='1' border='0'></td></tr>";
								for(var i=0; i<arrayItem.length; i++) {
									MENUitem += "<tr><td";
									if(arrayItem[i].childMenu) MENUitem += " class='subMenu'";
									MENUitem += "><a href='"+arrayItem[i].hrefLink+"' ";
									MENUitem += ">"+arrayItem[i].title+"</a><br></td></tr>\n";
								}
								MENUitem +=	"<tr><td class='bottomPadding'><img src='images/spacer.gif' width='1' height='1' border='0'></td></tr>";
								MENUitem += "</table>\n";
								MENUitem += "</td></tr></table>\n";
								MENUitem += "</div>\n";
								MENUitem += "\n";
								MENUitem += "<!-- SUB_MENU -->\n";
								leftMenuStr = leftMenuStr.replace("<!-- SUB_MENU -->\n", MENUitem);
							}

							for(var v=0; v<arrayName.length; v++){
								if(itemURL == arrayName[v].hrefLink){
									parentArrayItem = arrayName[v];
									break;
								} else if(arrayName[v].childMenu){
									for(var j=0; j<arrayName[v].childMenu.length; j++){
										if(itemURL == arrayName[v].childMenu[j].hrefLink){
											parentArrayItem = arrayName[v];
											break;
										}else if(arrayName[v].childMenu[j].childMenu){
											for(var z=0; z<arrayName[v].childMenu[j].childMenu.length; z++){
												if(itemURL == arrayName[v].childMenu[j].childMenu[z].hrefLink){
													parentArrayItem = arrayName[v];
													break;
												}
											}
										}
										if(parentArrayItem != null) break;
									}
									if(parentArrayItem != null) break;
								}
								if(parentArrayItem != null) break;
							}

							leftMenuStr += "<!-- SUB MENU STARTS -->\n";
							leftMenuStr += "<!-- SUB_MENU -->\n";
							leftMenuStr += "<!-- SUB MENU ENDS -->\n";
							leftMenuStr += "<table cellpadding='0' cellspacing='0' border='0' id='leftMenuTable'>\n";
							leftMenuStr += "<tr>\n<td class='menuHeaderMarker' width='7'><img src='images/spacer.gif' width='7' height='16' border='0'></td>\n";
							leftMenuStr += "<td colspan='2' class='menuHeader'>"+parentArrayItem.title+"</td>\n</tr>\n";
							if(parentArrayItem.childMenu){
								for(var i=0; i<parentArrayItem.childMenu.length; i++){
									if(parentArrayItem.childMenu[i].hrefLink == itemURL){
										leftMenuStr += "<tr>\n<td><img src='images/spacer.gif' width='1' height='1' border='0'></td>\n<td class='menuActiveMarker'><img src='images/menu_marker.gif' width='3' height='3' border='0'></td>\n";
										leftMenuStr += "<td";
										if(parentArrayItem.childMenu[i].childMenu != null) {
											leftMenuStr += " class='menuActiveSItem'";
											leftMenuStr += " id='leftMenuId"+i+"'";
											leftMenuStr += "><a href='.' onmouseover=\"displaySubSubMenu('leftMenuId"+i+"')\" onclick=\"return false;\">";
											leftMenuStr += parentArrayItem.childMenu[i].title+"</a></td>\n</tr>\n";
											buildSubMenu(parentArrayItem.childMenu[i].childMenu, "leftMenuId"+i);
										} else {
											leftMenuStr += " class='menuActiveItem'>"+parentArrayItem.childMenu[i].title+"</td>\n</tr>\n";
										}
									} else {
										leftMenuStr += "<tr>\n<td><img src='images/spacer.gif' width='1' height='1' border='0'></td><td><img src='images/spacer.gif' width='11' height='1' border='0'></td>\n";
										leftMenuStr += "<td";
										if(parentArrayItem.childMenu[i].childMenu != null){
											leftMenuStr += " class='subMenu'>";
											leftMenuStr += "<div id='leftMenuId"+i+"'>";
											if(parentArrayItem.childMenu[i].hrefLink) {
												leftMenuStr += "<a href='"+parentArrayItem.childMenu[i].hrefLink+"'";
												leftMenuStr += " onmouseover=\"displaySubSubMenu('leftMenuId"+i+"')\">";
											}
											else leftMenuStr += "<a href='.' onmouseover=\"displaySubSubMenu('leftMenuId"+i+"')\" onclick=\"return false;\">";
											leftMenuStr += parentArrayItem.childMenu[i].title+"</a></div></td>\n</tr>\n";
											buildSubMenu(parentArrayItem.childMenu[i].childMenu, "leftMenuId"+i);
										} else {
											leftMenuStr += ">";
											if(parentArrayItem.childMenu[i].hrefLink) leftMenuStr += "<a href='"+parentArrayItem.childMenu[i].hrefLink+"'>";
											leftMenuStr += parentArrayItem.childMenu[i].title
											if(parentArrayItem.childMenu[i].hrefLink) leftMenuStr += "</a>";
											leftMenuStr += "</td>\n</tr>\n";
										}
									}
								}
							}
						//	leftMenuStr += "<tr>\n<td height='1'></td><td height='1'><img src='images/spacer.gif' width='11' height='1' border='0'></td><td height='1'></td></tr>\n";
							leftMenuStr += "</table>\n";
							document.writeln(leftMenuStr);
						}

						function buildPath(arrayName, itemURL){
							//killLeftMenu();
							var pathStr = "";
							var titleArray = new Array();
						//	var cleanLeftMenu;
						//	cleanLeftMenu = ie? eval("leftMenuTable") : document.getElementById("leftMenuTable");
							for(var v=0; v<arrayName.length; v++){
								if(itemURL == arrayName[v].hrefLink){
									titleArray = [arrayName[v]];
									break;
								} else if(arrayName[v].childMenu){
									for(var j=0; j<arrayName[v].childMenu.length; j++){
										if(itemURL == arrayName[v].childMenu[j].hrefLink){
											titleArray = [arrayName[v],
														  arrayName[v].childMenu[j]];
											break;
										}else if(arrayName[v].childMenu[j].childMenu){
											for(var z=0; z<arrayName[v].childMenu[j].childMenu.length; z++){
												if(itemURL == arrayName[v].childMenu[j].childMenu[z].hrefLink){
													titleArray = [arrayName[v],
																  arrayName[v].childMenu[j],
																  arrayName[v].childMenu[j].childMenu[z]];
													break;
												}
											}
										}
										if(titleArray.length != 0) break;
									}
									if(titleArray.length != 0) break;
								}
								if(titleArray.length != 0) break;
							}

							pathStr += "<table cellpadding='0' cellspacing='0' border='0' width='100%' height='18' id='path'>\n<tr>";
							pathStr += "<td width='5'><img src='images/path_bg_left.gif' width='5' height='18'></td>\n";
							pathStr += "<td width='33'><a href='?page=home'><img src='images/path_home.gif' width='13' height='11' border='0' class='home'></a></td>\n";
							pathStr += "<td>\n";
							for(var i=0; i<titleArray.length; i++) {
								if(titleArray[i].hrefLink && i!= titleArray.length-1) pathStr += " | <b><a href='"+titleArray[i].hrefLink+"'> "+titleArray[i].title+" </a></b>\n";
								else pathStr += " | <b> <span style='font-size:13px;'>"+titleArray[i].title+" </span></b>\n";
							}
							pathStr += "</td>\n";
							pathStr += "<td width='5'><img src='images/path_bg_right.gif' width='5' height='18'></td>\n";
							pathStr += "</tr>\n</table>\n";

							document.writeln(pathStr);
						}

						function getUrlName(arrayName, itemURL){
							var title = null;
							for(var v=0; v<arrayName.length; v++){
								if(itemURL == arrayName[v].hrefLink){
									if(arrayName[v].bodytitle) {
										title = arrayName[v].bodytitle;
									} else {
										title = arrayName[v].title;
									}
									break;
								} else if(arrayName[v].childMenu){
									for(var j=0; j<arrayName[v].childMenu.length; j++){
										if(itemURL == arrayName[v].childMenu[j].hrefLink){
											if(arrayName[v].childMenu[j].bodytitle) {
												title = arrayName[v].childMenu[j].bodytitle;
											} else {
												title = arrayName[v].childMenu[j].title;
											}
											break;
										}else if(arrayName[v].childMenu[j].childMenu){
											for(var z=0; z<arrayName[v].childMenu[j].childMenu.length; z++){
												if(itemURL == arrayName[v].childMenu[j].childMenu[z].hrefLink){
													if(arrayName[v].childMenu[j].childMenu[z].bodytitle) {
														title = arrayName[v].childMenu[j].childMenu[z].bodytitle;
													} else {
														title = arrayName[v].childMenu[j].childMenu[z].title;
													}
													break;
												}
											}
										}
										if(title != null) break;
									}
									if(title != null) break;
								}
								if(title != null) break;
							}
							document.writeln(title);
						}

						////////////////////////////////////////////////////////////////////////////
						// Private declaration
						function displayOverItem(menu) {
							//hideAll();
							if(menu.className == "mmItemStrongWS") {
								menu.className = "mmOverItemStrongWS";
							} else if(menu.className == "mmItemWS"){
								menu.className = "mmOverItemWS";
							}
							if(lastMenuItem != null && lastMenuItem != menu) hideMenuItem();
							lastMenuItem = menu;
						}

						function displayOnlyMenuItem(idMainMenu) {
							if (lastMenu != null) hideSubMenu();
							lastMenu = null;
							menu = ie? eval(idMainMenu) : document.getElementById(idMainMenu);
							displayOverItem(menu);
							leftX  = calculateSumOffset(menu, 'offsetLeft');
							rightX = ie? leftX + document.all[idMainMenu].offsetWidth : leftX+parseInt(document.getElementById(idMainMenu).offsetWidth);
						//	alert("leftX: " + leftX + "\nrightX: " + rightX);
							leftY  = ie? calculateSumOffset(menu, 'offsetTop') + document.all[idMainMenu].offsetHeight :
										 calculateSumOffset(menu, 'offsetTop') + parseInt(document.getElementById(idMainMenu).offsetHeight);
							rightY = leftY;
						//	alert("rightY: " + rightY + "\nparentElement: " + document.all["MainTable"].parentNode.offsetHeight);
						}

						function displaySubSubMenu(idMainMenu) {
							var menu;
							var subsubmenu;
							var menuWidth = subMenuWidth;
							//alert(document.getElementById(idMainMenu+"submenu").id)
							menu = ie? eval(idMainMenu) : document.getElementById(idMainMenu);
							subsubmenu = ie? eval(idMainMenu+"_sub.style") : document.getElementById(idMainMenu+"_sub").style;
							subsubmenu.left = calculateSumOffset(menu, 'offsetLeft') + menuWidth - 8;
							subsubmenu.top  = calculateSumOffset(menu, 'offsetTop') - 5;
							subsubmenu.visibility = fShow;

							if (lastSubMenu != null && lastSubMenu != subsubmenu) hideSubSubMenu();

							leftX  = ie? document.all[idMainMenu+"_sub"].style.posLeft-150 :
										 parseInt(document.getElementById(idMainMenu+"_sub").style.left)-150;
							lastRightX = rightX;
							rightX = ie? document.all[idMainMenu+"_sub"].style.posLeft +
											document.all[idMainMenu+"_sub"].offsetWidth :
										 parseInt(document.getElementById(idMainMenu+"_sub").style.left) +
											parseInt(document.getElementById(idMainMenu+"_sub").offsetWidth);
							lastRightY = rightY;
							rightY = ie? document.all[idMainMenu+"_sub"].style.posTop+
											document.all[idMainMenu+"_sub"].offsetHeight :
										 parseInt(document.getElementById(idMainMenu+"_sub").style.top) +
											parseInt(document.getElementById(idMainMenu+"_sub").offsetHeight);
						//	alert("leftX :" + leftX + "\nrightX: " + rightX + "\nrightY: " + rightY);
							lastSubMenu = subsubmenu;
						}

						function displaySubMenu(idMainMenu) {
							var menu;
							var submenu;
							//alert(document.getElementById(idMainMenu+"submenu").id)
							menu = ie? eval(idMainMenu) : document.getElementById(idMainMenu);
							submenu = ie? eval(idMainMenu+"_sub.style") : document.getElementById(idMainMenu+"_sub").style;
							displayOverItem(menu);
							submenu.left = calculateSumOffset(menu, 'offsetLeft') + 14;
							submenu.top  = calculateSumOffset(menu, 'offsetTop') + 24;
							submenu.visibility = fShow;

							if (lastMenu != null && lastMenu != submenu) hideSubMenu();
							else if (lastSubMenu != null) hideSubSubMenu();

							leftX  = ie? document.all[idMainMenu+"_sub"].style.posLeft : parseInt(document.getElementById(idMainMenu+"_sub").style.left);
							rightX = ie? leftX + document.all[idMainMenu+"_sub"].offsetWidth : leftX+parseInt(document.getElementById(idMainMenu+"_sub").offsetWidth);
							leftY  = ie? document.all[idMainMenu+"_sub"].style.posTop+
									document.all[idMainMenu+"_sub"].offsetHeight : parseInt(document.getElementById(idMainMenu+"_sub").style.top)+parseInt(document.getElementById(idMainMenu+"_sub").offsetHeight);
							rightY = leftY;
						//	alert("leftX :" + leftX + "\nrightX: " + rightX + "\nrightY: " + rightY);
							lastMenu = submenu;
						}

						function hideSubMenu() {
							if (lastMenu != null) {
								lastMenu.visibility = fHide;
								lastMenu.left = 0;
							}
							hideSubSubMenu();
						}

						function hideSubSubMenu() {
						//	alert("hide sub menu");
							if (lastSubMenu != null) {
								lastSubMenu.visibility = fHide;
								lastSubMenu.left = 0;
								lastSubMenu = null;
								rightX = lastRightX;
								rightY = lastRightY;
							}
						}

						function hideMenuItem() {
							if (lastMenuItem != null) {
								if(lastMenuItem.className == "mmOverItemStrongWS") {
									lastMenuItem.className = "mmItemStrongWS";
								} else if(lastMenuItem.className == "mmOverItemWS"){
									lastMenuItem.className = "mmItemWS";
								}
							}
						}

						function hideAll() {
							hideMenuItem();
							hideSubMenu();
						}

						function calculateSumOffset(idItem, offsetName) {
							var totalOffset = 0;
							var item = eval('idItem');
							do
							{
								totalOffset += eval('item.'+offsetName);
								item = eval('item.offsetParent');
							} while (item != null);
							return totalOffset;
						}

						function updateIt(e) {
						if (ie&&!opr6) {
								var x = window.event.clientX;
								var y = window.event.clientY;

								if (x > rightX || x < leftX){
									hideAll();
								}
								else if (y > rightY) {
						//			alert("rightY: " + rightY + "\nCurrentY: " + y);
									hideAll();
								}
							}
							if (ns6)
							{
								var x = e.pageX;
								var y = e.pageY;

								if (x > rightX || x < leftX) hideAll();
								else if (y > rightY) hideAll();
							}
						}

						function operahide(){
						    if (opr6){
						        if (!MainTable.contains(event.toElement))
						        hideAll()
							}
						}

						if (ie||ns6){
							document.body.onclick=hideAll;
							document.body.onscroll=hideAll;
							document.body.onmousemove=updateIt;
						}