// JavaScript Document

function doRefSearch(){
	 var refCode = document.getElementById("propertyID").value;
	 var U = 'http://www.amberleyhousecottages.co.uk/sussex-holiday-property/' + refCode;
	window.location =U;
	return false;
}
function loadSlide(x){
			//alert('hello' + x);	
			var flashvars = {};
			var params = {};
			params.wmode = "transparent";
			flashvars.albID = x;
			flashvars.domain = "http://www.amberleyhousecottages.co.uk";
			var attributes = {};
			attributes.id = "slideBox";
			swfobject.embedSWF("swf/Banner_SShow.swf", "slideBox", "555", "270", "8.0.0", "swf/expressInstall.swf", flashvars, params, attributes);
}

function loadSlide2(x){
//	alert('hello load slide 2 ' + x);
			var flashvars = {};
			var params = {};
			params.wmode = "transparent";
			flashvars.albID = x;
			flashvars.domain = "http://www.amberleyhousecottages.co.uk";
			var attributes = {};
			attributes.id = "slideBox";
			swfobject.embedSWF("swf/SShow.swf", "slideBox2", "555", "372", "8.0.0", "swf/expressInstall.swf", flashvars, params, attributes);
}
			//Support function: checks to see if target
//element is an object or embed element

function isObject(targetID){
   var isFound = false;
   var el = document.getElementById(targetID);
   if(el && (el.nodeName === "OBJECT" || el.nodeName === "EMBED")){
      isFound = true;
   }
   return isFound;
}

//Support function: creates an empty
//element to replace embedded SWF object

function replaceSwfWithEmptyDiv(targetID){
   var el = document.getElementById(targetID);
   if(el){
      var div = document.createElement("div");
      el.parentNode.insertBefore(div, el);
      //Remove the SWF
      swfobject.removeSWF(targetID);
      //Give the new DIV the old element's ID
      div.setAttribute("id", targetID);
   }
}
function loadSWF(x, targetID){
	alert('hello' + x + ':' + targetID);
   //Check for existing SWF
   if(isObject(targetID)){
      //replace object/element with a new div
      replaceSwfWithEmptyDiv(targetID);
   }
   //Embed SWF
   loadSlide2(x)
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


