// Set the window name

window.name = "main";

// onload triggers

function homepageTrigger() {
	return true;
}

function subpageTrigger() {
	return true;
}

// printing function

function printPage() {
  if (window.print) window.print()
  else
    alert("Sorry, your browser doesn't support this feature. Use your standard print menu instead.");
}

// Image size checking + resizing

	function checkImageSize(srcImage,maxWidth,maxHeight) {
		if(document.images) {
			getWidth = srcImage.width;
			getHeight = srcImage.height;
			if(getWidth>maxWidth || getHeight>maxHeight) {
				widthVariance = maxWidth/getWidth;
				heightVariance = maxHeight/getHeight;
				if(widthVariance<=heightVariance) scalePercentage = getWidth/maxWidth;
				else scalePercentage = getHeight/maxHeight;
				srcImage.width = getWidth/scalePercentage;
				srcImage.height = getHeight/scalePercentage;
			}
		}
	}
	
	
// Email address validation
		
	function isValidEmail(src) {
		var emailReg = "^\\w+[\\+\\.\\w-]*@([\\w-]+\\.)*\\w+[\\w-]*\\.([A-Za-z]{2,4}|\\d+)$";
		var regex = new RegExp(emailReg);
		return regex.test(src);
	}

