/******************************************************************
name:			global.js
description:	global javascript file
******************************************************************/
/*****************************
	name:	makeFullHeight
	desc:	gets the height of the content div, and resizes
                   the container to an exact px so that it’s child
                   elements will fill 100% height
	param:	contentobj - the content object (e.g. a div)
		   containerobj - the container object that
                        is being resized
		   offsetpx(integer) - integer amount of px to
                   offset, this will change depending on your
                   application
	note:	MUST BE CALLED AFTER ELEMENTS HAVE
                   LOADED (or before the </body> tag)
*****************************/

function makeFullHeight(contentobj,containerobj,offsetpx){
	if(contentobj && containerobj){
		var contentHeight = contentobj.offsetHeight;
		var newHeight = contentHeight + offsetpx;
		containerobj.style.height = newHeight + 'px';
	}
}


/***************************************************************************************
Inititating the photo slideshow

Event.observe(window,'load',function()
{
	if ($('slideshow')){
		myShow = new Slideshow('slideshow', {hu: '../images/', images: ['slide-richochet.jpg','slide-spike.jpg','slide-team-bikini.jpg','slide-check.jpg']});
	}
});
***************************************************************************************/

function validateemail(){
	var digemail = document.getElementById('digemailinput');
	if(digemail.value == ''){
		alert('Please enter your email address.');
		return false;
	}
	else{
		if(checkEmail(digemail.value))return true;
		else {
			alert('Please enter an email in format "something@somewhere.com"');
			return false;
		}
	}
}

function checkEmail(val) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(val))return (true);
	else return (false)
}