
 function cl(msg){
	if(typeof(console) != 'undefined'){
		console.log(msg);
	}
}

// These classes were getting applied using a Magento module, but for some reason,
// that's not working, so I hacked it up using some JS
jQuery(document).ready(function($){
	$('ul.top-links a[title="My Account"]').addClass('top-link-myaccount');
	$('ul.top-links a[title="Log In"]').addClass('top-link-login')
	$('ul.top-links a[title="Log Out"]').addClass('top-link-logout')
	
	$("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank"); // Force external links to open in new window
});

/*
var Rollover = Class.create({
    initialize: function(id, options) {
        this.id = id;
        cl($(this.id));
        this.origsource = $(this.id).src;
        this.setOptions(options);
        this.preloadRollover();
        this.rollbackImage();
        this.observeMouse();
        return true;
    },

    setOptions: function(options) {
        this.options = {
            prefix: 'btn_'
        };
        Object.extend(this.options, options || {});
    },

    observeMouse: function() {
        $(this.id).observe('mouseover', this.rolloverImage.bindAsEventListener(this));
        $(this.id).observe('mouseout', this.rollbackImage.bindAsEventListener(this));
    },

    preloadRollover: function() {
        this.preload = new Image();
        this.preload.setAttribute('src',this.parseRollbackSource());
        this.preload_orig = new Image();
        this.preload_orig.setAttribute('src',this.origsource);
    },

    parseRollbackSource: function()
    {
        path = this.origsource.match(/(.*)\/(.*\.(png|gif|jpg))/)[1];
        filename = this.origsource.gsub(path, '').substr(1);
        return path + '/' + this.options.prefix + filename;
    },

    rolloverImage: function(e) {
        $(this.id).setAttribute('src',this.origsource);
    },

    rollbackImage: function(e) {
        $(this.id).setAttribute('src',this.parseRollbackSource());
    }
});

var hoverImages = [
  'btn_sign_me_up.gif',
  'btn_add_all_to_cart.gif',
  'btn_add_recipient',
  'btn_add_tags',
  'btn_add_to_cart',
  'btn_cancel_coupon',
  'btn_cart_get_quote',
  'btn_checkout',
  'btn_close_window',
  'btn_compare',
  'btn_continue_shopping',
  'btn_continue',
  'btn_create_account',
  'btn_enter_address',
  'btn_go',
  'btn_place_order',
  'btn_print-order',
  'btn_proceed_to_checkout',
  'btn_reorder',
  'btn_save'
];

document.observe("dom:loaded", function() {
	
	//Get all images and inputs
	var imageEls = [];
	$$('input[type="image"],img').each(function(el){
		imageEls.push([$(el), $(el).src] );
	});
	cl(imageEls);
	
	hoverImages.each(function(imageName){
		$$('src')
	});	
});

*/