$(document).ready(function() {
	$.ajax({
		type: "POST",
		url: "home.php",
		success: function(rslt) {
			$("#main_center").html(rslt);
		}
	});
	$.ajax({
		type: "POST",
		url: "leftsidebar.php",
		success: function(rslt) {
			$("#main_left").html(rslt);
		}
	});


	$("#home").click(function() {
		$.ajax({
			type: "POST",
			url: "home.php",
			success: function(rslt) {
				$("#main_center").html(rslt);
			}
		});	
	});

	$("#themes").click(function() {
		$.ajax({
			type: "POST",
			url: "themes.php",
			success: function(rslt) {
				$("#main_center").html(rslt);
			}
		});	
	});
});

$("#topPuzzles_ul >li").css("cursor","pointer");
$("#highest_ul >li").css("cursor","pointer");
	var tbl1_id = 1;
	function tbl1_show(id){
		$("#tbl1_"+tbl1_id).attr("class","up");
		$(".tbl1"+tbl1_id).hide();
		$("#tbl1_"+id).attr("class","down");
		$(".tbl1"+id).show();
		tbl1_id =id;
	}
	var tbl2_id = 1;
	function tbl2_show(id){
		$("#tbl2_"+tbl2_id).attr("class","up");
		$(".tbl2"+tbl2_id).hide();
		$("#tbl2_"+id).attr("class","down");
		$(".tbl2"+id).show();
		tbl2_id =id;
		$("#tbl2_more").attr("href",'rankings.php?id='+id);
	}
	var unlockdefault = 'Please enter a code.';
	function check_lock(){
		var v = $("input[@name='vercode']").val();
		if(v == '' || unlockdefault == v){
			$("input[@name='vercode']").val(unlockdefault);
			return false;
		}
		return true;
	}
$("input[@name='vercode']").click(function(){if(this.value==unlockdefault){this.value="";}})

