var currentImage = null;

function showImage(id, img, title) {
	
	var full = document.getElementById('fullImage');
	full.innerHTML = "<img src='"+img+"' alt='"+title+"' /><br/><h3>"+title+"</h3>";
	toggle('imageGallery', 'none');
	toggle('fullImage', 'block');

}

function hideImage() {

}

function toggle(id, state) {
	
	var elm = document.getElementById(id);
	
	if (state) {
		elm.style.display = state;
	} else {
		if (elm.style.display == 'none') {
			elm.style.display = '';
		} else {
			elm.style.display = 'none';
		}
	}
}

function forumCheck() {
	var ret = true;
	var email = document.getElementById('emailAddress').value;
	var phone = document.getElementById('phoneNumber').value;
	var emailValid = '/^\w+([\.-]?\w+)*@\w+([\.-]?\w+{2,3,4,5})*(\.\w)+$/';
	
	if ((email) && (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))) {
	} else {
		ret = false;
	}
	
	//alert(ret);
	return ret;
}

function displayVideo(videoID) {
	if (videoID) {
		var html = '<object width="480" height="295">';
		html += '<param name="movie" value="http://www.youtube.com/v/'+videoID+'&hl=en&fs=1&autoplay=1"></param>';
		html += '<param name="allowFullScreen" value="true"></param>';
		html += '<param name="allowscriptaccess" value="always"></param>';
		html += '<embed src="http://www.youtube.com/v/'+videoID+'&hl=en&fs=1&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed>';
		html += '</object>';
		
		document.getElementById('videoBox').style.backgroundImage = 'none';
		document.getElementById('videoBox').innerHTML = html;
	} else {
		document.getElementById('videoBox').style.backgroundImage = null;
		document.getElementById('videoBox').innerHTML = '';
	}
}