{% extends "ldt/ldt_base.html" %}
{# this page inherit base html, all pages of ldt inherit this page. #}
{# all contents are writed in the "iricontent" block  #}
{% load i18n %}

{% block css_import %}
{{ block.super }}
    
    <style type="text/css">
    
    .error {
    	display: none;
    }
   	
   	.leftcolumn {
   		width: 40%;
   		text-align: right;
   	}
   	
   	input {
   		border-radius: 3px;
   	}  	   
   	
	</style>

<script type="text/javascript">

	function check_valid_email(email) { 
		var reg = /[A-Z0-9._+]+@[A-Z0-9.-]+\.[A-Z]{2,4}/i;
		return (reg.exec(email) != null);
	}
	
	function check_valid_name(name) { 
		var reg = /^[ \w\-éàçèôöü]*$/i;
		return (reg.exec(name) != null);
	}
	
	function display_error_if_different (input1, input2, errorClass) {
			if ( $(input1).val() != $(input2).val() ) {
				$(errorClass).show();
				return false;				
			} else {
				$(errorClass).hide();
				return true;
			}
	}
		
	function is_valid_name (input, errorClass)  {
			if ( !check_valid_name($(input).val()) ) {
				$(errorClass).show();
				return false;				
			} else {
				$(errorClass).hide();
				return true;
			}
	}
	
	function is_valid_email (input, errorClass)  {
			if ( !check_valid_email($(input).val()) ) {
				$(errorClass).show();
				return false;				
			} else {
				$(errorClass).hide();
				return true;
			}
	}
</script>
{% endblock %}


{% block content %}

<ul>
    <li><a href="{% url ldt.user.views.profile %}" >{% trans "Profile change" %} </a></li>
    <li><a href="{% url ldt.user.views.password %}">{% trans "Password change" %}</a></li>
    <li><a href="{% url ldt.user.views.language %}">{% trans "Language change" %}</a></li>    
</ul>


<div id="iri-user-content" class="span-24 last">
    {% block iricontent %}{% endblock %}
</div>
{% endblock%}
