function detectBrowser() { 
    var BO = new Object(); 
    BO["ie"]        = false /*@cc_on || true @*/; 
    BO["ie4"]       = BO["ie"] && (document.getElementById == null); 
    BO["ie5"]       = BO["ie"] && (document.namespaces == null) && (!BO["ie4"]); 
    BO["ie6"]       = BO["ie"] && (document.implementation != null) && (document.implementation.hasFeature != null); 
    BO["ie55"]      = BO["ie"] && (document.namespaces != null) && (!BO["ie6"]); 
    /*@cc_on
    BO["ie7"]       = @_jscript_version == '5.7';
    @*/ 
    BO["ns4"]       = !BO["ie"] &&  (document.layers != null) &&  (window.confirm != null) && (document.createElement == null); 
    BO["opera"]     = (self.opera != null); 
    BO["gecko"]     = (document.getBoxObjectFor != null); 
    BO["khtml"]     = (navigator.vendor == "KDE"); 
    BO["konq"]      = ((navigator.vendor == 'KDE') || (document.childNodes) && (!document.all) && (!navigator.taintEnabled)); 
    BO["safari"]    = (document.childNodes) && (!document.all) && (!navigator.taintEnabled) && (!navigator.accentColorName); 
    BO["safari1.2"] = (parseInt(0).toFixed == null) && (BO["safari"] && (window.XMLHttpRequest != null)); 
    BO["safari2.0"] = (parseInt(0).toFixed != null) && BO["safari"] && !BO["safari1.2"]; 
    BO["safari1.1"] = BO["safari"] && !BO["safari1.2"] && !BO["safari2.0"]; 
    return BO; 
} 
 
var BO = new detectBrowser(); 

var input = document.getElementsByTagName('input');
for (var i=0; i<input.length; i++) {
	if (input[i].value == 'Search') {
		input[i].value = '';
		input[i].style.backgroundImage = "url('https://www.securance.co.uk/images/search.gif')";
                input[i].style.cursor = "pointer";
                input[i].style.width = "52px";
                input[i].style.height = "21px";
                input[i].style.border = "0";
                input[i].style.marginTop = "-2px";
		input[i].style.marginLeft = "0";
	}

	if (input[i].value == 'Select') {
		input[i].value = '';
		input[i].style.backgroundImage = "url('https://www.securance.co.uk/images/select.gif')";
		input[i].style.cursor = "pointer";
		input[i].style.width = "52px";
		input[i].style.height = "22px";
		input[i].style.border = "0";
		input[i].style.marginTop = "-10px";
		if (BO['ie7']) {
			input[i].style.marginLeft = "0";
		} else if (BO['ie']) {
			input[i].style.marginLeft = "-160px";
		}
	}

	if (input[i].value == 'Finish') {
		input[i].value = '';
		if (BO['ie7']) {
			input[i].style.marginLeft = "25%";
		} else if (BO['ie']) {
			input[i].style.marginLeft = "80%";
		} else if (BO['opera']) {
			input[i].style.marginLeft = "85%";
		} else {
			input[i].style.marginLeft = "33%";
		}
		input[i].style.marginTop = "-15px";
	}

	if (input[i].value == 'Edit') {
		input[i].value = '';
		input[i].style.backgroundImage = "url('https://www.securance.co.uk/images/edit.gif')";
                input[i].style.cursor = "pointer";
                input[i].style.width = "52px";
                input[i].style.height = "22px";
                input[i].style.border = "0";
		if (BO['ie7']) {
			input[i].style.marginLeft = "0";
		} else if (BO['ie']) {
			input[i].style.marginLeft = "-120px";
		} else {
                	input[i].style.marginLeft = "25px";
		}
	}

	if (input[i].value == 'Remove') {
		input[i].value = '';
		input[i].style.backgroundImage = "url('https://www.securance.co.uk/images/remove.gif')";
                input[i].style.cursor = "pointer";
                input[i].style.width = "60px";
                input[i].style.height = "22px";
                input[i].style.border = "0";
		if (BO['ie7']) {
			input[i].style.marginLeft = "-65px";
		} else if (BO['ie']) {
			input[i].style.marginLeft = "-185px";
		} else {
	                input[i].style.marginLeft = "-40px";
		}
	}

	if (input[i].value == 'Continue') {
		input[i].value = '';
		input[i].style.backgroundImage = "url('https://www.securance.co.uk/images/continue.gif')";
		input[i].style.cursor = "pointer";
		input[i].style.width = "69px";
		input[i].style.height = "22px";
		input[i].style.border = "0";
		if (BO['ie7']) {
			input[i].style.marginLeft = "-150px";
		} else if (BO['ie']) {
			input[i].style.marginLeft = "-140px";
		} else if (BO['opera']) {
			input[i].style.marginLeft = "25%";
		} else {
			input[i].style.marginLeft = "-150px";
		}
		input[i].style.marginTop = "10px";
	}
}

if (document.getElementById("aspnetForm")) {
	if (document.getElementById("aspnetForm").firstChild.nextSibling.nextSibling.nextSibling.childNodes[5]) {
		var firstBr = document.getElementById("aspnetForm").firstChild.nextSibling.nextSibling.nextSibling.childNodes[5].childNodes[1].childNodes[1].firstChild.nextSibling;
		var secondBr = document.getElementById("aspnetForm").firstChild.nextSibling.nextSibling.nextSibling.childNodes[5].childNodes[1].childNodes[1].firstChild.nextSibling.nextSibling;
		var thirdBr = document.getElementById("aspnetForm").firstChild.nextSibling.nextSibling.nextSibling.childNodes[5].childNodes[1].childNodes[1].firstChild.nextSibling.nextSibling.nextSibling;
		var inputNode = document.getElementById("aspnetForm").firstChild.nextSibling.nextSibling.nextSibling.childNodes[5].childNodes[1].childNodes[1].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling;

		firstBr.parentNode.removeChild(firstBr);
		secondBr.parentNode.removeChild(secondBr);
		thirdBr.parentNode.removeChild(thirdBr);
		var newSpan = document.createElement("span");
		var newSearchTitle = document.createTextNode("please select a condition:");
		newSpan.appendChild(newSearchTitle);
		inputNode.parentNode.insertBefore(newSpan, inputNode);
		newSpan.style.display = "block";
		newSpan.style.color = "#59410a !important";
	}

	if (document.getElementById("ctl00_ContentPlaceHolder1_ScreeningTable")) {
		var screeningTable = document.getElementById("ctl00_ContentPlaceHolder1_ScreeningTable");
		var tbody = screeningTable.lastChild;
		var firstRow = tbody.firstChild;
		if (firstRow) {
			var newTr = document.createElement("tr");
			var newTd = document.createElement("td");
			newTd.style.fontSize = "12px";
			var preText = document.createTextNode("Existing conditions:");
			newTr.appendChild(newTd);
			newTd.appendChild(preText);
			tbody.insertBefore(newTr, firstRow);
			var tds = tbody.getElementsByTagName("td");
			for (var i=0; i<tds.length; i++) {
				tds[i].style.color = "#59410a !important";
			}
		}
	}
}
