  $(document).ready(function(){

    $("#progress_bar").hide();
    $("#wrapper").hide();
    
    
     var left=document.getElementById('containingbox_leftnav');
     var right=document.getElementById('containingbox_app');
    
    if( right != undefined ) {
        if(right.offsetHeight > left.offsetHeight) {
            left.style.height=(right.offsetHeight+21)+"px";
        }
    }    
    

    

  });


    function getthis(num_calls,id, call_id, caller_number) {
        for(i=1;i<=num_calls;i++) {
            document.getElementById('cell1' + i).style.backgroundColor='#FFFFFF';
            document.getElementById('cell2' + i).style.backgroundColor='#FFFFFF';
            document.getElementById('cell3' + i).style.backgroundColor='#FFFFFF';
            document.getElementById('cell4' + i).style.backgroundColor='#FFFFFF';
            document.getElementById('cell5' + i).style.backgroundColor='#FFFFFF';            
        }       
        document.getElementById('cell1' + id).style.backgroundColor='#9edfef';
        document.getElementById('cell2' + id).style.backgroundColor='#9edfef';
        document.getElementById('cell3' + id).style.backgroundColor='#9edfef';
        document.getElementById('cell4' + id).style.backgroundColor='#9edfef';
        document.getElementById('cell5' + id).style.backgroundColor='#9edfef';


       document.body.style.cursor  = "wait";

        deletePlayer('wrapper', 'placeholder1', 'player1');        
        $("#progress_bar").show();
        $("#wrapper").show();
        

        $.ajax({
        url: "tracker_phone/tracker_phone_details.php",
        data: "call_id=" + escape(call_id) + "&caller_number=" + escape(caller_number),
        type: "POST",
        cache: false,
        success: function(msg){
            initPlayer('audio/tracker_phone_' + call_id + '.mp3');
            document.body.style.cursor  = 'default';
            $("#progress_bar").hide();
        }
        });
         //if(html==1){
         //good
         //} else {
         // error need to log
         //}
         
        
       

        

    }

    function initPlayer(theFile) {
        deletePlayer('wrapper', 'placeholder1', 'player1');
        createPlayer(theFile);
    }

    function deletePlayer(theWrapper, thePlaceholder, thePlayerId) {
        swfobject.removeSWF(thePlayerId);
        var tmp=document.getElementById(theWrapper);
        if (tmp) { tmp.innerHTML = "<div id=" + thePlaceholder + "></div>"; }
    }




     /* <![CDATA[ */
    function createPlayer(thefile) {
        var flashvars = {
                file:thefile,
                autostart:"true",
                backcolor: "529fb2",
                frontcolor: "FFFFFF",
                lightcolor: "FFFFFF"
        }
        var params = {
                allowfullscreen:"false",
                allowscriptaccess:"always"
        }
        var attributes = {
                id:"player1",
                name:"player1"
        }
        swfobject.embedSWF("audio/player.swf", "placeholder1", "200", "20", "9.0.115", false, flashvars, params, attributes);



        }
        /* ]]> */
