$(function(){
$(".most_pop_list li").mouseover(function(){
$(".most_pop_list li").removeClass();
$(this).addClass("top_active");
$(".big_popular").html($(this).find(".most_pop_h").html());
});
$(".newest_list li").mouseover(function(){
$(".newest_list li").removeClass();
$(this).addClass("top_active");
$(".big_newest").html($(this).find(".newest_h").html());
});
$(".players_list li").mouseover(function(){
$(".players_list li").removeClass();
$(this).addClass("top_active");
$(".big_players").html($(this).find(".players_h").html());
});
});
$(document).ready(function() {
       		$('input[type="text"]').focus(function() {
    		    if (this.value == this.defaultValue){ 
    		    	this.value = '';
				}
				if(this.value != this.defaultValue){
	    			this.select();
	    		}
    		});
    		$('input[type="text"]').blur(function() {
    		    if ($.trim(this.value) == ''){
			    	this.value = (this.defaultValue ? this.defaultValue : '');
				}
    		});
		});
$(document).ready(function() {
       		$('input[type="password"]').focus(function() {
    		    if (this.value == this.defaultValue){ 
    		    	this.value = '';
				}
				if(this.value != this.defaultValue){
	    			this.select();
	    		}
    		});
    		$('input[type="password"]').blur(function() {
    		    if ($.trim(this.value) == ''){
			    	this.value = (this.defaultValue ? this.defaultValue : '');
				}
    		});
		});
$(document).ready(function() {
       		$('textarea').focus(function() {
    		    if (this.value == this.defaultValue){ 
    		    	this.value = '';
				}
				if(this.value != this.defaultValue){
	    			this.select();
	    		}
    		});
    		$('textarea').blur(function() {
    		    if ($.trim(this.value) == ''){
			    	this.value = (this.defaultValue ? this.defaultValue : '');
				}
    		});
		});
$(document).ready(function(){
 $(".more").click(function(){ $("#more_categories").slideToggle("slow"); $("#register").slideUp("slow"); $("#more_favorites").slideUp("slow"); $(this).toggleClass("active"); return false; });
 $("#login").click(function(){ $("#register").slideToggle("slow"); $("#more_categories").slideUp("slow"); $(this).toggleClass("active"); return false; });
 $("#favourites").click(function(){ $("#more_favorites").slideToggle("slow"); $("#more_categories").slideUp("slow"); $(this).toggleClass("active"); return false; });
 $("#add_comment").click(function(){ $("#form_comment").slideToggle("slow"); $("#file_comments").slideUp("slow"); $(this).toggleClass("active"); return false; });
 $("#view_comments").click(function(){ $("#file_comments").slideToggle("slow"); $("#form_comment").slideUp("slow"); $(this).toggleClass("active"); return false; });
 $("#show_tell").click(function(){ $("#tell_friend").slideToggle("slow"); $("#report_broken").slideUp("slow"); $(this).toggleClass("active"); return false; });
 $("#show_report").click(function(){ $("#report_broken").slideToggle("slow"); $("#tell_friend").slideUp("slow"); $(this).toggleClass("active"); return false; });
});
$(function(){ $(".tiptip").tipTip({maxWidth: "auto", edgeOffset: 5}); });
function limitText(limitField, limitNum) { if (limitField.value.length > limitNum) { limitField.value = limitField.value.substring(0, limitNum); } }
function addEmoticon(areaId,text) { var txtarea = document.getElementById(areaId); var scrollPos = txtarea.scrollTop; var strPos = 0; var br = ((txtarea.selectionStart || txtarea.selectionStart == '0') ? "ff" : (document.selection ? "ie" : false ) ); if (br == "ie") { txtarea.focus(); var range = document.selection.createRange(); range.moveStart ('character', -txtarea.value.length); strPos = range.text.length; } else if (br == "ff") strPos = txtarea.selectionStart; var front = (txtarea.value).substring(0,strPos); var back = (txtarea.value).substring(strPos,txtarea.value.length); txtarea.value=front+text+back; strPos = strPos + text.length; if (br == "ie") { txtarea.focus(); var range = document.selection.createRange(); range.moveStart ('character', -txtarea.value.length); range.moveStart ('character', strPos); range.moveEnd ('character', 0); range.select(); } else if (br == "ff") { txtarea.selectionStart = strPos; txtarea.selectionEnd = strPos; txtarea.focus(); } txtarea.scrollTop = scrollPos; } 
