
//updateA4Images();

$bttntext=$("span._bttntext");
$bttntext.each(function() {
	var $aecBuyLink=$(this).parent();
	var aecBuyHref=$aecBuyLink.attr("href");
	aecBuyHref=aecBuyHref.replace(/si=artistdirect\&/,"si=artistdirect2&");
	if($aecBuyLink.attr("href")!=aecBuyHref) {$aecBuyLink.attr("href",aecBuyHref);}
});

debugaec=false;
tm=(new Date()).getTime();
function printd(str) {if(debugaec) {document.writeln(str+"<br>");}}


var $prices=null;
if (typeof jQuery!='undefined') {

	skuidx=0;
	skulist=new Array();
	skuparams=new Array();

	$prices=$("span._price");
	if($prices.length>0) {
		printd("Number of Prices Found: " + $prices.length);
		$prices.each(function() {
			tmp=$(this).attr("class").split(/ /);
			if(tmp.length>1) {
				tmpsku=tmp[1];
				skulist.push(tmpsku);
				skuparams.push("DTL_LCC" + (skuidx++) + "=" + tmpsku);
				printd("Adding SKU: " + tmpsku);
			}
		});
		printd("Time taken to gather IDs: " + (((new Date()).getTime())-tm) + "ms");
		
		DTL_WMSID=new Array("");
		DTL_SCID=new Array("");
		DTL_PRICE_RULEID=new Array("");
		DTL_PRICE_ONSALE=new Array("");
		DTL_PRICE_MSRP=new Array("");
		DTL_PRICE_SP=new Array("");

		 if(skuparams.length>0) {
			tmpskustr=skulist.join("_");
		
			document.writeln('<sc' + 'ript type="text/javascript" language="javascript" src="http://appsvr.thestore24.com/cgi-bin/webaec.aspx?Format=javascript&Type=product_info&GetPrice=on&Conf=artistdirect2&' + skuparams.join("&") + '"></scr' + 'ipt>');
		 printd('<br>aec call --><a target=_blank href="http://appsvr.thestore24.com/cgi-bin/webaec.aspx?Format=javascript&Type=product_info&GetPrice=on&Conf=artistdirect2&' + skuparams.join("&") + '">call</a>');
			 }

	}

}
tm=(new Date()).getTime();