/**
 * @mc émafbroadcast
 * 2008 05 25
 * GRANGENEUVE, LE MAGAsIN
 * 
 * fichier js contenant les opérations ajax et jquery pour la 
 * gestion de la page panier 
 */
		 	$(document).ready(function() { // dom ready
		 		$('#message').css("display", "none");
						
				function activesBasketButtons(){
					// gestion des boutons + - x
					// cibles les images et balance les actions
					$('.contentFull td.actions img').click(function(){
						var funct = this.id.substring(0, 3); // retourne soit add min ou del
						var itemId = this.id.substring(3, this.id.length);// retourne l'id
						$.post('ajax/updateBasketPage.php', {
							fct: funct,
							id: itemId
						}, // envoi en post les valeurs
 							function(c){ // update div
							$('.contentFull').html(c); // innerhtml
							activesBasketButtons();
							rollOverTR();
							loginFocus();
							
						})// function c et $.post
					})// click
				}
		 		
				$.post('ajax/updateBasketPage.php',  // envoi en post les valeurs
						function(c){ // update div
							$('.contentFull').html(c); // innerhtml
							activesBasketButtons();
							rollOverTR();
							loginFocus();
						})
						
				function rollOverTR(){
					$('.tableLine0, .tableLine1').mouseover( 
						function() { 
							$(this).find('td').not('.img').css("background-color", "#fafaf9")
						
						});
					$('.tableLine0, .tableLine1').mouseout( 
						function() { 
							$(this).find('td').not('.img').css("background-color", null)
						});
					
				}
				
				function loginFocus(){
					$('#loginFocus').click(function(){
						$('#log').focus();
					})
				}
				
				$('#formLogin').submit(function(){
					$('#shaPwdl').val($.sha1($('#passwordl').val()));
					$('#passwordl').val('');
				})
				
				$('#forgetPwd').attr({href:'profil.php?SID&pwd'});
				
			});
