function setActiveStyleSheet(title, clearDefault) {		// alert(title);		  var i, a, main;  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {	  	      if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && (a.getAttribute("title")!="screen" || clearDefault)) {      a.disabled = true;      if(a.getAttribute("title") == title) a.disabled = false;      }  }	  }function changeActiveStyleSheet(title, clearDefault){	setActiveStyleSheet(title, clearDefault);		// Reload the page to get around the sIFR reload problem		createCookie("style",title, 30);		// window.location = window.location;}var map = "";var directionsPanel;var directions;        function usePointFromPostcode(postcode, callbackFunction) {      localSearch.setSearchCompleteCallback(null,     function() {            if (localSearch.results[0]) {            var resultLat = localSearch.results[0].lat;        var resultLng = localSearch.results[0].lng;        var point = new GLatLng(resultLat,resultLng);        callbackFunction(point);      }else{        alert("Postcode or address not found!");      }    });        localSearch.execute(postcode + ", UK");}		function getRoute() {      if (GBrowserIsCompatible()) {                var map = new GMap2(document.getElementById("map"));        	               usePointFromPostcode(document.getElementById("txtPostcode").value,            function (point) {    	map.setCenter(point, 17);		        map = new GMap2(document.getElementById("map"));        map.addControl(new GSmallMapControl());        map.setCenter(new GLatLng(53.3846,-2.1330), 15);        directionsPanel = document.getElementById("directions");        directionsPanel.innerHTML = "";                directions = new GDirections(map, directionsPanel);			    var point1 = point;        var point2 = new GLatLng(53.3846,-2.1330);        directions.loadFromWaypoints([point1,point2],{getPolyline:true,getSteps:true})				// alert(directionsPanel.innerHTML);        });              }    }  sIFR.prefetch({    src: 'http://www.stockport.nhs.uk/resources/flash/sifr.swf',     highsrc: 'http://www.stockport.nhs.uk/resources/flash/sifr.swf'  });      if(readCookie("style") == 'normal')  {	  sIFR.compatMode = true;	  sIFR.activate();  }function doSifr() {		sIFR.replace({	selector: 'h1', 	src: 'http://www.stockport.nhs.uk/resources/flash/sifr.swf',	preventWrap: true,	css: { '.sIFR-root' : { 'text-align': 'left','color': '#0171B7', 'font-weight': 'bold' }},	 forceWidth: true, fitExactly: true, forceSingleLine: true	});	}	function doMap()	{				map = new GMap2(document.getElementById("map"));		map.addControl(new GSmallMapControl());		map.enableDoubleClickZoom();							var point = new GLatLng(53.3846,-2.1330);		map.setCenter(point, 14);				var marker = new GMarker(point);				map.addOverlay(marker);		}function getActiveStyleSheet() {				var i, a;			for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {						if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");					}			return null;}function getPreferredStyleSheet() {		var i, a;  	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {	  	if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title")) return a.getAttribute("title");    }    return null;  }function createCookie(name,value,days) {		if (days) {					var date = new Date();				date.setTime(date.getTime()+(days*24*60*60*1000));				var expires = "; expires="+date.toGMTString();		}		else expires = "";		document.cookie = name+"="+value+expires+"; path=/";}function readCookie(name) {		var nameEQ = name + "=";	var ca = document.cookie.split(';');		for(var i=0;i < ca.length;i++) {		var c = ca[i];		while (c.charAt(0)==' ') c = c.substring(1,c.length);		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);	}		return null;	}window.onload = function(e) {		var cookie = readCookie("style");	var title = cookie ? cookie : getPreferredStyleSheet();	setActiveStyleSheet(title);	}window.onunload = function(e) {		var title = getActiveStyleSheet();	createCookie("style",title, 30);	}	var cookie = readCookie("style");	var title = cookie ? cookie : getPreferredStyleSheet();	setActiveStyleSheet(title);function clearData(thisBox, value) {	if(thisBox.value ==(value))	{		thisBox.value = ("");	    	}}function resetData(thisBox, value) {		if(thisBox.value == (""))	{		thisBox.value = value;	}	}
