// JavaScript Document
<!-- hide from javascript impared
/* :::::::::::::::::: */
/* Title: Mobidia 2.20
Author: Pen Pix Design, Inc. (Matt ArjMandi)
URL: http://www.penpix.com
Start Date: 03/28/2009
Date Changed: 04/23/2009
Date Changed: 04/27/2009
Date Changed: 04/28/2009
Date Changed: 05/05/2009
Date Changed: 06/06/2011
Date Changed: 12/02/2011
*/
/* :::::::::::::::::: */
//
//Build Main Menu
function mainmenu () {
	// Defines the length of Mainmenu items
	var intMainLength = arrMainMap.length-3;
	// Defines the current active Main page Header
	var k = intSubSelected-1;
	document.write ("<tr>");
	// Builds Mainmenu based on the defined length
	for(i = 1; i <= intMainLength; i++) {
		// Checks if the mainmenu item is not the current page any of its sub items
		if(secNum != i) {
			document.write ("<td> ");
			document.write ("<a href='http://www.mobidia.com/" + arrMainMap[i] + ".shtml'><img class='linkImages_homeMainMenu' name='m11' src='" + arrPreMainOut[i].src + "' onmouseover='javascript: funImageSwitchOvr(this, " + i + ", arrPreMainOvr)' onmouseout='javascript: funImageSwitchOut(this, " + i + ", arrPreMainOut)' onmouseup='javascript: funImageSwitchOut(this, " + i + ", arrPreMainOut)' alt='Mobidia " + arrPath[i][0] + "' /></a></td>");
		// When the mainmenu item is the current page or any of its sub items
		} else {
			document.write ("<td> ");
			document.write ("<img class='linkImages_homeMainMenu' name='m11' src='" + arrPreMainOvr[i].src + "' alt='Mobidia " + arrPath[i][0] + "' /></td>");
		}
	}
	document.write ("</tr>");
}
//
//Build Sub Menu
function sidemenu () {
	// Defines the length of submenu items
	var intSubLength = arrSiteMap[secNum].length-1;
	// Defines the current active page
	var k = intSubSelected-1;
	// Insert the submenu separation LINE on top
	document.write ("<img class='sideGlobalMenuBar_separator' src='images/h_249x2_sepLine.gif' align='middle' alt='' /><br />");
	// Builds submenu based on the defined length
	for(i = 0; i <= intSubLength; i++) {
		// Checks if the the submenu item is the "Products" page
		if(arrSiteMap[secNum][0] == "products") {
			sidemenuProduts ();
		// Checks if the submenu item is not the current page
		} else if(k != i) {
			document.write ("<span class='sideGlobalMenuBar_Link'>");
			document.write ("<a href='http://www.mobidia.com/" + arrSiteMap[secNum][i] + ".shtml'>" + arrPath[secNum][i] + "</a>");
		// When the submenu item is the current page
		} else {
			// Checks if the the submenu item is the "pressroom" (Press Releases) page while the current page is "pressroom"
			if(arrSiteMap[secNum][i] == "pressroom") {
				sidemenuPress ();	
			} else {
				// Creates the submenu item for currnt page
				document.write ("<span class='sideGlobalMenuBar_Link_Active'>");
				document.write (arrPath[secNum][i]);							
			}
		}
		// To close the SPAN, BREAK and submenu separation UNDERLINE 
		// Checks if the the submenu item is the "pressroom" (Press Releases) page and the current page is "pressroom" as well
		if(k == i && arrSiteMap[secNum][i] == "pressroom" || arrSiteMap[secNum][0] == "products") {
			// Ignores the closing SPAN, BREAK and submenu separation UNDERLINE because it getes it fron "sidemenuPress" function
		} else {
			// Closes the SPAN, BREAK and submenu separation UNDERLINE 
			document.write ("</span><br /> ");
			document.write ("<img class='sideGlobalMenuBar_separator' src='images/h_249x2_sepLine.gif' align='middle' alt='' /><br />");
		}
			
	}
}
//
//Build Sub Submenu for Products items
function sidemenuProduts () {
	// Defines the length of submenu items
	var intSubLength = arrSiteMap[secNum].length-1;
	// Defines the current active page
	var k = intSubSelected-1;
	var p = intSubProduct;
	// Builds submenu based on the defined length
	for(i = 0; i <= intSubLength; i++) {
		// Checks if the submenu item is not the current page
		if(k != i) {
			document.write ("<span class='sideGlobalMenuBar_Link'>");
			document.write ("<a href='http://www.mobidia.com/" + arrSiteMap[secNum][i] + ".shtml'>" + arrPath[secNum][i] + "</a>");
		// When the submenu item is the current page
		} else {			
			// Creates the submenu item for currnt page
			document.write ("<span class='sideGlobalMenuBar_Link_Active'>");
			//document.write (":: &nbsp;&nbsp;" + arrPath[secNum][i]);
			document.write ("<a href='http://www.mobidia.com/" + arrSiteMap[secNum][i] + ".shtml'>" + arrPath[secNum][i] + "</a>");
			// Check if the current page is the subsidery of subsection
			if (k != 0) {
				// Defines the length of submenu subsections items
				var intSubsecLength = arrProducs[i].length-1;
				if (intSubsecLength != 0) {
				// Closes the SPAN, BREAK and submenu separation UNDERLINE 
					document.write ("</span><br /> ");
					document.write ("<img class='sideGlobalMenuBar_separator' src='images/h_249x2_sepLine.gif' alt='' /><br />");
				}
				// Build submenu subsections
					for(x = 1; x <= intSubsecLength; x++) {	
					// 
					// Check if the the submenu item is the "whitepaper" page while the current page is not "whitepaper"
						if(arrProducs[i][x] == "whitepaper") {
							// Creates the clickable submenu item 
							//document.write ("<span class='sideGlobalMenuBar_Link' style='margin-left: 28px;'>");
							//document.write ("<a href='http://contactform.mobidia.com/whitepaper.aspx'>" + arrProdPath[i][x] + "</a>");
							//
							document.write ("<span class='sideGlobalMenuBar_Link_Active' style='margin-left: 34px;'>");
							document.write (arrProdPath[i][x]);
							//
						} else if (x == p) { 
							document.write ("<span class='sideGlobalMenuBar_Link_Active' style='margin-left: 34px;'>");
							//document.write ("<a href='http://www.mobidia.com/" + arrProducs[i][x] + ".shtml'>:: &nbsp;" + arrProdPath[i][x] + "</a>");
							document.write (arrProdPath[i][x]);
						} else { 
							document.write ("<span class='sideGlobalMenuBar_Link' style='margin-left: 28px;'>");
							document.write ("<a href='http://www.mobidia.com/" + arrProducs[i][x] + ".shtml'>" + arrProdPath[i][x] + "</a>");
						}
						//document.write ("<br /> :: &nbsp;&nbsp;" + arrProducs[i][x]);
						if (x != intSubsecLength) {
						// Closes the SPAN, BREAK and submenu separation UNDERLINE 
						document.write ("</span><br /> ");
						document.write ("<img class='sideGlobalMenuBar_separator' src='images/h_249x2_sepLine.gif' alt='' /><br />");
						}
					}	
			}
		}
		// Closes the SPAN, BREAK and submenu separation UNDERLINE		 
		document.write ("</span><br /> ");
		document.write ("<img class='sideGlobalMenuBar_separator' src='images/h_249x2_sepLine.gif' align='middle' alt='' /><br />");					
	}
}
//
//Build Sub Submenu for Press Releases items
function sidemenuPress () {
	// Defines the length of Sub submenu items under Press Release by Year
	var intSubLengthPress = arrPressMap.length-1;
	// Defines the current active sub page
	var g = intSubPress-1;
	// Creates the "Press Releases" button in submenu list as not clickable
	document.write ("<span class='sideGlobalMenuBar_Link_Active'>");
	document.write (arrPath[secNum][i]);
	document.write ("</span><br /> ");
	document.write ("<img class='sideGlobalMenuBar_separator' src='images/h_249x2_sepLine.gif' alt='' /><br />");
	// Builds Sub submenu based on the defined length
	for(h = intSubLengthPress; h >= 0; h--) {
		// Checks if the sub submenu item is not the current page
		if(g != h) {
			// Checks if this is the first sub subithem in the list 
			if (h == intSubLengthPress) {
				// Bypass the "arrPressMap" for the URL and gets the link from "arrSiteMap" 
				document.write ("<span class='sideGlobalMenuBar_Link' style='margin-left: 28px;'>");
				document.write ("<a href='http://www.mobidia.com/" + arrSiteMap[secNum][i] + ".shtml'>" + arrPressMap[h] + "&nbsp; Releases</a>");
			} else {
				// Creates sub subitem URL from "arrPressMap"
				document.write ("<span class='sideGlobalMenuBar_Link' style='margin-left: 28px;'>");
				document.write ("<a href='http://www.mobidia.com/press" + arrPressMap[h] + ".shtml'>" + arrPressMap[h] + "&nbsp; Releases</a>");
			}					
		// When the sub submenu item is the current page
		} else {
			document.write ("<span class='sideGlobalMenuBar_Link_Active' style='margin-left: 34px;'>");
			document.write (arrPressMap[h] + "&nbsp; Releases");
		}
		// Closes the SPAN, BREAK and submenu separation UNDERLINE 
		document.write ("</span><br /> ");
		document.write ("<img class='sideGlobalMenuBar_separator' src='images/h_249x2_sepLine.gif' alt='' /><br />");
	}
}
//
// Build Breadcrumb 
function pathwriter () {
	// Defines the length of Sub submenu items under Press Release by Year
	var intSubLengthPress = arrPressMap.length-1;
	// Defines the current active submenu page
	var i = intSubSelected-1;
	// Insert the "Home" link 
	document.write ("<a href='http://www.mobidia.com/index.html'>Home</a>&nbsp;-&gt;&nbsp;&nbsp;");
	// Checks if the current page is not one of the main pages from mainmenu items
	if(i != 0) {
		// Insert the Main page link
		document.write ("<a href='http://www.mobidia.com/" + arrSiteMap[secNum][0] + ".shtml'>");
		document.write (arrPath[secNum][0] + "</a>&nbsp;-&gt;&nbsp;&nbsp;");
		// Checks if the current page is any of the "Press Releases" or "Products" pages 
		if(arrSiteMap[secNum][i] != "pressroom" && arrSiteMap[secNum][0] != "products") {
			// Inserts the title of the Current page
			document.write (arrPath[secNum][i]);
		// When current page is one of the "Press Releases" pages
		} else if(arrSiteMap[secNum][i] == "pressroom") {
			// Checks if the current page is the "Year Press Releases" pages
			if (intSubRelease == 0){
				// Inserts the YEAR form "arrPressMap" list based on the current active Sub submenu page
				document.write (arrPressMap[intSubPress-1] + "&nbsp;");
				// Inserts the title of the Current page
				document.write (arrPath[secNum][i]);
			// When the current page is the press release content
			} else {
				// Checks if the press release is from past years
				if (intSubPress-1 != intSubLengthPress){
					// Creates the link based on the YEAR
					document.write ("<a href='http://www.mobidia.com/press" + arrPressMap[intSubPress-1] + ".shtml'>");
				// When the press release blongs to the current year
				} else {
					// Creates the link back to current year
					document.write ("<a href='http://www.mobidia.com/pressroom.shtml'>");
				}
				// Inserts the YEAR form "arrPressMap" and title from "arrPath"
				document.write (arrPressMap[intSubPress-1] + "&nbsp;" + arrPath[secNum][i] + "</a>&nbsp;-&gt;&nbsp;&nbsp;");
				// Inserts the DATE of the release
				document.write (intSubRelease);
			}
		// When current page is one of the "Products" pages
		} else if(arrSiteMap[secNum][0] == "products") {
			// Defines the current active submenu product section page
			var s = intSubProduct;
			// Checks if the current page is one of subpages of product subsection 
			if (s != 0){
				// Insert the Main subsection page link
				document.write ("<a href='http://www.mobidia.com/" + arrProducs[i][0] + ".shtml'>");
				document.write (arrProdPath[i][0] + "</a>&nbsp;-&gt;&nbsp;&nbsp;");
				// Inserts the title of the Current page
			} 
			// Inserts the title of the Current page
			document.write (arrProdPath[i][s]);
		}
	// When the current page is one of the main pages from mainmenu items
	} else {
		// Insert the Main page title
		document.write (arrPath[secNum][0]);
	}
}
//

/*
//Build Sub Menu
function sidemenu () {
	// Defines the length of submenu items
	var intSubLength = arrSiteMap[secNum].length-1;
	// Defines the current active page
	var k = intSubSelected-1;
	// Insert the submenu separation LINE on top
	document.write ("<img class='sideGlobalMenuBar_separator' src='images/h_249x2_sepLine.gif' align='middle' alt='' /><br />");
	// Builds submenu based on the defined length
	for(i = 0; i <= intSubLength; i++) {
		// Check if the the submenu item is the "whitepaper" page while the current page is not "whitepaper"
		if(arrSiteMap[secNum][i] == "whitepaper" && k != i) {
			// Creates the clickable submenu item 
			document.write ("<span class='sideGlobalMenuBar_Link'>");
			document.write ("<a href='http://contactform.mobidia.com/whitepaper.aspx'>.: &nbsp;" + arrPath[secNum][i] + "</a>");
		// Checks if the submenu item is not the current page
		} else if(k != i) {
			document.write ("<span class='sideGlobalMenuBar_Link'>");
			document.write ("<a href='http://www.mobidia.com/" + arrSiteMap[secNum][i] + ".shtml'>.: &nbsp;" + arrPath[secNum][i] + "</a>");
		// When the submenu item is the current page
		} else {
			// Checks if the the submenu item is the "pressroom" (Press Releases) page while the current page is "pressroom"
			if(arrSiteMap[secNum][i] == "pressroom") {
				sidemenuPress ();
			// Checks if the the submenu item is the "Products" page	
			} else if(arrSiteMap[secNum][0] == "products") {
				sidemenuProduts ();
			} else {
				// Creates the submenu item for currnt page
				document.write ("<span class='sideGlobalMenuBar_Link_Active'>");
				document.write (":: &nbsp;&nbsp;" + arrPath[secNum][i]);							
			}
		}
		// To close the SPAN, BREAK and submenu separation UNDERLINE 
		// Checks if the the submenu item is the "pressroom" (Press Releases) page and the current page is "pressroom" as well
		if(k == i && arrSiteMap[secNum][i] == "pressroom") {
			// Ignores the closing SPAN, BREAK and submenu separation UNDERLINE because it getes it fron "sidemenuPress" function
		} else {
			// Closes the SPAN, BREAK and submenu separation UNDERLINE 
			document.write ("</span><br /> ");
			document.write ("<img class='sideGlobalMenuBar_separator' src='images/h_249x2_sepLine.gif' align='middle' alt='' /><br />");
		}
			
	}
}
*/
//-->
