
function verifyrooms() {
	rooms = parseInt(document.form1.noRooms.value);
	adults = parseInt(document.form1.noAdults.value);
	var availframe;

	if(document.getElementById("availFrame") != null)
		availframe = window.frames['availFrame'].document;

		/* If the image exists then there must be availability otherwise no image would have been loaded. */
		/* If the iframe is still loading it will just got to stage 2 and let it deal with it to stop possible problems */

		if(document.getElementById("ad") != null)
		{
			if(availframe.getElementById("dn"+document.getElementById("ad").value) == null)
			{
				if(availframe.getElementById("ifloadedwillhaveanothervalue").value == "LOADED")
				{
					document.getElementById("errormsgdiv").style.visibility = "visible";
					document.getElementById("ieworkaroundframe").style.display = "block";
					document.getElementById("ieworkaroundframe").style.height = "230px";
					document.getElementById("ieworkaroundframe").style.width = "430px";
					return false;
				}
			}
		}
}


function newVerifyRooms(iFrameShowing) {
	var rooms = parseInt(document.form1.noRooms.value);
	var adults = parseInt(document.form1.noAdults.value);
	var checkiFrame = iFrameShowing;
	var availframe;

	if (checkiFrame) {
		if(document.getElementById("availFrame") != null) {
			availframe = window.frames['availFrame'].document;
			/* If the image exists then there must be availability otherwise no image would have been loaded. */
			/* If the iframe is still loading it will just got to stage 2 and let it deal with it to stop possible problems */
			if(document.getElementById("ad") != null) {
				if(availframe.getElementById("dn"+document.getElementById("ad").value) == null) {
					if(availframe.getElementById("ifloadedwillhaveanothervalue").value == "LOADED") {
						document.getElementById("errormsgdiv").style.visibility = "visible";
						document.getElementById("ieworkaroundframe").style.display = "block";
						document.getElementById("ieworkaroundframe").style.height = "230px";
						document.getElementById("ieworkaroundframe").style.width = "430px";
						return false;
					}
				}
			}
		}	
	}
}
