function showEnquiry(theId, theLang, sefUrlStatus, parseParams) {
	fileLocation = '';
	if (sefUrlStatus!='Y') {
		fileLocation = '';
	} else {
		fileLocation = '/';
	}

	w_width = 500;
	w_height = 520;
	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 =  fileLocation+'templates/ws_mm_estates_12/showenquiry.php?pageid=' + theId + '&lang=' + theLang;
  window.showEnquiryWindow = open(fparam, 'showEnquiryWindow', theWindowParam);
	setTimeout('if(showEnquiryWindow&&!showEnquiryWindow.closed)showEnquiryWindow.focus()',100);
}

function photoGallery(theId, theLang, sefUrlStatus, parseParams) {
	fileLocation = '';
	if (sefUrlStatus!='Y') {
		fileLocation = '';
	} else {
		fileLocation = '/';
	}

	w_width = 700;
	w_height = 735;
	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 = fileLocation+'templates/ws_mm_estates_12/showphotogallery.php?pageid=' + theId + '&lang=' + theLang;
  window.photoGalleryWindow = open(fparam, 'photoGalleryWindow', theWindowParam);
	setTimeout('if(photoGalleryWindow&&!photoGalleryWindow.closed)photoGalleryWindow.focus()',100);
}
function planGallery(theId, theLang, sefUrlStatus, parseParams) {
	fileLocation = '';
	if (sefUrlStatus!='Y') {
		fileLocation = '';
	} else {
		fileLocation = '/';
	}

	w_width = 830;
	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 = fileLocation+'templates/ws_mm_estates_12/showplangallery.php?pageid=' + theId + '&lang=' + theLang;
  window.planGalleryWindow = open(fparam, 'planGalleryWindow', theWindowParam);
	setTimeout('if(planGalleryWindow&&!planGalleryWindow.closed)planGalleryWindow.focus()',100);
}
function videoGallery(theId, theLang, sefUrlStatus, parseParams) {
	fileLocation = '';
	if (sefUrlStatus!='Y') {
		fileLocation = '';
	} else {
		fileLocation = '/';
	}

	w_width = 700;
	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 = fileLocation+'templates/ws_mm_estates_12/showvideogallery.php?pageid=' + theId + '&lang=' + theLang;
  window.videoGalleryWindow = open(fparam, 'videoGalleryWindow', theWindowParam);
	setTimeout('if(videoGalleryWindow&&!videoGalleryWindow.closed)videoGalleryWindow.focus()',100);
}
function showPhoto(theId, theLang, thePhotoNum, sefUrlStatus, parseParams) {
	fileLocation = '';
	if (sefUrlStatus!='Y') {
		fileLocation = '';
	} else {
		fileLocation = '/';
	}

	w_width = 700;
	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 = fileLocation+'templates/ws_mm_estates_12/showphoto.php?pageid=' + theId + '&lang=' + theLang + '&photonum=' + thePhotoNum;
  window.showPhotoWindow = open(fparam, 'showPhotoWindow', theWindowParam);
	setTimeout('if(showPhotoWindow&&!showPhotoWindow.closed)showPhotoWindow.focus()',100);
}

function showLocationPhoto(theId, theLang, sefUrlStatus, parseParams) {
	fileLocation = '';
	if (sefUrlStatus!='Y') {
		fileLocation = '';
	} else {
		fileLocation = '/';
	}

	w_width = 700;
	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 = fileLocation+'templates/ws_mm_estates_12/showlocationphoto.php?pageid=' + theId + '&lang=' + theLang;
  window.showLocationPhotoWindow = open(fparam, 'showLocationPhotoWindow', theWindowParam);
	setTimeout('if(showLocationPhotoWindow&&!showLocationPhotoWindow.closed)showLocationPhotoWindow.focus()',100);
}
function goToFindProperty(theform,thePageId) {
  var theLoc = theform.criteria_location.value;
  var theType = theform.criteria_type.value;
  var theMinPrice = theform.criteria_minprice.value;
  var theMaxPrice = theform.criteria_maxprice.value;
  var theRef = theform.criteria_referenceno.value;
	
  lochref = 'index.php?pageid='+thePageId+'&filter=Search&criteria=set';

	if (theLoc != '') {	lochref += '&loc=' + theLoc; }
	if (theType != '') {	lochref += '&type=' + theType; }
	if (theMinPrice != '') {	lochref += '&minprice=' + theMinPrice; }
	if (theMaxPrice != '') {	lochref += '&maxprice=' + theMaxPrice; }
	if (theRef != '') {	lochref += '&ref=' + theRef; }

	//alert("The values are: "+theLoc+" "+theType+" "+theMinPrice+" "+theMaxPrice+" "+theRef+"The url is: "+lochref);
	location = lochref;
}
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 fullname = form.fullname.value;   
  var email = form.email.value;   
  var phone = form.phone.value;   

  if (!fullname)	{
    alert("You must enter your full name.");
    return false;
	} else if (!email)	{
		alert("You must enter your email.");
		return false;
	} else if ((email.indexOf('@') == -1) || (email.indexOf('.') == -1)) {
		alert("Wrong email format.");
		return false;
	} else if (!phone)	{
		alert("You must enter your phone number.");
		return false;
	} else {
		return true;
	}
}
