function ct_map(elid,la,lo)
{
  
  var latlng = new google.maps.LatLng(la,lo);
  var myOptions = {
      zoom: 10,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  var map = new google.maps.Map(document.getElementById(elid),myOptions); 
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------

CTnet = {
    timid:0,
    order:'name',
    page:0,
    netwall:0,
    sstr:'',
    namesp:'networksrch',
    srch:function(str)
    {
      $('#'+this.namesp+'_order_'+this.order).css('color','#000000');
      $('#'+this.namesp+'_order_'+this.order).css('text-decoration','underline');     
      this.sstr=str;

      $('#'+this.namesp+'_res').load('/ct_ajax/getnetworks',{s: str,o:this.order,p:this.page,a:this.netwall});    
    },
    srchkey:function(str)
    {
      this.srch(str);     
    },
    orderch:function(order)
    {
      this.order=order;
      this.page=0;
      $('.networks_search_sort a').css('color','#5c5c5c');
      $('.networks_search_sort a').css('text-decoration','none');
      $('#'+this.namesp+'_order_'+order).css('color','#000000');
      $('#'+this.namesp+'_order_'+order).css('text-decoration','underline');        
      this.srch(this.sstr);
    },    
    pagech:function(page)
    {         
      this.page=page;     
      this.srch(this.sstr);
    },
    ntwall:function()
    {         
      if (typeof netwall != 'undefined')
        this.netwall=!netwall;     
      else
        this.netwall=1;     

      this.srch(this.sstr);
    }
    
}


CTmynet = {
    timid:0,
    order:'name',
    page:0,
    netwall:0,
    sstr:'',
    namesp:'networksrch_my',
    srch:function(str)
    {
      $('#'+this.namesp+'_order_'+this.order).css('color','#000000');
      $('#'+this.namesp+'_order_'+this.order).css('text-decoration','underline');
      this.sstr=str;

      $('#'+this.namesp+'_res').load('/ct_ajax/getmynetworks',{s: str,o:this.order,p:this.page,a:this.netwall});
    },
    srchkey:function(str)
    {
      this.srch(str);
    },
    orderch:function(order)
    {
      this.order=order;
      this.page=0;
      $('.networks_search_sort_my a').css('color','#5c5c5c');
      $('.networks_search_sort_my a').css('text-decoration','none');
      $('#'+this.namesp+'_order_'+order).css('color','#000000');
      $('#'+this.namesp+'_order_'+order).css('text-decoration','underline');
      this.srch(this.sstr);
    },
    pagech:function(page)
    {
      this.page=page;
      this.srch(this.sstr);
    },
    ntwall:function()
    {
      if (typeof netwall != 'undefined')
        this.netwall=!netwall;
      else
        this.netwall=1;

      this.srch(this.sstr);
    }

}


//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
var oxhr;
CTbrowseusr = {
    timid:0,
    order:'first_name',
    page:0,
    sstr:'',
    namesp:'browseusr',
    srch:function(str)
    {
      $('#'+this.namesp+'_order_'+this.order).css('color','#000000');
      $('#'+this.namesp+'_order_'+this.order).css('text-decoration','underline');     
      this.sstr=str;

      var allVals = [];
     $('.fltr:checked').each(function() {
       allVals.push($(this).val());
     });

     allVals.push($('#search_type').val());
//	allVals.push(this.search_type);
     
     if(oxhr)
        oxhr.abort();
     
     $('#'+this.namesp+'_res').html('<p style="text-align:center;padding-top:20px"><img src="/gfx/35.gif"><br>Loading...</p>');
      $('#'+this.namesp+'_res').load('/ct_ajax/getbrowseusr',{s: str,o:this.order,p:this.page,c:allVals},function(response, status, xhr){ oxhr=xhr;}  );    
    },
    srchkey:function(str)
    {
      this.page=0;
      this.srch(str);     
    },
    orderch:function(order)
    {
      this.order=order;
      this.page=0;    
      this.srch(this.sstr);
    },    
    pagech:function(page)
    {         
      this.page=page;     
      this.srch(this.sstr);
    }
    
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------

CTlearnit = {

    lid:0,
    commentpage:0,
    getcomments:function()
    {
      $('#leranit_comments').load('/ct_ajax/getlearnitcomments',{p:this.commentpage,lid:this.lid});   
    },
    init:function(lid)
    {
      this.lid=lid;
      this.commentpage=0;
      this.getcomments();
    },
    pagech:function(page)
    {         
      this.commentpage=page;     
      this.getcomments();
    },    
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------

// start
$(document).ready(function()
{ 
  
  $('#menu_net').mouseenter(function() {
        $('#menu_netsub').slideDown();
  });
  
  $('#menu_net').mouseleave(function() {
        $('#menu_netsub').slideUp();
  });
  
  $('#menu_netsub').mouseleave(function() {
        $('#menu_netsub').slideUp();
  });
  
  
  $('#menu_netsub a').mouseenter(function() {
        $(this).corner();
  });
  
  $('#menu_netsub a').mouseleave(function() {
        $(this).corner();
  });
  
  $('.fancy').fancybox({scrolling:'no'});
  
  $(".rounded").each(function(){
        $(this).corner();
      });

  $('#target').fold();
                                    
});

