$(document).ready(function() {
	$('#easyXDM_DISQUS_net_default601_provider').contents().find('textarea').css('color','#FFFFFF');
	$('#easyXDM_DISQUS_net_default601_provider').contents().find('textarea').each(function() {
		$(this).css('color','#FFFFFF');
	});
	$('#easyXDM_DISQUS_net_default601_provider').contents().find('textarea').each(function() {
		
	});
	$('iframe').live('click',function() {
		alert('whatever...');
	});
	$('textarea').each(function() {
		$(this).live('click',function() {
			//$(this).attr('style','color:#FFFFFF');
			alert('whatever...');
		});
	});
	$('textarea').live('click',function() {
		//$(this).attr('style','color:#FFFFFF');
		alert('clicked!');
	});
	var currentTime = new Date();
	var month = (currentTime.getMonth() < 9 ? '0' : '') + (currentTime.getMonth() + 1);
	var day = (currentTime.getDate() < 9 ? '0' : '') + (currentTime.getDate() + 1);
	var year = currentTime.getFullYear();
	var today = year+'-'+month+'-'+day;
	$('a').each(function() {
		if ($(this).attr('rel').length) {
			if ($(this).attr('rel') == 'external') {
				$(this).attr('target','_blank');
				if ($(this).parent().attr('id').length) {
					var theid = $(this).parent().attr('id');
				} else if ($(this).attr('id').length) {
					var theid = $(this).attr('id');
				} else {
					var theid = 'generic';
				}
				var href = $(this).attr('href');
				if (href.indexOf('http') == 0) {
					$(this).click(function() {
						var collect = {
							id: theid,
							date: today,
							url: href,
							page: $(location).attr('href')
						}
						//$.post('/inc/trackit.php', collect);
					});
				}
			}
		}
	});
});

function social(t,w,h){
	window.open(t.href, 'simplesocial', 'scrollbars=1,menubar=0,width='+w+',height='+h+',resizable=1,toolbar=0,location=0,status=0,left='+(screen.width-w)/2+',top='+(screen.height-h)/3);
	return false;
}
