function cPets(objName) { this.name = objName; window[objName] = this; this.petFields = new Array(); this.petFields['animalID'] = Array(); this.petFields['animalID']['index'] = 0; this.petFields['animalID']['name'] = 'Animal ID'; this.petFields['status'] = Array(); this.petFields['status']['index'] = 1; this.petFields['status']['name'] = 'Status'; this.petFields['lastUpdated'] = Array(); this.petFields['lastUpdated']['index'] = 2; this.petFields['lastUpdated']['name'] = 'Last Update'; this.petFields['rescueID'] = Array(); this.petFields['rescueID']['index'] = 3; this.petFields['rescueID']['name'] = 'Rescue ID'; this.petFields['name'] = Array(); this.petFields['name']['index'] = 4; this.petFields['name']['name'] = 'Name'; this.petFields['summary'] = Array(); this.petFields['summary']['index'] = 5; this.petFields['summary']['name'] = 'Summary'; this.petFields['species'] = Array(); this.petFields['species']['index'] = 6; this.petFields['species']['name'] = 'Species'; this.petFields['breed'] = Array(); this.petFields['breed']['index'] = 7; this.petFields['breed']['name'] = 'Breed'; this.petFields['primaryBreed'] = Array(); this.petFields['primaryBreed']['index'] = 8; this.petFields['primaryBreed']['name'] = 'Primary Breed'; this.petFields['secondaryBreed'] = Array(); this.petFields['secondaryBreed']['index'] = 9; this.petFields['secondaryBreed']['name'] = 'Secondary Breed'; this.petFields['sex'] = Array(); this.petFields['sex']['index'] = 10; this.petFields['sex']['name'] = 'Gender'; this.petFields['mixed'] = Array(); this.petFields['mixed']['index'] = 11; this.petFields['mixed']['name'] = 'Mixed'; this.petFields['dogs'] = Array(); this.petFields['dogs']['index'] = 12; this.petFields['dogs']['name'] = 'Good with Dogs'; this.petFields['cats'] = Array(); this.petFields['cats']['index'] = 13; this.petFields['cats']['name'] = 'Good with Cats'; this.petFields['kids'] = Array(); this.petFields['kids']['index'] = 14; this.petFields['kids']['name'] = 'Good with Kids'; this.petFields['declawed'] = Array(); this.petFields['declawed']['index'] = 15; this.petFields['declawed']['name'] = 'Declawed'; this.petFields['housetrained'] = Array(); this.petFields['housetrained']['index'] = 16; this.petFields['housetrained']['name'] = 'House Trained'; this.petFields['age'] = Array(); this.petFields['age']['index'] = 17; this.petFields['age']['name'] = 'Age'; this.petFields['specialNeeds'] = Array(); this.petFields['specialNeeds']['index'] = 18; this.petFields['specialNeeds']['name'] = 'Special Needs'; this.petFields['altered'] = Array(); this.petFields['altered']['index'] = 19; this.petFields['altered']['name'] = 'Altered'; this.petFields['size'] = Array(); this.petFields['size']['index'] = 20; this.petFields['size']['name'] = 'Size'; this.petFields['uptodate'] = Array(); this.petFields['uptodate']['index'] = 21; this.petFields['uptodate']['name'] = 'Up-to-date'; this.petFields['color'] = Array(); this.petFields['color']['index'] = 22; this.petFields['color']['name'] = 'Color'; this.petFields['coatLength'] = Array(); this.petFields['coatLength']['index'] = 23; this.petFields['coatLength']['name'] = 'Coat Length'; this.petFields['pattern'] = Array(); this.petFields['pattern']['index'] = 24; this.petFields['pattern']['name'] = 'Pattern'; this.petFields['courtesy'] = Array(); this.petFields['courtesy']['index'] = 25; this.petFields['courtesy']['name'] = 'Courtesy Listing'; this.petFields['found'] = Array(); this.petFields['found']['index'] = 26; this.petFields['found']['name'] = 'Found'; this.petFields['foundDate'] = Array(); this.petFields['foundDate']['index'] = 27; this.petFields['foundDate']['name'] = 'Found Date'; this.petFields['foundZipcode'] = Array(); this.petFields['foundZipcode']['index'] = 28; this.petFields['foundZipcode']['name'] = 'Found Zip Code'; this.petFields['killDate'] = Array(); this.petFields['killDate']['index'] = 29; this.petFields['killDate']['name'] = 'Euth Date'; this.petFields['killReason'] = Array(); this.petFields['killReason']['index'] = 30; this.petFields['killReason']['name'] = 'Euth Reason'; this.petFields['description'] = Array(); this.petFields['description']['index'] = 31; this.petFields['description']['name'] = 'Description'; this.petFields['pic1'] = Array(); this.petFields['pic1']['index'] = 32; this.petFields['pic1']['name'] = 'Picture'; this.petFields['pictmn1'] = Array(); this.petFields['pictmn1']['index'] = 33; this.petFields['pictmn1']['name'] = 'Thumbnail'; this.petFields['pic2'] = Array(); this.petFields['pic2']['index'] = 34; this.petFields['pic2']['name'] = 'Picture'; this.petFields['pictmn2'] = Array(); this.petFields['pictmn2']['index'] = 35; this.petFields['pictmn2']['name'] = 'Thumbnail'; this.petFields['pic3'] = Array(); this.petFields['pic3']['index'] = 36; this.petFields['pic3']['name'] = 'Picture'; this.petFields['pictmn3'] = Array(); this.petFields['pictmn3']['index'] = 37; this.petFields['pictmn3']['name'] = 'Thumbnail'; this.petFields['pic4'] = Array(); this.petFields['pic4']['index'] = 38; this.petFields['pic4']['name'] = 'Picture'; this.petFields['pictmn4'] = Array(); this.petFields['pictmn4']['index'] = 39; this.petFields['pictmn4']['name'] = 'Thumbnail'; this.petFields['video1'] = Array(); this.petFields['video1']['index'] = 40; this.petFields['video1']['name'] = 'Video'; this.petFields['contactName'] = Array(); this.petFields['contactName']['index'] = 41; this.petFields['contactName']['name'] = 'Contact Name'; this.petFields['contactEmail'] = Array(); this.petFields['contactEmail']['index'] = 42; this.petFields['contactEmail']['name'] = 'Contact Email'; this.petFields['contactCellPhone'] = Array(); this.petFields['contactCellPhone']['index'] = 43; this.petFields['contactCellPhone']['name'] = 'Contact Cell Phone'; this.petFields['contactHomePhone'] = Array(); this.petFields['contactHomePhone']['index'] = 44; this.petFields['contactHomePhone']['name'] = 'Contact Home Phone'; this.petFields['locationZipcode'] = Array(); this.petFields['locationZipcode']['index'] = 45; this.petFields['locationZipcode']['name'] = 'Location Zipcode'; this.petFields['locationName'] = Array(); this.petFields['locationName']['index'] = 46; this.petFields['locationName']['name'] = 'Location Name'; this.petFields['detailLink'] = Array(); this.petFields['detailLink']['index'] = 47; this.petFields['detailLink']['name'] = 'Name'; this.petFields['created'] = Array(); this.petFields['created']['index'] = 48; this.petFields['created']['name'] = 'Created'; this.mode = ''; this.pet = new Array(); this.listId = 'rgPetContainer'; this.detailId = 'rgPetDetails'; this.fields = 'name,breed,color,species,age,thumbnail'; this.orderby = this.petFields['name']['index']; this.order = 'asc'; this.enableSearch = true; this.smartBrowse = true; this.sortbyField = 'name'; this.sortbyOrder = 'asc'; this.hideEmptyFields = false; this.detailTemplate = 'template1'; this.detailWidth = '600'; this.detailHeight = '620'; this.picMaxWidth = '400'; this.pictmnMaxWidth = '100'; this.picSize = 'thumbnail'; this.paging = true; this.perPage = 10; this.perRow = 4; this.rows = 4; this.detailPage = 'popover'; this.buildPets = function() { this.pet = [ ['19834154','Available','2024-03-28 17:19:45','A929821','Bruce','','Dog','Shepherd (short coat)','Shepherd','','Male','','','','','No','','Adult','No','Yes','Medium','Yes','Tan','Short','','Yes','No','','','','','

FOSTER CARE! 

My adoption and training fees are 50% off! 

Hello!  My name is Bruce, and I\'m a 2-year-old, neutered shepherd-husky mix that currently weighs about 65 lbs. I\'m both potty and crate-trained. I love to play fetch. Even though I am energetic and playful outside, I have great manners and love cuddling on the couch at home. I\'m looking for a family that is prepared to continue to teach me new things! If you have a resident dog, I would love to say hello to make sure we get along before I join your family!  For more information about me, just ask Customer Service about Bruce! ID#A929821

Since I’m not at the adoption center, you can make arrangements to meet me by emailing behavior@phs-spca.org

You may also submit your fully completed Adoption Profile Form to behavior@phs-spca.org and a staff member will call you to conduct a phone interview before making an appointment to meet me in person. You must be 18 or older to submit a profile. 

Application:

https://phs-spca.org/wp-content/uploads/2023/04/AdoptionProfiles_dog2023_fillin.pdf

*The application may not work on mobile devices and iPads. Please call (650) 340-7022 for assistance.

','','','','','','','','','','','','','','94010','Center for Compassion (Adoptable Animals)','Bruce','2023-09-28 14:29:37'], ['18941310','Available','2024-04-18 19:38:52','A919755','Elsa','','Rabbit','Shorthaired Rabbit (short coat)','Shorthaired Rabbit','','Female','','','','','No','','','No','Yes','Medium','Yes','White','Short','','Yes','No','','','','','

FOSTER CARE! MY ADOPTION FEES ARE WAIVED!

Elsa the rabbit here! I\'m a medium sized, spayed female, short hair rabbit that currently weighs 4.9 pounds. I\'m a beautiful bunny that will melt your heart with my gorgeous blue eyes! I have a personality that\'s just as dazzling. I\'m confident and love to explore new places! Head rubs and gentle ear scratches are great too, and I\'ll approach you to say hello and get some affection. I\'d prefer to be the only rabbit in my new home, unless you are able to give me lots of time and space to get to know a bunny companion. If you\'re looking for a fun and sweet rabbit like me, please submit your application today! Elsa ID#A919755.

Since I’m not at the adoption center, you can make arrangements to meet me by submitting your fully completed Adoption Profile Form to the adoptions department and a staff member will call you to set up an appointment to meet me in person. You must be 18 or older to submit a profile. 

Email:

 adoptinquire@peninsulahumanesociety.org 

Application: 

https://phs-spca.org/wp-content/uploads/2022/05/AdoptionProfiles_small2022fillin.pdf

 *The application may not work on mobile devices and iPads. Please call (650) 340-7022 for assistance.

','','','','','','','','','','','','','','','','Elsa','2023-01-12 19:34:23'], ['20207752','Available','2024-04-04 19:12:17','A940881','Kurlys','','Dog','German Shepherd Dog / Alaskan Malamute / Mixed (medium coat)','German Shepherd Dog','Alaskan Malamute','Male','Yes','','','','No','','Young','No','Yes','Large','Yes','','Medium','','Yes','No','','','','','

FOSTER CARE!

My adoption and training fees are 50% off! 

Hello, my name is Kurlys!  I\'m a 1 and a half year old, neutered male, German Shepherd, Alaskan Malamute mix that currently weighs about 80lbs.  I\'m still a growing boy so I\'ll do best with a family that is prepared for a very large dog. I\'m a curious boy that loves human attention and can\'t wait to make new friends.  If you have a resident dog, please make sure we have a chance to say hello before adding me to your family. I still have a lot to learn so I\'m hoping for a family that is prepared to continue my training and give me lots of exercise! I\'m a good boy who already know sit, down and shake (both front paws). I get a little bit stressed when I\'m left alone so I would do best with a family that understands I need a little extra attention. For more information about me, just ask Customer Service about Kurlys! ID# A940881

My foster family thinks that I am the bees knees! Here\'s what they had to say:

\"Kurlys is doing great! He\'s a bit scared of busy areas but he does great on walks around quiet neighborhoods. When he plays with other dogs, he\'s pretty gentle. He is learning to be alone at home and doing fine for up to an hour.\"

Since I’m not at the adoption center, you can make arrangements to meet me by emailing behavior@phs-spca.org

You may also submit your fully completed Adoption Profile Form to behavior@phs-spca.org and a staff member will call you to conduct a phone interview before making an appointment to meet me in person. You must be 18 or older to submit a profile. 

Application:

https://phs-spca.org/wp-content/uploads/2023/04/AdoptionProfiles_dog2023_fillin.pdf

*The application may not work on mobile devices and iPads. Please call (650) 340-7022 for assistance.

','','','','','','','','','','','','','','94010','Center for Compassion (Adoptable Animals)','Kurlys','2024-02-06 20:39:29'], ['17152511','Available','2024-03-29 20:11:15','A899789','Pogo','','Dog','Shepherd / Mixed (medium coat)','Shepherd','','','Yes','Yes','No','Yes','No','Yes','Adult','No','Yes','Medium','Yes','','Medium','','Yes','No','','','','','

FOSTER CARE!

My adoption and training fees are 50% off! 

Hello, my name is Pogo! I\'m a 3 year old, neutered shepherd mix that currently weighs about 50lbs! I\'m a fun-loving, playful guy that is great at exploring! My all time favorite thing is to spend time with all my friends! I\'m definitely a people dog, after some playtime I love to be petted and cuddled by my favorite humans.  I also enjoy running and chasing toys! I\'m an energetic young boy who is eager to learn; my new family will need to be prepared to continue my training and should have experience with rowdy boys like me. I play well with other outgoing, social dogs! Even though I\'m amazing, I would not be good with cats. I would like to meet the whole family including resident dogs before I go home. If you are ready for a energetic boy, submit an application in for me Pogo ID# A899789!

Since I’m not at the adoption center, you can make arrangements to meet me by emailing behavior@phs-spca.org

You may also submit your fully completed Adoption Profile Form to behavior@phs-spca.org and a staff member will call you to conduct a phone interview before making an appointment to meet me in person. You must be 18 or older to submit a profile. 

Application: https://phs-spca.org/wp-content/uploads/2023/04/AdoptionProfiles_dog2023_fillin.pdf

*The application may not work on mobile devices and iPads. Please call (650) 340-7022 for assistance.

\"\"

','','','','','','','','','','','','','','94010','Center for Compassion (Adoptable Animals)','Pogo','2021-08-24 13:25:08'], ['14021693','Available','2023-11-24 18:20:09','','Roosters!','Several different colors, breeds available','Chicken','Chicken / Mixed (medium coat)','Chicken','','Male','Yes','Yes','Yes','Yes','No','No','Adult','No','No','Small','','Brown','Medium','','Yes','No','','','','','

Looking for some handsome little bantams to add to your flock of littles? Or maybe just a couple big guys to get a flock started! Call or come in to learn more about us. You can find us at our intake facility and ask for our roosters, we have multiple breeds available, big and small. We are located at 12 Airport Blvd in San Mateo!

If you would like to find out how many roosters are available, please call (650) 340-7022

If you are interested in adopting a rooster, please come to 12 Airport Blvd, San Mateo CA 94401. We are open Monday-Friday 11AM-7PM and Saturday-Sunday 11AM-6PM.

','','','','','','','','','','','','','','','','Roosters!','2019-01-25 22:23:34'], ['18959178','Available','2024-03-28 17:22:14','A923559','Sahara','','Dog','Siberian Husky (long coat)','Siberian Husky','','Female','','','','','No','','Adult','No','Yes','Medium','Yes','White with Gray or Silver','Long','','Yes','No','','','','','

FOSTER CARE!

My adoption and training fees are 50% off! 

Hi there World! My name is Sahara, I am a 2 year old bundle of fun. I am 54 lbs., spayed female husky with a rambunctious personality who\'s ready for a new adventure. There is nothing I love more than exploring. I would love to find someone with the same wanderlust as me so we can travel together! I get so excited sometimes that I forget to listen, its a husky thing. I would love to be a model citizen but I need help sprucing up my manners. I play well with other dogs that match my playstyle but I might be a bit too rambunctious for little kids. If you are looking for a whirlwind of energy to add some excitement to your life, here I am! Sahara ID# A923559

Since I’m not at the adoption center, you can make arrangements to meet me by emailing behavior@phs-spca.org

You may also submit your fully completed Adoption Profile Form to behavior@phs-spca.org and a staff member will call you to conduct a phone interview before making an appointment to meet me in person. You must be 18 or older to submit a profile. 

Application:

https://phs-spca.org/wp-content/uploads/2023/04/AdoptionProfiles_dog2023_fillin.pdf

*The application may not work on mobile devices and iPads. Please call (650) 340-7022 for assistance.

\"\"

','','','','','','','','','','','','','','94010','Center for Compassion (Adoptable Animals)','Sahara','2023-01-19 13:51:35'], ['19011872','Available','2024-04-18 19:40:21','A922325','Snow White','','Rabbit','Shorthaired Rabbit (short coat)','Shorthaired Rabbit','','Female','','','','','No','','','No','Yes','Medium','Yes','White','Short','','Yes','No','','','','','

MY ADOPTION FEES ARE WAIVED!

Mirror, mirror on the wall, who\'s the fairest bunny of all? It\'s me, Snow White! I\'m an athletic girl that loves to hop, skip, and jump around! I\'m entertaining and always on the go. I can be a little nervous in new places, but I also enjoy pets and lap time from my favorite people. Once I\'ve gotten to be your buddy, I\'ll give you soft little licks on your hand. It\'s easy to make friends with me using a few veggie treats! If you\'re ready to begin our magical friendship, please ask about me today. Snow White ID#A922325.

','','','','','','','','','','','','','','','','Snow White','2023-02-06 20:59:34'], ['20034317','Available','2024-04-12 16:47:01','A938350','Thor','','Dog','Siberian Husky / Spitz (medium coat)','Siberian Husky','Spitz','Male','','','','','No','','Young','No','Yes','Medium','Yes','White','Medium','','Yes','No','','','','','

FOSTER CARE!

My adoption and training fees are 50% off! 

Hi, I\'m Thor! I\'m a 1 year old, neutered male, Siberian Husky mix and I weigh 51 pounds. Have you ever wished for a dog with the personality of a cat? Well if you have, I\'m your wish come true! I\'m a sweet and playful boy but I like to take my time getting to know new people. I need to be sure I\'m safe before I rub against you for pets. Once I\'m super comfortable, I love to run zoomies, play with toys and even jump into water! I love going on adventures. I have good car manners and I\'m getting better with my leash manners. I would be the perfect beach buddy! My ideal home would be with someone who is ready for a sweet, energetic pup and will take the time to help me overcome my shyness. As a scaredy cat, I would do best in quiet but active home. I promise to be your best buddy, once I get to know you. 

Thor ID# A938350

Since I’m not at the adoption center, you can make arrangements to meet me by emailing behavior@phs-spca.org

You may also submit your fully completed Adoption Profile Form to behavior@phs-spca.org and a staff member will call you to conduct a phone interview before making an appointment to meet me in person. You must be 18 or older to submit a profile. 

Application: https://phs-spca.org/wp-content/uploads/2023/04/AdoptionProfiles_dog2023_fillin.pdf

*The application may not work on mobile devices and iPads. Please call (650) 340-7022 for assistance.

','','','','','','','','','','','','','','94010','Center for Compassion (Adoptable Animals)','Thor','2023-11-30 17:42:40'], ['19879515','Available','2024-04-02 14:10:38','A934080','Tilly','','Dog','German Shepherd Dog / Husky / Mixed (medium coat)','German Shepherd Dog','Husky','Female','Yes','','','','No','','Adult','No','Yes','Medium','Yes','Black with Tan, Yellow or Fawn','Medium','','Yes','No','','','','','

FOSTER CARE!

My adoption and training fees are 50% off! 

Howdy, I\'m Tilly! I\'m a 2 year old, spayed female, Husky/Shepherd mix! I\'m a 50 pound, medium sized dog with super sized energy! My ideal day looks like this: we wake up and have a big breakfast. Then we go for a sniffari where we walk around the neighborhood smelling every single flower. When we get back home, I\'ll be wiggly and want to play with toys. After we play, I\'ll want to settle down with a good chew toy and take an afternoon nap, getting ready for our next exercise session in the afternoon. If you\'ve been looking for a fun and affectionate best friend, I would love to meet you!  Because of my shy and energetic nature I would do best in a household with older teens and adults, so please bring the whole family, including resident dogs to meet me!

Tilly AID # A934080

Since I’m not at the adoption center, you can make arrangements to meet me by emailing behavior@phs-spca.org

You may also submit your fully completed Adoption Profile Form to behavior@phs-spca.org and a staff member will call you to conduct a phone interview before making an appointment to meet me in person. You must be 18 or older to submit a profile. 

Application: https://phs-spca.org/wp-content/uploads/2023/04/AdoptionProfiles_dog2023_fillin.pdf

*The application may not work on mobile devices and iPads. Please call (650) 340-7022 for assistance.

\"\"

\"\"

','','','','','','','','','','','','','','94010','Center for Compassion (Adoptable Animals)','Tilly','2023-10-11 13:30:23'] ]; } this.init = function() { this.buildPets(); if (!this.sortbyField) { this.sortbyField = 'lastUpdated'; this.sortbyOrder = 'desc'; } if (cgiVar('toolkitAnimalID')) { showDetails(this.name, null, cgiVar('toolkitAnimalID')); } this.fieldsArray = this.fields.split(','); var orderby = readCookie('rgOrderby'); if (orderby && (this.mode == 'list')) { if (this.sortbyField && this.sortbyOrder && orderby == this.petFields[this.sortbyField]['index']){ this.order = this.sortbyOrder; } this.sortPetArrayOnLoad(orderby); } else { if (this.sortbyField && this.sortbyOrder) { this.order = this.sortbyOrder; this.sortPetArrayOnLoad(this.petFields[this.sortbyField]['index']); } } this.page = 1; } this.list = function(container) { this.listId = container; this.mode = 'list'; this.init(); this.writeList(); } this.list2 = function(container) { this.listId = container; this.mode = 'list2'; this.init(); this.writeList2(); } this.grid = function(container) { this.listId = container; this.mode = 'grid'; this.init(); this.writeGrid(); } this.random = function(div, url) { this.buildPets(); divObj = document.getElementById(div); this.petsWithPic = new Array(); for (x = 0; x < this.pet.length; x++) { if (this.pet[x][this.petFields['pictmn1']['index']]) { this.petsWithPic.push(x); } } if (this.petsWithPic.length == 0) return false; var r=Math.floor(Math.random()*this.petsWithPic.length); divObj.className = 'rgPetRandom'; divObj.innerHTML = '
Featured Adoptable Pet
'+this.pet[this.petsWithPic[r]][this.petFields['pictmn1']['index']] + '
'+this.pet[this.petsWithPic[r]][this.petFields['name']['index']]+'
'+ '
'+this.pet[this.petsWithPic[r]][this.petFields['breed']['index']]+'
'; divObj.animalID = this.pet[this.petsWithPic[r]][this.petFields['animalID']['index']]; divObj.onclick = function(e) { if (url.indexOf('?') == -1) url += '?'; location.href = url+'&toolkitAnimalID='+this.animalID; } } this.featured = function(div, url, animalID) { this.buildPets(); divObj = document.getElementById(div); for (x = 0; x < this.pet.length; x++) { if (this.pet[x][this.petFields['animalID']['index']] == animalID && this.pet[x][this.petFields['pictmn1']['index']]) { var rowNumber = x; break; } } if (rowNumber === false) { alert('failed'); return false; } divObj.className = 'rgPetRandom'; divObj.innerHTML = '
Featured Adoptable Pet
'+this.pet[rowNumber][this.petFields['pictmn1']['index']] + '
'+this.pet[rowNumber][this.petFields['name']['index']]+'
'+ '
'+this.pet[rowNumber][this.petFields['breed']['index']]+'
'; divObj.animalID = animalID; divObj.onclick = function(e) { if (url.indexOf('?') == -1) url += '?'; location.href = url+'&toolkitAnimalID='+animalID; } } this.detail = function() { this.init(); this.animalID = cgiVar('toolkitAnimalID'); for (x=0; x' + ' ' + ' ' + '' + ''; if (this.paging) search += ''; if (this.paging) search += ''; search += ''; var tr = document.createElement('tr'); tr.className = 'rgPetTableHeadSearch'; var td = document.createElement('td'); td.colSpan = this.fieldsArray.length; td.align = 'center'; td.id = 'rgPetTableHeadSearch'+this.name; td.innerHTML = search; tr.appendChild(td); thead.appendChild(tr); } else if (this.paging) { search += ''; if (this.paging) search += ''+ ''+ ''; search += '
'; var tr = document.createElement('tr'); tr.className = 'rgPetTableHeadSearch'; var td = document.createElement('td'); td.colSpan = this.fieldsArray.length; td.align = 'center'; td.id = 'rgPetTableHeadSearch'+this.name; td.innerHTML = search; tr.appendChild(td); thead.appendChild(tr); } var tr = document.createElement('tr'); tr.id = 'rgPetTableHeadFields'+this.name; tr.className = 'rgPetTableHeadFields'; for (x=0; x' + this.petFields[this.fieldsArray[x]]['name'] + ''; tr.appendChild(td); } thead.appendChild(tr); table.appendChild(thead); var tbody = document.createElement('tbody'); var rowCounter=0; this.displayablePets = 0; var petsWrittenOut = 0; if (this.page) { start = (this.page-1)*this.perPage; } else { this.page = 1; start = 0; } for (var y=0; y this.page * this.perPage) continue; if (this.displayablePets <= start) continue; petsWrittenOut += 1; var tr = document.createElement('tr'); tr.rowNumber = y; tr.id = this.name+y; tr.rgPetsClassName = this.name; tr.animalID = this.pet[y][this.petFields['animalID']['index']]; if (isEven(rowCounter)) { tr.rowNumber = y; tr.origClassName = 'rgPetTableRowEven'; tr.className = 'rgPetTableRowEven'; } else { tr.origClassName = 'rgPetTableRowOdd'; tr.className = 'rgPetTableRowOdd'; } rowCounter+=1; if ('Yes' == 'Yes') { tr.onclick = function(evt) { showDetails(this.rgPetsClassName, this.rowNumber); }; tr.onmouseover = function(evt) { this.className = 'rgPetTableRowOver'; }; tr.onmouseout = function(evt) { this.className = this.origClassName; }; } else { tr.onmouseover = function(evt) { this.className = 'rgPetTableRowOverInactive'; }; tr.onmouseout = function(evt) { this.className = this.origClassName; }; } //rgPets.pet[this.rowNumber][rgPets.petFields['animalID']['index']], rgPets.detailId); }; for (x=0; x this.petFields[this.fieldsArray[x]]['listLength']) { fieldValue = fieldValue.substring(0, this.petFields[this.fieldsArray[x]]['listLength']); } } var val = '
'; val += fieldValue + '
'; if (val) { td.innerHTML = val; } tr.appendChild(td); } tbody.appendChild(tr); } if (rowCounter == 0) { var tr = document.createElement('tr'); var td = document.createElement('td'); td.colSpan = this.fieldsArray.length; td.className = 'rgPetTableRowZeroPets'; td.innerHTML = 'No pets found.'; tr.appendChild(td); tbody.appendChild(tr); } table.appendChild(tbody); petContainer.innerHTML = ''; petContainer.appendChild(table); if (this.searchText) { searchForm = eval('document.rgPetsSearchForm'+this.name); searchForm.rgPetsSearchText.value = this.searchText; } this.pages = Math.ceil(this.displayablePets/this.perPage); if (this.paging && this.displayablePets > rowCounter) { obj = document.getElementById('nextButtons'); obj2 = document.getElementById('pageCount'); obj2.innerHTML = '(page '+this.page+' of '+this.pages+' )'; if (this.pages > this.page) { obj.innerHTML = 'Next »'; } else { obj.innerHTML = 'Next »'; } obj = document.getElementById('prevButtons'); if (this.page > 1) { obj.innerHTML = '« Previous'; } else { obj.innerHTML = '« Previous'; } } } this.writeList2 = function() { var petContainer = document.getElementById(this.listId); //alert(this.listId); var table = document.createElement('table'); table.cellSpacing = 0; table.id = 'rgPetTable'+this.name; table.className = 'rgPetTable list2'; var thead = document.createElement('thead'); if (this.enableSearch) { var search = ''; search += ''; if (this.paging) search += ''; search += ''; if (this.paging) search += ''; if (this.paging) search += ''; search += '
' + ' ' + ' ' + '' + '
'; var tr = document.createElement('tr'); tr.className = 'rgPetTableHeadSearch'; var td = document.createElement('td'); td.colSpan = this.fieldsArray.length; td.align = 'center'; td.id = 'rgPetTableHeadSearch'+this.name; td.innerHTML = search; tr.appendChild(td); thead.appendChild(tr); } else if (this.paging) { var search = ''; search += ''; if (this.paging) search += ''+ ''+ ''; search += '
'; var tr = document.createElement('tr'); tr.className = 'rgPetTableHeadSearch'; var td = document.createElement('td'); td.colSpan = this.fieldsArray.length; td.align = 'center'; td.id = 'rgPetTableHeadSearch'+this.name; td.innerHTML = search; tr.appendChild(td); thead.appendChild(tr); } table.appendChild(thead); var tbody = document.createElement('tbody'); var rowCounter=0; this.displayablePets = 0; var petsWrittenOut = 0; if (this.page) { start = (this.page-1)*this.perPage; } else { this.page = 1; start = 0; } for (var y=0; y this.page * this.perPage) continue; if (this.displayablePets <= start) continue; petsWrittenOut += 1; var tr = document.createElement('tr'); tr.rowNumber = y; tr.id = this.name+y; tr.rgPetsClassName = this.name; tr.animalID = this.pet[y][this.petFields['animalID']['index']]; if (isEven(rowCounter)) { tr.rowNumber = y; tr.origClassName = 'rgPetTableRowEven'; tr.className = 'rgPetTableRowEven'; } else { tr.origClassName = 'rgPetTableRowOdd'; tr.className = 'rgPetTableRowOdd'; } rowCounter+=1; tr.onclick = function(evt) { showDetails(this.rgPetsClassName, this.rowNumber); }; //rgPets.pet[this.rowNumber][rgPets.petFields['animalID']['index']], rgPets.detailId); }; tr.onmouseover = function(evt) { this.className = 'rgPetTableRowOver'; }; tr.onmouseout = function(evt) { this.className = this.origClassName; }; td = document.createElement('td'); var str = ''; if (this.picSize == 'thumbnail') { if (this.pet[y][this.petFields['pictmn1']['index']] != '') { str += '
'+this.pet[y][this.petFields['pictmn1']['index']]+'
'; } } else if (this.picSize == 'fullsize') { if (this.pet[y][this.petFields['pic1']['index']] != '') { //alert(this.pet[y][this.petFields['pic1']['index']]); str += '
'+this.pet[y][this.petFields['pic1']['index']]+'
'; } } for (x=0; x' + '' + this.petFields[this.fieldsArray[x]]['name'] + ': ' + '' + this.pet[y][this.petFields[this.fieldsArray[x]]['index']] + '' + ''; } else { str += '
' + '' + this.pet[y][this.petFields[this.fieldsArray[x]]['index']] + '' + '
'; } } if (str) { td.innerHTML = str; } tr.appendChild(td); tbody.appendChild(tr); } table.appendChild(tbody); petContainer.innerHTML = ''; petContainer.appendChild(table); if (this.searchText) { searchForm = eval('document.rgPetsSearchForm'+this.name); searchForm.rgPetsSearchText.value = this.searchText; } this.pages = Math.ceil(this.displayablePets/this.perPage); if (this.paging && this.displayablePets > rowCounter) { obj = document.getElementById('nextButtons'); obj2 = document.getElementById('pageCount'); obj2.innerHTML = '(page '+this.page+' of '+this.pages+' )'; if (this.pages > this.page) { obj.innerHTML = 'Next »'; } else { obj.innerHTML = 'Next »'; } obj = document.getElementById('prevButtons'); if (this.page > 1) { obj.innerHTML = '« Previous'; } else { obj.innerHTML = '« Previous'; } } } this.writeGrid = function() { if (!this.perRow) this.perRow = 4; if (!this.rows) this.rows = 3; this.perPage = (this.perRow * this.rows); var petContainer = document.getElementById(this.listId); //alert(this.listId); var table = document.createElement('table'); table.cellSpacing = 0; table.id = 'rgPetTable'+this.name; table.className = 'rgPetTable grid'; var thead = document.createElement('thead'); if (this.enableSearch) { var search = ''; search += ''; if (this.paging) search += ''; search += ''; if (this.paging) search += ''; if (this.paging) search += ''; search += '
' + ' ' + ' ' + '' + '
'; var tr = document.createElement('tr'); tr.className = 'rgPetTableHeadSearch'; var td = document.createElement('td'); td.colSpan = this.perRow; td.align = 'center'; td.id = 'rgPetTableHeadSearch'+this.name; td.innerHTML = search; tr.appendChild(td); thead.appendChild(tr); } else if (this.paging) { var search = ''; if (this.paging) search += ''+ ''+ ''; search += '
'; var tr = document.createElement('tr'); tr.className = 'rgPetTableHeadSearch'; var td = document.createElement('td'); td.colSpan = this.perRow; td.align = 'center'; td.id = 'rgPetTableHeadSearch'+this.name; td.innerHTML = search; tr.appendChild(td); thead.appendChild(tr); } table.appendChild(thead); var tbody = document.createElement('tbody'); var rowCounter=0; this.displayablePets = 0; var petsWrittenOut = 0; if (this.page) { start = (this.page-1)*this.perPage; } else { this.page = 1; start = 0; } for (var y=0; y this.page * this.perPage) continue; if (this.displayablePets <= start) continue; petsWrittenOut += 1; if ((petsWrittenOut-1) % this.perRow === 0) { // We need to create a new row var tr = document.createElement('tr'); tbody.appendChild(tr); rowCounter+=1; } td = document.createElement('td'); td.className = "rgPetTableCell" + this.fieldsArray[x] + this.name; td.style.verticalAlign = 'top'; td.animalID = this.pet[y][this.petFields['animalID']['index']]; td.animalNumber = y; var val = '
' + ''; if (this.picSize == 'thumbnail') { val += ''; } else if (this.picSize == 'fullsize') { val += ''; } val += '
' + this.pet[y][this.petFields['pictmn1']['index']] + '' + this.pet[y][this.petFields['pic1']['index']] + '
'; val += '
'+this.pet[y][this.petFields['name']['index']] + '
' + '
'+this.pet[y][this.petFields['breed']['index']] + '
'; td.innerHTML = val; if ('Yes' == 'Yes') { td.rgPetsClassName = this.name; td.onclick = function(evt) { showDetails(this.rgPetsClassName, this.animalNumber, this.animalID); }; td.onmouseover = function(evt) { this.className = 'rgPetTableCellOver'; }; td.onmouseout = function(evt) { this.className = this.origClassName; }; } else { td.onmouseover = function(evt) { this.className = 'rgPetTableCellOver'; }; td.onmouseout = function(evt) { this.className = this.origClassName; }; } tr.appendChild(td); if (y == this.pet.length-1 && (petsWrittenOut-1) % this.perRow !== 0) { c = this.displayablePets; while (c % this.perRow !== 0) { td = document.createElement('td'); td.className = "rgPetTableCell" + this.fieldsArray[x] + this.name; td.innerHTML = ' '; tr.appendChild(td); c+=1; } } } if (rowCounter == 0) { var tr = document.createElement('tr'); var td = document.createElement('td'); td.colSpan = this.perRow; td.className = 'rgPetTableRowZeroPets'; td.innerHTML = 'No pets found.'; tr.appendChild(td); tbody.appendChild(tr); } table.appendChild(tbody); petContainer.innerHTML = ''; petContainer.appendChild(table); if (this.searchText) { searchForm = eval('document.rgPetsSearchForm'+this.name); searchForm.rgPetsSearchText.value = this.searchText; } this.pages = Math.ceil(this.displayablePets/this.perPage); if (this.paging && this.displayablePets > rowCounter) { obj = document.getElementById('nextButtons'+this.name); obj2 = document.getElementById('pageCount'+this.name); obj2.innerHTML = '(page '+this.page+' of '+this.pages+' )'; if (this.pages > this.page) { obj.innerHTML = 'Next »'; } else { obj.innerHTML = 'Next »'; } obj = document.getElementById('prevButtons'+this.name); if (this.page > 1) { obj.innerHTML = '« Previous'; } else { obj.innerHTML = '« Previous'; } } } this.clearList = function() { var petContainer = document.getElementById(this.listId); petContainer.innerHTML = ''; } this.clearSearch = function(form) { form.rgPetsSearchText.value = ''; this.searchText = ''; this.clearList(); if (this.mode == 'list') { this.writeList(); } else if (this.mode == 'list2') { this.writeList2(); } else if (this.mode == 'grid') { this.writeGrid(); } return false; } this.setupSearch = function(form) { this.searchText = form.rgPetsSearchText.value; this.clearList(); if (this.mode == 'list') { this.writeList(); } else if (this.mode == 'list2') { this.writeList2(); } else if (this.mode == 'grid') { this.writeGrid(); } return false; } this.sortPetArray = function(fieldIndex) { if (this.mode == 'list') { if (this.orderby == fieldIndex) { if (this.order == 'asc') { this.order = 'desc'; } else { this.order = 'asc'; } } else this.order = 'asc'; } this.pet.multiSort(fieldIndex); this.orderby = fieldIndex; if (this.order == 'desc') this.pet.reverse(); if (this.mode == 'list') { createCookie('rgOrderby',fieldIndex,3); } } this.sortPetArrayOnLoad = function(fieldIndex) { this.pet.multiSort(fieldIndex); this.orderby = fieldIndex; if (this.order == 'desc') this.pet.reverse(); if (this.mode == 'list') { createCookie('rgOrderby',fieldIndex,3); } } this.sortby = function(fieldIndex) { this.doSort(fieldIndex); this.clearList(); this.writeList(); } this.doSort = function(fieldIndex) { this.sortPetArray(fieldIndex); } this.nextPet = function() { if (this.currentDetailRow < this.pet.length-1) { nextDetailRow = this.currentDetailRow+1; nextDetailPet = this.pet[nextDetailRow][this.petFields['animalID']['index']]; } else { nextDetailRow = 0; nextDetailPet = this.pet[nextDetailRow][this.petFields['animalID']['index']]; } document.getElementById('detailFrame').src = this.detailUrl(nextDetailPet); this.currentDetailPet = nextDetailPet; this.currentDetailRow = nextDetailRow; } this.prevPet = function() { if (this.currentDetailRow > 0) { nextDetailRow = this.currentDetailRow-1; nextDetailPet = this.pet[nextDetailRow][this.petFields['animalID']['index']]; } else { nextDetailRow = this.pet.length-1; nextDetailPet = this.pet[nextDetailRow][this.petFields['animalID']['index']]; } document.getElementById('detailFrame').src = this.detailUrl(nextDetailPet); this.currentDetailPet = nextDetailPet; this.currentDetailRow = nextDetailRow; } this.detailUrl = function(animalID) { var tempURL = location.href.split('://'); if (tempURL['0'] == 'https') { var url = 'https://toolkit.rescuegroups.org'; } else { var url = 'https://toolkit.rescuegroups.org'; } url += '/javascript/v2.0/'+this.detailTemplate+'?animalID='+animalID+'&key=i2Ff6P2t&referer='; return url; } } Array.prototype.multiSort = function(index){ // Written By: WillyDuitt@hotmail.com | 03-10-2005 \\; for(var i=0; i=0; x=(x-1)){ var temp = this[i].splice(index,1); this[i].unshift(temp); } } return true; } function cgiVar(varName) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;iPrevious  Next