//Form check function - added by Jasal Vadgama for www.cftechnology.co.uk
function CheckForm () { 

	//Initialise variables
	var errorMsg = "";

	//Check for a first name
	if (document.f_enquiry.f_name.value == ""){
		errorMsg += "\n\tName \t\t- Enter your Name";	
	}
	 	
	//Check for an e-mail address and that it is valid
	if ((document.f_enquiry.f_email.value == "") || (document.f_enquiry.f_email.value.length > 0 && (document.f_enquiry.f_email.value.indexOf("@",0) == - 1 || document.f_enquiry.f_email.value.indexOf(".",0) == - 1))) { 
		errorMsg += "\n\tE-mail Address \t- Enter your valid e-mail address";
	}
			
	//Check for an enquiry
	if (document.f_enquiry.f_comments.value == "") { 
 		errorMsg += "\n\tEnquiry \t\t- Enter a comment";
	}
		
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}

function PlayerOpen(soundfiledesc,soundfilepath,addinfo) {

	var UniqueID = 314 // Make each link open in a new window.
	var newWinOffset = 50 // Position of first pop-up

	PlayWin = window.open('',UniqueID,'width=320,height=190,top=' + newWinOffset +',left=50,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
	PlayWin.focus(); 
	var winContent = "<html><head><link rel='stylesheet' type='text/css' href='/css/player.css' /><title>" + soundfiledesc + "</title></head><body>";
	winContent += "<p><strong>" + soundfiledesc + "</strong></p>";
	winContent += "<object width='300' height='42'>";
	winContent += "<param name='src' value='" +  soundfilepath + "'>";
	winContent += "<param name='autoplay' value='true'>";
	winContent += "<param name='controller' value='true'>";
	winContent += "<embed src='" + soundfilepath + "' autostart='true' loop='false' width='300' height='42' controller='true'></embed>";
	winContent += "</object>";

	winContent += "<p align='center'>" + addinfo + "</p>";

	winContent += "<p align='right'><a href='#' class='maintext' title='Close Window' onClick='javascript:window.close()'>Close Window</a></p>";
	winContent += "</body></html>";
	PlayWin.document.write(winContent);
	PlayWin.document.close(); // "Finalizes" new window
	UniqueID = UniqueID + 1
	newWinOffset = newWinOffset + 20 // subsequent pop-ups will be this many pixels lower.
}

function noway(go) {
if (document.all) {
if (event.button == 2) {
alert(popup);
return false;
}
}
if (document.layers) {
if (go.which == 3) {
alert(popup);
return false;
}
}
} 