function update_productInfo(finition,coeur,like) {
		($('#pdt_finition')).html(finition);
		($('#pdt_love span')).html(coeur);
		($('#pdt_like')).html(like);
}

$(document).ready(function() {
   
    /* dialogboxes */
    $('#dial-favorite-identification').dialog({ autoOpen: false, modal: true, width:560, position: ['center', 310], closeText:"" 
           , open: function(event,ui){$('.ui-widget-overlay').click(function(){$('#dial-favorite-identification').dialog("close")})}});
    $('#dial-favorite').dialog({ autoOpen: false, modal: true, width:560, position: 'top', closeText:""
           , open: function(event,ui){$('.ui-widget-overlay').click(function(){$('#dial-favorite').dialog("close")})}});
    $('#dial-pushcredit').dialog({ autoOpen: false, modal: true, position: ['center', 300], closeText:"", width:500
           , open: function(event,ui){$('.ui-widget-overlay').click(function(){$('#dial-pushcredit').dialog("close")})}});
    $('#dial-magasin').dialog({ autoOpen: false, modal: true, width:640, position: 'top', closeText:""
			     , open: function(event,ui){$('.ui-widget-overlay').click(function(){$('#dial-magasin').dialog("close")})}});       
           
   
          
    /* navigation onglet  */
		$('#infoMenu a').click(function(el) {
                   $('#infoMenu a').removeClass('on');
				           $('#infoMenu a').children().css('backgroundPosition', 'right -20px');
                   $(this).addClass('on');
				           $(this).children().css('backgroundPosition', 'right 0px');
				           loc = el.currentTarget.toString();
				           layer = loc.split('#');
				           $(".pdt_description").jScrollPaneRemove();
				           $(".pdt_description").hide();1
				           $('#pdt-'+layer[1]).show();
				           $('#pdt-'+layer[1]).jScrollPane({scrollbarWidth: 4, scrollbarMargin: 10, showArrows:true});
				           return false;
    });
    $('#infoMenu a span').mouseover(function() {
				                 $(this).css('backgroundPosition', 'right 0px');
    });
    $('#infoMenu a').mouseout(function() {
            				if(!$(this).hasClass('on')) {
            					$(this).css('backgroundPosition', 'left -20px');
            					$(this).children().css('backgroundPosition', 'right -20px');
            				}
    });

});
		
jQuery(window).load(function() {

			    /* activation scroll description produit */
			    //$('#pdt-titre02').jScrollPane({scrollbarWidth: 19, scrollbarMargin: 10, showArrows:true});
			    
});

function updateModel(pcid) {

        var xhr; 
        try {  xhr = new ActiveXObject('Msxml2.XMLHTTP');   }
        catch (e) 
        {
            try {   xhr = new ActiveXObject('Microsoft.XMLHTTP');    }
            catch (e2) 
            {
              try {  xhr = new XMLHttpRequest();     }
              catch (e3) {  xhr = false;   }
            }
        }
     
        xhr.onreadystatechange  = function()
        {
               if(xhr.readyState == 4) {
                     if (xhr.responseText!='') {
                          eval(xhr.responseText);
                     }
               }
        }; 
        
        var data = 'pc_id=' + pcid;
        data += '&idAuteur=' + top.document.getElementById('idAuteur').value;
        xhr.open('POST', '../../ajax/updateModel.php',true); 
        xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        xhr.send(data);
        
}

function add_favorite(id_auteur) {

        var xhr; 
        try {  xhr = new ActiveXObject('Msxml2.XMLHTTP');   }
        catch (e) 
        {
            try {   xhr = new ActiveXObject('Microsoft.XMLHTTP');    }
            catch (e2) 
            {
              try {  xhr = new XMLHttpRequest();     }
              catch (e3) {  xhr = false;   }
            }
        }
     
        xhr.onreadystatechange  = function()
        {
               if(xhr.readyState == 4) {
                     if (xhr.responseText!='') {
                          eval(xhr.responseText);
                     }
               }
        }; 
        
    
        var data = 'id_auteur=' + id_auteur;
        data += '&idProduitColoris=' + top.document.getElementById('dial_favorite_idProduitColoris').value;
        data += '&urlPage='+escape(document.location.href);
        xhr.open('POST', '../../ajax/produits_auteurs.php',  true); 
        xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
      //  alert('../../ajax/produits_auteurs.php');
        xhr.send(data);
        
}

