<!--


		
	// create pop up window
	function newWindow2(theURL,winName) {
	  window.open(theURL,winName,'scrollbars=yes,width=330,height=300,resizable=yes,location=no,menubar=yes');
	}
	
	
	function newwindow(title, imageFile) {
		window.open("imageView.php?title="+escape(title)+"&imageFile="+escape(imageFile),"Image","width=800,height=600,resizable=no,scrollbars=no");
	}
	
	function newwindowText(title, id) {
		window.open("contentView.php?title="+escape(title)+"&id="+escape(id),"Content","scrollbars=yes,resizable=yes,width=600,height=550");
	}	
	
	
	function IsNumeric(strString) {
		//  check for valid numeric strings	
		
		var strValidChars = "0123456789.-";
		var strChar;
		var blnResult = true;
	
		if (strString.length == 0) return false;
	
		//  test strString consists of valid characters listed above
		for (i = 0; i < strString.length && blnResult == true; i++)
			{
			strChar = strString.charAt(i);
			if (strValidChars.indexOf(strChar) == -1)
				{
				blnResult = false;
				}
			}
		return blnResult;
	}
	
	function getSelectedCheckbox(buttonGroup) {
		// Go through all the check boxes. return an array of all the ones
		// that are selected (their position numbers). if no boxes were checked,
		// returned array will be empty (length will be zero)
		var retArr = new Array();
		var lastElement = 0;
		if (buttonGroup[0]) { // if the button group is an array (one check box is not an array)
			for (var i=0; i<buttonGroup.length; i++) {
				if (buttonGroup[i].checked) {
					retArr.length = lastElement;
					retArr[lastElement] = i;
					lastElement++;
				}
			}
		} else { // There is only one check box (it's not an array)
			if (buttonGroup.checked) { // if the one check box is checked
				retArr.length = lastElement;
				retArr[lastElement] = 0; // return zero as the only array value
			}
		}
		return retArr;
	} // Ends the "getSelectedCheckbox" function
	
	
	function changeGalleryImage(strImage, strCaption, strStory, strEnlarge) { 
		document.mainImage.src="images/gallery/"+strImage;
		document.getElementById("gallerycaption").innerHTML = strCaption;
		document.getElementById("gallerystory").innerHTML = strStory;
		//document.getElementById("galleryenlarge").innerHTML = strEnlarge;
	}	
	


function submitQuoteForm() {
// Do validation for form elements 

	var strMsg='';

	if (document.getElementById('name').value == "") {
		strMsg += " - Please enter your name \n";	
	}
	if (document.getElementById('phone_work').value == "" && 
		document.getElementById('phone_mob').value == "" ) 
	{ 
		strMsg += " - Please provide at least 1 contact number\n";	
	}

	if (document.getElementById('email').value == "") {
		strMsg += " - Please enter your email address \n";	
	}

	if (strMsg == '') {
		//alert("strMsg: " + strMsg);
		document.forms.quoteForm.submit();
	} else {
		alert("Please correct the following:\n\n" + strMsg);
	}
	
} 







//-->
