

// ---------- script properties ----------

var include_num = 1;
var bold = 0;

// ---------- sites ----------


var s = new Array();

s[0] = "NAME^URL.html^^keyword, keyword";
s[1] = "Steriods and Supplements^Steroids_Supplements1.html^^steroids, supplements, performance, enhancing, banned, substances, testing, positive, creatine, IOC, WADA, drugs";
s[2] = "Steriods & Supplements^Steroids_Supplements2.html^^steroids, Dianabol, illegal, hormones, Dysmorphic, health, risks, cardiac, cancer, pressure, risk, testing, banned, substances, schedule, cheating, drugs";
s[3] = "Steroid Use^Steroids_Supplements3.html^^steroids, enhance, performance, risks, schedule, drugs, weight, muscle, acne, Gynaecomastia, hyperactivity, lethargy, Doping, Hotline, testing, banned, substances ";
s[4] = "Dealing With Binge Drinking^Binge_Drinking.html^^binge, drinking, alcohol, consumption, abuse, underage, sexual, risk, substance, use, homicide, depression, anxiety, attention, deficit, hyperactivity, disorder, bulimia, schizophrenia";
s[5] = "The Value of Sport^Value_of_Sport.html^^participate, organised, sport, health, habits, social, skills, exercise, fitness, obesity, diabetes, heart, disease, anxiety, depression, concentration, memory, behaviour";
s[6] = "Depression^Depression.html^^happiness, self, esteem, happy, unhappy, depression";
s[7] = "Bully Truths^Bullying.html^^bullying, bully, physical, verbal, abuse";
s[8] = "Concussion^Concussion.html^^concussion, concussed, concentration, death, Boksmart, consciousness, memory, loss, confusion, headache, nausea, dizziness, sensitivity, light, noise, excessive, tiredness, numbness, tingling, drowsiness, vomiting, seizure,  seizures, speech, neck, concentration, amnesia";
s[9] = "Changes to Concussion Rules^News030611.html^^concussion, retire, contact, neurological, specialist, mandatory, rest, symptom, free, I.R.B., IRB, Zurich, Consensus, Statement, Kennedy, Ashton, guidelines";
s[10] = "Sports Supplements - Are they worth it^News070711.html^^supplements, peak, performance, dietitian, diet, supplementation, contaminated, banned, substances, contaminants, steroids, stimulants, enhancement";
s[11] = "The Elite Child Athlete^News080811.html^^Elite, Els, Smit, Olympic, burn, out, sport, break, training, guideline, chronic, concentration, injury, injuries, training, diet, hydration, equipment, competition";
s[12] = "Strength Training in Children^News200711.html^^training, children, gym, Paediatrics,, young, youth, supervision, certified, strength, conditioning, coach, weights";
s[13] = "^.html^^";
s[14] = "^.html^^";
s[15] = "^.html^^";
s[16] = "^.html^^";
s[17] = "^.html^^";
s[18] = "^.html^^";



// ---------- end of script properties and sites ----------


var cookies = document.cookie;
var p = cookies.indexOf("d=");

if (p != -1) {
	var st = p + 2;
	var en = cookies.indexOf(";", st);
	if (en == -1) {
		en = cookies.length;
	}
	var d = cookies.substring(st, en);
	d = unescape(d);
}
var od = d;
var m = 0;
if (d.charAt(0) == '"' && d.charAt(d.length - 1) == '"') {
	m = 1;
}

var r = new Array();
var co = 0;

if (m == 0) {
	var woin = new Array();
	var w = d.split(" ");
	for (var a = 0; a < w.length; a++) {
		woin[a] = 0;
		if (w[a].charAt(0) == '-') {
			woin[a] = 1;
		}
	}
	for (var a = 0; a < w.length; a++) {
		w[a] = w[a].replace(/^\-|^\+/gi, "");
	}
	a = 0;
	for (var c = 0; c < s.length; c++) {
		pa = 0;
		nh = 0;
		for (var i = 0; i < woin.length; i++) {
			if (woin[i] == 0) {
				nh++;
				var pat = new RegExp(w[i], "i");
				var rn = s[c].search(pat);
				if (rn >= 0) {
					pa++;
				} else {
					pa = 0;
				}
			}
			if (woin[i] == 1) {
				var pat = new RegExp(w[i], "i");
				var rn = s[c].search(pat);
				if (rn >= 0) {
					pa = 0;
				}
			}
		}
		if (pa == nh) {
			r[a] = s[c];
			a++;
		}
	}
	co = a;
}

if (m == 1) {
	d = d.replace(/"/gi, "");
	var a = 0;
	var pat = new RegExp(d, "i");
	for (var c = 0; c < s.length; c++) {
		var rn = s[c].search(pat);
		if (rn >= 0) {
			r[a] = s[c];
			a++;
		}
	}
	co = a;

}


function return_query() {
	document.jse_Form.d.value = od;
}

function num_jse() {
	document.write(co);
}

function out_jse() {
	if (co == 0) {
		document.write('Your search did not match any documents.<p>Make sure all keywords are spelt correctly.<br>Try different or more general keywords.');
		return;
	}
	for (var a = 0; a < r.length; a++) {
		var os = r[a].split("^");
		if (bold == 1 && m == 1) {
			var br = "<b>" + d + "</b>";
			os[2] = os[2].replace(pat, br);
		}
		if (include_num == 1) {
			document.write(a + 1, '. <a href="', os[1], '">', os[0], '</a><br>', os[2], '<p>');
		} else {
			document.write('<a href="', os[1], '">', os[0], '</a><br>', os[2], '<p>');
		}
	}

}

