function checkLoginForm(form)
{
    var spacesReg = new RegExp("^[ ]*$");
    errorMessage = "";
    if ( spacesReg.test(form.txtLogin.value) )
    {
        errorMessage += "Please enter a Screenname/email";
    }
    if ( spacesReg.test(form.frmPassword.value) )
    {
        if(errorMessage != "")
            errorMessage += "\n";
        errorMessage += "Please enter a Password";
    }
    if(errorMessage != "")
    {
        alert(errorMessage);
        return false
    }
    return true;
}

function mailValidate(text){
	var str = text.replace(/(\-|\s|\+|\(|\))/g, '');
	var reg = /\D*[\d]{11,}\D*/;
	if (reg.test(str)){
		alert('Incorrect Subject');
		return false;
	}
	else{
		return tfv.exec();
	}
}

function checkCaptionFields() {
	var chatupline = $('#getyounoticed_').val();	
	var description = $('#description_').val();
	var error = "";
	
	if ( chatupline.length < 21 )
	{
		error += "Chat Up Line must be at least 20 characters\n";
	}
	if ( description.length < 21 )
	{
		error += "Description must be at least 20 characters";
	}
	
	if ( error == "" )
	{
		return true;
	}
	else
	{
		alert(error);
		return false;
	}
}

function checkDetailedInformation(sex, subid) {
	var error = "";
	
	if ( $("input[name='haircol_[" + sex + "][" + subid + "]']:checked").val() == 0 )
	{
		error += "Please tell us about your Hair colour\n";
	}
	if ( $("input[name='eyecol_[" + sex + "][" + subid + "]']:checked").val() == 0 )
	{
		error += "Please tell us about your Eye colour\n";	
	}
	if ( $("input[name='build_[" + sex + "][" + subid + "]']:checked").val() == 0 )
	{
		error += "Please tell us about your Body type\n";
	}
	if ( $("input[name='height_[" + sex + "][" + subid + "]']:checked").val() == 0 )
	{
		error += "Please tell us about your Height\n";
	}
	if ( $("input[name='race_[" + sex + "][" + subid + "]']:checked").val() == 0 )
	{
		error += "Please tell us about your Ethnicity\n";
	}
	if ( $("input[name='religion_[" + sex + "][" + subid + "]']:checked").val() == 0 )
	{
		error += "Please tell us about your Religion\n";
	}
	if ( $("input[name='education_[" + sex + "][" + subid + "]']:checked").val() == 0 )
	{
		error += "Please tell us about your Education\n";
	}
	if ( $("input[name='employment_[" + sex + "][" + subid + "]']:checked").val() == 0 )
	{
		error += "Please tell us about your Employment\n";
	}
	if ( $("input[name='income_[" + sex + "][" + subid + "]']:checked").val() == 0 )
	{
		error += "Please tell us about your Income\n";
	}
	if ( $("input[name='drinker_[" + sex + "][" + subid + "]']:checked").val() == 0 )
	{
		error += "Please tell us about your Drinking\n";
	}
	if ( $("input[name='smoker_[" + sex + "][" + subid + "]']:checked").val() == 0 )
	{
		error += "Please tell us about your Smoking\n";
	}
	if ( $("input[name='familystatus_[" + sex + "][" + subid + "]']:checked").val() == 0 )
	{
		error += "Please tell us about your Relationships\n";
	}
	if ( $("input[name='children_[" + sex + "][" + subid + "]']:checked").val() == 0 )
	{
		error += "Please tell us about your Have children\n";
	}
	if ( $("input[name='want_children_[" + sex + "][" + subid + "]']:checked").val() == 0 )
	{
		error += "Please tell us about your Want children\n";
	}
	
	if ( error == "" )
	{
		return true;
	}
	else
	{
		alert(error);
		return false;
	}
}