
// This script came from  
// Uncle Jim's Javascript Examples 
// JDStiles.com

var key = "";
function makeEntry (){
	this.Name="";
	this.URL = "";
	this.Desc = "";
	this.Category = "";
	return this;
}

 function makeArray(n) {
	this.length = n;
	for (var k = 1; k <= n; k++) {
		this[k] = "";
	}
	return this;
}               

function makeLinks(size) {
	this.length = size;
	for (var r=1; r<= size; r++) {
		this[r] = new makeEntry();
		this[r].Name = namesArray[r];
		this[r].URL = urlsArray[r];
		this[r].Desc = descArray[r];
	}
	return this;
}



var linksize=0;

datesArray = new makeArray(linksize);
namesArray = new makeArray(linksize);
urlsArray = new makeArray(linksize);
descArray = new makeArray(linksize);


var arraycount=0;

arraycount += 1; 
urlsArray[arraycount] = "http://www.wvchip.org/search.shtml";
namesArray[arraycount] = "WVCHIP Website Search";
descArray[arraycount] = "Search the WVCHIP website.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/index2.shtml";
namesArray[arraycount] = "WVCHIP Home Page";
descArray[arraycount] = "The West Virginia Children’s Health Insurance Program (WVCHIP) is a low cost health care plan for children and teenagers of working families. Working together, we will make sure your children get the high quality health insurance they need. It’s easy to get more information about WVCHIP. Start by exploring this website.";

arraycount += 1; 
urlsArray[arraycount] = "http://www.wvchip.org/amin_eligibility.shtml";
namesArray[arraycount] = "American Indian and Native Alaskan Eligibility";
descArray[arraycount] = "Children who are members of federally recognized American Indian or Native Alaskan tribes are not required to pay co-payments once enrolled in the West Virginia Children’s Health Insurance Program.";

arraycount += 1; 
urlsArray[arraycount] = "http://www.wvchip.org/apply_help.shtml";
namesArray[arraycount] = "Apply For WVCHIP";
descArray[arraycount] = "Need help applying for WVCHIP?  Applying for WVCHIP can be completed entirely in your own home. If you would like to have face to face contact with someone, you may select one of the many outreach and enrollment sites listed by county, below. The outreach and enrollment sites also have applications available if you choose to personally obtain one.";

arraycount += 1; 
urlsArray[arraycount] = "http://www.wvchip.org/benefits.shtml";
namesArray[arraycount] = "Summary of Benefits";
descArray[arraycount] = "Doctors office visits, hospitalization, urgent care or after hours clinic visits, perscription drugs, immunizations, dental services, oral surgery, accident related dental services, vision services and therapy, well care child. Mental health and chemical dependency services.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/benefits.shtml";
namesArray[arraycount] = "Childrens Health Insurance Board";
descArray[arraycount] = "Childrens Health Insurance Board. Currently, the following members comprise the Children’s Health Insurance Board...";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/chip_contact.shtml";
namesArray[arraycount] = "WVCHIP Contact Information";
descArray[arraycount] = "Do you have eligibility questions on how to qualify for WV CHIP? Do you need help filling out the application, or want to check on the status of your application? Contact WVCHIP Helpline toll-free at 1-877-WVA-CHIP (1-877-982-2447) which is available Monday through Friday, 8 am to 8 pm.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/chipnotes.shtml";
namesArray[arraycount] = "Chip Notes";
descArray[arraycount] = "Coordinated Payor Billing Workshops. Moving News. CHIP Members May Qualify for Earned Income Tax and Child Care Credits. Payment Accuracy Measurement (PAM) Demonstration Project. Apply online using inROADS.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/chip_staff.shtml";
namesArray[arraycount] = "Staff Directory";
descArray[arraycount] = "WVCHIP Staff directory listing and contact information.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/copay.shtml";
namesArray[arraycount] = "Copay Information";
descArray[arraycount] = "The WVCHIP Plan has two levels of copayment participation. Members under Group A have copayments for brand name prescription drugs only. Members under Group B have copayments for prescription drugs and for some medical and other health services.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/eligible.shtml";
namesArray[arraycount] = "Who Is Eligible";
descArray[arraycount] = "Income Guidelines, Whose Income Is Counted? Can my family qualify for WVCHIP if our income is over the amount listed on the income chart? What types of deductions are allowed if I am self-employed? Where can my family get health care if we don’t meet the WVCHIP guidelines?";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/enrollment.shtml";
namesArray[arraycount] = "Enrollment Information";
descArray[arraycount] = "Find out how many children are currently enrolled in WVCHIP. It’s easy to start your WVCHIP application over the phone or to complete it online. You will need to share information on who is in your family and your family’s income.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/faqs.shtml";
namesArray[arraycount] = "Frequently Asked Questions";
descArray[arraycount] = "If your question is not answered in this section, please review Who Is Eligible, Enrollment Information and Current Members. You may also contact the toll-free helpline at 1-877-982-2447 for additional information.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/general_info.shtml";
namesArray[arraycount] = "What is WVCHIP?";
descArray[arraycount] = "WVCHIP was created to help working families who do not have health insurance for their children. You want your kids to be healthy. One good way to keep them healthy is making sure they get medical care. Children who get good medical care have a better chance of being healthy and doing well in school.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/grandparents.shtml";
namesArray[arraycount] = "Grandparents Information";
descArray[arraycount] = "WVCHIP could be the solution for your grandchildren’s health insurance needs. If you are raising your grandchildren, one of your biggest worries may be how to keep them healthy and strong. Having health insurance can make it possible for you to get health care for your grandchildren before they are seriously ill. Now, more uninsured children than ever are getting health insurance through WVCHIP.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/healthy.shtml";
namesArray[arraycount] = "Healthy Kids";
descArray[arraycount] = "When you bring your children in for well child visits regularly during their growing up years, the doctor can find and treat little problems before they become big ones.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/immigrant.shtml";
namesArray[arraycount] = "Immigrant Information";
descArray[arraycount] = "Immigrant restrictions have been dropped for children! Any legal immigrant child who is lawfully admitted for permanent residence after August 22, 1996 NO LONGER must wait five years to be eligible for the West Virginia Children’s Health Insurance Program.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/insurance.shtml";
namesArray[arraycount] = "Insurance Exceptions";
descArray[arraycount] = "If your child has had other insurance within the last six months, you will not qualify unless you meet one of the following exceptions...";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/links.shtml";
namesArray[arraycount] = "Helpful Links";
descArray[arraycount] = "Links to Programs and Organizations that support the Mission of WV CHIP and the Children of West Virginia. Links to National, Federal, and Other Programs which relate to the Children's Health Insurance Program";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/materials.shtml";
namesArray[arraycount] = "WVCHIP Materials";
descArray[arraycount] = "WVCHIP promotional items are available for use in community outreach activities. If you work with an organization, etc. that serves or interacts with families who may be eligible to participate in WVCHIP, you can order materials to promote WVCHIP free of charge. Please click on the order form that most closely resembles your type of outreach.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/members.shtml";
namesArray[arraycount] = "Current WVCHIP Members";
descArray[arraycount] = "The toll-free helpline welcomes calls from members and non-members. Please call 1-877-982-2447. Someone will take your call from 8:00 am to 8:00 pm, Monday through Friday. During other hours, you can leave a message and a CHIP customer service representative will return your call.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/notice_changes.shtml";
namesArray[arraycount] = "Notice of Changes";
descArray[arraycount] = "Notice of Changes to the WV CHIP Program. The following changes have been made to the West Virginia Children's Health Insurance Program (WV CHIP), and are effective on July 1, 2002.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/outreach.shtml";
namesArray[arraycount] = "Outreach Information";
descArray[arraycount] = " There are several agencies and organizations that are committed to helping WVCHIP promote information about low-cost health care to working families. They may also be able to help you complete an application or just answer a question about the program. Click here for the community outreach team.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/outreach_events.shtml";
namesArray[arraycount] = "Outreach Events";
descArray[arraycount] = "This section is dedicated to informing you of events in West Virginia in support of the Children's Health Insurance Program.  If you have any pictures or news of CHIP events, please notify us to add to this page.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/outreach_forms.shtml";
namesArray[arraycount] = "Outreach Forms";
descArray[arraycount] = "As you may know, it is asked that you fill out a request form when CHIP materials are needed such as: applications, publications, other available outreach materials, or even to request use of CHIPPY the WV CHIP Mascot costume. This process makes it much easier for the CHIP office to fill your requests correctly and in a timely matter.  You can now download and print the needed forms from this page.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/provider.shtml";
namesArray[arraycount] = "Provider Information";
descArray[arraycount] = "Providers do not have to a member of WVCHIP to provide services to a child who has health coverage through CHIP. They only need to accept the reimbursement amount provided by CHIP.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/reports.shtml";
namesArray[arraycount] = "Reports and Documents";
descArray[arraycount] = "This page consists of reports and documents found in this website. Most of the reports and documents are in Adobe Acrobat (.pdf) format. PDF formatted documents look just like the original printed documents.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/resources.shtml";
namesArray[arraycount] = "Resources";
descArray[arraycount] = "Helpful resources and links. WVCHIP Plan Resources, MEDICAID Resources, State Government Resources, Federal Resources.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/supporting_orgs.shtml";
namesArray[arraycount] = "Supporting Organizations";
descArray[arraycount] = "The WV Children's Health Insurance Program (WV CHIP) realizes how important it is for everyone in the community to take part in WV CHIP outreach and education. There are children that can be helped by WV CHIP, but we need help in reaching those families who may not have information on the Program. Educating parents about the program is very important in making sure the children of West Virginia have health care coverage.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/training.shtml";
namesArray[arraycount] = "WVCHIP Training Information";
descArray[arraycount] = "Community Training Workshops conducted by WVCHIP provide an in-depth seminar on the WVCHIP. Included in the training is an overview of WVCHIP, current topics, changes to the program, eligibility information, outreach information, and more.";

arraycount += 1;
urlsArray[arraycount] = "http://www.wvchip.org/whatswvchip.shtml";
namesArray[arraycount] = "What is WVCHIP";
descArray[arraycount] = "WVCHIP was created to help working families who do not have health insurance for their children. You want your kids to be healthy. One good way to keep them healthy is making sure they get medical care. Children who get good medical care have a better chance of being healthy and doing well in school.";

linksize = arraycount;

// ----end data -------


function searchLinks(links, keyword){
	results = "";     
	results += ('<br /><br />Search results for keyword: <strong>' +keyword +'</strong><br /><br />');
	results += "<ol>";
	for (var q=1; q<=links.length; q++) {
		
		if (links[q].URL.toLowerCase().indexOf(keyword) != -1){
		  	results += ("<li><a href=" + links[q].URL +">" + links[q].Name + "</a> - ");
		  	results += ( links[q].Desc + "</li>");
		  	continue;
		}
		if (links[q].Desc.toLowerCase().indexOf(keyword) != -1) {
		  	results += ("<li><a href=" + links[q].URL +">" + links[q].Name + "</a> - ");
		  	results += ( links[q].Desc + "</li>");
		  	continue;
		}
		if (links[q].Name.toLowerCase().indexOf(keyword) != -1) {
		  	results += ("<li><a href=" + links[q].URL +">" + links[q].Name + "</a> - ");
		  	results += ( links[q].Desc + "</li>");
		  	continue;
		}
	}  
	results += "</ol>"; 
	return results;                            
}
		
function validate_form() {		
	txt = document.form.search.value;
	if (txt.indexOf(".") != -1){ alert("Search is invalid! Contains a '.'"); return;}
	if (txt.indexOf(",") != -1){ alert("Search is invalid! Contains a ','"); return;}
	if (txt.indexOf("@") != -1){ alert("Search is invalid! Contains a '@''"); return;}
	if (txt.indexOf("!") != -1){ alert("Search is invalid! Contains a '!''"); return;}
	if (txt.indexOf("#") != -1){ alert("Search is invalid! Contains a '#''"); return;}
	if (txt.indexOf("$") != -1){ alert("Search is invalid! Contains a '$''"); return;}
	if (txt.indexOf("%") != -1){ alert("Search is invalid! Contains a '%''"); return;}
	if (txt.indexOf("^") != -1){ alert("Search is invalid! Contains a '^''"); return;}
	if (txt.indexOf("&") != -1){ alert("Search is invalid! Contains a '&''"); return;}
	if (txt.indexOf("*") != -1){ alert("Search is invalid! Contains a '*''"); return;}
	if (txt.indexOf("(") != -1){ alert("Search is invalid! Contains a '(''"); return;}
	if (txt.indexOf(")") != -1){ alert("Search is invalid! Contains a ')''"); return;}
	if (txt.indexOf("[") != -1){ alert("Search is invalid! Contains a '[''"); return;}
	if (txt.indexOf("]") != -1){ alert("Search is invalid! Contains a ']''"); return;}
	if (txt.indexOf(";") != -1){ alert("Search is invalid! Contains a ';''"); return;}
	if (txt.indexOf(":") != -1){ alert("Search is invalid! Contains a ':''"); return;}
	if (txt.indexOf("<") != -1){ alert("Search is invalid! Contains a '<''"); return;}
	if (txt.indexOf(">") != -1){ alert("Search is invalid! Contains a '>''"); return;}
	if (txt.indexOf("?") != -1){ alert("Search is invalid! Contains a '?''"); return;}
	if (txt.indexOf("-") != -1){ alert("Search is invalid! Contains a '-''"); return;}
	if (txt.indexOf("=") != -1){ alert("Search is invalid! Contains a '=''"); return;}
	if (txt.indexOf("+") != -1){ alert("Search is invalid! Contains a '+''"); return;}
	else { 
		jsi = new makeLinks(linksize);
		results = searchLinks(jsi, txt);
	}
	document.getElementById("searchResults").innerHTML = results;
}
