$().ready( function (){
	
	$loginMessage = $('#loginMessage').text('');
	

	
	$('form[name=loginForm]').submit( function() {
		
		return true;
		if($('input[name=login]').val() && $('input[name=password]').val()) 
		{
			
			data = 'action=login&&extra=ajax&&login=' + $('input[name=login]').val() + '&&password=' + $('input[name=password]').val();
		 
			$.ajax( {
				url: 'login.php',
				type: 'GET',
				data: data,
				cache: false,
				
				success: function(html){
					
					if(html != '0')
						$('#loginTable').html(html);	
					else
					{	
					 	$loginMessage.text('Child Name or Password incorect!');
					 	return false
					 }	
				}
			});
			return false;
		}
		else
		{
			$loginMessage.text('Child Name or Password empty!');
			return false;
		}
	
	});
	
	
	$('form[name=fileupload]').submit( function()
	{
		
		if(!$('form[name=fileupload] #file').val())
		{
			$('#uploadMesage').html('<spam style="color: red">Invalid file!</span>');
			return false;
		}
		
	});
	
	//upload button
	i = 0;
	$('#file_upload_button').click( function()
	{
		if((i++)%2 == 0)
			$(this).html('Upload file');
		else
			$(this).html('Upload file <img src="images/expand_icon.png" border="0" style="width: 10px; height:10px;" alt="expand"/>');
				
		$('#fileupload').toggle('1000');
		
			
		
		return false;	
		
	});
	
	

	
});

