$(document).ready(function(){

$("a#showaddchs").click(function () {
	$("a#showaddchs").hide("fast");
	$("#addchs").show("slow");
});
$("a#showaddtip").click(function () {
	$("a#showaddtip").hide("fast");
	$("#addtip").show("slow");
});

$("a#showaddpost").click(function () {
	$("a#showaddpost").hide("fast");
	$("a#showaddrecepie").hide("fast");
	$("#addpost").show("slow");
});

$("a#showaddrecepie").click(function () {
	$("a#showaddrecepie").hide("fast");
	$("a#showaddpost").hide("fast");
	$("#addrecepie").show("slow");
});

$("a#showaddcat").click(function () {
	$("a#showaddcat").hide("fast");
	$("#addcat").show("slow");
});

$('#vrecepie').live('mouseover', function(event) {	$('#vrecepie').addClass('active');
	$('#downmenudiv').html($('#invrecepie').html());
	$('#vdiet').removeClass('active');
	$('#vabout').removeClass('active');
	$('#vtips').removeClass('active');
})
$('#vdiet').live('mouseover', function(event) {
	$('#vrecepie').removeClass('active');
	$('#vabout').removeClass('active');
	$('#vtips').removeClass('active');
	$('#downmenudiv').html(' ');
});
$('#vabout').live('mouseover', function(event) {
	$('#vrecepie').removeClass('active');
	$('#vdiet').removeClass('active');
	$('#vtips').removeClass('active');
	$('#downmenudiv').html(' ');
});
$('#vtips').live('mouseover', function(event) {
	$('#vrecepie').removeClass('active');
	$('#vdiet').removeClass('active');
	$('#vabout').removeClass('active');
	$('#downmenudiv').html(' ');
});

$("#datepicker").datePicker().val(new Date().asString()).trigger('change');
$("#datepicker2").datePicker().val(new Date().asString()).trigger('change');

$('.catlist').eq(0).click();

});

function generateUrl() {	var title = $("#title").val();
	$.get("urlgen.php?s="+title,
   	function(data){
    	$("#url").val(data);
   	});
}

function getPosts(catid) {	$('.catlist').removeClass('catlistactive');
	$('a#cat'+catid).addClass('catlistactive');
	$.get("/quick.php?catid="+catid,
   	function(data){
    	$("#postsplace").html(data);
   	});
}
