/*
Site: Title
HTTP: subdomain.domain.de
Date: YYYY-MM-DD
*/


/**
 * Site - Initialize
 */
$(document).ready(
  function() {
    function_view_node_mark();
    function_links_external_target();
  }
);


/**
 * View - Node - Mark
 */
function function_view_node_mark() {

  // MARK NODES WITH ADDITIONAL CSS CLASSES
  if ($("div.view-content").length > 0) {
    $("div.view-content").find("div.node").each(
      function(number_i){
        if (number_i % 2 == 0) {
          $(this).addClass("node-even");
        } else {
          $(this).addClass("node-odd");
        }
      }
    )
  }

};


/**
 * links external target
 */
function function_links_external_target() {
  $('a').each(
    function () {
      if ( $(this).attr('href').substr(0,7) == 'http://' ) {
        $(this).attr('target', '_blank');
      }
    }
  );
}
