// 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
*/
/* :::::::::::::::::: */
//
//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' 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 ();
			} else {
				// Creates the submenu item for currnt page
				document.write ("<span class='sideGlobalMenuBar_Link_Active'>");
				document.write (":: &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(arrSiteMap[secNum][i] == "pressroom" && k == i) {
			// 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' 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 (":: &nbsp;" + 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'>.: &nbsp;" + 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'>.: &nbsp;" + 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 (":: &nbsp;" + 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" pages
		if(arrSiteMap[secNum][i] != "pressroom") {
			// Inserts the title of the Current page
			document.write (arrPath[secNum][i]);
		// When current page is one of the "Press Releases" pages
		} else {
			// 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 the current page is one of the main pages from mainmenu items
	} else {
		// Insert the Main page title
		document.write (arrPath[secNum][0]);
	}
}
//
//-->