jQuery(document).ready(function($) {
	$(".comments-open").click(function () {
		$("#post-" + $(this).attr("id")).slideToggle("slow");
    });
})

jQuery(document).ready(function($) {
	$("li.details-open").click(function () {
		$(this).find('.description').slideToggle("slow");
    });
})

jQuery(document).ready(function() {
		$("#cse_search").autocomplete(searchdata);
		$('#cse_search').result(function(event, data, formatted) {
			$("#cse-search-box-2").submit();
		});
	});
	
jQuery(document).ready(function() {
		jQuery('a').click(function() {
			var $a=jQuery(this);
			var href=$a.attr('href');
			if(href.match(/out\//)) {
				var category='out';
				var event='click';
				var label=href;
				pageTracker._trackPageview(href);
				pageTracker._trackEvent(category,event,label);
			}
			if(href.match(/merchant\//)) {
				var category='merchant';
				var event='click';
				var label=href;
				pageTracker._trackPageview(href);
				pageTracker._trackEvent(category,event,label);
			}
		});
	});
	
function switchButtonCode( id, url ){
	var button = document.getElementById( 'b_' + id );
	var div = document.getElementById( 'd_' + id );
	var previous = document.getElementById( 'p_' + id );
		
	button.style.display = 'none';
	div.style.display = 'inline';
	previous.style.visibility = 'visible';
		
	new_win = window.open(url,'_blank','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1');
	new_win.blur();
}

function reloadpage(url,url2) {
      new_win = window.open(url,'_blank','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1');
      new_win.blur();
      window.location.href=url2;
}