/* Common Javascript Functions */
/*
	Functions:
		1. Date Function for header
		2. Header Function
		3. Footer Function
		4. Left Menu
		
	Title:       : common.js
				 : AppMed, Inc. Medical Billing
	Version      : 2.0
	Release Date : 01/2011
	Description  : Common Routines for all Web Pages
*/


 function dateArray(n) {

	this.length = n

	return this

	}

	var dayNames;
	dayNames = new dateArray(7);

	dayNames[1] = "Sunday"
	dayNames[2] = "Monday"
	dayNames[3] = "Tuesday"
	dayNames[4] = "Wednesday"
	dayNames[5] = "Thursday"
	dayNames[6] = "Friday"
	dayNames[7] = "Saturday"

	function myDateString(oneDate) {

		var theDay = dayNames[oneDate.getDay() + 1]
		var theMonth = oneDate.getMonth() + 1

		if (document.all)

		{var IE4=true

 		}
		else{

 		var NN4=true
		}

		var theYear = oneDate.getFullYear()
		var currDay = oneDate.getDate();
		
		if (currDay < 9) {
			currDay = "0" + currDay;
		}
		
		if (theMonth < 10) {
			theMonth = "0" + theMonth;
		}

		return theDay + ", " + theMonth + "." + currDay +

		"." + theYear
	}


function footer() {

	document.write("<div style='clear: both;'>&nbsp;</div>");
	document.write("<div id='footer'>");
	document.write("<p id='legal'>Copyright &copy; 2011 AppMed, Inc. All Rights Reserved. &bull; Designed by: JDM</p>");
	document.write("<p id='links'><a href='privacy_policy.html'>Privacy Policy</a> | <a href='terms_of_use_page.html'>Terms of Use</a></p>");
	document.write("</div>");
	document.write("</body>");
	document.write("</html>");
	
	}


function header() {
	
	var now = myDateString(new Date)

	document.write("<img src=images/appmedlogo.png alt=Logo />");
	document.write("<p>AppMed PM and EHR Software</p>");
	document.write("<p class=p3>ONC-ATCB Certified EHR</p>");
	document.write("<p class=p2>Where Healthcare and Technology Converge</p>");
	document.write("<h4>" + now + "</h4><br />");
	

	}

function menuArray(n) {

	this.length = n

	return this

	}

	var menuNames;
	menuNames = new menuArray(42);
	
	menuNames[1] = ("<div id=main>");
	menuNames[2] = ("<span>AppMed</span>");
	menuNames[3] = ("<a href='default.htm'>Home</a>");
	menuNames[4] = ("<a href='aboutus.html'>About Us</a>");
	menuNames[5] = ("<a href='contactus.php'>Contact Us</a>");
	menuNames[6] = ("</div>");
	
	menuNames[7] = ("<div id=products>");
	menuNames[8] = ("<span>Appmed Products</span>");
	menuNames[9] = ("<a href='billing.html'>Billing / Practice Mgmnt.</a>");
	menuNames[10] = ("<a href='scheduling.html'>Patient Appt. Scheduling</a>");
	menuNames[11] = ("<a href='emr.html'>Electronic Medical Records (EMR/EHR)</a>");
	menuNames[12] = ("<a href='eprescribing.html'>AppMed E / Prescribing</a>");
	menuNames[13] = ("<a href='contactus.php'>Contact Us</a>");
	menuNames[14] = ("</div>");
	
	menuNames[15] = ("<div id=Services>");
	menuNames[16] = ("<span>Additional Services</span>");
	menuNames[17] = ("<a href='training.html'>Training</a>");
	menuNames[18] = ("<a href='support.html'>Customer Support</a>");
	menuNames[19] = ("<a href='hosting.html'>Application Hosting</a>");
	menuNames[20] = ("<a href='tfsdefault.html'>Medical Billing Services</a>");
	menuNames[21] = ("<a href='addlservices.html'>Data Conversion</a>");
	menuNames[22] = ("</div>");
	
	menuNames[23] = ("<div>");
	menuNames[24] = ("<span>Appmed News</span>");
	menuNames[25] = ("<a href='events.html'>Events</a>");
	menuNames[26] = ("<a href='publications.html'>Publications</a>");
	menuNames[27] = ("<a href='articles.html'>Articles</a>");
	menuNames[28] = ("<a href='reseller.html'>Reseller</a>");
	menuNames[29] = ("</div>");
	
	menuNames[30] = ("<div>");
    menuNames[31] = ("<span>Client Support</span>");
	menuNames[32] = ("<a href='updates.php'>Get Software Updates</a>");
	menuNames[33] = ("<a href='popularsites.html'>Popular Sites</a>");
	menuNames[34] = ("<a href='downloads.html'>Popular Downloads</a>");
	menuNames[35] = ("<a href='partners.html'>Bus to Bus Partners</a>");	
	menuNames[36] = ("<a href='faq.php'>FAQ's</a>");
	menuNames[37] = ("<a href='contactus.php'>Contact Us</a>");
	menuNames[38] = ("</div>");
	
	menuNames[39] = ("<div class='collapsed'>");
	menuNames[40] = ("<span>Bulletin Board</span>");
	menuNames[41] = ("<a href='forums/index.php'>Bulletin Board</a>");
	menuNames[42] = ("</div>");
	
function arrayCnt(arrayCnt) {
	var intCnt
	intCnt = 42
	return intCnt
	}				

function myMenuString(a) {

	var menuItem	
	
	menuItem = menuNames[a];
	return menuItem
}


