/*
 * Tilex Common Javascript
 *
 * March 23, 2009
 *
 */

// init the $tilex namespace. All functions should be part of this namespace
var $tilex = window.$tilex || {};  

//
// createLink(): Given a jQuery selector and a URL, add an onclick event that 
// lets you click on a div to go to a new page 
//
$tilex.createLink = function(cssSelector, url) {
	$(cssSelector).click(function() { 
		if ($(this).hasClass('external')) {
			window.open( url );
        	return false;
		} else {
			location.href=url;
		}
	});
}

$(document).load(function () {
 // fix PNG transparency. We have to do this on load(), not ready(), because
 // all of the pngs have to have loaded before we can apply the fix to them
 //$('img').pngfix();
 //$('h2.logo, div.homeHero, div.tooltipInner').pngfix();
 //$tilex.initRelExternal();
 
  
 /* new method */
 DD_belatedPNG.fix('.homeHero, .png, .usageGuide, .close, .rootTmb, .bathroomTmb, .moldTmb, .showerTmb, .burstOverlay, .newLabel');
 
});

$(document).ready( function() {
   
    $clxcommon.initExternal();
    $clxcommon.initWarning();
    $clxcommon.attachClickAnalytics('clorox-link');
    $clxcommon.attachClickAnalytics('clorox-promo');
    $clxcommon.attachClickAnalytics('clorox-popup');

});


