function create_main_contact(){
	add_element('img', 'header_dynamic', '', './pic/img/img_barres_titre.png', 159, 5, '', '', '');
	add_element('txt', 'header_dynamic', '', 'Contact', 135, 40, 900, 25, 'gothm-medium');
	add_content('main_dynamic','1', 40, 15, 450, 420);
	get_id('title_content_1').innerHTML = 'Informations';
	add_element('txt', 'main_dynamic', 'label_entete_contact', '* Informations obligatoires', 100, 25, 330, 20, 'text_10_left_white');
	add_input('prenom', 'Nom*', 145, 25, 330, 20, 70);
	add_input('nom', 'Prenom*', 180, 25, 330, 20, 70);
	add_input('email', 'Email*', 215, 25, 330, 20, 70);
	add_input('adresse', 'Adresse', 250, 25, 330, 20, 70);
	add_input('code_postal', 'Code Postal', 285, 25, 130, 20, 70);
	add_input('ville', 'Ville', 285, 245, 130, 20, 50);
	add_input('tel_fixe', 'Téléphone', 320, 25, 130, 20, 70);
	add_input('tel_portable', 'Portable', 320, 245, 130, 20, 50);

	add_content('main_dynamic','2', 40, 460, 440, 420);
	get_id('title_content_2').innerHTML = 'Message';
	add_element('textarea', 'main_dynamic', 'message_core', '', 110, 470, 410, 330);
	get_id('message_core').onclick = function(){set_focus(this.id)};
	add_element('txt', 'main_dynamic', 'label_send_message', 'Envoyer', 448, 470, 410, 20, 'text_11_right_white_underline');
	get_id('label_send_message').onclick = function(){
		if (get_id('prenom').value == ''){
			dialog_box('alert','','Erreur!!!','Veuillez saisir votre Nom','prenom',function(){});
		}else if (get_id('prenom').value == ''){
			dialog_box('alert','','Erreur!!!','Veuillez saisir votre Prenom','nom',function(){});
		}else if (get_id('email').value == ''){
			dialog_box('alert','','Erreur!!!','Veuillez saisir votre Email','email',function(){});
		}else{
			message = 'First Name: ' + get_id('prenom').value;
			message = message + '<br>Last Name: ' + get_id('nom').value;
			message = message + '<br>Adress: ' + get_id('adresse').value;
			message = message + '<br>ZIP Code: ' + get_id('code_postal').value;
			message = message + '<br>City:' + get_id('ville').value;
			message = message + '<br>Phone: ' + get_id('tel_fixe').value;
			message = message + '<br>Cell Phone: ' + get_id('tel_portable').value;
			message = message + '<br>Email: ' + get_id('email').value;
			message_core = get_id('message_core').value;
			while (message_core.search('\n') != -1) 
				message_core = message_core.replace('\n',"<br>");
			message = message + '<br><br>Message: ' + message_core;
			insert_recup_record('./ajax/contact.php?message='+message+'&email='+get_id('email').value, function(response){email_confirm_sent(response)});
			load_page('contact');
		}
	}
	text = 'Conformément à la loi "Informatique et Libertés du 6 janvier 1978" vous disposez d\'un droit d\'accès, de modification, de rectification et de suppression des données vous concernant. Si vous souhaitez exercer ce droit, contactez le webmestre à l\'adresse suivante: webmaster@dimrosel.com';
	//text = 'You may access and modify or delete your contact information by contacting Customer Service at contact@caddytronic.com.';
	//text = text + '<br>We will make good faith efforts to resolve requests to correct inaccurate or delete information except where the request is unreasonable, requires disproportionate technical effort or expense, jeopardizes the privacy of others, or would be impractical.';

	add_element('txt', 'main_dynamic', 'label_pied_contact', text, 390, 25, 430, 20, 'text_10_left_white');
}
function email_confirm_sent(is_sent){
	if (is_sent == 1){
		load_page('contact_confirm');
	}else{
		load_page('contact_problem');
	}
}
function create_main_contact_confirm(){
	add_element('img', 'main_dynamic', '', './pic/img/img_barres_titre.png', 42, 15, '', '', '');
	add_element('txt', 'main_dynamic', '', 'Contact', 20, 50, 900, 25, 'gothm');
	add_element('txt', 'main_dynamic', 'label_entete_contact', 'Your message has been sent successfully!', 230, 0, 900, 20, 'text_16_center_white_bold');
}
function create_main_contact_problem(){
	add_element('img', 'main_dynamic', '', './pic/img/img_barres_titre.png', 42, 15, '', '', '');
	add_element('txt', 'main_dynamic', '', 'Contact', 20, 50, 900, 25, 'gothm');
	add_element('txt', 'main_dynamic', 'label_entete_contact', 'Technical problem, please try later.', 230, 0, 900, 20, 'text_16_center_white_bold');
}
function add_input(id, text, top, left, width, height, decal){
	add_element('txt', 'main_dynamic', 'label_'+id, text, top+3, left, width, height, 'text_10_left_white');
	add_element('input', 'main_dynamic', id, '', top, left+decal, width, height);
	get_id(id).onclick = function(){set_focus(this.id)};

}

