function doTrack(action, section ) {
	_gaq.push(['_trackEvent', 'Articles', action, section]);
	return true;
}

function track_search(){
	var trackType = "title";
	
	trackType = $('input:checked').val();
	var trackValue = $('#q').val();
	doTrack('search_'+trackType,trackValue);
	return true;

}

//******************************************************************************************

var currentlyDisplayed = "";

//******************************************************************************************

function toggleInfo(who){
	document.getElementById("info"+who).blur();
	if(currentlyDisplayed != who){
		load(who);
	} else{
		off(who);
	}
}

function info(who){
	$(document.getElementById("details_div_"+who)).slideDown();
	$(document.getElementById("nodetails_div_"+who)).slideUp();
	$(document.getElementById("img_change_"+who)).animate({
				height: '100px', 
			}, 400);
	currentlyDisplayed = who;
}

function off(who){
	$(document.getElementById("details_div_"+who)).slideUp();
	$(document.getElementById("nodetails_div_"+who)).slideDown();
	$(document.getElementById("img_change_"+who)).animate({
				height: '60px', 
			}, 400);
	currentlyDisplayed = "";
}

function scaleImgUp(who){
	$(document.getElementById("img_change_"+who)).animate({
				height: '100px', 
			}, 400);
}
function scaleImgDown(who){
	if(currentlyDisplayed == who){return;};
	$(document.getElementById("img_change_"+who)).animate({
				height: '60px', 
			}, 400);
}

function load(who){
		$("#indicator_"+who).show();
		$.ajax({
			url: "ArticleDetails?artId="+who+"&qsBaseForFilter=" + qsBaseForFilter,
			dataType: "html",
			success: function( html ) {
				off(currentlyDisplayed);
				$("#indicator_"+who).hide();
				$("#details_loader_"+who).html(html);
				info(who);
				
			},
			error: function(jqXHR, textStatus, errorThrown){
				//alert(textStatus+" "+errorThrown);
			}
			
		});
	}

//*******************************************/

$(document).ready(function() {
	if(articleDetailsID!=-1){
		currentlyDisplayed = articleDetailsID;
		info(currentlyDisplayed);
	}
})

