function addJavascript(jsname,pos)
{
	var th = document.getElementsByTagName(pos)[0];
	var s = document.createElement('script');
	s.setAttribute('type','text/javascript');
	s.setAttribute('src',jsname);
	th.appendChild(s);
}
addJavascript('/text/js/ccnivo.js','head');
addJavascript('/text/js/jquery.cursor.js','head');
addJavascript('/text/js/jquery.nivo.slider.pack.js','head');
addJavascript('/text/js/lac.js','head');

var fixEmbeddedVideo = function(embedCode)
{
   if(embedCode && embedCode.toLowerCase().indexOf('classid') == -1)
   {
      var objPos = embedCode.toLowerCase().indexOf('object ') + 'object '.length;
      return embedCode.substr(0, objPos) + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' + embedCode.substr(objPos);
   }
   else
   {
      return embedCode;
   }
}


jQuery.noConflict();
jQuery(function()
{
jQuery("html body.main table.mainLayoutTable tbody tr td.contentbg div table tbody tr td.tableitemheaderbg div.tableheader:contains('Shipment Tracking')").html('<img width="10" height="1" border="0" src="http://images.countrycurtains.com/images/set_a/en_us/global/globalgraphics/spacer01.gif">');
	
jQuery("html body.main table.mainLayoutTable tbody tr td.contentbg div table tbody tr td div.tableitem:contains('No tracking information available.')").html('<img width="10" height="2" border="0" src="http://images.countrycurtains.com/images/set_a/en_us/global/globalgraphics/spacer01.gif">');

//	switcharoo();
});

function switcharoo(){
	if ( window.location.hostname == "countrycurtains2-prod.marketlive.com" || window.location.hostname == "countrycurtains2-rev.marketlive.com"){
		var head = document.getElementsByTagName("head")[0];
		var link = document.createElement("link");
		var link2 = document.createElement("link");
		var link3 = document.createElement("link");
		var link4 = document.createElement("link");
		var link5 = document.createElement("link");
 
		link.setAttribute("rel", "stylesheet");
    		link.setAttribute("href", "text/css/newer_home.css");
    		link.setAttribute("type", "text/css");
		link2.setAttribute("rel", "stylesheet");
    		link2.setAttribute("href", "text/css/howto_new.css");
    		link2.setAttribute("type", "text/css");
		link3.setAttribute("rel", "stylesheet");
    		link3.setAttribute("href", "text/css/howto_ie_new.css");
    		link3.setAttribute("type", "text/css");
		link4.setAttribute("rel", "stylesheet");
    		link4.setAttribute("href", "/text/css/gateway_template_new.css");
    		link4.setAttribute("type", "text/css");
		link5.setAttribute("rel", "stylesheet");
    		link5.setAttribute("href", "/text/css/gateway_template_ie_new.css");
    		link5.setAttribute("type", "text/css");
 
    	head.appendChild(link);
		head.appendChild(link2);
		head.appendChild(link3);
		head.appendChild(link4);
		head.appendChild(link5);
	}

}

