function openWindow(url, width, height, properties) {
	var props;
	
	if (properties == '')
		props = "resizable=0,scrollbars=yes,menubar=0,status=0,toolbar=0,location=0";
	else
		props = properties;
		
	var win = window.open(url, 'window', 'width=' + width + ',height=' + height + ',' + properties);
}

function showContent(element) {
	if (document.getElementById) {
		document.getElementById('ourBlogContent').style.display = 'none';
		document.getElementById('expertTipsContent').style.display = 'none';
		document.getElementById('dailyFindContent').style.display = 'none';
	}
	else if (document.all) {
		document.all['ourBlogContent'].style.display = 'none';
		document.all['expertTipsContent'].style.display = 'none';
		document.all['dailyFindContent'].style.display = 'none';
	}
	
	if (element == 'ourblog') {
		if (document.getElementById)
			document.getElementById('ourBlogContent').style.display = ''; 
		else if (document.all)
			document.all['ourBlogContent'].style.display = '';
	}
	else if (element == 'experttips') {
		if (document.getElementById)
			document.getElementById('expertTipsContent').style.display = '';
		else if (document.all)
			document.all['expertTipsContent'].style.display = '';
	}
	else {
		if (document.getElementById)
			document.getElementById('dailyFindContent').style.display = '';
		else if (document.all)
			document.all['dailyFindContent'].style.display = '';
	}
}

function submitSubscribeForm() {
	if (document.getElementById) {
		var email = document.getElementById('sfEmailAddress');
		//var type1 = document.getElementById('sfType1');
		//var type2 = document.getElementById('sfType2');
		//var type3 = document.getElementById('sfType3');
	}
	else {
		var email = document.all['sfEmailAddress'];
		//var type1 = document.all['sfType1'];
		//var type2 = document.all['sfType2'];
		//var type3 = document.all['sfType3'];
	}
	
	//if (email.value != "" && (type1.checked || type2.checked || type3.checked))
	if (checkEmail(email.value)) {
		alert("Thank you, you will now be receiving trend reports on a regular basis");
		document.subscribeForm.submit();
	}
	else {
		alert('You must enter a valid email address');
	}
}

function checkEmail(email) {
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	
	if (filter.test(email))
		return true;
	else
		return false;
}

