function openPopUp(istrServerName, ilngSiteID, istrType) {
	window.open("http://" + istrServerName + "/popup.asp?entityID=" + ilngSiteID + "&popUpType=" + istrType);
}

function openWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function openwindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function openDirectoryFlashMapWindow(id, siteid) {
	vavailwidth = screen.availWidth;
	vavailheight = screen.availHeight;
	vwidth = 800;
	vheight = 600;
	vleft = Math.round((vavailwidth - vwidth) / 2);
	vtop  = Math.round((vavailheight - vheight) / 2);
	vstring = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="
	+ vwidth + ",height=" + vheight + ",left=0,top=0";
	MapWindow=window.open('directoryFlashMapPopUp.asp?id=' + id + '&siteid=' + siteid,'MapWindow',vstring);
	MapWindow.focus();
	MapWindow.moveTo(vleft, vtop);
}

function validateForm(iobjForm) {
	if (iobjForm.Name.value.length == 0) {
		alert("Name cannot be left blank");
		return false;
	}
	if (iobjForm.Phone.value.length == 0) {
		alert("Phone Number cannot be left blank");
		return false;
	}
	return true;
}

function validatePoll(iobjForm) {
	for (var i=0;i<iobjForm.pollresponse.length; i++) {
		if (iobjForm.pollresponse[i].checked)
			return true
	}
	alert("Please select a response");
	return false;
}

function validateProduct(iobjForm) {
	if (isNaN(parseInt(iobjForm.catqty.value))) {
		alert("Quantity must be a valid number");
		return false;
	}
	return true;
}

function submitPayPalForm() {
	document.frmPayPal.submit();
}

function validateCheckout(iobjForm) {
	if (iobjForm.FirstName.value.length == 0) {
		alert("Given Name cannot be left blank");
		return false;
	}
	if (iobjForm.LastName.value.length == 0) {
		alert("Surname cannot be left blank");
		return false;
	}
	
	if (iobjForm.Email.value.length == 0) {
		alert("E-mail cannot be left blank");
		return false;
	}
	else if (iobjForm.Email.value.indexOf("@") == -1) {
		alert("E-mail must contain an @ character");
		return false;
	}

	if (iobjForm.BillingStreet.value.length == 0) {
		alert("Billing Street cannot be left blank");
		return false;
	}
	if (iobjForm.BillingCity.value.length == 0) {
		alert("Billing City cannot be left blank");
		return false;
	}
	if (iobjForm.BillingState.value.length == 0) {
		alert("Billing State cannot be left blank");
		return false;
	}
	if (iobjForm.BillingPostCode.value.length == 0) {
		alert("Billing Post Code cannot be left blank");
		return false;
	}
	if (iobjForm.BillingCountry.value.length == 0) {
		alert("Billing Country cannot be left blank");
		return false;
	}

	return true;
}


function showPollResults() {
	document.getElementById("poll").style.display = "none";
	document.getElementById("pollresults").style.display = "";
}

function showCalendarMonth(ilngEntityID) {
	window.location = "display.asp?entityid=" + ilngEntityID + "&monthyear=" + document.getElementById("eventsdropdown").value
}


function backToPreviousPage() {
	history.go(-1);
	
}


