
function intSportId_check() {

    var intSportId = $('#intSportId').val();
        
    if ($('#intNoDcId').attr('checked') == false) {
        if (intSportId > 0) {
            
            /*
            new Ajax.Request('skapalagsida-do-2.html', {
                method: 'post', parameters: 'intSportId=' + intSportId,
                onSuccess: function(transport) {
                    var response = transport.responseText || "no response text";

                    $('#intDfId').html(response);
                    $('#intDcId').html('<option value="">-- Välj först ett förbund --</option>');

                },
                onFailure: function() { alert('Ett fel har uppstått') }
            });
            */

            $.ajax({
                url: 'skapalagsida-do-2.html?rnd=' + new String(Math.random()).substring(2, 11),
                type: "POST",
                data: 'intSportId=' + intSportId,
                cache: false,
                async: true,
                success: function (response) {
                    $('#intDfId').html(response);
                    $('#intDcId').html('<option value="">-- Välj först ett förbund --</option>');
                }
            });


        }
        else {
            $('#intDfId').html('<option value="">-- Välj först en sport --</option>');
            $('#intDcId').html('<option value="">-- Välj först ett förbund --</option>');
        }
    }
}


function intDfId_check() {

    var intSportId = $('#intSportId').val();
    var intDfId = $('#intDfId').val();

    if (intDfId > 0) {

        /*
        new Ajax.Request('skapalagsida-do-3.html', {
            method: 'post', parameters: 'intSportId=' + intSportId + '&intDfId=' + intDfId,
            onSuccess: function(transport) {
                var response = transport.responseText || "no response text";
                $('#intDcId').html(response);
            },
            onFailure: function() { alert('Ett fel har uppstått') }
        });
        */

        $.ajax({
            url: 'skapalagsida-do-3.html?rnd=' + new String(Math.random()).substring(2, 11),
            type: "POST",
            data: 'intSportId=' + intSportId + '&intDfId=' + intDfId,
            cache: false,
            async: true,
            success: function (response) {
                $('#intDcId').html(response);
            }
        });

    }
    else {
        $('#intDcId').html('<option value="">-- Välj först ett förbund --</option>');
    }
}

function intNoDcId_check() {

    if ($('#intNoDcId').attr('checked') == true) {
        $('#intDfId').html('<option value="">Ingen förening</option>');
        $('#intDcId').html('<option value="">Ingen förening</option>');
    }
    else {
        intSportId_check();
    }
}



function intCountyId_check() {

    var intCountyId = $('#intCountyId').val();

    if (intCountyId > 0) {

        /*
        new Ajax.Request('skapalagsida-do-4.html', {
            method: 'post', parameters: 'intCountyId=' + intCountyId,
            onSuccess: function(transport) {
                var response = transport.responseText || "no response text";

                $('#intMunicipalityId').html(response);

            },
            onFailure: function() { alert('Ett fel har uppstått') }
        });
        */

        $.ajax({
            url: 'skapalagsida-do-4.html?rnd=' + new String(Math.random()).substring(2, 11),
            type: "POST",
            data: 'intCountyId=' + intCountyId,
            cache: false,
            async: true,
            success: function (response) {
                $('#intMunicipalityId').html(response);
            }
        });

    }
    else {
        $('#intMunicipalityId').html('<option value="">-- Välj först ett län --</option>');
    }

}

function popup(url, intWidth, intHeight) {
    window.open(url, "namn", "width=" + intWidth + ",height=" + intHeight + ",scrollbars=yes,status=no,toolbar=no,resizable=yes,location=no,menubar=no,directories=no")
}

function strTeamName_clear() {

    var strTeamName = $('#strTeamName').val();

    if (strTeamName == 'Ert lagnamn') {
        $('#strTeamName').val('');
    }
    else {
        strTeamName_check();
    }

}

function strTeamName_check() {

    var intCheck = -1;
    var intRunCheck = -1;
    var strTeamName = $('#strTeamName').val();

    if (strTeamName.length >= 3 || intRunCheck == 1) {

        var strPattern = new RegExp(/^\w{3,20}$/);

        if (strPattern.test(strTeamName) == true) {
            
            /*
            new Ajax.Request('skapalagsida-do-1.html', {
                method: 'post', parameters: 'strTeamName=' + strTeamName,
                onSuccess: function (transport) {
                    var response = transport.responseText || "no response text";

                    if (transport.getHeader('intCheck') == 1) {

                        $('#reg_name_status').html('Lagnamnet är ledigt');
                        $('#reg_name_status').css({ 'color': 'green' });
                        
                    }
                    else {
                        $('#reg_name_status').html('Lagnamnet är upptaget');
                        $('#reg_name_status').css({ 'color': 'red' });
                    }

                },
                onFailure: function () { alert('Ett fel har uppstått') }
            });
            */

            $.ajax({
                url: 'skapalagsida-do-1.html?rnd=' + new String(Math.random()).substring(2, 11),
                type: "POST",
                data: 'strTeamName=' + strTeamName,
                cache: false,
                async: true,
                success: function (response) {
                                        
                    if (response == "OK") {
                        $('#reg_name_status').html('Lagnamnet är ledigt');
                        $('#reg_name_status').css({ 'color': 'green' });
                    }
                    else {
                        $('#reg_name_status').html('Lagnamnet är upptaget');
                        $('#reg_name_status').css({ 'color': 'red' });
                    }
                    

                }
            });


        }
        else {
            $('#reg_name_status').html('Innehåller ogiltiga tecken');
            $('#reg_name_status').css({ 'color': 'red' });
        }

        intRunCheck = 1;

    }
    else {

        var strPattern = new RegExp(/^\w{0,20}$/);

        if (strPattern.test(strTeamName) == true)
            $('#reg_name_status').html('');
        else
            $('#reg_name_status').html('Innehåller ogiltiga tecken');
        $('#reg_name_status').css({ 'color': 'red' });


    }


}

function form_reg_step1_validate() {

    var intCheck = 1;

    if ($('#reg_name_status').html() != 'Lagnamnet är ledigt') {
        intCheck = -1;
        $('#strTeamName').focus();
        if ($('#reg_name_status').innerHTML == '') {
            $('#reg_name_status').html('Minst 3 tecken');
            $('#reg_name_status').css({ 'color': 'red' });
        }
    }
    
    if (intCheck == 1) {
        return true;
    }
    else {
        return false;
    }

}



function find_intCountyId_check() {

    var intCountyId = $('#select2').val();

    if (intCountyId > 0) {
        
        /*
        new Ajax.Request('hitta-ajax-1.html', {
            method: 'post', parameters: 'intCountyId=' + intCountyId,
            onSuccess: function (transport) {
                var response = transport.responseText || "no response text";

                $('#select3').html(response);

            },
            onFailure: function () { alert('Ett fel har uppstått') }
        });
        */

        $.ajax({
            url: 'hitta-ajax-1.html?rnd=' + new String(Math.random()).substring(2, 11),
            type: "POST",
            data: 'intCountyId=' + intCountyId,
            cache: false,
            async: true,
            success: function (response) {
                $('#select3').html(response);
            }
        });

    }
    else {
        $('#select3').html('<option value="">-- Välj först ett län --</option>');
    }

}


function form_reg_step2_validate() {

    var intCheck = 1;

    $('#intSportId_status').css({ 'display': 'none' });
    $('#intDfId_status').css({ 'display': 'none' });
    $('#intDcId_status').css({ 'display': 'none' });
    $('#intCountyId_status').css({ 'display': 'none' });
    $('#intMunicipalityId_status').css({ 'display': 'none' });
    $('#intAgeId_status').css({ 'display': 'none' });

    if ($('#intSportId').val() <= 0) {
        intCheck = -1;
        $('#intSportId_status').css({ 'display': 'inline' });
        $('#strStep2_status').html('<p>Välj en sport</p>');
        return false;
    }


    if ($('#intNoDcId').attr('checked') == false) {

        if ($('#intDfId').val() <= 0) {
            intCheck = -1;
            $('#intDfId_status').css({ 'display': 'inline' });
            $('#strStep2_status').html('<p>Välj ett förbund eller att ni inte tillhör en förening</p>');
            return false;
        }

        if ($('#intDcId').val() <= 0) {
            intCheck = -1;
            $('#intDcId_status').css({ 'display': 'inline' });
            $('#strStep2_status').html('<p>Välj en förening eller att ni inte tillhör en förening</p>');
            return false;
        }

    }

    if ($('#intCountyId').val() <= 0) {
        intCheck = -1;
        $('#intCountyId_status').css({ 'display': 'inline' });
        $('#strStep2_status').html('<p>Välj ett län</p>');
        return false;
    }


    if ($('#intMunicipalityId').val() <= 0) {
        intCheck = -1;
        $('#intMunicipalityId_status').css({ 'display': 'inline' });
        $('#strStep2_status').html('<p>Välj en kommun</p>');
        return false;
    }

    if ($('#intAgeId').val() <= 0) {
        intCheck = -1;
        $('#intAgeId_status').css({ 'display': 'inline' });
        $('#strStep2_status').html('<p>Välj en ålder</p>');
        return false;
    }

    if (intCheck == 1) {
        $('#strStep2_status').html('');
        return true;
    }
    else {
        return false;
    }

}

function strTroopMail2_check() {

    var strPattern = new RegExp(/^(([\w-]+\.?)+@([a-zA-Z0-9-]{1,}\.?)+\.[a-zA-Z]{2,4}){1}$/);
    if (strPattern.test($('#strTroopMail').val()) == true) {
        if ($('#strTroopMail').val() == $('#strTroopMail2').val()) {
            if ($('#strTroopUserName').val() == '') {
                $('#strTroopUserName').val($('#strTroopMail').val());
            }
        }
    }

}

function form_reg_step3_validate() {

    var intCheck = 1;

    $('#strTroopForename_status').css({ 'display': 'none' });
    $('#strTroopSurname_status').css({ 'display': 'none' });
    $('#strTroopMail_status').css({ 'display': 'none' });
    $('#strTroopMail2_status').css({ 'display': 'none' });
    $('#strTroopUserName_status').css({ 'display': 'none' });
    $('#strTroopPassword_status').css({ 'display': 'none' });
    $('#strTroopPassword2_status').css({ 'display': 'none' });
    $('#strTeamRef_status').css({ 'display': 'none' });

    var strPattern = new RegExp(/^.{2,50}$/);
    if (strPattern.test($('#strTroopForename').val()) == false) {
        intCheck = -1;
        $('#strTroopForename_status').css({ 'display': 'inline' });
        $('#strTroopForename').focus();
        $('#strStep3_status').html('<p>Ange ditt förnamn</p>');
        return false;
    }

    var strPattern = new RegExp(/^.{2,50}$/);
    if (strPattern.test($('#strTroopSurname').val()) == false) {
        intCheck = -1;
        $('#strTroopSurname_status').css({ 'display': 'inline' });
        $('#strTroopSurname').focus();
        $('#strStep3_status').html('<p>Ange ditt efternamn</p>');
        return false;
    }

    var strPattern = new RegExp(/^(([\w-]+\.?)+@([a-zA-Z0-9-]{1,}\.?)+\.[a-zA-Z]{2,4}){1}$/);
    if (strPattern.test($('#strTroopMail').val()) == false) {
        intCheck = -1;
        $('#strTroopMail_status').css({ 'display': 'inline' });
        $('#strTroopMail').focus();
        $('#strStep3_status').html('<p>E-postadress är inte giltig</p>');
        return false;
    }
    else {
        if ($('#strTroopMail').val() != $('#strTroopMail2').val()) {
            intCheck = -1;
            $('#strTroopMail2_status').css({ 'display': 'inline' });
            $('#strTroopMail2').focus();
            $('#strStep3_status').html('<p>E-postadresserna är inte lika</p>');
            return false;
        }
    }

    var strPattern = new RegExp(/^.{4,50}$/);
    if (strPattern.test($('#strTroopUserName').val()) == false) {
        intCheck = -1;
        $('#strTroopUserName_status').css({ 'display': 'inline' });
        $('#strTroopUserName').focus();
        $('#strStep3_status').html('<p>Ange önskat användarnamn, minst 4 tecken</p>');
        return false;
    }

    var strPattern = new RegExp(/^.{6,50}$/);
    if (strPattern.test($('#strTroopPassword').val()) == false) {
        intCheck = -1;
        $('#strTroopPassword_status').css({ 'display': 'inline' });
        $('#strTroopPassword').focus();
        $('#strStep3_status').html('<p>Ange önskat lösenord, minst 6 tecken</p>');
        return false;
    }
    else {
        if ($('#strTroopPassword').val() != $('#strTroopPassword2').val()) {
            intCheck = -1;
            $('#strTroopPassword2_status').css({ 'display': 'inline' });
            $('#strTroopPassword2').focus();
            $('#strStep3_status').html('<p>Lösenorden är inte lika</p>');
            return false;
        }
    }

    var strPattern = new RegExp(/^.+$/);
		if (strPattern.test($('#strTeamRef').val()) == false) {
			intCheck = -1;
			$('#strTeamRef_status').css({ 'display': 'inline' });
			$('#strTeamRef').focus();
			$('#strStep3_status').html('<p>Välj ett alternativ</p>');
		return false;
    }

    if ($('#intAccept').attr('checked') == false) {
        intCheck = -1;
        $('#strStep3_status').html('<p>Du måste acceptera de allmänna villkoren</p>');
        return false;
    }


    if (intCheck == 1) {
        return true;
    }
    else {
        return false;
    }

}

function contact_validate() {

    var intCheck = 1;

    $('#strName_status').css({ 'display': 'none' });
    $('#strEmail_status').css({ 'display': 'none' });
    $('#strType_status').css({ 'display': 'none' });
    $('#strClub_status').css({ 'display': 'none' });
    $('#strSubject_status').css({ 'display': 'none' });

    var strPattern = new RegExp(/^.{4,50}$/);
    if (strPattern.test($('#strName').val()) == false) {
        intCheck = -1;
        $('#strName_status').css({ 'display': 'inline' });
        $('#strName').focus();
        $('#contact_validate').html('<p>Ange ditt namn</p>');
        return false;
    }
    
    var strPattern = new RegExp(/^(([\w-]+\.?)+@([a-zA-Z0-9-]{1,}\.?)+\.[a-zA-Z]{2,4}){1}$/);
    if (strPattern.test($('#strEmail').val()) == false) {
        intCheck = -1;
        $('#strEmail_status').css({ 'display': 'inline' });
        $('#strEmail').focus();
        $('#contact_validate').html('<p>Ange en korrekt e-postadress</p>');
        return false;
    }

    if ($('#strType').val() <= 0) {
        intCheck = -1;
        $('#strType_status').css({ 'display': 'inline' });
        $('#strType').focus();
        $('#contact_validate').html('<p>Välj en ärendetyp</p>');
        return false;
    }

    var strPattern = new RegExp(/^.{4,50}$/);
    if (strPattern.test($('#strClub').val()) == false) {
        intCheck = -1;
        $('#strClub_status').css({ 'display': 'inline' });
        $('#strClub').focus();
        $('#contact_validate').html('<p>Ange klubb/lag som ärendet gäller</p>');
        return false;
    }

    var strPattern = new RegExp(/^.{4,50}$/);
    if (strPattern.test($('#strSubject').val()) == false) {
        intCheck = -1;
        $('#strSubject_status').css({ 'display': 'inline' });
        $('#strSubject').focus();
        $('#contact_validate').html('<p>Ange en rubrik för ditt ärende</p>');
        return false;
    }

    var strPattern = new RegExp(/^(.|\n){4,4000}$/);
    if (strPattern.test($('#strBody').val()) == false) {
        intCheck = -1;
        $('#strBody').focus();
        $('#contact_validate').html('<p>Berätta vad ärendet gäller</p>');
        return false;
    }
    
    if (intCheck == 1) {
        return true;
    }
    else {
        return false;
    }

}

function sponsorship_validate() {

    var intCheck = 1;

    $('#strClub_status').css({ 'display': 'none' });
    $('#strTeams_status').css({ 'display': 'none' });
    $('#strName_status').css({ 'display': 'none' });
    $('#strPhone_status').css({ 'display': 'none' });
    $('#strEmail_status').css({ 'display': 'none' });

    var strPattern = new RegExp(/^.{4,50}$/);
    if (strPattern.test($('#strClub').val()) == false) {
        intCheck = -1;
        $('#strClub_status').css({ 'display': 'inline' });
        $('#strClub').focus();
        $('#contact_validate').html('<p>Ange den klubb/förening det gäller</p>');
        return false;
    }

    var strPattern = new RegExp(/^.{1,50}$/);
    if (strPattern.test($('#strTeams').val()) == false) {
        intCheck = -1;
        $('#strTeams_status').css({ 'display': 'inline' });
        $('#strTeams').focus();
        $('#contact_validate').html('<p>Ange hur många lag har föreningen</p>');
        return false;
    }

    var strPattern = new RegExp(/^.{3,50}$/);
    if (strPattern.test($('#strName').val()) == false) {
        intCheck = -1;
        $('#strName_status').css({ 'display': 'inline' });
        $('#strName').focus();
        $('#contact_validate').html('<p>Ange ditt namn<p>');
        return false;
    }

    var strPattern = new RegExp(/^.{4,50}$/);
    if (strPattern.test($('#strPhone').val()) == false) {
        intCheck = -1;
        $('#strPhone_status').css({ 'display': 'inline' });
        $('#strPhone').focus();
        $('#contact_validate').html('<p>Ange ditt telefonnummer</p>');
        return false;
    }

    var strPattern = new RegExp(/^(([\w-]+\.?)+@([a-zA-Z0-9-]{1,}\.?)+\.[a-zA-Z]{2,4}){1}$/);
    if (strPattern.test($('#strEmail').val()) == false) {
        intCheck = -1;
        $('#strEmail_status').css({ 'display': 'inline' });
        $('#strEmail').focus();
        $('#contact_validate').html('<p>Ange en korrekt e-postadress</p>');
        return false;
    }

    if (intCheck == 1) {
        return true;
    }
    else {
        return false;
    }

}


//--------------------- TEMP FOR CLUBPAGE -------------------------

function strClubName_clear() {

	var strClubName = $('#strClubName').val();

	if (strClubName == 'Ert klubbnamn') {
		$('#strClubName').val('');
	}
	else {
		strClubName_check();
	}

}

function strClubName_check() {

	var intCheck = -1;
	var intRunCheck = -1;
	var strClubName = $('#strClubName').val();

	if (strClubName.length >= 3 || intRunCheck == 1) {

		var strPattern = new RegExp(/^\w{3,20}$/);

		if (strPattern.test(strClubName) == true) {
            /*
			new Ajax.Request('skapaklubbsida-do-1.html', {
				method: 'post', parameters: 'strClubName=' + strClubName,
				onSuccess: function (transport) {
					var response = transport.responseText || "no response text";

					if (transport.getHeader('intCheck') == 1) {

						$('reg_name_status').update('Klubbnamnet är ledigt');
						$('reg_name_status').setStyle({ 'color': 'green' });

					}
					else {
						$('reg_name_status').update('Klubbnamnet är upptaget');
						$('reg_name_status').setStyle({ 'color': 'red' });
					}



				},
				onFailure: function () { alert('Ett fel har uppstått') }
			});
            */

		    $.ajax({
		        url: 'skapaklubbsida-do-1.html?rnd=' + new String(Math.random()).substring(2, 11),
		        type: "POST",
		        data: 'strClubName=' + strClubName,
		        cache: false,
		        async: true,
		        success: function (response) {

		            if (response == "OK") {
		                $('#reg_name_status').html('Klubbnamnet är ledigt');
		                $('#reg_name_status').css({ 'color': 'green' });
		            }
		            else {
		                $('#reg_name_status').html('Klubbnamnet är upptaget');
		                $('#reg_name_status').css({ 'color': 'red' });
		            }


		        }
		    });

		}
		else {
			$('#reg_name_status').html('Innehåller ogiltiga tecken');
			$('#reg_name_status').css({ 'color': 'red' });
		}

		intRunCheck = 1;

	}
	else {

		var strPattern = new RegExp(/^\w{0,20}$/);

		if (strPattern.test(strClubName) == true)
			$('#reg_name_status').html('');
		else {
			$('#reg_name_status').html('Innehåller ogiltiga tecken');
			$('#reg_name_status').css({ 'color': 'red' });
		}

	}


}

function formClub_reg_step1_validate() {

	var intCheck = 1;

	if ($('#reg_name_status').html() != 'Klubbnamnet är ledigt') {
		intCheck = -1;
		$('#strClubName').focus();
		if ($('#reg_name_status').innerHTML == '') {
			$('#reg_name_status').html('Minst 3 tecken');
			$('#reg_name_status').css({ 'color': 'red' });
		}
	}

	if (intCheck == 1) {
		return true;
	}
	else {
		return false;
	}

}





function formClub_reg_step2_validate() {

	var intCheck = 1;

	$('#intSportId_status').css({ 'display': 'none' });
	$('#intDfId_status').css({ 'display': 'none' });
	$('#intDcId_status').css({ 'display': 'none' });
	$('#intCountyId_status').css({ 'display': 'none' });
	$('#intMunicipalityId_status').css({ 'display': 'none' });

	if ($('#intSportId').val() <= 0) {
		intCheck = -1;
		$('#intSportId_status').css({ 'display': 'inline' });
		$('#strStep2_status').html('<p>Välj en sport</p>');
		return false;
	}


    if ($('#intNoDcId').attr('checked') == false) {

		if ($('#intDfId').val() <= 0) {
			intCheck = -1;
			$('#intDfId_status').css({ 'display': 'inline' });
			$('#strStep2_status').html('<p>Välj ett förbund eller att ni inte tillhör en förening</p>');
			return false;
		}

		if ($('#intDcId').val() <= 0) {
			intCheck = -1;
			$('#intDcId_status').css({ 'display': 'inline' });
			$('#strStep2_status').html('<p>Välj en förening eller att ni inte tillhör en förening</p>');
			return false;
		}

	}

    if ($('#intCountyId').val() <= 0) {
		intCheck = -1;
		$('#intCountyId_status').css({ 'display': 'inline' });
		$('#strStep2_status').html('<p>Välj ett län</p>');
		return false;
	}


    if ($('#intMunicipalityId').val() <= 0) {
		intCheck = -1;
		$('#intMunicipalityId_status').css({ 'display': 'inline' });
		$('#strStep2_status').html('<p>Välj en kommun</p>');
		return false;
	}

	if (intCheck == 1) {
		$('#strStep2_status').html('');
		return true;
	}
	else {
		return false;
	}

}

function strUserMail2_check() {

	var strPattern = new RegExp(/^(([\w-]+\.?)+@([a-zA-Z0-9-]{1,}\.?)+\.[a-zA-Z]{2,4}){1}$/);
	if (strPattern.test($('#strUserMail').val()) == true) {
	    if ($('#strUserMail').val() == $('#strUserMail2').val()) {
	        if ($('#strUserUserName').val() == '') {
				$('#strUserUserName').val($('strUserMail').val());
			}
		}
	}

}

function formClub_reg_step3_validate() {

	var intCheck = 1;

	$('#strUserName_status').css({ 'display': 'none' });
	$('#strUserMail_status').css({ 'display': 'none' });
	$('#strUserMail2_status').css({ 'display': 'none' });
	$('#strUserUserName_status').css({ 'display': 'none' });
	$('#strUserPassword_status').css({ 'display': 'none' });
	$('#strUserPassword2_status').css({ 'display': 'none' });

	var strPattern = new RegExp(/^.{2,50}$/);
	if (strPattern.test($('#strUserName').val()) == false) {
		intCheck = -1;
		$('#strUserName_status').css({ 'display': 'inline' });
		$('#strUserName').focus();
		$('#strStep3_status').html('<p>Ange ditt namn</p>');
		return false;
	}

	var strPattern = new RegExp(/^(([\w-]+\.?)+@([a-zA-Z0-9-]{1,}\.?)+\.[a-zA-Z]{2,4}){1}$/);
	if (strPattern.test($('#strUserMail').val()) == false) {
		intCheck = -1;
		$('#strUserMail_status').css({ 'display': 'inline' });
		$('#strUserMail').focus();
		$('#strStep3_status').html('<p>E-postadress är inte giltig</p>');
		return false;
	}
	else {
		if ($('#strUserMail').val() != $('#strUserMail2').val()) {
			intCheck = -1;
			$('#strUserMail2_status').css({ 'display': 'inline' });
			$('#strUserMail2').focus();
			$('#strStep3_status').html('<p>E-postadresserna är inte lika</p>');
			return false;
		}
	}

	var strPattern = new RegExp(/^.{4,50}$/);
	if (strPattern.test($('#strUserUserName').val()) == false) {
		intCheck = -1;
		$('#strUserUserName_status').css({ 'display': 'inline' });
		$('#strUserUserName').focus();
		$('#strStep3_status').html('<p>Ange önskat användarnamn, minst 4 tecken</p>');
		return false;
	}

	var strPattern = new RegExp(/^.{6,50}$/);
	if (strPattern.test($('#strUserPassword').val()) == false) {
		intCheck = -1;
		$('#strUserPassword_status').css({ 'display': 'inline' });
		$('#strUserPassword').focus();
		$('#strStep3_status').html('<p>Ange önskat lösenord, minst 6 tecken</p>');
		return false;
	}
	else {
		if ($('#strUserPassword').val() != $('#strUserPassword2').val()) {
			intCheck = -1;
			$('#strUserPassword2_status').css({ 'display': 'inline' });
			$('#strUserPassword2').focus();
			$('#strStep3_status').html('<p>Lösenorden är inte lika</p>');
			return false;
		}
	}



	if ($('#intAccept').attr('checked') == false) {
		intCheck = -1;
		$('#strStep3_status').html('<p>Du måste acceptera de allmänna villkoren</p>');
		return false;
	}


	if (intCheck == 1) {
		return true;
	}
	else {
		return false;
	}

}
