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 = [ ['9315932','Available','2015-11-01 11:47:35','','Abby Lee & Miller','','Dog','Shih Tzu','Shih Tzu','','Female','','','','No','','','Adult','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Abby Lee & Miller','2015-11-01 10:46:36'], ['9634163','Available','2016-02-04 13:55:30','','Abilene & Flannery','','Dog','Toy Terrier / Yorkshire Terrier Yorkie / Mixed','Toy Terrier','Yorkshire Terrier Yorkie','Female','Yes','','','No','','','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Abilene & Flannery','2016-02-04 13:55:29'], ['9634167','Available','2016-02-04 13:58:01','','Alissa Mae','','Dog','Shih Tzu / Maltese / Mixed','Shih Tzu','Maltese','Female','Yes','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Alissa Mae','2016-02-04 13:57:59'], ['10223733','Available','2016-07-01 14:21:13','','Arlen','','Dog','West Highland White Terrier Westie / Maltese','West Highland White Terrier Westie','Maltese','Male','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Arlen','2016-07-01 14:21:12'], ['4540262','Available','2013-03-17 12:06:40','','Baby Cary Grant & Baby Doris Day','','Dog','Shih Tzu / Terrier / Mixed','Shih Tzu','Terrier','Male','Yes','','','No','','','Baby','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Baby Cary Grant & Baby Doris Day','2012-05-06 10:59:24'], ['4540272','Available','2013-03-17 12:05:57','','Baby Doris Day & Baby Cary Grant','','Dog','Shih Tzu / Terrier / Mixed','Shih Tzu','Terrier','Female','Yes','','','No','','','Baby','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Baby Doris Day & Baby Cary Grant','2012-05-06 11:03:48'], ['9634174','Available','2016-02-04 13:59:46','','Baby Eugene','','Dog','Toy Terrier / Terrier / Mixed','Toy Terrier','Terrier','Male','Yes','','','No','','','Baby','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Baby Eugene','2016-02-04 13:59:46'], ['4062046','Available','2013-03-17 12:08:35','','Baby Theodore','','Dog','Terrier / Shih Tzu / Mixed','Terrier','Shih Tzu','Male','Yes','Yes','Yes','No','','','Baby','No','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Baby Theodore','2011-11-22 14:58:35'], ['8243140','Available','2015-08-02 17:25:01','','Baylor','','Dog','Shih Tzu','Shih Tzu','','','','','','No','','Yes','Adult','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Baylor','2015-02-11 18:01:00'], ['8982881','Available','2015-08-20 11:29:00','','Beba','','Dog','Labrador Retriever / Chow Chow / Mixed','Labrador Retriever','Chow Chow','Female','Yes','','','No','','Yes','Baby','','Yes','Medium','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Beba','2015-08-12 19:56:46'], ['9915397','Available','2016-04-23 17:20:07','','Ben','','Dog','Staffordshire Bull Terrier / American Bulldog / Mixed','Staffordshire Bull Terrier','American Bulldog','Male','Yes','','','No','','','Young','','Yes','Large','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Ben','2016-04-23 16:35:43'], ['10223739','Available','2016-07-01 14:23:40','','Bill & Ted','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Adult','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Bill & Ted','2016-07-01 14:23:39'], ['4293991','Available','2015-02-16 16:09:46','','Brady Boy & Paris Boy','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Senior','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Brady Boy & Paris Boy','2012-02-09 12:22:28'], ['7034881','Available','2015-10-04 17:41:11','','Buttercup Rose','','Dog','Pit Bull Terrier / Labrador Retriever / Mixed','Pit Bull Terrier','Labrador Retriever','Female','Yes','','','No','','Yes','Young','','Yes','Large','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Buttercup Rose','2014-06-02 12:22:31'], ['5989707','Available','2015-03-07 07:30:08','','Carmela Rose','','Dog','Shih Tzu','Shih Tzu','','Female','','','','No','','Yes','Adult','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Carmela Rose','2013-08-20 14:26:26'], ['8399361','Available','2015-06-02 14:14:44','','Casanova','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Adult','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Casanova','2015-03-30 17:42:07'], ['9279750','Available','2015-11-01 11:48:11','','Catriona','','Dog','Shih Tzu','Shih Tzu','','Female','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Catriona','2015-10-22 14:22:54'], ['10151315','Available','2016-06-14 15:47:07','','Chanel Rose','','Dog','Shih Tzu','Shih Tzu','','Female','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Chanel Rose','2016-06-14 15:38:07'], ['9634183','Available','2016-02-18 17:03:16','','Colin','','Dog','Yorkshire Terrier Yorkie','Yorkshire Terrier Yorkie','','Male','','','','No','','','Baby','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Colin','2016-02-04 14:02:49'], ['9722720','Available','2016-04-07 13:18:50','','Cow & Coda','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Cow & Coda','2016-02-28 16:49:33'], ['2842067','Available','2011-11-24 15:48:47','','Crystal Joy','','Dog','Shih Tzu / Pekingese / Mixed','Shih Tzu','Pekingese','Female','Yes','','','No','','','Young','No','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Crystal Joy','2010-10-04 13:53:42'], ['9891009','Available','2016-06-29 10:35:32','','Daphne Mae','','Dog','Shih Tzu','Shih Tzu','','Female','','','','No','','','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Daphne Mae','2016-04-18 15:56:39'], ['4858379','Available','2014-01-22 15:19:41','','Dearfield','','Dog','Chihuahua','Chihuahua','','Male','','','','No','','','Baby','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Dearfield','2012-08-11 12:51:26'], ['9894517','Available','2016-06-29 16:19:59','','Declan Ray','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Declan Ray','2016-04-19 16:20:40'], ['8243160','Available','2015-04-15 18:04:55','','Delphine & Frangelica','','Dog','Maltese','Maltese','','Female','','','','No','','','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Delphine & Frangelica','2015-02-11 18:13:28'], ['9634184','Available','2016-02-18 17:07:02','','Devin','','Dog','Yorkshire Terrier Yorkie','Yorkshire Terrier Yorkie','','Male','','','','No','','','Baby','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Devin','2016-02-04 14:04:31'], ['4503779','Available','2014-02-20 17:00:15','','Dusty Rose','','Dog','Lhasa Apso','Lhasa Apso','','Female','','No','','','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Dusty Rose','2012-04-22 15:26:31'], ['10223748','Available','2016-07-01 14:28:39','','Eastwood','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Eastwood','2016-07-01 14:28:38'], ['9891553','Available','2016-07-21 08:16:21','','Eleanor Rose','','Dog','Shih Tzu','Shih Tzu','','Female','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Eleanor Rose','2016-04-18 17:40:26'], ['9100868','Available','2015-11-01 11:48:34','','Emilien Joy','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Adult','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Emilien Joy','2015-09-09 15:18:17'], ['9508646','Available','2015-12-26 11:04:34','','Erica Mae','','Dog','Shih Tzu','Shih Tzu','','Female','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Erica Mae','2015-12-26 11:00:36'], ['9634194','Available','2016-04-07 13:11:28','','Eunice','','Dog','Yorkshire Terrier Yorkie','Yorkshire Terrier Yorkie','','Female','','','','No','','','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Eunice','2016-02-04 14:07:26'], ['9316452','Available','2015-11-12 14:52:02','','Farrah Lynn','','Dog','Shih Tzu','Shih Tzu','','Female','','','','No','','Yes','Adult','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Farrah Lynn','2015-11-01 11:12:42'], ['6888733','Available','2014-07-03 18:38:31','','Figgy Newton','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','','Baby','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Figgy Newton','2014-05-01 18:53:11'], ['7792770','Available','2014-10-30 18:04:25','','FitzRoy','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','FitzRoy','2014-10-30 15:40:26'], ['9722719','Available','2016-02-28 16:48:15','','Flannery','','Dog','Yorkshire Terrier Yorkie / Toy Terrier','Yorkshire Terrier Yorkie','Toy Terrier','Female','','','','No','','','Baby','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Flannery','2016-02-28 16:48:14'], ['9634199','Available','2016-02-04 14:09:45','','Forrest','','Dog','Toy Terrier / Yorkshire Terrier Yorkie / Mixed','Toy Terrier','Yorkshire Terrier Yorkie','Male','Yes','','','No','','','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Forrest','2016-02-04 14:09:43'], ['9316324','Available','2015-11-01 12:49:33','','Gene & Kelley','','Dog','Shih Tzu / Yorkshire Terrier Yorkie / Mixed','Shih Tzu','Yorkshire Terrier Yorkie','Male','Yes','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Gene & Kelley','2015-11-01 11:01:56'], ['10347970','Available','2016-07-22 12:34:32','','Gizmo Denzel','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Senior','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Gizmo Denzel','2016-07-22 12:30:13'], ['9316469','Available','2015-11-01 11:49:37','','Jacob Gino','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','','Baby','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Jacob Gino','2015-11-01 11:38:38'], ['8982739','Available','2015-11-23 16:19:46','','Jayce','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Jayce','2015-08-12 19:43:35'], ['10025708','Available','2016-06-29 10:37:19','','Jerry Lewis','','Dog','Lhasa Apso / Cavalier King Charles Spaniel / Mixed','Lhasa Apso','Cavalier King Charles Spaniel','Male','Yes','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Jerry Lewis','2016-05-20 18:22:23'], ['9316490','Available','2016-04-07 13:16:35','','Jethro & Ellie Mae','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Jethro & Ellie Mae','2015-11-01 11:59:14'], ['8851599','Available','2015-11-01 12:30:31','','Lidia','','Dog','Labrador Retriever / Staffordshire Bull Terrier / Mixed','Labrador Retriever','Staffordshire Bull Terrier','Female','Yes','','','No','','Yes','Young','','Yes','Large','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Lidia','2015-07-14 15:57:42'], ['2108407','Available','2015-02-16 16:07:02','','Lief','','Dog','Shih Tzu','Shih Tzu','','Male','','','','','','Yes','Senior','No','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Lief','2010-01-10 20:34:28'], ['9846198','Available','2016-04-07 13:45:09','','Little Gotti','','Dog','Yorkshire Terrier Yorkie','Yorkshire Terrier Yorkie','','Male','','','','No','','','Adult','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Little Gotti','2016-04-07 13:45:00'], ['9846220','Available','2016-04-07 13:52:53','','London','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','London','2016-04-07 13:52:52'], ['7983117','Available','2014-12-25 15:28:36','','Marlo & Iggy','','Dog','Shih Tzu','Shih Tzu','','Female','','','','No','','','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Marlo & Iggy','2014-12-04 17:24:09'], ['9634264','Available','2016-02-04 14:32:19','','Matteo','','Dog','Labrador Retriever / American Staffordshire Terrier / Mixed','Labrador Retriever','American Staffordshire Terrier','Male','Yes','','','No','','Yes','Young','','Yes','Large','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Matteo','2016-02-04 14:32:17'], ['10025702','Available','2016-06-29 10:38:44','','Mickey & HuHu','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Mickey & HuHu','2016-05-20 18:20:32'], ['9634228','Available','2016-04-07 13:08:33','','Milan','','Dog','Yorkshire Terrier Yorkie / Toy Terrier','Yorkshire Terrier Yorkie','Toy Terrier','Male','','','','No','','','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Milan','2016-02-04 14:19:47'], ['5266264','Available','2014-01-22 15:44:52','','Morgan','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Morgan','2012-12-26 14:44:34'], ['5357944','Available','2013-01-27 14:47:20','','Morgan Rose','','Dog','Shih Tzu','Shih Tzu','','Female','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Morgan Rose','2013-01-27 14:47:18'], ['10262708','Available','2016-07-11 07:12:46','','Niki Rose','','Dog','Shih Tzu','Shih Tzu','','Female','','','','No','','Yes','Senior','Yes','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Niki Rose','2016-07-10 11:08:39'], ['9634232','Available','2016-02-04 14:22:05','','Nikko','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Adult','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Nikko','2016-02-04 14:22:03'], ['9279784','Available','2015-11-01 12:20:53','','Oreo Mio','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Adult','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Oreo Mio','2015-10-22 14:36:30'], ['1805805','Available','2014-09-04 14:47:27','','Orlando','Bought as a gift to someone who doesn\'t like dogs, Orlando had a rough start, but is learning to be happy and loved.','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','','Young','No','Yes','Small','Yes','Black with White','','','No','No','','','','','','','','','','','','','','','','','','','','','Orlando','2009-09-11 11:15:24'], ['10025712','Available','2016-06-29 10:40:06','','Paul Newman','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Paul Newman','2016-05-20 18:24:26'], ['6827639','Available','2014-04-11 18:13:08','','Paulie Rose & Molly Joy','','Dog','Toy Terrier','Toy Terrier','','Female','','','','No','','','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Paulie Rose & Molly Joy','2014-04-11 17:43:30'], ['6322103','Available','2016-05-23 14:02:43','','Peony Flower','','Dog','Maltese','Maltese','','Female','','','','No','','','Adult','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Peony Flower','2013-11-18 16:15:08'], ['1805849','Available','2015-02-19 09:39:36','','Ranger','Gorgeous little guy, grumpy at times, looking for someone with a sense of humor.','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','','Senior','No','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Ranger','2009-09-11 11:20:21'], ['3947185','Available','2015-02-18 13:42:39','','Rico & Kalie','','Dog','Pomeranian','Pomeranian','','Male','','','','No','','','Senior','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Rico & Kalie','2011-10-14 07:00:40'], ['6567392','Available','2014-03-08 18:54:37','','Romeo','','Dog','Rottweiler / Labrador Retriever / Mixed','Rottweiler','Labrador Retriever','Male','Yes','','','No','','','Young','','Yes','Medium','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Romeo','2014-01-24 17:09:43'], ['3227438','Available','2013-03-17 12:09:18','','Rosie & Posie','','Dog','Yorkshire Terrier Yorkie / Chihuahua / Mixed','Yorkshire Terrier Yorkie','Chihuahua','Female','Yes','','','No','','','Baby','','','Small','','','','','No','No','','','','','','','','','','','','','','','','','','','','','Rosie & Posie','2011-02-22 11:19:16'], ['10260023','Available','2016-07-09 18:26:07','','Sadie Grace','','Dog','Shih Tzu','Shih Tzu','','Female','','','','No','','Yes','Adult','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Sadie Grace','2016-07-09 17:51:09'], ['5934949','Available','2015-08-02 17:24:25','','Samantha Rose','','Dog','Terrier','Terrier','','Female','','','','','','','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Samantha Rose','2013-08-03 15:03:30'], ['8243216','Available','2015-03-13 17:11:49','','Sasha & Scarlett','','Dog','Terrier / Shih Tzu / Mixed','Terrier','Shih Tzu','Female','Yes','','','No','','','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Sasha & Scarlett','2015-02-11 18:38:26'], ['9634236','Available','2016-04-07 13:14:02','','Sophia & Tobi','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Sophia & Tobi','2016-02-04 14:24:03'], ['8243220','Available','2015-02-11 18:40:50','','Spice','','Dog','Labrador Retriever / Rhodesian Ridgeback / Mixed','Labrador Retriever','Rhodesian Ridgeback','Female','Yes','','','No','','Yes','Young','','Yes','Medium','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Spice','2015-02-11 18:40:49'], ['1805957','Available','2015-02-16 15:57:18','','Spice & Sugar','Must be adopted with her sister Sugar','Dog','Terrier','Terrier','','Female','','','','No','','','Senior','No','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Spice & Sugar','2009-09-11 11:36:48'], ['9316493','Available','2015-11-01 12:02:49','','Taylor Rose','','Dog','Poodle (unknown type) / Shih Tzu / Mixed','Poodle (unknown type)','Shih Tzu','Female','Yes','','','No','','Yes','Adult','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Taylor Rose','2015-11-01 12:02:48'], ['9846229','Available','2016-04-07 13:59:03','','Tennesse','','Dog','Shih Tzu','Shih Tzu','','Male','','','','No','','','Baby','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Tennesse','2016-04-07 13:58:57'], ['5436132','Available','2015-10-04 17:41:33','','Toby','','Dog','American Bulldog / Labrador Retriever / Mixed','American Bulldog','Labrador Retriever','Male','Yes','','','No','','Yes','Young','','Yes','Large','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Toby','2013-02-25 18:04:59'], ['2290893','Available','2014-04-10 18:00:19','','Trixie','','Dog','Chow Chow / Labrador Retriever / Mixed','Chow Chow','Labrador Retriever','Female','Yes','No','','','','','Young','No','','Medium','','','','','No','No','','','','','','','','','','','','','','','','','','','','','Trixie','2010-03-19 15:28:56'], ['5625789','Available','2013-05-04 16:13:01','','Tulip','','Dog','Labrador Retriever / Spaniel / Mixed','Labrador Retriever','Spaniel','Female','Yes','','','','','Yes','Young','','Yes','Medium','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Tulip','2013-05-04 16:07:20'], ['10223716','Available','2016-07-01 14:14:33','','Vinnie Ray','','Dog','Shih Tzu','Shih Tzu','','Male','','','','','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Vinnie Ray','2016-07-01 14:14:32'], ['9634206','Available','2016-02-04 14:12:41','','Wells','','Dog','Toy Terrier / Yorkshire Terrier Yorkie / Mixed','Toy Terrier','Yorkshire Terrier Yorkie','Male','Yes','','','No','','','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Wells','2016-02-04 14:12:38'], ['3651762','Available','2012-06-07 12:40:11','','Winifred Mae','','Dog','Shih Tzu / Yorkshire Terrier Yorkie / Mixed','Shih Tzu','Yorkshire Terrier Yorkie','Female','Yes','','','No','','','Baby','','','Small','','','','','No','No','','','','','','','','','','','','','','','','','','','','','Winifred Mae','2011-07-16 19:48:57'], ['9634276','Available','2016-02-04 14:34:59','','Zach','','Dog','Maltese','Maltese','','Male','','','','No','','Yes','Young','','Yes','Small','Yes','','','','No','No','','','','','','','','','','','','','','','','','','','','','Zach','2016-02-04 14:34:56'] ]; } 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 ('No' == '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 ('No' == '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=bl61Hbze&referer=http%3A%2F%2Fwww.shihtzurescue.org%2Fas%2Fhome.shtml'; 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