// JavaScript Document
$(document).ready(function(){
	var height = $(window).height()-55;
	$('#googleMap').attr('height',height);
	$('a.showPanels').live('click',function(){
		$('#rightColumn').removeClass('hidden');							
		$(this).removeClass('showPanels');							
		$(this).addClass('hidePanels');							
	});												
	$('a.hidePanels').live('click',function(){
		$('#rightColumn').addClass('hidden');							
		$(this).addClass('showPanels');							
		$(this).removeClass('hidePanels');							
	});
	$('a.drpDownMenu').toggle(function() {
 		 $(this).next().slideDown();
	}, function() {
 		 $(this).next().slideUp();
	});
	$('a.drpDownMenu').blur(function(){
		$(this).next().slideUp();
	});
	$(".defaultValue").each(function(){									 
		if($(this).attr("value") == $(this).attr("default") || $(this).attr("value") == '')
			$(this).attr("value", $(this).metadata().data);
 	});
	$(".defaultValue").click(function(){
			$(this).attr("value", "");	 
 	});
	$(".defaultValue").blur(function(){
		if($(this).attr("value") == $(this).attr("default") || $(this).attr("value") == '')
			$(this).attr("value", $(this).metadata().data);
 	});
	$('#prevCat').click(function(){
		if($('#curPage').val() > 1)
		{
			$('#curPage').val(parseInt($('#curPage').val())-1);										  
			$('#showContent').html('<p align="center" style="height:180px; background:#eff0f1;"><img src="media/preloader.gif" style="margin:80px 0 0 10px;" /></p>');
			$.get('?m=categories&a=get.categories&s=ajax&curPage='+$('#curPage').val(),showCategories);
		}
	});									
	$('#nextCat').click(function(){
		if($('#curPage').val() < $('#totalPages').val())								  
		{
			$('#curPage').val(parseInt($('#curPage').val())+1);										  
			$('#showContent').html('<p align="center" style="height:180px; background:#eff0f1;"><img src="media/preloader.gif" style="margin:80px 0 0 10px;" /></p>');
			$.get('index.php?m=categories&a=get.categories&s=ajax&curPage='+$('#curPage').val(),showCategories);
		}
	});									
});
function showCategories(data)
{
	$('#showContent').html(data);
}
