$(document).ready(function() {
  
  var techModalAlias = $.url.param("technology");
  
  if( techModalAlias != 'undefined' && techModalAlias != '' ){
    
    loadTechModal( techModalAlias );
  }
  
	$(".technology_trigger").click(function () {
		
		  loadTechModal( $(this).attr('rel') );
    });

});

function loadTechModal( techAlias ){
  
    var api = $("#overlay_conatiner").overlay({ 
       
        close: '',
     
        // some expose tweaks suitable for facebox-looking dialogs 
        expose: { 
     
            // you might also consider a "transparent" color for the mask 
            color: '#000', 
     
            // load mask a little faster 
            loadSpeed: 200, 
     
            // highly transparent 
            opacity: 0.7 
        }, 
     
        // we want to use the programming API 
        api: true 
     
    // load it immediately after the construction 
    }).load();
    
    var rel = techAlias;
    
    $.ajax({
      url: "ajax_data",
      type: "GET",
      async: false,
      data: ({technology : rel}),
      dataType: "html",
          success: function(msg){
        $("#overlay_conatiner").empty();
        $("#overlay_conatiner").append(msg);

        
        $(".close").click(function () {
          api.close();
          $('#overlay_conatiner').empty();
        });
        
        $('.png_fix').supersleight();
        
        
        $("#overlay_carousel .scrollable").scrollable({
           size: 7, speed: 1000
        });
        
        var children = $("#overlay_carousel .scrollable .items").children();
        
        var count = 0;
        
        children.each(function (i) {
          
          if( count == 0 ){
            $(this).addClass('active');
          }
          count++;
        });
      }

    }).responseText;

}

