// JavaScript Document Atlanta Web Design GA .com

jQuery(document).ready(function() {
	// for Google search optimization coverts .businesscatalyst.com domain to real domain
	var theurl='http://www.idealjewelryandpawn.com'+window.location.pathname+window.location.search;
	jQuery("link[rel=canonical]").attr("href",theurl);
	// end ready follows
	});
// Google Analytics
	var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-25030822-1']);
    _gaq.push(['_setDomainName', 'none']);
    _gaq.push(['_setAllowLinker', true]);
    _gaq.push(['_trackPageview']);
    (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
// Code for BC Shopping Cart compatibility with Google Analytics
	var checkoutTracking = function(){
		if (typeof ValidateCart !== 'function') { return; }
		var _validateCart = ValidateCart;
		ValidateCart = function(){
			var 
				link = document.getElementById('catshopbuy'),
				res = _validateCart.apply(this, arguments);		
			if (res === true) {
				_gaq.push(['_link', link.href]);    
			}        
			return false;
		};
	};
	checkoutTracking();
// Code to delay outbound links so Google can track. Add code to each link, for example.com add
// onClick="recordOutboundLink(this, 'Outbound Links', 'example.com');return false;"
   function recordOutboundLink(link, category, action) {
    _gat._getTrackerByName()._trackEvent(category, action);
    setTimeout('document.location = "' + link.href + '"', 100);
  }
