// site namespace
BCNTRY.site = {
    name: 'Dogfunk',
    catalog: 'dogfunk',

    connection: {},
    event: {},
    page: {},   // per-page namespaces
    util: {}
};

var catalog='dogfunk';
var ajax_load_msg = '<span class="ajax_load">Loading...</span>';


//Displays the pricecomparison promo
// Structure can change per site, should be populated on the necessary site.js
function price_compare_display(json_data){
    //alert(json_data.title);
    var promo_well = document.getElementById('promo_price_compare');
    if(json_data.products != null && json_data.products.length > 0) {
	  var html_data =
      '<div id="" class="price_comparison"> ' +
	  '	<h2>Also Available From Other Stores</h2> '+
	  '	<ul> ';
	  for(var i=0;i<json_data.products.length;i++) {
	  html_data += 
	  '       <li> '+
	  '			<div class="brand_logo"><img src="' + json_data.products[i].logo+ '" /></div> '+
	  '			<a class="btn_shop_now" type="button"></a> '+
	  '			<span><a href="' + json_data.products[i].url + '">' + json_data.products[i].vendorName+ '</a> from <strong>' + json_data.products[i].price+ '</strong></span> ' +
	  '		</li> ';
	  }
	  html_data +=
	  '		<li> ' +
	  '			<span id="whats_this"><a href="/">What\'s this?</a></span> ' +
	  '			<span id="powered_by">Powered by <a href="/">Geardigger.com</a></span> ' +
	  '		</li> ' +
	  '	</ul> ' +
	  '	<div class="clearb" /> ' +
	  '</div> ';
	promo_well.innerHTML = html_data;  
    }
}

var price_compare_template = 
'<div id="" class="price_comparison"> '
+ '	<h2>Also Available Here:</h2> '
+ '	<ul> '
+ '{for p in products}'
+ '		<li> '
+ '			<div class="brand_logo"> '
+ '				<a href="${p.url}"  target=\'blank\'  onclick="price_compare_click(\'${sku}\',\'${p.vendorName}\', this );"><img src="${p.logo}" /> </a>'
+ '				<a href="${p.url}" class="btn_shop_now" type="button" target=\'blank\' onclick="price_compare_click(\'${sku}\',\'${p.vendorName}\', this );"></a> '
+ '			</div> '
+ '			<span><a href="${p.url}" target=\'blank\' onclick="price_compare_click(\'${sku}\',\'${p.vendorName}\', this );">${p.vendorName}</a> from <strong>\$${p.price}</strong></span> '
+ '		</li> '
+ '{/for}'
+ '	</ul> '
+ '	<div id="bottom_links"> '
+ '		<span id="whats_this"><a rel="nofollow" href="#" onclick="show_hint(\'price_compare_whats_this\',\'price_compare_whats_this_link\'); template_links_tl(\'tr_template\', \'header: pricecompare\'); return false;">What\'s this?</a></span> '
+ '		<span id="powered_by"><div>Powered by <a target=\'blank\' rel="nofollow" href="http://www.geardigger.com">Geardigger.com</a></div></span> '
+ '	</div> '
+ '	<div class="clearb" /> '
+ '</div>'
+ ' <div class="hint" id="price_compare_whats_this" style="display:none">'
+ '            <div class="hint_title" id="price_compare_whats_this_title">'
+ '                <a rel="nofollow" id="price_compare_whats_this_link_close_x" href="#" onclick="hide_hint(\'price_compare_whats_this\'); template_links_tl(\'tr_template\', \'header: pricecompare_close\'); return false;" class="hint_close">close</a>'
+ '                </div><div class="hint_content" id="price_compare_content">'
+ '                <p>Dogfunk.com knows that no one wants the used-car-salesman experience, so we decided to show you the other guys prices in an effort to keep your shopping experience as informed as possible. We do our best to confirm this information is correct, but assume no responsibility for the accuracy of the price and shipping information provided by other vendors.</p>'
+ '                <a id="price_compare_whats_this_link_close" href="#" onclick="hide_hint(\'price_compare_whats_this\'); template_links_tl(\'tr_template\', \'header: pricecompare_x\'); return false;" class="hint_close">close</a>'
+ '            </div>'
+ ' </div>';

