// JavaScript Document
$(document).ready(function () {
  

var words={
// Add words here to be changed. Format - 'original':'replacement'
'Onesie':'One Piece',
'Onezie':'One Piece',
'onesie':'one piece',
'onezie':'one piece',
'Onesies':'One Piece',
'Onezies':'One Piece',
'onesies':'one piece',
'onezies':'one piece',
'onsies':'one pieces',
'onsie':'one piece',
'Onsie':'One Piece',
'Onsies':'One Pieces'

}
var regs=[];
for(arg in words){regs[regs.length]=new RegExp(arg,'g')}

function replaceText(){
var tags=document.getElementsByTagName('body')[0].getElementsByTagName('*');
var i=0,t;
	while(t=tags[i++]){
		if(t.childNodes[0]){
			var j=0, c;
			while(c=t.childNodes[j++]){
				if(c.nodeType==3){
					var k=0;
					for(arg in words){
						c.nodeValue=c.nodeValue.replace(regs[k],words[arg]);
						k++;
					}
				}
			}
		}
	}
}

replaceText();


//direct people to color charts
	$('.osx').click(function(){
		window.location.assign("http://www.kidsblanks.com/Wholesale_Clothing_Brands_Color_Chart.php")
	});


//make wholesale tag transparent on rollover
$('[src=images/wholesale-baby-clothes-prices.png]').hover(
  function () {
    $(this).fadeTo("fast", .3);
  },
  function () {
    $(this).fadeTo("fast", 1);
  }
);


  //end of doc ready
});
