function email(user) {
	document.write('<a href="mailto:' + user + '@j7sports.co.uk" title="Email ' + user + '@j7sports.co.uk!">');
	document.write(user + '@j7sports.co.uk');
	document.write('</a>'); 
}

function writeImages () {
	var str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="595" height="354" title="J7 Images">'
			+ '<param name="movie" value="flash/images.swf" />'
			+ '<param name="quality" value="high" />'
			+ '<param name="flashVars" value="path=flash" />'
			+ '<embed src="flash/images.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" flashVars="path=flash" width="595" height="354"></embed>'
			+ '</object>';
			
	document.write(str);
}

/* Validation Funtions */
function isValidEmail(str) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str)){
		return true;
	}
	else {
		return false;
	}
}

function checkcontactform(){
	var ftxt = '';

	if (document.contactform.name.value==''){
		ftxt += '\n- Please enter your Name.';
	}
	
	if (document.contactform.phone.value==''){
		ftxt += '\n- Please enter your Phone Number.';
	}
	
	if (isValidEmail(document.contactform.email.value)==false){
		ftxt += '\n- Please enter your Email Address.';
	}
	
	if (document.contactform.subject.value==''){
		ftxt += '\n- Please select an enquiry Subject.';
	}
	
	if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else {
		return true;
	}
}
