// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
$(document).ready( function () {
	var domains = [document.domain];
	var domain_selector = "",left_str= ":not([@href^=http://",left_str_https= ":not([@href^=https://",right_str = "])";

	domain_selector = left_str+domains.join(right_str+left_str)+right_str;
	domain_selector+= left_str_https+domains.join(right_str+left_str_https)+right_str;

  $("a[@href^=http]"+domain_selector).click(function(){
    window.open(this.href,"_blank");
    return false;
  });
  
  $("area[@href^=http]"+domain_selector).click(function(){
    window.open(this.href,"_blank");
    return false;
  });
});
