function tracklien(){
    var tracer = new Image;
    var valeur = 0;
    var transaction = 0;
    var reference = 0;
    var sas_tmstp = Math.round(Math.random()*10000000000);
    tracer.src = 'http://www.smartadserver.com/track/ift2.asp?115398;12565;'+sas_tmstp+';'+valeur+';'+transaction+';'+reference;
}


jQuery(function(){
    jQuery('.error').hide();
    jQuery('div.accordeonable').hide();
    jQuery('a.accordeon').click(function(){
        if(!jQuery('#'+jQuery(this).attr('rel')).is(':visible')){
            jQuery('div.accordeonable').hide();
            jQuery('#'+jQuery(this).attr('rel')).slideDown();
        }else{
            jQuery('#'+jQuery(this).attr('rel')).slideUp();
            
        }
        return false;
    });
});

function zoomMontage(){
    var options = {  
        zoomType: 'standard',  
        lens:true,  
        preloadText: 'Chargement du zoom',
        preloadImages: true,  
        alwaysOn:false,  
        xOffset:0,  
        title: false,
        yOffset:0,  
        zoomWidth: 200,
        zoomHeight:200,
        position:'right'  
    };  
    jQuery("#montageZoom").jqzoom(options);  
}
/**
 * validation du form email/mms
 */
function validation(type){
    jQuery('.error'+type).hide();
    if(type == 'mms'){
        if(jQuery('#numero').val() == '')
            return showError('Saisissez le numéro du destinataire',type);
        if(jQuery('#objet').val() == '')
            return showError('Saisissez l\'objet du MMS',type);
        if(jQuery('#mms_message').val() == '')
            return showError('Saisissez un message',type);
    }
    if(type == 'email'){
        if(jQuery('#my_email').val() == '')
            return showError('Saisissez votre adresse email',type);
        if(!ValidMail(jQuery('#my_email').val()))
            return showError('Votre adresse email est invalide',type);
        if(jQuery('#email').val() == '')
            return showError('Saisissez l\'email du destinataire',type);
        if(!ValidMail(jQuery('#email').val()))
            return showError('L\'email du destinataire est invalide',type);
        if(jQuery('#message').val() == '')
            return showError('Saisissez un message',type);
    }
    return true
}
function ValidMail(lemail){
    mail =/[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(ad|aero|ae|af|ag|ai|al|am|an|ao|aq|arpa|ar|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|biz|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|com|coop|co|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|eur|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|info|int|in|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|museum|mu|mv|mw|mx|my|mz|name|na|nc|net|ne|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pro|pr|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$/;
    reponse=mail.test(lemail)
    return reponse;
}

function showError(message,type){
    jQuery('.error'+type).html(message);
    jQuery('.error'+type).fadeIn('slow');
    return false;
}
