//============================================
//		Shared Javascript for www.overfinch.co.uk
//
//		Location: 'htdocs/scripts/overfinch.js'
//
//		designed and created by Paul Keeney (paul.keeney@parks.uk.com)
//		created: 28/07/2009			last modified: 28/07/2009
//============================================



function getXMLHTTP() { //fuction to return the xml http object

		var xmlhttp;
		if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
			try {xmlhttp = new XMLHttpRequest();} catch (e) {xmlhttp = false;}
		}

		if(!xmlhttp && typeof ActiveXObject != "undefined"){
			try{ xmlhttp=new ActiveXObject("MSXML2.XMLHTTP"); }catch(e){xmlhttp=false;}
			if(!xmlhttp)try{ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }catch(e){xmlhttp=false;}
		}

		return xmlhttp;

    }


// Ajax call to swap DIV content
UpdateDiv = function(sURL,sDIV) {
	var req = getXMLHTTP();
	if (req) {
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				// only if "OK"
				if (req.status == 200) {
					document.getElementById(sDIV).innerHTML=req.responseText;
				} else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", sURL, true);
		req.send(null);
	}
}


ShowComingSoon = function(sElem,sValue) {
	var item = document.getElementById(sElem);
	sElem.innerHTML = sValue;
	if(sValue == "COMING SOON") {
		sElem.style.color = "#936161";
	} else {
		sElem.style.color = "#c5c5c5";
	}


}




