// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
/**
 * console.log fix for machines not running firebug.
 *
 */
if (typeof(console) === 'undefined') {
    var console = {
        log: function () {},
        info: function () {},
        warn: function () {},
        error: function () {},
        time: function () {}
    };
}
else if (typeof(console.log) === 'undefined') {
    console.log = function () {};
}

$(document).ready(function () {

  $.extend($.gritter.options, { 
    fade_in_speed: 300,
    fade_out_speed: 300,
    time: 4000
  });
  $('#loading').hide();

  $("#loading").ajaxStart(function (){
    $(this).show();
  });

  $("#loading").ajaxStop(function (){
    $(this).hide();
  });

  var text = $(".gritter").text();
  var grit = (text.length > 0)? $.trim(text) : "Implement the Logic with Resistor Software.";
  $.gritter.add({
    title: 'Resistor Software',
    text: grit
  });

    
	$(".resistor").colorbox();
  
	$(".portfolio").colorbox({
		inline: true,
		href: "#portfolio",
		onLoad: function () {
			$(".resistor").trigger('click');
		}
	});
 	
 	$(".shopify").colorbox({
		inline: true,
		href: "#shopify"
	});
	
		
});
