


jQuery(document).ready(function(){


    $.fn.ceebox.videos.base.param.allowScriptAccess = "sameDomain" //added to kill the permissions problem
    $.extend($.fn.ceebox.videos, {
        uctv: {
            siteRgx: /uctv\.tv\/search\-details/i,
            idRgx: /(?:showID=)([0-9]+)/i,
            src: "http://www.uctv.tv/player/player_uctv_bug.swf",
            flashvars: {
                previewImage: "http://www.uctv.tv/images/programs/[id].jpg",
                movie: "rtmp://webcast.ucsd.edu/vod/mp4:[id]",
                videosize: 0,
                buffer: 1,
                volume: 50,
                repeat: false,
                smoothing: true
            }
        }
    });
    $(".pop").ceebox({
        borderColor: '#dcdcdc',
        boxColor: "#fff",
        htmlWidth: 600,
        htmlHeight: 450,
        modal: false
    });
    
    
    
    $("#a510").click(function(){
        $('.a510').toggleClass("on");
        $(this).toggleClass("on");
        return false;
    });
    $("#a812").click(function(){
        $('.a812').toggleClass("on");
        $(this).toggleClass("on");
        return false;
    });
    $("#a912").click(function(){
        $('.a912').toggleClass("on");
        $(this).toggleClass("on");
        return false;
    });
    $("#a1315").click(function(){
        $('.a1315').toggleClass("on");
        $(this).toggleClass("on");
        return false;
    });
    $("#a1114").click(function(){
        $('.a1114').toggleClass("on");
        $(this).toggleClass("on");
        return false;
    });
    $("#a1417").click(function(){
        $('.a1417').toggleClass("on");
        $(this).toggleClass("on");
        return false;
    });
    
    // open modal details on click
    var $loading = $('<img src="[(base_url)]assets/templates/vn/img/ajax-loader.gif" alt="loading">');
    
    
    
    
    
    $('#cDate').datePicker({
        startDate: '01/01/1980'
    });
    
    // mask input field
    /*
     
     $("#cDate").mask("99/99/9999");
     $("#cMereTelPriv").mask("+99(99) 999-99-99");
     $("#cMereTelPro").mask("+99(99) 999-99-99");
     $("#cPereTelPriv").mask("+99(99) 999-99-99");
     $("#cPereTelPro").mask("+99(99) 999-99-99");
     
     */
    // show/hide more adresse
    $("#other").next().hide();
    
    $('#other').click(function(){
        $("#other").next().toggle('slow', function(){
            // Animation complete.
        });
    });
    
    
    
    
    
    // option selected: autre 
    
    
    
    //$('tr.hide1,tr.hide2').hide();
    $('tr.hide1,tr.hide2,tr.hide3,tr.hide4,tr.hide5,td.hide1,td.hide2,td.hide3,td.hide4,td.hide5').hide();
    $('#cHabiteChez').change(function(){
        $str = "";
        $("#cHabiteChez option:selected").each(function(){
            $str = $(this).val();
        });
        //alert(str);
        $('tr.hide1').show();
        if ($str == 'autre') {
            //alert('GOT it');
            /*$('td.hide1').animate({
             opacity: 'toggle',
             //left: '+=50',
             // height: 'toggle'
             }, 1000, function(){
             // Animation complete.
             });
             */
            $('td.hide1').show();
        }
        else {
            $('td.hide1').hide();
        }
    }).change();
    
    
    $('#cHabiteChez2').change(function(){
        $str = "";
        $("#cHabiteChez2 option:selected").each(function(){
            $str = $(this).val();
        });
        //alert(str);
        $('tr.hide2').show();
        if ($str == 'autre') {
            //alert('GOT it');
            /*$('td.hide2').animate({
             opacity: 'toggle',
             //left: '+=50',
             // height: 'toggle'
             }, 1000, function(){
             // Animation complete.
             });
             */
            $('td.hide2').show();
        }
        else {
            $('td.hide2').hide();
        }
    }).change();
    
    $('#cTel1Who').change(function(){
        $cTel1Who = "";
        $("#cTel1Who option:selected").each(function(){
            $cTel1Who = $(this).val();
        });
        
        $('tr.hide3').show();
        if ($cTel1Who == 'autre') {
        
            $('td.hide3').show();
        }
        else {
            $('td.hide3').hide();
        }
    }).change();
    
    $('#cTel2Who').change(function(){
        $cTel2Who = "";
        $("#cTel2Who option:selected").each(function(){
            $cTel2Who = $(this).val();
        });
        $('tr.hide4').show();
        if ($cTel2Who == 'autre') {
        
            $('td.hide4').show();
        }
        else {
            $('td.hide4').hide();
        }
    }).change();
    
    $('#cTel3Who').change(function(){
        $cTel3Who = "";
        $("#cTel3Who option:selected").each(function(){
            $cTel3Who = $(this).val();
        });
        $('tr.hide5').show();
        if ($cTel3Who == 'autre') {
        
            $('td.hide5').show();
        }
        else {
            $('td.hide5').hide();
        }
    }).change();
    
    
    
});

