var currentPage = 1;
function paginate( name, page, search, operations, perpage, order )
{
	if( page < 1 )
		return false;
		
	$("#container_mls_list").load(
			"service.php", {"page":page,"search":search,"operations":operations,"perPage":perpage,"order":order}	);
	return false;

}

function openDir( form, control ) { 

	var newIndex = control.selectedIndex; 

//	if ( newIndex == 0 ) { 

//		alert( "Please select a location!" ); 

//	} else { 

		cururl = control.options[ newIndex ].value; 

		window.location.assign( cururl ); 

//	} 

} 

$(document).ready(function(){
	



$("a").tooltip({ 
    bodyHandler: function() { 
        return $("#tip_"+this.id).html(); 
    }, 
    showURL: false 
});

$('#tabs div').hide(); // Hide all divs
$('#tabs div:first').show(); // Show the first div
$('#tabs ul li:first').addClass('active'); // Set the class of the first link to active

$('#tabs ul li a').click(function(){ //When any link is clicked
	$('#tabs ul li').removeClass('active'); // Remove active class from all links
	$(this).parent().addClass('active'); //Set clicked link class to active
	var currentTab = $(this).attr('href'); // Set variable currentTab to value of href attribute of clicked link
	$('#tabs div').hide(); // Hide all divs
	$(currentTab).show(); // Show div with id equal to variable currentTab
	return false;
});

$(".content").hide();
$(".content_selected").show();
//$('<img src="img/arrow-down.png" class="arrow" />').insertAfter('a h1'); 				   
$("a h1").click(function(){
	if($(this).is(".active")) {
     $(this).toggleClass("active");
	 $('.arrow.active').attr('src','img/arrow-down.png'); // change the image src of the current ACTIVE image to have an INACTIVE state.
     $(this).parent().next(".content").slideToggle();
     return false;
	} else {
		$(".content:visible").slideUp("slow"); // close all visible divs with the class of .content
		$("h1.active").removeClass("active");  // remove the class active from all h1's with the class of .active
		$(this).toggleClass("active");
		$('.arrow.active').attr('src','img/arrow-down.png'); // change the image src of the current ACTIVE image to have an INACTIVE state.
		$(".arrow").addClass('active');
		$(this).siblings('.arrow.active').attr('src','img/arrow-up.png'); // change the image src of the new active image to have an active state.
		$(this).parent().next(".content").slideToggle();
		$(this).parent().next(".content").show();
		return false;
	}
});


});

