$(document).ready(function(){
	$('a.login').each(function(){
		var query = $(this).attr('href').slice($(this).attr('href').indexOf('?')+1);
		$(this).attr('href', 'login-frame.php?' + query + '&TB_iframe=true&height=400&width=400&modal=false');
	});
	
	$('.rank img.unselected').each(function(){	
		$(this).hover(
			function(){
				if($(this).attr('alt') == 'down'){
					$(this).attr('src', '../images/down-selected.jpg');	
				}
				if($(this).attr('alt') == 'up'){
					$(this).attr('src', '../images/up-selected.jpg');
				}
			},
			function(){
				if($(this).attr('alt') == 'down'){
					$(this).attr('src', '../images/down-unselected.jpg');	
				}
				if($(this).attr('alt') == 'up'){
					$(this).attr('src', '../images/up-unselected.jpg');
				}
			}
		);		
	});
	
	$('.rank img.notselected').each(function(){
		var imgsrc = $(this).attr('src');
		
		$(this).hover(
			function(){
				if($(this).attr('alt') == 'down'){
					$(this).attr('src', '../images/down-selected.jpg');	
				}
				if($(this).attr('alt') == 'up'){
					$(this).attr('src', '../images/up-selected.jpg');
				}
			},
			function(){
				if($(this).attr('alt') == 'down'){
					$(this).attr('src', '../images/down-notselected.jpg');	
				}
				if($(this).attr('alt') == 'up'){
					$(this).attr('src', '../images/up-notselected.jpg');
				}			
			}
		);		
	});
});

function refreshParent(){
	parent.tb_remove(); 
	parent.location.reload(true)
	return true;
}