jQuery(document).ready(function() {
    
	jQuery("select.petprofiles").change(function(e){
		var p = this.options[this.selectedIndex].value;
		jumpViewPet(p);
	});
	
	jQuery("select#selectalbum").change(function(e){
		var a = this.options[this.selectedIndex].value;
		jumpViewAlbum(a);
	});
	
	if ($(".galleryview").hasClass("ui-tabs-selected"))
    	setTimeout('$("#galleryBody").show()', 600);
    else
    	setTimeout('$("#gallery").show()', 600);
	
});

function jumpViewAlbum(a){
	if(a=='') return;
	window.location = a;
}


function jumpViewPet(p){
	if(p<0) return;
	jQuery("#petcontainer").load("/meetotherpets/viewpetprofile",{pid:p, uid:curid},function(e){
		addAccordion('#favorites');
		addAccordion('#photos');
		addAccordion('#biography');
	});	
}

