$(document).ready(function(){	
	$(".show-all").click(function () {
		$(".register .optional").toggle();
		if ($(".show-all").html() == 'Hide all registration fields')
			$(".show-all").html('Show me the full registration form');
		else
			$(".show-all").html('Hide all registration fields');
	});
	
	$("#username").attr( 'value', 'Username' );
	$("#password").attr( 'value', '****' );
	
	$("#username").click(function() {
		$("#username").attr( 'value', '' );
		$("#password").attr( 'value', '' );
	});
	
	$('tr').click ( function () {

	     // get this class name
	     var myClass = $(this).attr('class');
	     
	     $.post("http://tweetflirting.com/ajax/read", {id: myClass}, function() {

	     });
	     
	     // now toggle the tr element matching this class if there is one
	     if ($('.content-' + myClass).hasClass('hide'))
	     	$('.content-' + myClass).removeClass('hide')
	     else
	     	$('.content-' + myClass).addClass('hide')
	     
	     
	     //$('.'+myClass + ' td').css('font-weight', 'normal');

	});
	
	$('.location_profiles .info a').click ( function (e) {
		var profile = $(this).attr('rel');
		$('#profile_container').html('<iframe src="http://tweetflirting.com/search/location/profile/'+profile+'" width="396px;" height="500px" class="hide" id="profile" frameborder="0" scrolling="no" style="position:absolute; top:'+(e.pageY-350)+'px; left:'+e.pageX+'px"></iframe>');
		
		$('iframe').removeClass('hide');
		return false;		
	});
		
		
	$(".clickable_region").click(function(e){
      alert(e.pageX +', '+ e.pageY);
   }); 
});
