$(document).ready(function() { 
	/*
	setInterval(function(){
		var now = new Date();
		$('.header_info2').html(now.toLocaleString());
	}, 1000);
	*/
	
/*
	$('#search').keyup(function(){
		var value = $('#search').val();
		var form_data = {
			searchkey : value
		}
		var base_url = $('base').attr("href");
		$.ajax({
			url: base_url+"index.php/search/search2",
			type: 'POST',
			data: form_data,
			//dataType: 'json',
			success: function(msg){
				$('#divsearch').show();
				$('#divsearch').html(msg);
			}
		});
	});
*/	
	
	$('#search').keyup(function(){
		var value = $('#search').val();
		if(value){
			var form_data = {
				skey : value
			}
			var base_url = $('base').attr("href");
			$.ajax({
				url: base_url+"index.php/search/search2",
				type: 'POST',
				data: form_data,
				//dataType: 'json',
				success: function(msg){
					$('#divsearch').show();
					$('#divsearch').html(msg);
				}
			});
		}else{
			$('#divsearch').hide();
			s$('#divsearch').html('');
		}
	});
	

	
	$(function()
	{
		// this initialises the demo scollpanes on the page.
		$('#pane1').jScrollPane();
		$('#pane2').jScrollPane({showArrows:true});
		$('#panel2, #pane3, #pane4').jScrollPane({scrollbarWidth:10, scrollbarMargin:10});
		
		// this allows you to click a link to add content to #pane4 and shows how to 
		// reinitialise the scrollbars when you have done this.
		$('#add-content').bind(
			'click',
			function()
			{
				$('#pane4').append($('<p></p>').html($('#intro').html())).jScrollPane({scrollbarWidth:10, scrollbarMargin:10});
			}
		);
		// and this allows you to click the link to reduce the amount of content in
		// #pane4 and reinitialise the scrollbars.
		$('#remove-content').bind(
			'click',
			function()
			{
				$('#pane4').empty().append($('<p></p>').html($('#intro').html())).jScrollPane({scrollbarWidth:10, scrollbarMargin:10});
			}
		);
	});	

});


