function msg(what)
{
	var inuse = 0;
	//$(".msg:visible").hide();

	if ( inuse == 0 )
	{
		if ( $("#"+what).css("display") == 'none' )
		{
			var val = $("#"+what).next().children();
			var val2 = val.val();

			if ( val2 == 'Your Name' || val2 == 'Your Email' )
			{
				val.val("");
			}

			inuse = 1;
			$("#"+what).fadeIn('normal',function(){ inuse=0; });
			setTimeout("$('#"+what+"').fadeOut('fast');",2000);
		}
	}
}

function Sendspam() 
{
	//untuk makhluk2 yang tak reti nak write
	if ($("#spam-name").val() == 'Your Name' || $("#spam-email").val() == 'Your Email')
	{
		alert('Fill in both Name and Email');
		return false;
	}

	if ( $("#spam").val() == '' )
	{
		alert('You must write something first.');
		return false;
	}

	if ( $("#spam").val().length < 10 )
	{
		alert('Pendek sangat! Too short! Must be atleast 10 chars.');
		return false;
	}

	//kalau ade spams
	if ($("#newspams").html().length > 1)
	{
		$("#newspams").children(".errors").remove();
	}
	

	//serialize data
	 var data = $("#form_spams input,textarea").serialize();
	
	 var html = '';
	 var html = $.ajax({
					   type: "POST",
					   url: "/save.php?ajax=1",
					   data: data,
					   async: false
					 }).responseText;
	
	var check = html.search("/<p class=\"error\"/");

	//tade error
	if (check == -1)
	{
		$("#newspams").append(html).fadeIn('slow');	
		$("#spam").val(" ");
		setTimeout("$(\".msg-content:first\").slideDown();",1000);
	}

	
	//and still return false. kekeke
	return false;
}

function down(what)
{
	$("#msg-"+what+"-content").slideToggle('fast');
	return false;
}

function wishpage(page)
{
	$.get("/wish.php?page="+page,'',
	  function(data){
		$("#spams").html(data);
	  }
	);
}