// JavaScript Document
 $(document).ready(function() {

$('#dropdown_mycategoryorder-3 option:first').text('Select Issue');
							
$('.rss-box a').supersleight();

//$('.widget_mycategoryorder a').removeAttr("title");

							
function goToByScroll(id){
     	$('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
}
$('#issueListLink').click(function() {
	//goToByScroll("issueList");
	$.scrollTo("#issueList", 800, {onAfter:function(){
	$('#IssuesTip').fadeIn();
	} });
	return false;
});
$('#mycategoryorder-3 select').click(function() {
	$('#IssuesTip').fadeOut();
})
$('#IssuesTip').live('click', function() {
	$('#IssuesTip').fadeOut();
})



$('.widget_mycategoryorder').prepend('<a name="issueList" id="issueList"></a><div id="IssuesTip">View Research Trends Previous Issues</div>')

$('#centercol .single-post table').each(function(index) {
	$(this).children('tbody').children('tr:even').addClass('odd');
})

$('.cat_desc p:first').addClass('h3');

$('.wpcf7-text').focus(function() {
  $(this).addClass('focus').fadeIn();
});
$('.wpcf7-text').blur(function() {
  $(this).removeClass('focus');
});
$('.wpcf7-form textarea').focus(function() {
  $(this).addClass('focus').fadeIn();
});
$('.wpcf7-form textarea').blur(function() {
  $(this).removeClass('focus');
});
/*$('#centercol .post-meta .post-meta-key').remove();
$('#centercol .post-meta li').each(function(index) {
		var testValue =  jQuery.trim($(this).text());
		if (testValue.length<4) {
			$(this).remove();
		} 
    //console.log(jQuery.trim($(this).text()));
  });*/

$('#rightcol .widget_mycategoryorder li.cat-item a').mouseover(function() {
  $(this).parent().addClass('active');
});
$('#rightcol .widget_mycategoryorder li.cat-item a').mouseout(function() {
  $(this).parent().removeClass('active');
});

$('#send-link-to-friend h2').click(function() {
  $('#sendtofriendform').fadeIn();
});
if($('#issuePDF').text()){;
var issuePDF = $('#issuePDF').text();
$('#text-5 .textwidget a').attr('href', issuePDF);
};

$('#polls-widget-3 h2').after('<p class="instructions">(1 = lowest interest and 5 = highest interest)</p>')

/**** Track case study document clicks ****/
$('a.pdfDownload').click(function() {
	var pdfhref = $(this).attr('href');
		//if(typeof pageTracker !== 'undefined') {
			_gaq.push(['_trackEvent', 'Downloads', 'PDF', pdfhref]);
	//}
});

})
