// JavaScript Document
var optionsArr = new Array();
optionsArr = ["Acne",
			"Acne Scarring",
			"Brow position and shape",
			"Brown Spots",
			"Capillaries",
			"Cellulite",
			"Dark circles under eyes",
			"Decolletage",
			"Excessive sweating",
			"Eye bags - Upper / Lower",
			"Face dyschromia (blotchy colouring)",
			"Face telangiectasia (shown by cheeks)",
			"Facial Flushing / Redness",
			"Facial Rejuvenation",
			"Facial Veins",
			"Forehead sebaceous hyperplasia",
			"Glabella furrows",
			"Hair Removal",
			"Jaw / chin / neck definition",
			"Leg Veins",
			"Lines under eyes",
			"Lip Plumping and other facial filling",
			"Marionette lines and pre-jowl-sulcus",
			"Melasma Neck Poikiloderma",
			"Neck Poikiloderma",
			"Port Wine Stains",
			"Psoriasis",
			"Repigmentation",
			"Scarring",
			"Skin Cancer",
			"Skin Care Products",
			"Sunspots and other induced lesions",
			"Sunspots / Age Spots / Freckles",
			"Thickened / Keloid Scarring",
			"Vitiligo & white scarred skin",
			"Wrinkles - frown lines, worry lines, \"crow's feet\" lines"
			];

var resultsArr = new Array();
resultsArr[0] = [2, 18, 27];
resultsArr[1] = [1, 3, 4, 5, 11, 12 ,13, 18, 22, 23, 25];
resultsArr[2] = [6, 15];
resultsArr[3] = [3, 7, 23, 24];
resultsArr[4] = [7, 24];
resultsArr[5] = [15];
resultsArr[6] = [0, 1, 5, 10, 13, 16];
resultsArr[7] = [0, 7, 24, 25];
resultsArr[8] = [6];
resultsArr[9] = [10, 26];
resultsArr[10] = [0, 1, 2, 3, 7, 25, 26];
resultsArr[11] = [7, 24];
resultsArr[12] = [7, 24];
resultsArr[13] = [1, 2, 3, 6, 15, 16];
resultsArr[14] = [4, 7, 24];
resultsArr[15] = [0, 1, 7];
resultsArr[16] = [0, 5, 6];
resultsArr[17] = [8];
resultsArr[18] = [5, 6, 15, 16];
resultsArr[19] = [7];
resultsArr[20] = [0, 1, 6, 25, 26];
resultsArr[21] = [5, 24];
resultsArr[22] = [5, 6, 15, 16];
resultsArr[23] = [7];
resultsArr[24] = [0, 2, 7, 24, 25];
resultsArr[25] = [7, 24];
resultsArr[26] = [];
resultsArr[27] = [3, 17];
resultsArr[28] = [17, 25];
resultsArr[29] = [18, 19, 20,21];
resultsArr[30] = [0];
resultsArr[31] = [0, 1, 2, 18, 26];
resultsArr[32] = [3, 7, 23, 26, 27];
resultsArr[33] = [14];
resultsArr[34] = [17, 25];
resultsArr[35] = [1, 2, 3, 5, 6, 15, 16, 25];

var treatmentsArr = new Array();
treatmentsArr[0] = ["Preventative & reparative Skin Care", "/index.php?page=proc-skincareadvice", "The long-term aim of skin care is to delay skin ageing and maintain youthful, healthy skin. There are many preventative causes of skin damage and ageing, and several products that are helpful to reverse skin damage."];
treatmentsArr[1] = ["Erbium Laser", "/index.php?page=proc-laserresurfacing", "The surface layers of the skin are removed in order to erase or soften wrinkles, sun damage, and scarring or pigmentation problems."];
treatmentsArr[2] = ["Light to Medium Peels", "/index.php?page=proc-peels", "If bleaching creams aren't sufficient, light skin peeling is commonly used in the treatment of blotchy pigmentation. These peels are also used to treat acne, dry skin and fine wrinkling."];
treatmentsArr[3] = ["Laser Resurfacing", "/index.php?page=proc-laserresurfacing", "The surface layers of the skin are removed in order to erase or soften wrinkles, sun damage, and scarring or pigmentation problems."];
treatmentsArr[4] = ["Skin Rolling", "/index.php?page=proc-skinrolling", "A treatment for assisting the skin's own reparation of acne scars."];
treatmentsArr[5] = ["Dermal Fillers", "/index.php?page=proc-dermalfillers", "Facial lines may be softened or erased by injecting a substance into the skin to 'plump' out the line, scar or fold."];
treatmentsArr[6] = ["Muscle Relaxant Injection", "/index.php?page=proc-musclerelaxant", "Facial lines may be softened or erased by injecting a substance into the skin to 'plump' out the line, scar or fold."];
treatmentsArr[7] = ["Gemini Laser", "/index.php?page=proc-vascularpigmentation", "Red blood vessels, flushing and brown age and sun spots are now able to be erased with the Gemini and VBeam lasers."];
treatmentsArr[8] = ["LPIR Laser", "/index.php?page=proc-laserremoval", "Long-term hair removal can be achieved with a minimum of discomfort or inconvenience with our long pulse Alexandrite (Elite) hair-removing laser."];
treatmentsArr[9] = ["Sclerotherapy","/index.php?page=proc-sclerotherapy","Unwanted vessels, usually of the leg, are treated by injection. 'Spider veins', 'starbursts' and some larger blue veins are amenable to this procedure."];
treatmentsArr[10] = ["Laser Blepharoplasty", "/index.php?page=proc-laserblepharoplasty", "The surgical correction of excess fullness or bagginess of the upper eyelid, or of 'bags' beneath the eye."];
treatmentsArr[11] = ["Subcision", "/index.php?page=proc-subcision", "Subcision involves undermining scars, wrinkles or cutaneous depressions to release their attachment to deeper structures. New connective tissue is then formed which helps to 'lift out' these contour abnormalities."];
treatmentsArr[12] = ["Punch Grafting/elevations", "/index.php?page=proc-punchgrafting", "Scarred areas of the face are released or replaced with healthy skin from another site."];
treatmentsArr[13] = ["Fat Transplantation", "/index.php?page=proc-fattransplantation", "Fat is taken from an area where there is too much and is placed in other areas where there is too little, such as the ageing or post-acne-scarred face."];
treatmentsArr[14] = ["Injection of scar with an anti-cancer drug", "/index.php?page=thickenedscars", "These scars are the result of the body's over-zealous attempt to heal and replace lost or damaged skin. The means of correcting such as a scar depends upon its specific characteristics."];
treatmentsArr[15] = ["Thermage", "/index.php?page=proc-thermage", "A non-invasive, non-laser method for the treatment of saggy skin on the face, eyelids, abdomen and hands, for which no recuperative period is required."];
treatmentsArr[16] = ["Suture Lift", "/index.php?page=proc-suture-lifting", "With very little risk or downtime, and no need for general anaesthetic, this is a very clever, alternative face lifting procedure for a subtle and very natural lift to the face."];
treatmentsArr[17] = ["ReCell", "/index.php?page=proc-sprayonskin", "Spray-on skin for repair of areas that have lost their normal colour through disease or injury"];
treatmentsArr[18] = ["Photodynamic Therapy", "/index.php?page=proc-photodynamic", "This non-surgical, light-based treatment selectively destroys skin cancer and spares your healthy skin. It is also effective in the treatment of sunspots and certain types of acne."];
treatmentsArr[19] = ["Sundry Procedures", "/index.php?page=proc-sundryprocedures", "Minor and adjunct procedures that are also used in the practice"];
treatmentsArr[20] = ["Imiquimod", "/index.php?page=proc-imiquimod", "A cream that stimulates the body's own immune system, empowering it to destroy the skin cancer itself."];
treatmentsArr[21] = ["Mohs’ Micrographic Surgery", "/index.php?page=proc-mohsmicrographic", "The most effective and precise surgical technique for curing more severe types of skin cancer."];
treatmentsArr[22] = ["TCA CROSS Method", "/index.php?page=proc-tcacrossmethod", "This is a safe and highly effective treatment for acne scarring; particularly 'ice-pick' scars."];
treatmentsArr[23] = ["Excisional Surgery", "/index.php?page=proc-excisionalsurgery", "The process of cutting away unwanted lesions."];
treatmentsArr[24] = ["Vbeam Laser", "/index.php?page=proc-vbeam", "An intense but gentle burst of light that selectively destroys the blood vessels of your spider veins, without damaging the surrounding tissue."];
treatmentsArr[25] = ["Fraxel Laser", "/index.php?page=proc-fractionallaser", "A non-aggressive skin resurfacing method that is useful for post-acne scarring, photodamage, wrinkling and resistant pigmentation disorders."];
treatmentsArr[26] = ["Portrait PSR3", "/index.php?page=proc-plasmaregeneration", "The power of plasma resurfacing is probably at its best when treating the delicate area around the eyes."];
treatmentsArr[27] = ["ClearLight 100", "/index.php?page=proc-clearlight100", "In this procedure, a selective light beam safely and accurately penetrates the skin and destroys precancerous tissue and acne bacteria without causing harm to tissues."];

function initProcFinder(){
	var sel = document.createElement('select');	
	var op = document.createElement('option');	
	var txt = document.createTextNode("-- SELECT YOUR CONCERN --");
	op.appendChild(txt);
	sel.appendChild(op);
	for(var a=0; a<optionsArr.length; a++){
		var op = document.createElement('option');	
		var txt = document.createTextNode(optionsArr[a]);
		op.appendChild(txt);
		sel.appendChild(op);
	}
	sel.onchange = function(){
		changeResults(this);
	};	 
	document.getElementById('finderDiv').appendChild(sel);
	var div = document.createElement('div');
	div.id = "resultsHolder";
	document.getElementById('finderDiv').appendChild(div);
}	 

function changeResults(sel){
	var selected = sel.selectedIndex-1;	
	removeResults();
	
	var resHeading = document.createElement('h2');
	resHeading.style.paddingTop = "10px";
	var t = document.createTextNode("Procedure Results");
	resHeading.appendChild(t);
	
	var div = document.getElementById("resultsHolder");
	div.appendChild(resHeading);	
	
	if(resultsArr[selected].length>0){	
		for(var a=0; a<resultsArr[selected].length; a++){
			addResult(treatmentsArr[resultsArr[selected][a]][0],treatmentsArr[resultsArr[selected][a]][1],treatmentsArr[resultsArr[selected][a]][2]);
		}
	}else{
		var msg = document.createTextNode("Currently there are no procedures for this concern.");	
		div.appendChild(msg);
	}
}

function removeResults(){
	var div = document.getElementById("resultsHolder");
	while (div.childNodes[0]){
		div.removeChild(div.childNodes[0]);
	}
}

function addResult(title, url, txt){
	var holder = document.getElementById("resultsHolder");
	
	var div = document.createElement('div');
	div.className = "resultDiv";
	var a = document.createElement('a');
	a.href = url;
	a.className = "resultsTitle";
	var t = document.createTextNode(title);
	a.appendChild(t);
	
	var sum = document.createElement('p');
	var tx = document.createTextNode(txt+"  ");
	
	/*var a2 = document.createElement('a');
	a2.href = url;
	var t2 = document.createTextNode("Read More");
	a2.appendChild(t2);*/
	
	sum.appendChild(tx);
	//sum.appendChild(a2);
	
	div.appendChild(a);
	div.appendChild(sum);
	
	holder.appendChild(div);
}
