function investor(actionVal){
	if(document.frmLogin.userId.value == ""){
		alert("Please enter your USER ID!");
		document.frmLogin.userId.focus();
	
		return false;
	}
	if(document.frmLogin.password.value == ""){
		alert("Please enter your PASSWORD!");
		document.frmLogin.password.focus();
	
		return false;
	}
	

	if((document.frmLogin.userId.value != "health")||(document.frmLogin.password.value != "health101")){
		//location.reload();
		document.frmLogin.userId.value = "";
		document.frmLogin.password.value = "";
		msg.innerHTML = "<font color='#FF0000'>Login failed! Please re-enter your UserId and Password.<\/font>";
	
		return false;
	}
	return true;
}


function ShowPage(page)
{
	OpenWin=this.open(page, 'HealthHighway', "TOOLBAR=no,MENUBAR=no,RESIZABLE=yes,SCROLLBARS=yes,STATUS=0");
}

function winOpen(file,winname){
		var demo = window.open(file,winname,'scrollbar=no,status=no, menubar=no, location=no, resizable=yes'); 
		
	}
function memLogin(what, secure){
	var logpage;
//	uncomment this when this goes on the SSL.
	if((arguments.length > 1) && (arguments[1])){
		logpage = "http://" + location.host + "/" + what;
		}else{
			logpage = "http://" + location.host + "/" + what;
		}
	
	location.href = logpage;
}

function tmemLogin(what, secure){
	var logpage;
//	var kahan = "www.healthhighway.com"
	var kahan = location.host;
//	uncomment this when this goes on the SSL.
	alert("You are being transferred to a secure site!");
	logpage = "https://" + kahan + "/" + what;
	
	window.opener.location.href = logpage;
document.writeln("You are being transferred to HealthHighway's secured portal!");

	window.close();
	//location.href = logpage;
	
}

// for index.htm

function swap(imgIndex,where) {
    document[where].src = aryImages[imgIndex];
  }
  
  // generates rnd number and returns
  // it receives a seed value and then returns a random integer between 0 and the seed value
 
 
function rnd(seed){
	return Math.round(Math.random()* seed);
  }
  
  function init(){
 
		getRnd();
  }

// GLOBAL DECLERATION OF ARRAYS
// section for random tag lines 
	var tagLines = new Array(7);  // tagline array
	var cComment = new Array(3);  // user comment array
	var cAuthor = new Array (3);  // user name (author)
	var aryBanner = new Array(2);
	var aryBannerLink = new Array(2);
	var aryBT = new Array(8); // holds the add banner replacement text.
	
	// banner array
	
	aryBanner[0] = "/images/banner.gif";
	aryBanner[1] = "/images/banner1.gif";
	
	aryBannerLink[0] = "http://www.staples.com";
	aryBannerLink[1] = "http://www.esurg.com";
	// tagline array
	tagLines[0] = "Managed Care to Patient Care";
	tagLines[1] = "NextGen Health";
	tagLines[2] = "Connected Healthcare";
	tagLines[3] = "Helping you deliver ";
	tagLines[4] = "The Road to Simplicity ";
	tagLines[5] = "Helping you Deliver Healthcare ";
	tagLines[6] = "Connected Healthcare Delivery ";


	// client comments array
	cComment[0] = "Never seen a system as complete as this one!";
	cComment[1] = "Excellent! Got what I was looking for!!!";
	cComment[2] = "Next to perfect.";
	
	// client name array
	cAuthor[0] = "Dr. Edward";
	cAuthor[1] = "Dr. Neema";
	cAuthor[2] = "Dr. Dang";
  // end of tag lines array 


  
	// ad banner text array
		aryBT[0] = "A Million Dollar System for a modest monthly fee.";
		aryBT[1] = "Connected Healthcare for Providers, Patients, and Payers";
		aryBT[2] = "Buy your office supplies online at Staples.com";
		aryBT[3] = "Efficient and Cost Effective practice management tools.";
		aryBT[4] = "Get your medical and office supplies from e-Surg";
		aryBT[5] = "Your Clinical Data Always at your fingertips";
		aryBT[6] = "Subscription Based - Pay only for what you need and use";
		aryBT[7] = "Reduce or Eliminate Network Hassles";
		aryBT[8] = "Technology that works the way you do";
		aryBT[9] = "Easy to Learn – Easy to Use";


	// ad banner text array ends here

  // find lengths
	var lenTL = tagLines.length - 1;
	var lenCC = cComment.length - 1;
	var lenCA = cAuthor.length - 1;
	var lenAB = aryBanner.length - 1;
	var lenBT = aryBT.length - 1;
	var hold = rnd(lenCC);
	var hold2 = rnd(lenTL);

//RETURNS A RANDOM TEXT  
function getRnd(){
	
	setText(tagLines[rnd(lenTL)],cComment[hold],cAuthor[hold]);
	
//	alert ("lentTL " + lenTL + " lenCC " + lenCC + " lenCA " + lenCA + "\n temp is \n" + temp + "\n hold " + hold + "hold2" + hold2 + "\lenAB- " + lenAB + " banner.src = " + aryBanner[rnd(lenAB)]) ;
	return true;
  }

// SETS RANDOM TEXT, BANNER ETC   
function setText(tag, comment, author){  // sets the text in text areas for random tag lines and comments from clients also the style
 
	rndTagLine.className = "tagLine";
	rndComment.className = "comments";
	rndTagLine.innerHTML = tag;
	rndComment.innerHTML = comment + " - " + author;
//	setBanner('banner');   to remove banner from index.html

	setBannerTxt();

 } 
 
//SETS AD BANNERS 

 function setBanner(where){
	 abanner.target = "_blank";
	 var rndVal = rnd(lenAB);
	 banner.src = aryBanner[rndVal];
	 abanner.href = aryBannerLink[rndVal];
 }


function setBannerTxt(){
	var temp = aryBT[rnd(lenBT)];
	rndImg.innerHTML = "<span class=tagline>" + temp + "</span>";
}

// MENU SECTION
//'/gt21/who.htm','demo'
function zeTopMenu(){
		document.writeln("<td width=\"20%\" bgcolor=\"#fbf3ca\" align=\"middle\" onmouseout=\"this.style.background=\'#fbf3ca\'\" onmouseover=\"this.style.background=\'#a5b2d6\'\"><font color=\"#008080\" size=\"2\"><b><A href=\"redirect.jsp?to=\/index.html\">Home</A></b></font></td>");
        document.writeln("<td width=\"20%\" bgcolor=\"#fbf3ca\" align=\"middle\" onmouseout=\"this.style.background=\'#fbf3ca\'\" onmouseover=\"this.style.background=\'#a5b2d6\'\"><font color=\"#008080\" size=\"2\"><b><A href=\"redirect.jsp?to=\/aboutus.htm\" id=about>About Us</A></b></font></td>");
        document.writeln("<td width=\"20%\" bgcolor=\"#fbf3ca\" align=\"middle\" onmouseout=\"this.style.background=\'#fbf3ca\'\" onmouseover=\"this.style.background=\'#a5b2d6\'\" colspan=\"2\"><font color=\"#008080\" size=\"2\"><b><A href=\"redirect.jsp?to=\/services.htm\" id=services>Services</A></b></font></td>");
        document.writeln("<td width=\"20%\" bgcolor=\"#fbf3ca\" align=\"middle\" onmouseout=\"this.style.background=\'#fbf3ca\'\" onmouseover=\"this.style.background=\'#a5b2d6\'\"><font color=\"#008080\" size=\"2\"><b><A href=\"javascript:winOpen(\'\/gt21/who.htm\',\'demo\')\">Guided Tour</A></b></font></td>");
        document.writeln("<td width=\"20%\" bgcolor=\"#fbf3ca\" align=\"middle\" onmouseout=\"this.style.background=\'#fbf3ca\'\" onmouseover=\"this.style.background=\'#a5b2d6\'\"><font color=\"#008080\" size=\"2\"><b><A href=\"javascript:ShowPage(\'\/sregister.htm\')\">Sign Up Now</A></b></font></td>");
}




function zTopMenu(){
		document.writeln("<td width=\"20%\" bgcolor=\"#fbf3ca\" align=\"middle\" onmouseout=\"this.style.background=\'#fbf3ca\'\" onmouseover=\"this.style.background=\'#a5b2d6\'\"><font color=\"#008080\" size=\"2\"><b><A href=\"\/index.html\">Home</A></b></font></td>");
        document.writeln("<td width=\"20%\" bgcolor=\"#fbf3ca\" align=\"middle\" onmouseout=\"this.style.background=\'#fbf3ca\'\" onmouseover=\"this.style.background=\'#a5b2d6\'\"><font color=\"#008080\" size=\"2\"><b><A href=\"\/aboutus.htm\" id=about>About Us</A></b></font></td>");
        document.writeln("<td width=\"20%\" bgcolor=\"#fbf3ca\" align=\"middle\" onmouseout=\"this.style.background=\'#fbf3ca\'\" onmouseover=\"this.style.background=\'#a5b2d6\'\" colspan=\"2\"><font color=\"#008080\" size=\"2\"><b><A href=\"\/services.htm\" id=services>Services</A></b></font></td>");
        document.writeln("<td width=\"20%\" bgcolor=\"#fbf3ca\" align=\"middle\" onmouseout=\"this.style.background=\'#fbf3ca\'\" onmouseover=\"this.style.background=\'#a5b2d6\'\"><font color=\"#008080\" size=\"2\"><b><A href=\"javascript:winOpen(\'\/gt21/who.htm\',\'demo\')\">Guided Tour</A></b></font></td>");
        document.writeln("<td width=\"20%\" bgcolor=\"#fbf3ca\" align=\"middle\" onmouseout=\"this.style.background=\'#fbf3ca\'\" onmouseover=\"this.style.background=\'#a5b2d6\'\"><font color=\"#008080\" size=\"2\"><b><A href=\"javascript:ShowPage(\'\/sregister.htm\')\">Sign Up Now</A></b></font></td>");
}

function zFooter(){
	document.writeln("<td width=\"150\" align=\"middle\"><A href=\"\/contactus.htm\" ><font size=\"2\" color=\"#808080\">Contact Us</font></A></td>");
    document.writeln("<td width=\"150\" align=\"middle\"><A href=\"\/sitemap.htm\" ><font size=\"2\" color=\"white\">Site map</font></A></td>");// change color to 808080
    document.writeln("<td width=\"150\" align=\"middle\"><A href=\'javascript:ShowPage(\"\/termsofuse.htm#PrivacyStatement\")\'  termsofuse.htm#PrivacyStatement?)?? termsofuse.htm#PrivacyStatement?)?><font color=\"#808080\" size=\"2\">Privacy</font></A></td>");
    document.writeln("<td width=\"150\" align=\"middle\"><A href=\'javascript:ShowPage(\"\/termsofuse.htm#Pat_UseAgreement\")\'  termsofuse.htm#Pat_UseAgreement?)?? termsofuse.htm#Pat_UseAgreement?)?><font color=\"#808080\" size=\"2\">Terms of use</font></A></td>");
    document.writeln("<td width=\"151\"><a href=\"javascript:ShowPage(\'\/feedback.htm\')\"><font color=\"#808080\" size=\"2\">Your feedback</font></a></td>");
}


function zeFooter(){
	document.writeln("<td width=\"150\" align=\"middle\"><A href=\"redirect.jsp?to=\/contactus.htm\" ><font size=\"2\" color=\"#808080\">Contact Us</font></A></td>");
    document.writeln("<td width=\"150\" align=\"middle\"><A href=\"redirect.jsp?to=\/sitemap.htm\" ><font size=\"2\" color=\"white\">Site map</font></A></td>");
    document.writeln("<td width=\"150\" align=\"middle\"><A href=\'javascript:ShowPage(\"\/termsofuse.htm#PrivacyStatement\")\'  termsofuse.htm#PrivacyStatement?)?? termsofuse.htm#PrivacyStatement?)?><font color=\"#808080\" size=\"2\">Privacy</font></A></td>");
    document.writeln("<td width=\"150\" align=\"middle\"><A href=\'javascript:ShowPage(\"\/termsofuse.htm#Pat_UseAgreement\")\'  termsofuse.htm#Pat_UseAgreement?)?? termsofuse.htm#Pat_UseAgreement?)?><font color=\"#808080\" size=\"2\">Terms of use</font></A></td>");
    document.writeln("<td width=\"151\"><a href=\"javascript:ShowPage(\'\/feedback.htm\')\"><font color=\"#808080\" size=\"2\">Your feedback</font></a></td>");
}


//MENU SECTION ENDS HERE

//BOOKMARKS

function addBook(){
	var url;
	url = location.protocol + "//" + location.host + location.pathname;

	window.external.AddFavorite(url, "HealthHighway.com, Inc.");
}




function bookmarkus(){
	var ver = navigator.appName
	var num = parseInt(navigator.appVersion)
	
	if(ver.indexOf("Microsoft") != -1){
		document.writeln ("<a href=javascript:void(0) onclick=addBook() onmouseover=\"self.status='Bookmark Us'; return true\" onmouseout\"self.status=' '; return true\" ><b>Bookmark Us</b></a>");
	}else{
		document.writeln ("To Bookmark (CTRL + D)");
	}
}