function showGallery(theId, theLang, theType) {
	if ((theType == 'Photo')||(theType == 'Plan')) {
		w_width = 830;
		w_height = 640;
	} else if (theType == 'Video') {
		w_width = 550;
		w_height = 450;
	}
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',status=no,resizable=yes,scrollbars=yes';

	fparam = 'templates/ws_mm_estates_23/showgallery.php?pageid=' + theId+'&lang=' + theLang +'&type='+ theType;
  window.showGalleryWindow = open(fparam, 'showGalleryWindow', theWindowParam);
	setTimeout('if(showGalleryWindow&&!showGalleryWindow.closed)showGalleryWindow.focus()',100);
}
function showEnquiry(theId, theLang) {
	w_width = 630;
	w_height = 600;
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',status=no,resizable=yes,scrollbars=yes';

	fparam = 'templates/ws_mm_estates_23/showenquiry.php?pageid=' + theId + '&lang=' + theLang;
  window.showEnquiryWindow = open(fparam, 'showEnquiryWindow', theWindowParam);
	setTimeout('if(showEnquiryWindow&&!showEnquiryWindow.closed)showEnquiryWindow.focus()',100);
}
function showSpecifications(theId, theLang) {
	w_width = 500;
	w_height = 550;
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',status=no,resizable=yes,scrollbars=yes';

	fparam = 'templates/ws_mm_estates_23/showspecs.php?pageid=' + theId + '&lang=' + theLang;
  window.showSpecificationsWindow = open(fparam, 'showSpecificationsWindow', theWindowParam);
	setTimeout('if(showSpecificationsWindow&&!showSpecificationsWindow.closed)showSpecificationsWindow.focus()',100);
}
function showPhoto(theId, theLang, thePhotoNum) {
	w_width = 800;
	w_height = 620;
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',status=no,resizable=yes,scrollbars=yes';

	fparam = 'templates/ws_mm_estates_23/showphoto.php?pageid=' + theId + '&lang=' + theLang + '&photonum=' + thePhotoNum;
  window.showPhotoWindow = open(fparam, 'showPhotoWindow', theWindowParam);
	setTimeout('if(showPhotoWindow&&!showPhotoWindow.closed)showPhotoWindow.focus()',100);
}
function showLocationMap(theId, thePhoto, theLang) {
	w_width = 800;
	w_height = 620;
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',status=no,resizable=yes,scrollbars=yes';

	fparam = 'templates/ws_mm_estates_23/showphoto.php?pageid=' + theId + '&lang=' + theLang + '&map=' + thePhoto;
  window.showPhotoWindow = open(fparam, 'showPhotoWindow', theWindowParam);
	setTimeout('if(showPhotoWindow&&!showPhotoWindow.closed)showPhotoWindow.focus()',100);
}
function enquireforproperty(thePageId, theLang) {
	alert(thePageId+theLang);
	
  lochref = 'index.php?pageid='+thePageId+'&filter=Search&criteria=set';
	
	//alert("The values are: "+theLoc+" "+theType+" "+theMinPrice+" "+theMaxPrice+" "+theRef+"The url is: "+lochref);
	location = lochref;
}
function ValidatePropertyEnquiryForm (form) { // Used in Give us your feedback page (pageid=5&ctype=bm)
  var fname = form.fullname.value;   
  var country = form.country.value;   
	var phone = form.phone.value;
  var email = form.email.value;   

  if (!fname)	{
    alert("You must enter your full name.");
    return false;
	} else if (!country) {
		alert("You must select your country.");
		return false;
	} else if ((!phone)&&(!email)) {
		alert("You must enter your phone number or your email address.");
		return false;
	} else if ((email)&&((email.indexOf('@') == -1) || (email.indexOf('.') == -1))) {
		alert("Wrong email format.");
		return false;
	} else {
		return true;
	}
}
function ShowPhotoSrc(theId, theFile, theDescId, theDesc, theType) {
	if (document.getElementById) {
		var c = document.getElementById(theId);
		if (c.style.display != "block") {
			if ((theType == 'Photo')||(theType == 'Plan')) {
				c.innerHTML = '<img src="' + theFile + '">';
			} else if (theType == 'Video'){
				c.innerHTML =  '<OBJECT ID="EstatesVideo" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" standby="Loading Microsoft® Windows® Media Player components..." type="application/x-oleobject"><PARAM NAME="FileName" VALUE="'+theFile+'"><PARAM NAME="animationatStart" VALUE="true"><PARAM NAME="transparentatStart" VALUE="true"><PARAM NAME="autoStart" VALUE="true"><PARAM NAME="showControls" VALUE="true"><EMBED type="application/x-mplayer2" pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/" SRC="'+theFile+'" name="EstatesVideo" AutoStart=true></EMBED></OBJECT>';
			}
		} else {
			c.innerHTML = '<img src="../../layout/images/transparent.gif">';
			c.style.display="none";
		}
	}
	if ((theType == 'Photo')||(theType == 'Plan')) {
	document.getElementById(theId).alt = theDesc;
	}
	document.getElementById(theDescId).value = theDesc;
}
function showDetails() {
	document.getElementById('details').style.display = 'block'; 
	document.getElementById('technicalspecs').style.display = 'none'; 
	document.getElementById('buildingspecs').style.display = 'none'; 
}
function showTechnicalSpecs() {
	document.getElementById('details').style.display = 'none'; 
	document.getElementById('technicalspecs').style.display = 'block'; 
	document.getElementById('buildingspecs').style.display = 'none'; 
}
function showBuildingSpecs() {
	document.getElementById('details').style.display = 'none'; 
	document.getElementById('technicalspecs').style.display = 'none'; 
	document.getElementById('buildingspecs').style.display = 'block'; 
}
