<!-- Heavily modified code from: The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
/*
This file handles three different random entities:
1. A random image that is displayed on most pages above the left-hand nav links
2. A random image + link that is displayed on most pages below the left-hand nav links
3. Multiple random gradients, their text overlays, and links to more information in the right column of most pages
*/

/*
1. Display a random image
*/
var randomImage1 = new Array()
randomImage1[0] = '/images/Dollar_Small.jpg';
randomImage1[1] = '/images/physician_small.jpg';
randomImage1[2] = '/images/calculator.jpg';

function showRandomImage() {
	var p = randomImage1.length;
	var index = Math.round(Math.random()*(p-1));
	document.write('<img width="110" src="' + randomImage1[index] + '">');
}

/*
2. Display a random image with a link
randomImage2 and randomLink must have the same number of elements or errors will occur
*/
var randomImage2 = new Array();
var randomLink = new Array();
var newWindow = new Array();
randomImage2[0] = '/images/WHY_icon_internal.jpg';
randomLink[0] = '/Services/scope.shtml';
newWindow[0] = false;
randomImage2[1] = '/images/QAide_Icon_internal.jpg';
randomLink[1] = '/video/QAideDemo.wmv';
newWindow[1] = true;
randomImage2[2] = '/images/revenue_calculator_small.gif';
randomLink[2] = '/Downloads/Electronic Revenue Calculator.xls';
newWindow[2] = true;
randomImage2[3] = '/images/Brochure_Icon_internal.jpg';
randomLink[3] = '/Downloads/PHMGbrochure_9-07_web.pdf';
newWindow[3] = true;

function showRandomImageLink() {
	var p = randomImage2.length;
	var index = Math.round(Math.random()*(p-1));
	document.write('<a href="' + randomLink[index] + '"');
	if(newWindow[index]) {
		document.write(' target="_blank"');
	}
	document.write('><img src="' + randomImage2[index] + '"></a>');
}

/*
3. Display a gradient, some header text, some body text, and a link to more information.
All three arrays must be the same size or errors will occur.
*/
var gradHeader = new Array();
var gradBody = new Array();
var gradLink = new Array();
var i = 0;

gradHeader[i] = 'Total Practice Management';
gradBody[i] = 'PHMG offers client-centered, data-driven total practice management services to new or established clinical teams';
gradLink[i] = '/Services/practicemanagement.shtml';
i++;

gradHeader[i] = 'Electronic Medical Billing Service';
gradBody[i] = 'Learn more about our electronic medical billing service and how we can increase total revenue';
gradLink[i] = '/Services/revenuecycle.shtml';
i++;

gradHeader[i] = 'Physician Billing Software';
gradBody[i] = 'Learn how your practice can benefit from our proprietary physician billing software';
gradLink[i] = '/Services/technology.shtml';
i++;

gradHeader[i] = 'Healthcare Coding';
gradBody[i] = 'PHMG offers comprehensive healthcare coding services and chart audits to physician and hospital clients';
gradLink[i] = '/Services/healthcarecoding.shtml';
i++;

gradHeader[i] = 'Technology Solutions';
gradBody[i] = 'PHMG offers expert guidance in selecting and creating the latest in healthcare technology business solutions';
gradLink[i] = '/Services/technology.shtml';
i++;

gradHeader[i] = 'Practice Management Consultants';
gradBody[i] = 'PHMG’s practice management consultants have increased a client’s revenues by more than 19%';
gradLink[i] = '/Services/revenuecycle.shtml';
i++;

gradHeader[i] = 'Hospitalist Medicine';
gradBody[i] = 'PHMG has designed proprietary software that tracks census data, average LOS, physician scheduling, etc. to produce real-time reports';
gradLink[i] = '/Services/hospitalistmedicine.shtml';
i++;

gradHeader[i] = 'Emergency Medicine';
gradBody[i] = 'PHMG offers solutions that lower A/R days and denial rates and increase payment per procedure';
gradLink[i] = '/Services/emergencymedicine.shtml';
i++;

function showRandomGradients(amount) {
	var indexes = new Array();
	var maxIndex = gradHeader.length;
	var i = 0;
	
	/*
	Randomly generate the list of indexes to display.  If "amount" is greater than or equal to the maximum number
	of gradients to choose from, we set "amount" equal to the max and fill the list of indexes with all of the
	gradients.  Otherwise, we randomly select "amount" indexes to display.
	*/
	if(amount >= maxIndex) {
		for(i = 0; i < maxIndex; i++) {
			indexes[i] = i;
		}
		amount = maxIndex;
	} else {
		while(indexes.length < amount) {
			var index = Math.round(Math.random()*(maxIndex-1));
			var found = false; // Do not display the same entry twice
			for(j = 0; j < indexes.length; j++) {
				if(indexes[j] == index) {
					found = true;
					break;
				}
			}
			if(!found) {
				indexes[i++] = index;
			}
		}
	}
	
	// Display the gradients
	for(i = 0; i < amount; i++) {
		document.write('<div class="BaseYellowBox gradient">');
			document.write('<img class="gradient_image" src="/images/grad_white.png" alt="Gradient" />');
			document.write('<span><span class="YellowBoxHeading"><a href="' + gradLink[indexes[i]] + '">' + gradHeader[indexes[i]] + '</a></span><br />');
			document.write(gradBody[indexes[i]] + '<br />');
			document.write('<img src="../images/blue_dot.gif" alt="Horizontal rule" class="ReplacementHR"/>');
			document.write('<div class="MoreLinks"><a href="' + gradLink[indexes[i]] + '">More ...</a></div></span>');
		document.write('</div>');
	}
}
//  End -->