Advertisement
Guest User

working as of 7:37pm sept2

a guest
Sep 2nd, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 131.46 KB | None | 0 0
  1. var gvarJasURL = form_data.gvar_dev_jasper_url;
  2. var gvarASPURL = form_data.gvar_dev_asp_url;
  3.  
  4. //-------------------- ADDRESS VALIDATION
  5. function addressValidation(){
  6. var cities = ['Bangued','Boliney','Bucay','Bucloc','Daguioman','Danglas','Dolores','La Paz','Lacub','Lagangilang','Lagayan','Langiden','Licuan-Baay','Luba','Malibcong','Manabo','Peñarrubia','Pidigan','Pilar','Sallapadan','San Isidro','San Juan','San Quintin','Tayum','Tineg','Tubo','Villaviciosa','Butuan City','Buenavista','Cabadbaran','Carmen','Jabonga','Kitcharao','Las Nieves','Magallanes','Nasipit','Remedios T. Romualdez','Santiago','Tubay','Bayugan','Bunawan','Esperanza','La Paz','Loreto','Prosperidad','Rosario','San Francisco','San Luis','Santa Josefa','Sibagat','Talacogon','Trento','Veruela','Altavas','Balete','Banga','Batan','Buruanga','Ibajay','Kalibo','Lezo','Libacao','Madalag','Makato','Malay','Malinao','Nabas','New Washington','Numancia','Tangalan','Legazpi City','Ligao City','Tabaco City','Bacacay','Camalig','Daraga','Guinobatan','Jovellar','Libon','Malilipot','Malinao','Manito','Oas','Pio Duran','Polangui','Rapu-Rapu','Santo Domingo','Tiwi','Anini-y','Barbaza','Belison','Bugasong','Caluya','Culasi','Hamtic','Laua-an','Libertad','Pandan','Patnongon','San Jose','San Remigio','Sebaste','Sibalom','Tibiao','Tobias Fornier','Valderrama','Calanasan','Conner','Flora','Kabugao','Luna','Pudtol','Santa Marcela','Baler','Casiguran','Dilasag','Dinalungan','Dingalan','Dipaculao','Maria Aurora','San Luis','Isabela City','Akbar','Al-Barka','Hadji Mohammad Ajul','Hadji Muhtamad','Lamitan','Lantawan','Maluso','Sumisip','Tabuan-Lasa','Tipo-Tipo','Tuburan','Ungkaya Pukan','Balanga City','Abucay','Bagac','Dinalupihan','Hermosa','Limay','Mariveles','Morong','Orani','Orion','Pilar','Samal','Basco','Itbayat','Ivana','Mahatao','Sabtang','Uyugan','Batangas City','Lipa City','Tanauan City','Agoncillo','Alitagtag','Balayan','Balete','Bauan','Calaca','Calatagan','Cuenca','Ibaan','Laurel','Lemery','Lian','Lobo','Mabini','Malvar','Mataas na Kahoy','Nasugbu','Padre Garcia','Rosario','San Jose','San Juan','San Luis','San Nicolas','San Pascual','Santa Teresita','Santo Tomas','Taal','Talisay','Taysan','Tingloy','Tuy','Baguio City','Atok','Bakun','Bokod','Buguias','Itogon','Kabayan','Kapangan','Kibungan','La Trinidad','Mankayan','Sablan','Tuba','Tublay','Almeria','Biliran','Cabucgayan','Caibiran','Culaba','Kawayan','Maripipi','Naval','Tagbilaran City','Alburquerque','Alicia','Anda','Antequera','Baclayon','Balilihan','Batuan','Bien Unido','Bilar','Buenavista','Calape','Candijay','Carmen','Catigbian','Clarin','Corella','Cortes','Dagohoy','Danao','Dauis','Dimiao','Duero','Garcia Hernandez','Getafe','Guindulman','Inabanga','Jagna','Lila','Loay','Loboc','Loon','Mabini','Maribojoc','Panglao','Pilar','President Carlos P. Garcia','Sagbayan','San Isidro','San Miguel','Sevilla','Sierra Bullones','Sikatuna','Talibon','Trinidad','Tubigon','Ubay','Valencia','Malaybalay City','Valencia City','Baungon','Cabanglasan','Damulog','Dangcagan','Don Carlos','Impasug-ong','Kadingilan','Kalilangan','Kibawe','Kitaotao','Lantapan','Libona','Malitbog','Manolo Fortich','Maramag','Pangantucan','Quezon','San Fernando','Sumilao','Talakag','Malolos City','Meycauayan City','San Jose del Monte City','Angat','Balagtas','Baliuag','Bocaue','Bulacan','Bustos','Calumpit','Doña Remedios Trinidad','Guiguinto','Hagonoy','Marilao','Norzagaray','Obando','Pandi','Paombong','Plaridel','Pulilan','San Ildefonso','San Miguel','San Rafael','Santa Maria','Tuguegarao City','Abulug','Alcala','Allacapan','Amulung','Aparri','Baggao','Ballesteros','Buguey','Calayan','Camalaniugan','Claveria','Enrile','Gattaran','Gonzaga','Iguig','Lal-lo','Lasam','Pamplona','Peñablanca','Piat','Rizal','Sanchez-Mira','Santa Ana','Santa Praxedes','Santa Teresita','Santo Niño','Solana','Tuao','Basud','Capalonga','Daet','Jose Panganiban','Labo','Mercedes','Paracale','San Lorenzo Ruiz','San Vicente','Santa Elena','Talisay','Vinzons','Iriga City','Naga City','Baao','Balatan','Bato','Bombon','Buhi','Bula','Cabusao','Calabanga','Camaligan','Canaman','Caramoan','Del Gallego','Gainza','Garchitorena','Goa','Lagonoy','Libmanan','Lupi','Magarao','Milaor','Minalabac','Nabua','Ocampo','Pamplona','Pasacao','Pili','Presentacion','Ragay','Sagñay','San Fernando','San Jose','Sipocot','Siruma','Tigaon','Tinambac','Catarman','Guinsiliban','Mahinog','Mambajao','Sagay','Roxas City','Cuartero','Dao','Dumalag','Dumarao','Ivisan','Jamindan','Ma-ayon','Mambusao','Panay','Panitan','Pilar','Pontevedra','President Roxas','Sapi-an','Sigma','Tapaz','Bagamanoc','Baras','Bato','Caramoran','Gigmoto','Pandan','Panganiban','San Andres','San Miguel','Viga','Virac','Cavite City','Dasmariñas City','Tagaytay City','Trece Martires City','Alfonso','Amadeo','Bacoor','Carmona','General Mariano Alvarez','General Emilio Aguinaldo','General Trias','Imus','Indang','Kawit','Magallanes','Maragondon','Mendez','Naic','Noveleta','Rosario','Silang','Tanza','Ternate','Bogo City','Cebu City','Carcar City','Danao City','Lapu-Lapu City','Mandaue City','Naga City','Talisay City','Toledo City','Alcantara','Alcoy','Alegria','Aloguinsan','Argao','Asturias','Badian','Balamban','Bantayan','Barili','Boljoon','Borbon','Carmen','Catmon','Compostela','Consolacion','Cordoba','Daanbantayan','Dalaguete','Dumanjug','Ginatilan','Liloan','Madridejos','Malabuyoc','Medellin','Minglanilla','Moalboal','Oslob','Pilar','Pinamungahan','Poro','Ronda','Samboan','San Fernando','San Francisco','San Remigio','Santa Fe','Santander','Sibonga','Sogod','Tabogon','Tabuelan','Tuburan','Tudela','Compostela','Laak','Mabini','Maco','Maragusan','Mawab','Monkayo','Montevista','Nabunturan','New Bataan','Pantukan','Kidapawan City','Alamada','Aleosan','Antipas','Arakan','Banisilan','Carmen','Kabacan','Libungan','Mlang','Magpet','Makilala','Matalam','Midsayap','Pigkawayan','Pikit','President Roxas','Tulunan','Panabo City','Island Garden City of Samal','Tagum City','Asuncion','Braulio E. Dujali','Carmen','Kapalong','New Corella','San Isidro','Santo Tomas','Talaingod','Davao City','Digos City','Bansalan','Don Marcelino','Hagonoy','Jose Abad Santos','Kiblawan','Magsaysay','Malalag','Malita','Matanao','Padada','Santa Cruz','Santa Maria','Sarangani','Sulop','Mati City','Baganga','Banaybanay','Boston','Caraga','Cateel','Governor Generoso','Lupon','Manay','San Isidro','Tarragona','Arteche','Balangiga','Balangkayan','Borongan','Can-avid','Dolores','General MacArthur','Giporlos','Guiuan','Hernani','Jipapad','Lawaan','Llorente','Maslog','Maydolong','Mercedes','Oras','Quinapondan','Salcedo','San Julian','San Policarpo','Sulat','Taft','Buenavista','Jordan','Nueva Valencia','San Lorenzo','Sibunag','Aguinaldo','Alfonso Lista','Asipulo','Banaue','Hingyon','Hungduan','Kiangan','Lagawe','Lamut','Mayoyao','Tinoc','Batac City','Laoag City','Adams','Bacarra','Badoc','Bangui','Banna','Burgos','Carasi','Currimao','Dingras','Dumalneg','Marcos','Nueva Era','Pagudpud','Paoay','Pasuquin','Piddig','Pinili','San Nicolas','Sarrat','Solsona','Vintar','Candon City','Vigan City','Alilem','Banayoyo','Bantay','Burgos','Cabugao','Caoayan','Cervantes','Galimuyod','Gregorio Del Pilar','Lidlidda','Magsingal','Nagbukel','Narvacan','Quirino','Salcedo','San Emilio','San Esteban','San Ildefonso','San Juan','San Vicente','Santa','Santa Catalina','Santa Cruz','Santa Lucia','Santa Maria','Santiago','Santo Domingo','Sigay','Sinait','Sugpon','Suyo','Tagudin','Iloilo City','Passi City','Ajuy','Alimodian','Anilao','Badiangan','Balasan','Banate','Barotac Nuevo','Barotac Viejo','Batad','Bingawan','Cabatuan','Calinog','Carles','Concepcion','Dingle','Dueñas','Dumangas','Estancia','Guimbal','Igbaras','Janiuay','Lambunao','Leganes','Lemery','Leon','Maasin','Miagao','Mina','New Lucena','Oton','Pavia','Pototan','San Dionisio','San Enrique','San Joaquin','San Miguel','San Rafael','Santa Barbara','Sara','Tigbauan','Tubungan','Zarraga','Cauayan City','Santiago City','Alicia','Angadanan','Aurora','Benito Soliven','Burgos','Cabagan','Cabatuan','Cordon','Delfin Albano','Dinapigue','Divilacan','Echague','Gamu','Ilagan','Jones','Luna','Maconacon','Mallig','Naguilian','Palanan','Quezon','Quirino','Ramon','Reina Mercedes','Roxas','San Agustin','San Guillermo','San Isidro','San Manuel','San Mariano','San Mateo','San Pablo','Santa Maria','Santo Tomas','Tumauini','Tabuk','Balbalan','Lubuagan','Pasil','Pinukpuk','Rizal','Tanudan','Tinglayan','San Fernando City','Agoo','Aringay','Bacnotan','Bagulin','Balaoan','Bangar','Bauang','Burgos','Caba','Luna','Naguilian','Pugo','Rosario','San Gabriel','San Juan','Santo Tomas','Santol','Sudipen','Tubao','Biñan City','Calamba City','San Pablo City','Santa Rosa City','Alaminos','Bay','Cabuyao','Calauan','Cavinti','Famy','Kalayaan','Liliw','Los Baños','Luisiana','Lumban','Mabitac','Magdalena','Majayjay','Nagcarlan','Paete','Pagsanjan','Pakil','Pangil','Pila','Rizal','San Pedro','Santa Cruz','Santa Maria','Siniloan','Victoria','Iligan City','Bacolod','Baloi','Baroy','Kapatagan','Kauswagan','Kolambugan','Lala','Linamon','Magsaysay','Maigo','Matungao','Munai','Nunungan','Pantao Ragat','Pantar','Poona Piagapo','Salvador','Sapad','Sultan Naga Dimaporo','Tagoloan','Tangcal','Tubod','Marawi City','Bacolod-Kalawi','Balabagan','Balindong','Bayang','Binidayan','Buadiposo-Buntong','Bubong','Bumbaran','Butig','Calanogas','Ditsaan-Ramain','Ganassi','Kapai','Kapatagan','Lumba-Bayabao','Lumbaca-Unayan','Lumbatan','Lumbayanague','Madalum','Madamba','Maguing','Malabang','Marantao','Marogong','Masiu','Mulondo','Pagayawan','Piagapo','Poona Bayabao','Pualas','Saguiaran','Sultan Dumalondong','Picong','Tagoloan II','Tamparan','Taraka','Tubaran','Tugaya','Wao','Ormoc City','Tacloban City','Abuyog','Alangalang','Albuera','Babatngon','Barugo','Bato','Baybay','Burauen','Calubian','Capoocan','Carigara','Dagami','Dulag','Hilongos','Hindang','Inopacan','Isabel','Jaro','Javier','Julita','Kananga','La Paz','Leyte','Liloan','MacArthur','Mahaplag','Matag-ob','Matalom','Mayorga','Merida','Palo','Palompon','Pastrana','San Isidro','San Miguel','Santa Fe','Sogod','Tabango','Tabontabon','Tanauan','Tolosa','Tunga','Villaba','Cotabato City','Ampatuan','Barira','Buldon','Buluan','Datu Abdullah Sangki','Datu Anggal Midtimbang','Datu Blah T. Sinsuat','Datu Hoffer Ampatuan','Datu Montawal','Datu Odin Sinsuat','Datu Paglas','Datu Piang','Datu Salibo','Datu Saudi-Ampatuan','Datu Unsay','General Salipada K. Pendatun','Guindulungan','Kabuntalan','Mamasapano','Mangudadatu','Matanog','Northern Kabuntalan','Pagalungan','Paglat','Pandag','Parang','Rajah Buayan','Shariff Aguak','Shariff Saydona Mustapha','South Upi','Sultan Kudarat','Sultan Mastura','Sultan sa Barongis','Talayan','Talitay','Upi','Boac','Buenavista','Gasan','Mogpog','Santa Cruz','Torrijos','Masbate City','Aroroy','Baleno','Balud','Batuan','Cataingan','Cawayan','Claveria','Dimasalang','Esperanza','Mandaon','Milagros','Mobo','Monreal','Palanas','Pio V. Corpuz','Placer','San Fernando','San Jacinto','San Pascual','Uson','Caloocan','Las Piñas','Makati','Malabon','Mandaluyong','Manila','Marikina','Muntinlupa','Navotas','Parañaque','Pasay','Pasig','Quezon City','San Juan City','Taguig','Valenzuela City','Pateros','Oroquieta City','Ozamiz City','Tangub City','Aloran','Baliangao','Bonifacio','Calamba','Clarin','Concepcion','Don Victoriano Chiongbian','Jimenez','Lopez Jaena','Panaon','Plaridel','Sapang Dalaga','Sinacaban','Tudela','Cagayan de Oro','Gingoog City','Alubijid','Balingasag','Balingoan','Binuangan','Claveria','El Salvador','Gitagum','Initao','Jasaan','Kinoguitan','Lagonglong','Laguindingan','Libertad','Lugait','Magsaysay','Manticao','Medina','Naawan','Opol','Salay','Sugbongcogon','Tagoloan','Talisayan','Villanueva','Barlig','Bauko','Besao','Bontoc','Natonin','Paracelis','Sabangan','Sadanga','Sagada','Tadian','Bacolod City','Bago City','Cadiz City','Escalante City','Himamaylan City','Kabankalan City','La Carlota City','Sagay City','San Carlos City','Silay City','Sipalay City','Talisay City','Victorias City','Binalbagan','Calatrava','Candoni','Cauayan','Enrique B. Magalona','Hinigaran','Hinoba-an','Ilog','Isabela','La Castellana','Manapla','Moises Padilla','Murcia','Pontevedra','Pulupandan','Salvador Benedicto','San Enrique','Toboso','Valladolid','Bais City','Bayawan City','Canlaon City','Guihulngan City','Dumaguete City','Tanjay City','Amlan','Ayungon','Bacong','Basay','Bindoy','Dauin','Jimalalud','La Libertad','Mabinay','Manjuyod','Pamplona','San Jose','Santa Catalina','Siaton','Sibulan','Tayasan','Valencia','Vallehermoso','Zamboanguita','Allen','Biri','Bobon','Capul','Catarman','Catubig','Gamay','Laoang','Lapinig','Las Navas','Lavezares','Lope de Vega','Mapanas','Mondragon','Palapag','Pambujan','Rosario','San Antonio','San Isidro','San Jose','San Roque','San Vicente','Silvino Lobos','Victoria','Cabanatuan City','Gapan City','Science City of Muñoz','Palayan City','San Jose City','Aliaga','Bongabon','Cabiao','Carranglan','Cuyapo','Gabaldon','General Mamerto Natividad','General Tinio','Guimba','Jaen','Laur','Licab','Llanera','Lupao','Nampicuan','Pantabangan','Peñaranda','Quezon','Rizal','San Antonio','San Isidro','San Leonardo','Santa Rosa','Santo Domingo','Talavera','Talugtug','Zaragoza','Alfonso Castaneda','Ambaguio','Aritao','Bagabag','Bambang','Bayombong','Diadi','Dupax del Norte','Dupax del Sur','Kasibu','Kayapa','Quezon','Santa Fe','Solano','Villaverde','Abra de Ilog','Calintaan','Looc','Lubang','Magsaysay','Mamburao','Paluan','Rizal','Sablayan','San Jose','Santa Cruz','Calapan City','Baco','Bansud','Bongabong','Bulalacao','Gloria','Mansalay','Naujan','Pinamalayan','Pola','Puerto Galera','Roxas','San Teodoro','Socorro','Victoria','Puerto Princesa City','Aborlan','Agutaya','Araceli','Balabac','Bataraza','Brookes Point','Busuanga','Cagayancillo','Coron','Culion','Cuyo','Dumaran','El Nido','Kalayaan','Linapacan','Magsaysay','Narra','Quezon','Rizal','Roxas','San Vicente','Sofronio Española','Taytay','Angeles City','City of San Fernando','Apalit','Arayat','Bacolor','Candaba','Floridablanca','Guagua','Lubao','Mabalacat','Macabebe','Magalang','Masantol','Mexico','Minalin','Porac','San Luis','San Simon','Santa Ana','Santa Rita','Santo Tomas','Sasmuan','Alaminos City','Dagupan City','San Carlos City','Urdaneta City','Agno','Aguilar','Alcala','Anda','Asingan','Balungao','Bani','Basista','Bautista','Bayambang','Binalonan','Binmaley','Bolinao','Bugallon','Burgos','Calasiao','Dasol','Infanta','Labrador','Laoac','Lingayen','Mabini','Malasiqui','Manaoag','Mangaldan','Mangatarem','Mapandan','Natividad','Pozzorubio','Rosales','San Fabian','San Jacinto','San Manuel','San Nicolas','San Quintin','Santa Barbara','Santa Maria','Santo Tomas','Sison','Sual','Tayug','Umingan','Urbiztondo','Villasis','Lucena City','Tayabas City','Agdangan','Alabat','Atimonan','Buenavista','Burdeos','Calauag','Candelaria','Catanauan','Dolores','General Luna','General Nakar','Guinayangan','Gumaca','Infanta','Jomalig','Lopez','Lucban','Macalelon','Mauban','Mulanay','Padre Burgos','Pagbilao','Panukulan','Patnanungan','Perez','Pitogo','Plaridel','Polillo','Quezon','Real','Sampaloc','San Andres','San Antonio','San Francisco','San Narciso','Sariaya','Tagkawayan','Tiaong','Unisan','Aglipay','Cabarroguis','Diffun','Maddela','Nagtipunan','Saguday','Antipolo City','Angono','Baras','Binangonan','Cainta','Cardona','Jalajala','Morong','Pililla','Rodriguez','San Mateo','Tanay','Taytay','Teresa','Alcantara','Banton','Cajidiocan','Calatrava','Concepcion','Corcuera','Ferrol','Looc','Magdiwang','Odiongan','Romblon','San Agustin','San Andres','San Fernando','San Jose','Santa Fe','Santa Maria','Calbayog City','Catbalogan City','Almagro','Basey','Calbiga','Daram','Gandara','Hinabangan','Jiabong','Marabut','Matuguinao','Motiong','Pagsanghan','Paranas','Pinabacdao','San Jorge','San Jose De Buan','San Sebastian','Santa Margarita','Santa Rita','Santo Niño','Tagapul-an','Talalora','Tarangnan','Villareal','Zumarraga','Alabel','Glan','Kiamba','Maasim','Maitum','Malapatan','Malungon','Enrique Villanueva','Larena','Lazi','Maria','San Juan','Siquijor','Sorsogon City','Barcelona','Bulan','Bulusan','Casiguran','Castilla','Donsol','Gubat','Irosin','Juban','Magallanes','Matnog','Pilar','Prieto Diaz','Santa Magdalena','General Santos City','Koronadal City','Banga','Lake Sebu','Norala','Polomolok','Santo Niño','Surallah','Tboli','Tampakan','Tantangan','Tupi','Maasin City','Anahawan','Bontoc','Hinunangan','Hinundayan','Libagon','Liloan','Limasawa','Macrohon','Malitbog','Padre Burgos','Pintuyan','Saint Bernard','San Francisco','San Juan','San Ricardo','Silago','Sogod','Tomas Oppus','Tacurong City','Bagumbayan','Columbio','Esperanza','Isulan','Kalamansig','Lambayong','Lebak','Lutayan','Palimbang','President Quirino','Senator Ninoy Aquino','Banguingui','Hadji Panglima Tahil','Indanan','Jolo','Kalingalan Caluang','Lugus','Luuk','Maimbung','Old Panamao','Omar','Pandami','Panglima Estino','Pangutaran','Parang','Pata','Patikul','Siasi','Talipao','Tapul','Surigao City','Alegria','Bacuag','Basilisa','Burgos','Cagdianao','Claver','Dapa','Del Carmen','Dinagat','General Luna','Gigaquit','Libjo','Loreto','Mainit','Malimono','Pilar','Placer','San Benito','San Francisco','San Isidro','San Jose','Santa Monica','Sison','Socorro','Tagana-an','Tubajon','Tubod','Bislig City','Tandag City','Barobo','Bayabas','Cagwait','Cantilan','Carmen','Carrascal','Cortes','Hinatuan','Lanuza','Lianga','Lingig','Madrid','Marihatag','San Agustin','San Miguel','Tagbina','Tago','Tarlac City','Anao','Bamban','Camiling','Capas','Concepcion','Gerona','La Paz','Mayantoc','Moncada','Paniqui','Pura','Ramos','San Clemente','San Jose','San Manuel','Santa Ignacia','Victoria','Bongao','Languyan','Mapun','Panglima Sugala','Sapa-Sapa','Sibutu','Simunul','Sitangkai','South Ubian','Tandubas','Turtle Islands','Olongapo City','Botolan','Cabangan','Candelaria','Castillejos','Iba','Masinloc','Palauig','San Antonio','San Felipe','San Marcelino','San Narciso','Santa Cruz','Subic','Dapitan City','Dipolog City','Bacungan','Baliguian','Godod','Gutalac','Jose Dalman','Kalawit','Katipunan','La Libertad','Labason','Liloy','Manukan','Mutia','Piñan','Polanco','President Manuel A. Roxas','Rizal','Salug','Sergio Osmeña Sr.','Siayan','Sibuco','Sibutad','Sindangan','Siocon','Sirawai','Tampilisan','Pagadian City','Zamboanga City','Aurora','Bayog','Dimataling','Dinas','Dumalinao','Dumingag','Guipos','Josefina','Kumalarang','Labangan','Lakewood','Lapuyan','Mahayag','Margosatubig','Midsalip','Molave','Pitogo','Ramon Magsaysay','San Miguel','San Pablo','Sominot','Tabina','Tambulig','Tigbao','Tukuran','Vincenzo A. Sagun','Alicia','Buug','Diplahan','Imelda','Ipil','Kabasalan','Mabuhay','Malangas','Naga','Olutanga','Payao','Roseller Lim','Siay','Talusan','Titay','Tungawan'];
  7. var citiesProvinceID = ['1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','2','2','2','2','2','2','2','2','2','2','2','2','3','3','3','3','3','3','3','3','3','3','3','3','3','3','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','5','5','5','5','5','5','5','5','5','5','5','5','5','5','5','5','5','5','6','6','6','6','6','6','6','6','6','6','6','6','6','6','6','6','6','6','7','7','7','7','7','7','7','8','8','8','8','8','8','8','8','9','9','9','9','9','9','9','9','9','9','9','9','9','10','10','10','10','10','10','10','10','10','10','10','10','11','11','11','11','11','11','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','12','13','13','13','13','13','13','13','13','13','13','13','13','13','13','14','14','14','14','14','14','14','14','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15','16','16','16','16','16','16','16','16','16','16','16','16','16','16','16','16','16','16','16','16','16','16','17','17','17','17','17','17','17','17','17','17','17','17','17','17','17','17','17','17','17','17','17','17','17','17','18','18','18','18','18','18','18','18','18','18','18','18','18','18','18','18','18','18','18','18','18','18','18','18','18','18','18','18','18','19','19','19','19','19','19','19','19','19','19','19','19','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','20','21','21','21','21','21','22','22','22','22','22','22','22','22','22','22','22','22','22','22','22','22','22','23','23','23','23','23','23','23','23','23','23','23','24','24','24','24','24','24','24','24','24','24','24','24','24','24','24','24','24','24','24','24','24','24','24','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','25','26','26','26','26','26','26','26','26','26','26','26','27','27','27','27','27','27','27','27','27','27','27','27','27','27','27','27','27','27','28','28','28','28','28','28','28','28','28','28','28','29','29','29','29','29','29','29','29','29','29','29','29','29','29','29','29','30','30','30','30','30','30','30','30','30','30','30','31','31','31','31','31','31','31','31','31','31','31','31','31','31','31','31','31','31','31','31','31','31','31','32','32','32','32','32','33','33','33','33','33','33','33','33','33','33','33','34','34','34','34','34','34','34','34','34','34','34','34','34','34','34','34','34','34','34','34','34','34','34','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','35','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','36','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','37','38','38','38','38','38','38','38','38','39','39','39','39','39','39','39','39','39','39','39','39','39','39','39','39','39','39','39','39','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','40','41','41','41','41','41','41','41','41','41','41','41','41','41','41','41','41','41','41','41','41','41','41','41','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','42','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','43','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','44','45','45','45','45','45','45','46','46','46','46','46','46','46','46','46','46','46','46','46','46','46','46','46','46','46','46','46','47','47','47','47','47','47','47','47','47','47','47','47','47','47','47','47','47','48','48','48','48','48','48','48','48','48','48','48','48','48','48','48','48','48','49','49','49','49','49','49','49','49','49','49','49','49','49','49','49','49','49','49','49','49','49','49','49','49','49','49','50','50','50','50','50','50','50','50','50','50','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','51','52','52','52','52','52','52','52','52','52','52','52','52','52','52','52','52','52','52','52','52','52','52','52','52','52','53','53','53','53','53','53','53','53','53','53','53','53','53','53','53','53','53','53','53','53','53','53','53','53','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','54','55','55','55','55','55','55','55','55','55','55','55','55','55','55','55','56','56','56','56','56','56','56','56','56','56','56','57','57','57','57','57','57','57','57','57','57','57','57','57','57','57','58','58','58','58','58','58','58','58','58','58','58','58','58','58','58','58','58','58','58','58','58','58','58','58','59','59','59','59','59','59','59','59','59','59','59','59','59','59','59','59','59','59','59','59','59','59','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','60','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','61','62','62','62','62','62','62','63','63','63','63','63','63','63','63','63','63','63','63','63','63','64','64','64','64','64','64','64','64','64','64','64','64','64','64','64','64','64','65','65','65','65','65','65','65','65','65','65','65','65','65','65','65','65','65','65','65','65','65','65','65','65','65','65','66','66','66','66','66','66','66','67','67','67','67','67','67','68','68','68','68','68','68','68','68','68','68','68','68','68','68','68','69','69','69','69','69','69','69','69','69','69','69','69','70','70','70','70','70','70','70','70','70','70','70','70','70','70','70','70','70','70','70','71','71','71','71','71','71','71','71','71','71','71','71','72','72','72','72','72','72','72','72','72','72','72','72','72','72','72','72','72','72','72','73','73','73','73','73','73','73','73','73','73','73','73','73','73','73','73','73','73','73','73','73','73','73','73','73','73','73','73','74','74','74','74','74','74','74','74','74','74','74','74','74','74','74','74','74','74','74','75','75','75','75','75','75','75','75','75','75','75','75','75','75','75','75','75','75','76','76','76','76','76','76','76','76','76','76','76','77','77','77','77','77','77','77','77','77','77','77','77','77','77','78','78','78','78','78','78','78','78','78','78','78','78','78','78','78','78','78','78','78','78','78','78','78','78','78','78','78','79','79','79','79','79','79','79','79','79','79','79','79','79','79','79','79','79','79','79','79','79','79','79','79','79','79','79','79','80','80','80','80','80','80','80','80','80','80','80','80','80','80','80','80'];
  8. var provinceID = ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80'];
  9. var provinces = ['Abra','Agusan del Norte','Agusan del Sur','Aklan','Albay','Antique','Apayao','Aurora','Basilan','Bataan','Batanes','Batangas','Benguet','Biliran','Bohol','Bukidnon','Bulacan','Cagayan','Camarines Norte','Camarines Sur','Camiguin','Capiz','Catanduanes','Cavite','Cebu','Compostela Valley','Cotabato','Davao del Norte','Davao del Sur','Davao Oriental','Eastern Samar','Guimaras','Ifugao','Ilocos Norte','Ilocos Sur','Iloilo','Isabela','Kalinga','La Union','Laguna','Lanao del Norte','Lanao del Sur','Leyte','Maguindanao','Marinduque','Masbate','Metro Manila','Misamis Occidental','Misamis Oriental','Mountain Province','Negros Occidental','Negros Oriental','Northern Samar','Nueva Ecija','Nueva Vizcaya','Occidental Mindoro','Oriental Mindoro','Palawan','Pampanga','Pangasinan','Quezon','Quirino','Rizal','Romblon','Samar','Sarangani','Siquijor','Sorsogon','South Cotabato','Southern Leyte','Sultan Kudarat','Sulu','Surigao del Norte','Surigao del Sur','Tarlac','Tawi-Tawi','Zambales','Zamboanga del Norte','Zamboanga del Sur','Zamboanga Sibugay'];
  10. var provincesRegionID = ['2','16','16','9','8','9','2','5','17','5','4','6','2','11','10','13','5','4','8','8','13','9','8','6','10','14','15','14','14','14','11','9','2','3','3','9','4','2','3','6','13','17','11','17','7','8','1','13','13','2','9','11','11','5','4','7','7','7','5','3','6','4','6','7','11','15','10','8','15','11','15','17','16','16','5','17','5','12','12','12'];
  11. var regionsID = ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17'];
  12. var regions = ['National Capital Region','Cordillera Administrative Region','Region 1','Region 2','Region 3','Region 4-A','Region 4-B','Region 5','Region 6','Region 7','Region 8','Region 9','Region 10','Region 11','Region 12','Region 13','Autonomous Region in Muslim Mindanao'];
  13. var tempProvinces = [];
  14. var tempRegion = "";
  15.  
  16. $j(".app_city-inputEx-fieldWrapper input[type='text']").eq($j(".app_city-inputEx-fieldWrapper").length - 1).autocomplete({
  17. minLength: 2,
  18. source: cities,
  19. select: function a(event, ui){
  20. tempProvinces.length = 0;
  21. $j(".app_province-inputEx-fieldWrapper input[type='text']").eq($j(".app_province-inputEx-fieldWrapper").length - 1).val("");
  22. $j(".app_region-inputEx-fieldWrapper input[type='text']").eq($j(".app_region-inputEx-fieldWrapper").length - 1).val("");
  23. $j(".app_country-inputEx-fieldWrapper input[type='text']").eq($j(".app_country-inputEx-fieldWrapper").length - 1).val("");
  24. getProvinces(ui.item.value);
  25. }
  26. }).focus(function() {
  27. $j(this).autocomplete("search", "");
  28. });
  29.  
  30. function getProvinces(selCity){
  31. var city = selCity;
  32. var tempCityProvinceIDs = [];
  33. for (var i = 0; i < cities.length; i++){
  34. if (city == cities[i]){
  35. tempCityProvinceIDs.push(citiesProvinceID[i]);
  36. }
  37. }
  38. for (var j = 0; j < tempCityProvinceIDs.length; j++){
  39. for (var k = 0; k < provinceID.length; k++){
  40. if (tempCityProvinceIDs[j] == provinceID[k]){
  41. tempProvinces.push(provinces[k]);
  42. }
  43. }
  44. }
  45.  
  46. if (tempProvinces.length > 1){
  47. $j(".app_province-inputEx-fieldWrapper input[type='text']").eq($j(".app_province-inputEx-fieldWrapper").length - 1).autocomplete({
  48. minLength: 0,
  49. source: tempProvinces,
  50. select: function b(event, ui){
  51. getRegion(ui.item.value);
  52. }
  53. }).focus(function() {
  54. $j(this).autocomplete("search", "");
  55. });
  56. }
  57. else{
  58. $j(".app_province-inputEx-fieldWrapper input[type='text']").val(tempProvinces[0]);
  59. getRegion(tempProvinces[0]);
  60. }
  61.  
  62.  
  63. }
  64.  
  65. function getRegion(selProvince){
  66. var province = selProvince;
  67. var tempRegionID = "";
  68. for (var i = 0; i < provinces.length; i++){
  69. if (province == provinces[i]){
  70. tempRegionID = provincesRegionID[i];
  71. }
  72. }
  73. for (var j = 0; j < regionsID.length; j++){
  74. if (tempRegionID == regionsID[j]){
  75. $j(".app_region-inputEx-fieldWrapper input[type='text']").eq($j(".app_region-inputEx-fieldWrapper").length - 1).val(regions[j]);
  76. $j(".app_country-inputEx-fieldWrapper input[type='text']").eq($j(".app_country-inputEx-fieldWrapper").length - 1).val("Philippines");
  77. }
  78. }
  79. }
  80. }
  81.  
  82. //--------- COMP TRIGGER
  83. function compTrigger()
  84. {
  85. if($j(".comp_trigger-inputEx-fieldWrapper input[type='radio']:checked").val() === "Less") {
  86. $j("#valrep_landimp_comparison_4").hide();
  87. //$j("#valrep_landimp_comparison_5").hide();
  88. $j("#valrep_landimp_comparison_5 span").hide();
  89. $j("#valrep_landimp_comp5_date_month").hide();
  90. $j("#valrep_landimp_comp5_date_day").hide();
  91. $j("#valrep_landimp_comp5_date_year").hide();
  92. $j("#valrep_landimp_comp5_source").hide();
  93. $j("#valrep_landimp_comp5_contact_no").hide();
  94. $j("#valrep_landimp_comp5_location").hide();
  95. $j("#valrep_landimp_comp5_area").hide();
  96. $j("#valrep_landimp_comp5_base_price").hide();
  97. $j("#valrep_landimp_comp5_price_sqm").hide();
  98. $j("#valrep_landimp_comp5_discount_rate").hide();
  99. $j("#valrep_landimp_comp5_discounts").hide();
  100. $j("#valrep_landimp_comp5_selling_price").hide();
  101. $j("#valrep_landimp_comparison_5 .-inputEx-fieldWrapper").hide();
  102. $j("#valrep_landimp_comp5_rec_location").hide();
  103. $j("#valrep_landimp_comp5_rec_size").hide();
  104. $j("#valrep_landimp_comp5_rec_shape").hide();
  105. $j("#valrep_landimp_comp5_rec_corner_influence").hide();
  106. $j("#valrep_landimp_comp5_rec_tru_lot").hide();
  107. $j("#valrep_landimp_comp5_rec_elevation").hide();
  108. $j("#valrep_landimp_comp5_rec_time_element").hide();
  109. $j("#valrep_landimp_comp5_rec_degree_of_devt").hide();
  110. $j("#valrep_landimp_comp5_concluded_adjustment").hide();
  111. $j("#valrep_landimp_comp5_adjusted_value").hide();
  112. $j("#valrep_landimp_comp5_remarks").hide();
  113. }
  114. else {
  115. $j("#valrep_landimp_comparison_4").show();
  116. //$j("#valrep_landimp_comparison_5").show();
  117. $j("#valrep_landimp_comparison_5 span").show();
  118. $j("#valrep_landimp_comp5_date_month").show();
  119. $j("#valrep_landimp_comp5_date_day").show();
  120. $j("#valrep_landimp_comp5_date_year").show();
  121. $j("#valrep_landimp_comp5_source").show();
  122. $j("#valrep_landimp_comp5_contact_no").show();
  123. $j("#valrep_landimp_comp5_location").show();
  124. $j("#valrep_landimp_comp5_area").show();
  125. $j("#valrep_landimp_comp5_base_price").show();
  126. $j("#valrep_landimp_comp5_price_sqm").show();
  127. $j("#valrep_landimp_comp5_discount_rate").show();
  128. $j("#valrep_landimp_comp5_discounts").show();
  129. $j("#valrep_landimp_comp5_selling_price").show();
  130. $j("#valrep_landimp_comparison_5 .-inputEx-fieldWrapper").show();
  131. $j("#valrep_landimp_comp5_rec_location").show();
  132. $j("#valrep_landimp_comp5_rec_size").show();
  133. $j("#valrep_landimp_comp5_rec_shape").show();
  134. $j("#valrep_landimp_comp5_rec_corner_influence").show();
  135. $j("#valrep_landimp_comp5_rec_tru_lot").show();
  136. $j("#valrep_landimp_comp5_rec_elevation").show();
  137. $j("#valrep_landimp_comp5_rec_time_element").show();
  138. $j("#valrep_landimp_comp5_rec_degree_of_devt").show();
  139. $j("#valrep_landimp_comp5_concluded_adjustment").show();
  140. $j("#valrep_landimp_comp5_adjusted_value").show();
  141. $j("#valrep_landimp_comp5_remarks").show();
  142. }
  143. }
  144.  
  145. $j(".comp_trigger-inputEx-fieldWrapper input[type='radio']").on("click", function() {
  146. compTrigger();
  147. });
  148.  
  149. var appraisal_request = ".app_request_appraisal-inputEx-fieldWrapper";
  150. var arrLengthrequest = $j(".app_request_appraisal-inputEx-fieldWrapper").length-1;
  151. var address_area = $j(".app_tct_no-inputEx-fieldWrapper").parent().parent();
  152. var contactPerson = ".app_contact_person-inputEx-fieldWrapper";
  153. var contactNo = ".app_contact-inputEx-fieldWrapper";
  154. var month = ".app_daterequested_month-inputEx-fieldWrapper";
  155. var day = ".app_daterequested_day-inputEx-fieldWrapper";
  156. var year = ".app_daterequested_year-inputEx-fieldWrapper";
  157. var d = new Date();
  158. /*
  159. var curr_month = d.getMonth();
  160. var curr_day = d.getDate();
  161. var curr_year = d.getFullYear();
  162. */
  163. var months = new Array(12);
  164. var pref_date1_month = ".app_pref_inspection_date2_month-inputEx-fieldWrapper";
  165. months[0] = "01";
  166. months[1] = "02";
  167. months[2] = "03";
  168. months[3] = "04";
  169. months[4] = "05";
  170. months[5] = "06";
  171. months[6] = "07";
  172. months[7] = "08";
  173. months[8] = "09";
  174. months[9] = "10";
  175. months[10] = "11";
  176. months[11] = "12";
  177. var quantity = ".app_me_quantity-inputEx-fieldWrapper";
  178. var type = ".app_me_type-inputEx-fieldWrapper";
  179. var manufacturer = ".app_me_manufacturer-inputEx-fieldWrapper";
  180. var model = ".app_me_model-inputEx-fieldWrapper";
  181. var serial_no = ".app_me_serial_no-inputEx-fieldWrapper";
  182. var age = ".app_me_age-inputEx-fieldWrapper";
  183. var condition = ".app_me_condition-inputEx-fieldWrapper";
  184. var address_area = $j(".app_tct_no-inputEx-fieldWrapper").parent().parent();
  185. var car_appraisal_purpose = ".appraisal_purpose_style-inputEx-fieldWrapper";
  186. var car_loan = ".loan_style-inputEx-fieldWrapper";
  187. var car_loan_purpose = ".app_car_loan_purpose-inputEx-fieldWrapper";
  188. var vehicle_type = ".app_vehicle_type-inputEx-fieldWrapper";
  189. var car_series = ".app_car_series-inputEx-fieldWrapper";
  190. var car_model = ".app_car_model-inputEx-fieldWrapper";
  191. var car_color = ".app_car_color-inputEx-fieldWrapper";
  192. var car_milage = ".app_car_mileage-inputEx-fieldWrapper";
  193. var car_plate_no = ".app_car_plate_no-inputEx-fieldWrapper";
  194. var car_body_type = ".app_car_body_type-inputEx-fieldWrapper";
  195. var car_displacement = ".app_car_displacement-inputEx-fieldWrapper";
  196. var car_motor_no = ".app_car_motor_no-inputEx-fieldWrapper";
  197. var car_chassis_no = ".app_car_chassis_no-inputEx-fieldWrapper";
  198. var cr_no = ".app_car_cr_no-inputEx-fieldWrapper";
  199. var cr_date_month = ".app_car_cr_date_month-inputEx-fieldWrapper";
  200. var cr_date_day = ".app_car_cr_date_day-inputEx-fieldWrapper";
  201. var cr_date_year = ".app_car_cr_date_year-inputEx-fieldWrapper";
  202. var car_header = ".appraisal_header-inputEx-fieldWrapper";
  203. var lot_direction = ".lot_plotting_direction-inputEx-fieldWrapper";
  204.  
  205. window.onload = function(){
  206. //ON LOAD INDENTATION
  207.  
  208. compTrigger();
  209. addressValidation();
  210.  
  211. //ONLY SHOW NECESSARY FIELDS
  212. $j(".app_request_appraisal-inputEx-fieldWrapper").each(function(index, el) {
  213. if($j(appraisal_request + " select:eq(" + index + ")").val() === "motor_vehicle") {
  214. address_area.eq(index).hide();
  215. $j(car_appraisal_purpose + ":eq("+ index + ")").show();
  216. $j(car_loan + ":eq("+ index + ")").show();
  217. $j(car_loan_purpose + ":eq("+ index + ")").show();
  218. $j(car_series + ":eq("+ index + ")").show();
  219. $j(car_model + ":eq("+ index + ")").show();
  220. $j(car_color + ":eq("+ index + ")").show();
  221. $j(car_milage + ":eq("+ index + ")").show();
  222. $j(car_plate_no + ":eq("+ index + ")").show();
  223. $j(car_body_type + ":eq("+ index + ")").show();
  224. $j(car_displacement + ":eq("+ index + ")").show();
  225. $j(car_motor_no + ":eq("+ index + ")").show();
  226. $j(car_chassis_no + ":eq("+ index + ")").show();
  227. $j(cr_no + ":eq("+ index + ")").show();
  228. $j(cr_date_month + ":eq("+ index + ")").show();
  229. $j(cr_date_day + ":eq("+ index + ")").show();
  230. $j(cr_date_year + ":eq("+ index + ")").show();
  231. $j(vehicle_type + ":eq("+ index + ")").show();
  232. $j(car_header + ":eq("+ index + ")").show();
  233. $j(quantity + ":eq("+ index + ")").hide();
  234. $j(type + ":eq("+ index + ")").hide();
  235. $j(manufacturer + ":eq("+ index + ")").hide();
  236. $j(model + ":eq("+ index + ")").hide();
  237. $j(serial_no + ":eq("+ index + ")").hide();
  238. $j(age + ":eq("+ index + ")").hide();
  239. $j(condition + ":eq("+ index + ")").hide();
  240. }
  241. else if($j(appraisal_request + " select:eq(" + index + ")").val() === "townhouse_condo") {
  242. $j(".app_tct_no-inputEx-fieldWrapper label:eq("+ index + ")").text("CCT No.");
  243. address_area.eq(index).show();
  244. $j(quantity + ":eq("+ index + ")").hide();
  245. $j(type + ":eq("+ index + ")").hide();
  246. $j(manufacturer + ":eq("+ index + ")").hide();
  247. $j(model + ":eq("+ index + ")").hide();
  248. $j(serial_no + ":eq("+ index + ")").hide();
  249. $j(age + ":eq("+ index + ")").hide();
  250. $j(condition + ":eq("+ index + ")").hide();
  251. $j(car_appraisal_purpose + ":eq("+ index + ")").hide();
  252. $j(car_loan + ":eq("+ index + ")").hide();
  253. $j(car_loan_purpose + ":eq("+ index + ")").hide();
  254. $j(car_series + ":eq("+ index + ")").hide();
  255. $j(car_model + ":eq("+ index + ")").hide();
  256. $j(car_color + ":eq("+ index + ")").hide();
  257. $j(car_milage + ":eq("+ index + ")").hide();
  258. $j(car_plate_no + ":eq("+ index + ")").hide();
  259. $j(car_body_type + ":eq("+ index + ")").hide();
  260. $j(car_displacement + ":eq("+ index + ")").hide();
  261. $j(car_motor_no + ":eq("+ index + ")").hide();
  262. $j(car_chassis_no + ":eq("+ index + ")").hide();
  263. $j(cr_no + ":eq("+ index + ")").hide();
  264. $j(cr_date_month + ":eq("+ index + ")").hide();
  265. $j(cr_date_day + ":eq("+ index + ")").hide();
  266. $j(cr_date_year + ":eq("+ index + ")").hide();
  267. $j(vehicle_type + ":eq("+ index + ")").hide();
  268. $j(car_header + ":eq("+ index + ")").hide();
  269. }
  270. else if($j(appraisal_request + " select:eq(" + index + ")").val() === "machinery_equipment") {
  271. address_area.eq(index).hide();
  272. $j(quantity + ":eq("+ index + ")").show();
  273. $j(type + ":eq("+ index + ")").show();
  274. $j(manufacturer + ":eq("+ index + ")").show();
  275. $j(model + ":eq("+ index + ")").show();
  276. $j(serial_no + ":eq("+ index + ")").show();
  277. $j(age + ":eq("+ index + ")").show();
  278. $j(condition + ":eq("+ index + ")").show();
  279. $j(car_appraisal_purpose + ":eq("+ index + ")").hide();
  280. $j(car_loan + ":eq("+ index + ")").hide();
  281. $j(car_loan_purpose + ":eq("+ index + ")").hide();
  282. $j(car_series + ":eq("+ index + ")").hide();
  283. $j(car_model + ":eq("+ index + ")").hide();
  284. $j(car_color + ":eq("+ index + ")").hide();
  285. $j(car_milage + ":eq("+ index + ")").hide();
  286. $j(car_plate_no + ":eq("+ index + ")").hide();
  287. $j(car_body_type + ":eq("+ index + ")").hide();
  288. $j(car_displacement + ":eq("+ index + ")").hide();
  289. $j(car_motor_no + ":eq("+ index + ")").hide();
  290. $j(car_chassis_no + ":eq("+ index + ")").hide();
  291. $j(cr_no + ":eq("+ index + ")").hide();
  292. $j(cr_date_month + ":eq("+ index + ")").hide();
  293. $j(cr_date_day + ":eq("+ index + ")").hide();
  294. $j(cr_date_year + ":eq("+ index + ")").hide();
  295. $j(vehicle_type + ":eq("+ index + ")").hide();
  296. $j(car_header + ":eq("+ index + ")").hide();
  297. }
  298. else {
  299. address_area.eq(index).show();
  300. $j(car_appraisal_purpose + ":eq("+ index + ")").hide();
  301. $j(car_loan + ":eq("+ index + ")").hide();
  302. $j(car_loan_purpose + ":eq("+ index + ")").hide();
  303. $j(car_series + ":eq("+ index + ")").hide();
  304. $j(car_model + ":eq("+ index + ")").hide();
  305. $j(car_color + ":eq("+ index + ")").hide();
  306. $j(car_milage + ":eq("+ index + ")").hide();
  307. $j(car_plate_no + ":eq("+ index + ")").hide();
  308. $j(car_body_type + ":eq("+ index + ")").hide();
  309. $j(car_displacement + ":eq("+ index + ")").hide();
  310. $j(car_motor_no + ":eq("+ index + ")").hide();
  311. $j(car_chassis_no + ":eq("+ index + ")").hide();
  312. $j(cr_no + ":eq("+ index + ")").hide();
  313. $j(cr_date_month + ":eq("+ index + ")").hide();
  314. $j(cr_date_day + ":eq("+ index + ")").hide();
  315. $j(cr_date_year + ":eq("+ index + ")").hide();
  316. $j(vehicle_type + ":eq("+ index + ")").hide();
  317. $j(car_header + ":eq("+ index + ")").hide();
  318. $j(quantity + ":eq("+ index + ")").hide();
  319. $j(type + ":eq("+ index + ")").hide();
  320. $j(manufacturer + ":eq("+ index + ")").hide();
  321. $j(model + ":eq("+ index + ")").hide();
  322. $j(serial_no + ":eq("+ index + ")").hide();
  323. $j(age + ":eq("+ index + ")").hide();
  324. $j(condition + ":eq("+ index + ")").hide();
  325. $j(".app_tct_no-inputEx-fieldWrapper label:eq("+ index + ")").text("TCT No.");
  326. $j(".app_block_no-inputEx-fieldWrapper:eq("+ index + ")").hide();
  327. $j(".app_lot_no-inputEx-fieldWrapper:eq("+ index + ")").hide();
  328. }
  329. });
  330.  
  331. };
  332.  
  333. //----------- VIEW PDF
  334. //Fix original attachments list margin
  335. $j("#app_attachment-List").css({"margin-left": "35px", "width": "300px"});
  336.  
  337. //Apply link to PDF viewing
  338. $j(".viewpdf_btn-inputEx-fieldWrapper input[type='button']").each(function(index,el){
  339. $j(this).click(function(){
  340. var fn = $j(".app_attachment_filename-inputEx-fieldWrapper input[type='text']").eq(index).val();
  341. window.open(gvarASPURL+"/AppraisalWebApp/ViewPDF.aspx?fn="+fn);
  342. //window.open("http://122.3.65.204:3000/AppraisalWebApp/ViewPDF.aspx?fn="+fn);
  343. });
  344. });
  345.  
  346. //FIRST APRPAISAL TYPE
  347. var appTypeIndex = form_data.Counter - 1;
  348. $j(".app_attachment-inputEx-fieldWrapper").find($j(".inputEx-ListField-subFieldEl")).each(function(index, el){
  349. var eachAppType = $j(this).find($j(".app_attachment_appraisal_type-inputEx-fieldWrapper input[type='text']")).val();
  350. var mainAppType = $j(".app_request_appraisal-inputEx-fieldWrapper select").eq(0).val() + "_" + appTypeIndex;
  351.  
  352. if (mainAppType != eachAppType){
  353. $j(".app_attachment-inputEx-fieldWrapper").find($j(".inputEx-ListField-subFieldEl")).eq(index).hide();
  354. }
  355. else{
  356. $j(".app_attachment-inputEx-fieldWrapper").find($j(".inputEx-ListField-subFieldEl")).eq(index).show();
  357. }
  358. });
  359.  
  360. //----------- DOWNLOAD PDF
  361. $j(".downloadpdf_btn-inputEx-fieldWrapper input[type='button']").each(function(index, el){
  362. $j(this).click(function(){
  363. var fn = $j(".app_attachment_filename-inputEx-fieldWrapper input[type='text']").eq(index).val();
  364. window.open(gvarASPURL+"/AppraisalWebApp/DownloadAttachment.ashx?fn="+fn);
  365. //window.open("http://122.3.65.204:3000/AppraisalWebApp/DownloadAttachment.ashx?fn="+fn);
  366. });
  367. });
  368.  
  369. //--------------NO PDF
  370. $j(".nopdf_btn-inputEx-fieldWrapper input[type='button']").each(function(index, el){
  371. var fn = $j(".app_attachment_filename-inputEx-fieldWrapper input[type='text']").eq(index).val();
  372. if (fn === "NO FILE"){
  373. $j(".downloadpdf_btn-inputEx-fieldWrapper").eq(index).hide();
  374. $j(".viewpdf_btn-inputEx-fieldWrapper").eq(index).hide();
  375.  
  376. $j(this).click(function(){
  377. alert("No file has been uploaded for this requirement.");
  378. });
  379. }
  380. else{
  381. $j(".nopdf_btn-inputEx-fieldWrapper").eq(index).hide();
  382. }
  383. });
  384.  
  385. //-------------View Print Friendly Report
  386. $j(".print_form-inputEx-fieldWrapper input[type='button']").click(function() {
  387. var at = $j(".app_request_appraisal-inputEx-fieldWrapper select:eq(0)").val();
  388. window.open(gvarASPURL+"/AppraisalWebApp/ViewBlank.aspx?at="+at);
  389. //window.open(gvarASPURL+"/AppraisalWebApp/BlankForm.aspx?fn="+gvarJasURL+"/jasperserver/rest_v2/reports/reports/GDS_Link_Asia/Appraisal/Blank/Appraisal-VacantLotwithImprovements.pdf?record_id="+form_data.system.record_id);
  390. });
  391.  
  392. //-------------Valuation Report
  393. var url1 = gvarJasURL+"/jasperserver/rest_v2/reports/reports/Security_Bank/Land_with_Improvements.pdf?record_id="+form_data.system.record_id;
  394. //var url1 = "http://reports.gdslinkasia.com:8080/jasperserver/rest_v2/reports/reports/GDS_Link_Asia/Appraisal/Appraisal-VacantLotwithImprovements.pdf?record_id="+form_data.system.record_id;
  395. var url2;
  396. var url3;
  397. var url4;
  398. $j(".app_attachment_file-inputEx-fieldWrapper input[type='text']").each(function(index, el){
  399. if ($j(".app_attachment_file-inputEx-fieldWrapper input[type='text']").eq(index).val() === "Vicinity"){
  400. url2 = gvarASPURL+"/AppraisalWebApp/ViewPDF.aspx?fn=" + $j(".app_attachment_filename-inputEx-fieldWrapper input[type='text']").eq(index).val();
  401. }
  402.  
  403. if ($j(".app_attachment_file-inputEx-fieldWrapper input[type='text']").eq(index).val() === "Plans"){
  404. url3 = gvarASPURL+"/AppraisalWebApp/ViewPDF.aspx?fn=" + $j(".app_attachment_filename-inputEx-fieldWrapper input[type='text']").eq(index).val();
  405. }
  406.  
  407. if ($j(".app_attachment_file-inputEx-fieldWrapper input[type='text']").eq(index).val() === "Property Pictures"){
  408. url4 = gvarASPURL+"/AppraisalWebApp/ViewPDF.aspx?fn=" + $j(".app_attachment_filename-inputEx-fieldWrapper input[type='text']").eq(index).val();
  409. }
  410. });
  411. $j(".btn_valuation_report-inputEx-fieldWrapper input[type='button']").click(function() {
  412. window.open(gvarASPURL+"/AppraisalWebApp/ValuationReport.aspx?url1="+url1+"&url2="+url2+"&url3="+url3+"&url4="+url4);
  413. //window.open("http://122.3.65.204:3000/AppraisalWebApp/ValuationReport.aspx?url1="+url1+"&url2="+url2);
  414. });
  415.  
  416. //--------------Upload Supplementary Docs
  417. $j("#appraisal_request-List-0-more_docs_btn-button").click(function() {
  418. var ln = $j("#app_account_last_name-field").val();
  419. var fn = form_data.app_account_first_name;
  420. var mn = form_data.app_account_middle_name;
  421. var mm = form_data.app_daterequested_month;
  422. var dd = form_data.app_daterequested_day;
  423. var yy = form_data.app_daterequested_year;
  424. var uid = ln + "_" + fn + "_" + mm + dd + yy;
  425. var index = parseInt(form_data.Counter, 10) - 1;
  426. var at = $j(".app_request_appraisal-inputEx-fieldWrapper select:eq(0)").val();
  427.  
  428. window.open(gvarASPURL+"/AppraisalWebApp/RequestUpload2.aspx?uid="+uid+"&at="+at+"&id="+index);
  429. });
  430.  
  431. //----------- APPRAISAL REQUEST VIEW
  432. $j("#appraisal_request-List-0-app_request_appraisal-label").html($j("#appraisal_request-List-0-app_request_appraisal-field option:selected").text());
  433. $j("#appraisal_request-List-0-app_request_appraisal-label").attr("style", "text-decoration: underline");
  434. $j(".app_request_appraisal").hide();
  435. $j("#appraisal_request-List-0-app_request_appraisal").attr("style", "margin-left: 300px; font-size: 16;");
  436. $j("#appraisal_request-List-0-app_request_appraisal-label-wrapper").attr("style", "width: 300px;");
  437.  
  438. $j(".valrep_land_propdesc_area-inputEx-fieldWrapper input[type='text']").blur(function() {
  439. $j(".valrep_landimp_value_total_area-inputEx-fieldWrapper input[type='text']").val($j(".valrep_landimp_propdesc_area-inputEx-fieldWrapper input[type='text']").val());
  440. });
  441.  
  442. //------------------Land Plot Validation
  443. $j(".inputEx-ListField-addButton").click(function() {
  444. direction_length = $j(".lot_plotting_direction-inputEx-fieldWrapper").length-1;
  445. $j(lot_direction).each(function(idx, el) {
  446. if(idx === direction_length) {
  447. $j(bearing + " select:eq("+idx+")").val("E");
  448. $j(lot_direction + " select:eq("+idx+")").change(function() {
  449. for(var i in arrValue) {
  450. if(arrValue.indexOf($j(lot_direction + " select:eq("+idx+")").val()) > -1) {
  451. $j(bearing + " select:eq("+idx+")").val("");
  452. $j(bearing + " select:eq("+idx+")").attr('disabled', 'disabled');
  453. $j(degrees + " input[type='text']:eq("+idx+")").attr('disabled', 'disabled');
  454. }
  455. else {
  456. $j(bearing + " select:eq("+idx+")").val("E");
  457. $j(bearing + " select:eq("+idx+")").removeAttr('disabled');
  458. $j(degrees + " input[type='text']:eq("+idx+")").removeAttr('disabled');
  459. }
  460. }
  461. });
  462.  
  463. $j(bearing + " select:eq("+idx+")").change(function() {
  464. if($j(lot_direction + " select:eq("+idx+")").val() === "N" && $j(bearing + " select:eq("+idx+")").val() === "") {
  465. $j(degrees + " input[type='text']:eq("+idx+")").attr('disabled', 'disabled');
  466. $j(bearing + " select:eq("+idx+")").removeAttr('disabled');
  467. }
  468. else if($j(lot_direction + " select:eq("+idx+")").val() === "S" && $j(bearing + " select:eq("+idx+")").val() === "") {
  469. $j(degrees + " input[type='text']:eq("+idx+")").attr('disabled', 'disabled');
  470. $j(bearing + " select:eq("+idx+")").removeAttr('disabled');
  471. }
  472. else {
  473. $j(bearing + " select:eq("+idx+")").removeAttr('disabled');
  474. $j(degrees + " input[type='text']:eq("+idx+")").removeAttr('disabled');
  475. }
  476. });
  477.  
  478. }
  479. });
  480. });
  481.  
  482. $j("#view_btn-button").click(function(){
  483. var svr = window.location.origin;
  484.  
  485. var plotCount = $j(".lot_plotting_direction").length;
  486. var toPass = "";
  487. for (var i = 0; i < plotCount; i++)
  488. {
  489. var direction = $j(".lot_plotting_direction select").eq(i).val();
  490. var degrees = $j(".lot_plotting_degrees input[type='text']").eq(i).val();
  491. var bearing = $j(".lot_plotting_bearing select").eq(i).val();
  492. var distance = $j(".lot_plotting_distance input[type='text']").eq(i).val();
  493.  
  494. if (i < (plotCount-1))
  495. {
  496. toPass += '{"lot_plotting_direction":"'+direction+'","lot_plotting_degrees":"'+degrees+'","lot_plotting_bearing":"'+bearing+'","lot_plotting_distance":"'+distance+'"},';
  497. }
  498. else
  499. {
  500. toPass += '{"lot_plotting_direction":"'+direction+'","lot_plotting_degrees":"'+degrees+'","lot_plotting_bearing":"'+bearing+'","lot_plotting_distance":"'+distance+'"}';
  501. }
  502. }
  503.  
  504. function onAjaxLoad(el){
  505. $j(el).css({background:'url("/system/ckeditor_assets/pictures/gds_link_asia/4e4f3595-b8f6-46f7-af42-21e1c3e8c391/content_loader.gif?1372060142") no-repeat right #FFFFFF'});
  506. }
  507. function onAjaxComplete(el){
  508. $j(el).attr('style','background-color: white');
  509. }
  510. PLOTTING = {
  511. getArray: function(callback){
  512. $j.ajax({
  513. type: "POST",
  514. url: svr+'/gds_link_asia/appraisal/new/update_plotting.json?authenticated',
  515. //data: 'data={"record":'+JSON.stringify(getFormValues())+'}',
  516. data: 'data={"record":{"temp_record_id":"'+form_data.system.record_id+'","lot_plotting":['+toPass+']}}',
  517. success: function(data){
  518. callback.call(this,data);
  519. },
  520. contentType: "application/x-www-form-urlencoded",
  521. dataType: 'json',
  522. beforeSend: function(){onAjaxLoad("#load_status-field"); $j("#load_status-field").val("Please wait while the plotting image is being loaded.");},
  523. complete: function(){onAjaxComplete("#load_status-field"); $j("#load_status-field").val(""); openPlot();}
  524. });
  525. }
  526. };
  527. PLOTTING.getArray(function(data) {
  528. });
  529. });
  530.  
  531. function openPlot()
  532. {
  533. var f = form_data.app_account_first_name;
  534. var m = form_data.app_account_middle_name;
  535. var l = form_data.app_account_last_name;
  536. window.open(gvarASP+"/AppraisalWebApp/Plotting.aspx?uid="+form_data.system.record_id+"&fn="+f+"&mn="+m+"&ln="+l);
  537. }
  538.  
  539. /* Price Computation */
  540. var area1 = ".valrep_landimp_comp1_area-inputEx-fieldWrapper";
  541. var ask_price1 = ".valrep_landimp_comp1_base_price-inputEx-fieldWrapper";
  542. var price1 = ".valrep_landimp_comp1_price_sqm-inputEx-fieldWrapper";
  543. var discount_rate1 = ".valrep_landimp_comp1_discount_rate-inputEx-fieldWrapper";
  544. var discounted_price1 = ".valrep_landimp_comp1_discounts-inputEx-fieldWrapper";
  545. var index_price1 = ".valrep_landimp_comp1_selling_price-inputEx-fieldWrapper";
  546. var adj_value1 = ".valrep_landimp_comp1_adjusted_value-inputEx-fieldWrapper";
  547. var average = ".valrep_landimp_comp_average-inputEx-fieldWrapper";
  548.  
  549. var area2 = ".valrep_landimp_comp2_area-inputEx-fieldWrapper";
  550. var ask_price2 = ".valrep_landimp_comp2_base_price-inputEx-fieldWrapper";
  551. var price2 = ".valrep_landimp_comp2_price_sqm-inputEx-fieldWrapper";
  552. var discount_rate2 = ".valrep_landimp_comp2_discount_rate-inputEx-fieldWrapper";
  553. var discounted_price2 = ".valrep_landimp_comp2_discounts-inputEx-fieldWrapper";
  554. var index_price2 = ".valrep_landimp_comp2_selling_price-inputEx-fieldWrapper";
  555. var adj_value2 = ".valrep_landimp_comp2_adjusted_value-inputEx-fieldWrapper";
  556.  
  557. var area3 = ".valrep_landimp_comp3_area-inputEx-fieldWrapper";
  558. var ask_price3 = ".valrep_landimp_comp3_base_price-inputEx-fieldWrapper";
  559. var price3 = ".valrep_landimp_comp3_price_sqm-inputEx-fieldWrapper";
  560. var discount_rate3 = ".valrep_landimp_comp3_discount_rate-inputEx-fieldWrapper";
  561. var discounted_price3 = ".valrep_landimp_comp3_discounts-inputEx-fieldWrapper";
  562. var index_price3 = ".valrep_landimp_comp3_selling_price-inputEx-fieldWrapper";
  563. var adj_value3 = ".valrep_landimp_comp3_adjusted_value-inputEx-fieldWrapper";
  564.  
  565. var area4 = ".valrep_landimp_comp4_area-inputEx-fieldWrapper";
  566. var ask_price4 = ".valrep_landimp_comp4_base_price-inputEx-fieldWrapper";
  567. var price4 = ".valrep_landimp_comp4_price_sqm-inputEx-fieldWrapper";
  568. var discount_rate4 = ".valrep_landimp_comp4_discount_rate-inputEx-fieldWrapper";
  569. var discounted_price4 = ".valrep_landimp_comp4_discounts-inputEx-fieldWrapper";
  570. var index_price4 = ".valrep_landimp_comp4_selling_price-inputEx-fieldWrapper";
  571. var adj_value4 = ".valrep_landimp_comp4_adjusted_value-inputEx-fieldWrapper";
  572.  
  573. var area5 = ".valrep_landimp_comp5_area-inputEx-fieldWrapper";
  574. var ask_price5 = ".valrep_landimp_comp5_base_price-inputEx-fieldWrapper";
  575. var price5 = ".valrep_landimp_comp5_price_sqm-inputEx-fieldWrapper";
  576. var discount_rate5 = ".valrep_landimp_comp5_discount_rate-inputEx-fieldWrapper";
  577. var discounted_price5 = ".valrep_landimp_comp5_discounts-inputEx-fieldWrapper";
  578. var index_price5 = ".valrep_landimp_comp5_selling_price-inputEx-fieldWrapper";
  579. var adj_value5 = ".valrep_landimp_comp5_adjusted_value-inputEx-fieldWrapper";
  580.  
  581. var location1 = ".valrep_landimp_comp1_rec_location-inputEx-fieldWrapper";
  582. var size1 = ".valrep_landimp_comp1_rec_size-inputEx-fieldWrapper";
  583. var shape1 = ".valrep_landimp_comp1_rec_shape-inputEx-fieldWrapper";
  584. var cor_influence1 = ".valrep_landimp_comp1_rec_corner_influence-inputEx-fieldWrapper";
  585. var tru_lot1 = ".valrep_landimp_comp1_rec_tru_lot-inputEx-fieldWrapper";
  586. var elevation1 = ".valrep_landimp_comp1_rec_elevation-inputEx-fieldWrapper";
  587. var deg_devt1 = ".valrep_landimp_comp1_rec_degree_of_devt-inputEx-fieldWrapper";
  588. var time_element1 = ".valrep_landimp_comp1_rec_time_element-inputEx-fieldWrapper";
  589.  
  590. var arrRectification1 = [
  591. ".valrep_landimp_comp1_rec_location-inputEx-fieldWrapper",
  592. ".valrep_landimp_comp1_rec_size-inputEx-fieldWrapper",
  593. ".valrep_landimp_comp1_rec_shape-inputEx-fieldWrapper",
  594. ".valrep_landimp_comp1_rec_corner_influence-inputEx-fieldWrapper",
  595. ".valrep_landimp_comp1_rec_tru_lot-inputEx-fieldWrapper",
  596. ".valrep_landimp_comp1_rec_elevation-inputEx-fieldWrapper",
  597. ".valrep_landimp_comp1_rec_degree_of_devt-inputEx-fieldWrapper",
  598. ".valrep_landimp_comp1_rec_time_element-inputEx-fieldWrapper" ];
  599. var total_adjust1 = ".valrep_landimp_comp1_concluded_adjustment-inputEx-fieldWrapper";
  600.  
  601. var location2 = ".valrep_landimp_comp2_rec_location-inputEx-fieldWrapper";
  602. var size2 = ".valrep_landimp_comp2_rec_size-inputEx-fieldWrapper";
  603. var shape2 = ".valrep_landimp_comp2_rec_shape-inputEx-fieldWrapper";
  604. var cor_influence2 = ".valrep_landimp_comp2_rec_corner_influence-inputEx-fieldWrapper";
  605. var tru_lot2 = ".valrep_landimp_comp2_rec_tru_lot-inputEx-fieldWrapper";
  606. var elevation2 = ".valrep_landimp_comp2_rec_elevation-inputEx-fieldWrapper";
  607. var deg_devt2 = ".valrep_landimp_comp2_rec_degree_of_devt-inputEx-fieldWrapper";
  608. var time_element2 = ".valrep_landimp_comp2_rec_time_element-inputEx-fieldWrapper";
  609.  
  610. var arrRectification2 = [
  611. ".valrep_landimp_comp2_rec_location-inputEx-fieldWrapper",
  612. ".valrep_landimp_comp2_rec_size-inputEx-fieldWrapper",
  613. ".valrep_landimp_comp2_rec_shape-inputEx-fieldWrapper",
  614. ".valrep_landimp_comp2_rec_corner_influence-inputEx-fieldWrapper",
  615. ".valrep_landimp_comp2_rec_tru_lot-inputEx-fieldWrapper",
  616. ".valrep_landimp_comp2_rec_elevation-inputEx-fieldWrapper",
  617. ".valrep_landimp_comp2_rec_degree_of_devt-inputEx-fieldWrapper",
  618. ".valrep_landimp_comp2_rec_time_element-inputEx-fieldWrapper" ];
  619. var total_adjust2 = ".valrep_landimp_comp2_concluded_adjustment-inputEx-fieldWrapper";
  620.  
  621. var location3 = ".valrep_landimp_comp3_rec_location-inputEx-fieldWrapper";
  622. var size3 = ".valrep_landimp_comp3_rec_size-inputEx-fieldWrapper";
  623. var shape3 = ".valrep_landimp_comp3_rec_shape-inputEx-fieldWrapper";
  624. var cor_influence3 = ".valrep_landimp_comp3_rec_corner_influence-inputEx-fieldWrapper";
  625. var tru_lot3 = ".valrep_landimp_comp3_rec_tru_lot-inputEx-fieldWrapper";
  626. var elevation3 = ".valrep_landimp_comp3_rec_elevation-inputEx-fieldWrapper";
  627. var deg_devt3 = ".valrep_landimp_comp3_rec_degree_of_devt-inputEx-fieldWrapper";
  628. var time_element3 = ".valrep_landimp_comp3_rec_time_element-inputEx-fieldWrapper";
  629.  
  630. var arrRectification3 = [
  631. ".valrep_landimp_comp3_rec_location-inputEx-fieldWrapper",
  632. ".valrep_landimp_comp3_rec_size-inputEx-fieldWrapper",
  633. ".valrep_landimp_comp3_rec_shape-inputEx-fieldWrapper",
  634. ".valrep_landimp_comp3_rec_corner_influence-inputEx-fieldWrapper",
  635. ".valrep_landimp_comp3_rec_tru_lot-inputEx-fieldWrapper",
  636. ".valrep_landimp_comp3_rec_elevation-inputEx-fieldWrapper",
  637. ".valrep_landimp_comp3_rec_degree_of_devt-inputEx-fieldWrapper",
  638. ".valrep_landimp_comp3_rec_time_element-inputEx-fieldWrapper" ];
  639. var total_adjust3 = ".valrep_landimp_comp3_concluded_adjustment-inputEx-fieldWrapper";
  640.  
  641. var location4 = ".valrep_landimp_comp4_rec_location-inputEx-fieldWrapper";
  642. var size4 = ".valrep_landimp_comp4_rec_size-inputEx-fieldWrapper";
  643. var shape4 = ".valrep_landimp_comp4_rec_shape-inputEx-fieldWrapper";
  644. var cor_influence4 = ".valrep_landimp_comp4_rec_corner_influence-inputEx-fieldWrapper";
  645. var tru_lot4 = ".valrep_landimp_comp4_rec_tru_lot-inputEx-fieldWrapper";
  646. var elevation4 = ".valrep_landimp_comp4_rec_elevation-inputEx-fieldWrapper";
  647. var deg_devt4 = ".valrep_landimp_comp4_rec_degree_of_devt-inputEx-fieldWrapper";
  648. var time_element4 = ".valrep_landimp_comp4_rec_time_element-inputEx-fieldWrapper";
  649.  
  650. var arrRectification4 = [
  651. ".valrep_landimp_comp4_rec_location-inputEx-fieldWrapper",
  652. ".valrep_landimp_comp4_rec_size-inputEx-fieldWrapper",
  653. ".valrep_landimp_comp4_rec_shape-inputEx-fieldWrapper",
  654. ".valrep_landimp_comp4_rec_corner_influence-inputEx-fieldWrapper",
  655. ".valrep_landimp_comp4_rec_tru_lot-inputEx-fieldWrapper",
  656. ".valrep_landimp_comp4_rec_elevation-inputEx-fieldWrapper",
  657. ".valrep_landimp_comp4_rec_degree_of_devt-inputEx-fieldWrapper",
  658. ".valrep_landimp_comp4_rec_time_element-inputEx-fieldWrapper" ];
  659. var total_adjust4 = ".valrep_landimp_comp4_concluded_adjustment-inputEx-fieldWrapper";
  660.  
  661. var location5 = ".valrep_landimp_comp5_rec_location-inputEx-fieldWrapper";
  662. var size5 = ".valrep_landimp_comp5_rec_size-inputEx-fieldWrapper";
  663. var shape5 = ".valrep_landimp_comp5_rec_shape-inputEx-fieldWrapper";
  664. var cor_influence5 = ".valrep_landimp_comp5_rec_corner_influence-inputEx-fieldWrapper";
  665. var tru_lot5 = ".valrep_landimp_comp5_rec_tru_lot-inputEx-fieldWrapper";
  666. var elevation5 = ".valrep_landimp_comp5_rec_elevation-inputEx-fieldWrapper";
  667. var deg_devt5 = ".valrep_landimp_comp5_rec_degree_of_devt-inputEx-fieldWrapper";
  668. var time_element5 = ".valrep_landimp_comp5_rec_time_element-inputEx-fieldWrapper";
  669.  
  670. var arrRectification5 = [
  671. ".valrep_landimp_comp5_rec_location-inputEx-fieldWrapper",
  672. ".valrep_landimp_comp5_rec_size-inputEx-fieldWrapper",
  673. ".valrep_landimp_comp5_rec_shape-inputEx-fieldWrapper",
  674. ".valrep_landimp_comp5_rec_corner_influence-inputEx-fieldWrapper",
  675. ".valrep_landimp_comp5_rec_tru_lot-inputEx-fieldWrapper",
  676. ".valrep_landimp_comp5_rec_elevation-inputEx-fieldWrapper",
  677. ".valrep_landimp_comp5_rec_degree_of_devt-inputEx-fieldWrapper",
  678. ".valrep_landimp_comp5_rec_time_element-inputEx-fieldWrapper" ];
  679. var total_adjust5 = ".valrep_landimp_comp5_concluded_adjustment-inputEx-fieldWrapper";
  680.  
  681. var arrAdj = [
  682. ".valrep_landimp_comp1_adjusted_value-inputEx-fieldWrapper",
  683. ".valrep_landimp_comp2_adjusted_value-inputEx-fieldWrapper",
  684. ".valrep_landimp_comp3_adjusted_value-inputEx-fieldWrapper",
  685. ".valrep_landimp_comp4_adjusted_value-inputEx-fieldWrapper",
  686. ".valrep_landimp_comp5_adjusted_value-inputEx-fieldWrapper"
  687. ];
  688.  
  689. var rounded_to = ".valrep_landimp_comp_rounded_to-inputEx-fieldWrapper";
  690. var eco_life = ".valrep_landimp_desc_economic_life-inputEx-fieldWrapper";
  691. var eff_life = ".valrep_landimp_desc_effective_age-inputEx-fieldWrapper";
  692. var rem_life = ".valrep_landimp_desc_imp_remain_life-inputEx-fieldWrapper";
  693.  
  694. $j(document).ready(function() {
  695. $j(price1 + " input[type='text']").val(getPrice(ask_price1,area1));
  696.  
  697. $j(ask_price1).on("keydown keyup change paste", function() {
  698. $j(price1 + " input[type='text']").val(getPrice(ask_price1,area1));
  699. $j(discounted_price1 + " input[type='text']").val(getDiscount(price1,discount_rate1));
  700. $j(index_price1 + " input[type='text']").val(getIndexPrice(price1,discounted_price1));
  701. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  702. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  703. $j(average + " input[type='text']").val(getAverage(arrAdj));
  704. $j(rounded_to + " input[type='text']").val(roundNum(average));
  705. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  706. });
  707.  
  708. $j(area1).on("keydown keyup change paste", function() {
  709. $j(price1 + " input[type='text']").val(getPrice(ask_price1,area1));
  710. $j(discounted_price1 + " input[type='text']").val(getDiscount(price1,discount_rate1));
  711. $j(index_price1 + " input[type='text']").val(getIndexPrice(price1,discounted_price1));
  712. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  713. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  714. $j(average + " input[type='text']").val(getAverage(arrAdj));
  715. $j(rounded_to + " input[type='text']").val(roundNum(average));
  716. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  717. });
  718.  
  719. $j(discounted_price1 + " input[type='text']").val(getDiscount(price1,discount_rate1));
  720.  
  721. $j(price1).on("keydown keyup change paste", function() {
  722. $j(price1 + " input[type='text']").val(getPrice(ask_price1,area1));
  723. $j(discounted_price1 + " input[type='text']").val(getDiscount(price1,discount_rate1));
  724. $j(index_price1 + " input[type='text']").val(getIndexPrice(price1,discounted_price1));
  725. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  726. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  727. $j(average + " input[type='text']").val(getAverage(arrAdj));
  728. $j(rounded_to + " input[type='text']").val(roundNum(average));
  729. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  730. });
  731.  
  732. $j(discount_rate1).on("keydown keyup change paste", function() {
  733. $j(price1 + " input[type='text']").val(getPrice(ask_price1,area1));
  734. $j(discounted_price1 + " input[type='text']").val(getDiscount(price1,discount_rate1));
  735. $j(index_price1 + " input[type='text']").val(getIndexPrice(price1,discounted_price1));
  736. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  737. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  738. $j(average + " input[type='text']").val(getAverage(arrAdj));
  739. $j(rounded_to + " input[type='text']").val(roundNum(average));
  740. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  741. });
  742.  
  743. $j(index_price1 + " input[type='text']").val(getIndexPrice(price1,discounted_price1));
  744.  
  745. $j(price1).on("keydown keyup change paste", function() {
  746. $j(price1 + " input[type='text']").val(getPrice(ask_price1,area1));
  747. $j(discounted_price1 + " input[type='text']").val(getDiscount(price1,discount_rate1));
  748. $j(index_price1 + " input[type='text']").val(getIndexPrice(price1,discounted_price1));
  749. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  750. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  751. $j(average + " input[type='text']").val(getAverage(arrAdj));
  752. $j(rounded_to + " input[type='text']").val(roundNum(average));
  753. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  754. });
  755.  
  756. $j(discounted_price1).on("keydown keyup change paste", function() {
  757. $j(price1 + " input[type='text']").val(getPrice(ask_price1,area1));
  758. $j(discounted_price1 + " input[type='text']").val(getDiscount(price1,discount_rate1));
  759. $j(index_price1 + " input[type='text']").val(getIndexPrice(price1,discounted_price1));
  760. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  761. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  762. $j(average + " input[type='text']").val(getAverage(arrAdj));
  763. $j(rounded_to + " input[type='text']").val(roundNum(average));
  764. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  765. });
  766.  
  767. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  768.  
  769. $j(location1).on("keydown keyup change paste", function() {
  770. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  771. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  772. $j(average + " input[type='text']").val(getAverage(arrAdj));
  773. $j(rounded_to + " input[type='text']").val(roundNum(average));
  774. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  775. });
  776.  
  777. $j(size1).on("keydown keyup change paste", function() {
  778. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  779. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  780. $j(average + " input[type='text']").val(getAverage(arrAdj));
  781. $j(rounded_to + " input[type='text']").val(roundNum(average));
  782. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  783. });
  784.  
  785. $j(shape1).on("keydown keyup change paste", function() {
  786. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  787. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  788. $j(average + " input[type='text']").val(getAverage(arrAdj));
  789. $j(rounded_to + " input[type='text']").val(roundNum(average));
  790. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  791. });
  792.  
  793. $j(cor_influence1).on("keydown keyup change paste", function() {
  794. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  795. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  796. $j(average + " input[type='text']").val(getAverage(arrAdj));
  797. $j(rounded_to + " input[type='text']").val(roundNum(average));
  798. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  799. });
  800.  
  801. $j(tru_lot1).on("keydown keyup change paste", function() {
  802. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  803. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  804. $j(average + " input[type='text']").val(getAverage(arrAdj));
  805. $j(rounded_to + " input[type='text']").val(roundNum(average));
  806. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  807. });
  808.  
  809. $j(elevation1).on("keydown keyup change paste", function() {
  810. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  811. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  812. $j(average + " input[type='text']").val(getAverage(arrAdj));
  813. $j(rounded_to + " input[type='text']").val(roundNum(average));
  814. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  815. });
  816.  
  817. $j(deg_devt1).on("keydown keyup change paste", function() {
  818. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  819. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  820. $j(average + " input[type='text']").val(getAverage(arrAdj));
  821. $j(rounded_to + " input[type='text']").val(roundNum(average));
  822. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  823. });
  824.  
  825. $j(time_element1).on("keydown keyup change paste", function() {
  826. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  827. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  828. $j(average + " input[type='text']").val(getAverage(arrAdj));
  829. $j(rounded_to + " input[type='text']").val(roundNum(average));
  830. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  831. });
  832.  
  833. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  834.  
  835. $j(index_price1).on("keydown keyup change paste", function() {
  836. $j(price1 + " input[type='text']").val(getPrice(ask_price1,area1));
  837. $j(discounted_price1 + " input[type='text']").val(getDiscount(price1,discount_rate1));
  838. $j(index_price1 + " input[type='text']").val(getIndexPrice(price1,discounted_price1));
  839. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  840. $j(average + " input[type='text']").val(getAverage(arrAdj));
  841. $j(rounded_to + " input[type='text']").val(roundNum(average));
  842. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  843. });
  844.  
  845. $j(total_adjust1).on("keydown keyup change paste", function() {
  846. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  847. $j(average + " input[type='text']").val(getAverage(arrAdj));
  848. $j(rounded_to + " input[type='text']").val(roundNum(average));
  849. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  850. });
  851.  
  852. $j(price2 + " input[type='text']").val(getPrice(ask_price2,area2));
  853.  
  854. $j(ask_price2).on("keydown keyup change paste", function() {
  855. $j(price2 + " input[type='text']").val(getPrice(ask_price2,area2));
  856. $j(discounted_price2 + " input[type='text']").val(getDiscount(price2,discount_rate2));
  857. $j(index_price2 + " input[type='text']").val(getIndexPrice(price2,discounted_price2));
  858. $j(adj_value2 + " input[type='text']").val(getAdjustedValue(index_price2,total_adjust2));
  859. $j(total_adjust2 + " input[type='text']").val(getTotalAdjustment(arrRectification2,index_price2));
  860. $j(average + " input[type='text']").val(getAverage(arrAdj));
  861. $j(rounded_to + " input[type='text']").val(roundNum(average));
  862. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  863. });
  864.  
  865. $j(area2).on("keydown keyup change paste", function() {
  866. $j(price2 + " input[type='text']").val(getPrice(ask_price2,area2));
  867. $j(discounted_price2 + " input[type='text']").val(getDiscount(price2,discount_rate2));
  868. $j(index_price2 + " input[type='text']").val(getIndexPrice(price2,discounted_price2));
  869. $j(adj_value2 + " input[type='text']").val(getAdjustedValue(index_price2,total_adjust2));
  870. $j(total_adjust2 + " input[type='text']").val(getTotalAdjustment(arrRectification2,index_price2));
  871. $j(average + " input[type='text']").val(getAverage(arrAdj));
  872. $j(rounded_to + " input[type='text']").val(roundNum(average));
  873. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  874. });
  875.  
  876. $j(discounted_price2 + " input[type='text']").val(getDiscount(price2,discount_rate2));
  877.  
  878. $j(price2).on("keydown keyup change paste", function() {
  879. $j(price2 + " input[type='text']").val(getPrice(ask_price2,area2));
  880. $j(discounted_price2 + " input[type='text']").val(getDiscount(price2,discount_rate2));
  881. $j(index_price2 + " input[type='text']").val(getIndexPrice(price2,discounted_price2));
  882. $j(adj_value2 + " input[type='text']").val(getAdjustedValue(index_price2,total_adjust2));
  883. $j(total_adjust2 + " input[type='text']").val(getTotalAdjustment(arrRectification2,index_price2));
  884. $j(average + " input[type='text']").val(getAverage(arrAdj));
  885. $j(rounded_to + " input[type='text']").val(roundNum(average));
  886. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  887. });
  888.  
  889. $j(discount_rate2).on("keydown keyup change paste", function() {
  890. $j(price2 + " input[type='text']").val(getPrice(ask_price2,area2));
  891. $j(discounted_price2 + " input[type='text']").val(getDiscount(price2,discount_rate2));
  892. $j(index_price2 + " input[type='text']").val(getIndexPrice(price2,discounted_price2));
  893. $j(adj_value2 + " input[type='text']").val(getAdjustedValue(index_price2,total_adjust2));
  894. $j(total_adjust2 + " input[type='text']").val(getTotalAdjustment(arrRectification2,index_price2));
  895. $j(average + " input[type='text']").val(getAverage(arrAdj));
  896. $j(rounded_to + " input[type='text']").val(roundNum(average));
  897. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  898. });
  899.  
  900. $j(index_price2 + " input[type='text']").val(getIndexPrice(price2,discounted_price2));
  901.  
  902. $j(price2).on("keydown keyup change paste", function() {
  903. $j(price2 + " input[type='text']").val(getPrice(ask_price2,area2));
  904. $j(discounted_price2 + " input[type='text']").val(getDiscount(price2,discount_rate2));
  905. $j(index_price2 + " input[type='text']").val(getIndexPrice(price2,discounted_price2));
  906. $j(adj_value2 + " input[type='text']").val(getAdjustedValue(index_price2,total_adjust2));
  907. $j(total_adjust2 + " input[type='text']").val(getTotalAdjustment(arrRectification2,index_price2));
  908. $j(average + " input[type='text']").val(getAverage(arrAdj));
  909. $j(rounded_to + " input[type='text']").val(roundNum(average));
  910. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  911. });
  912.  
  913. $j(discounted_price2).on("keydown keyup change paste", function() {
  914. $j(price2 + " input[type='text']").val(getPrice(ask_price2,area2));
  915. $j(discounted_price2 + " input[type='text']").val(getDiscount(price2,discount_rate2));
  916. $j(index_price2 + " input[type='text']").val(getIndexPrice(price2,discounted_price2));
  917. $j(adj_value2 + " input[type='text']").val(getAdjustedValue(index_price2,total_adjust2));
  918. $j(total_adjust2 + " input[type='text']").val(getTotalAdjustment(arrRectification2,index_price2));
  919. $j(average + " input[type='text']").val(getAverage(arrAdj));
  920. $j(rounded_to + " input[type='text']").val(roundNum(average));
  921. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  922. });
  923.  
  924. $j(total_adjust2 + " input[type='text']").val(getTotalAdjustment(arrRectification2,index_price2));
  925.  
  926. $j(location2).on("keydown keyup change paste", function() {
  927. $j(total_adjust2 + " input[type='text']").val(getTotalAdjustment(arrRectification2,index_price2));
  928. $j(adj_value2 + " input[type='text']").val(getAdjustedValue(index_price2,total_adjust2));
  929. $j(average + " input[type='text']").val(getAverage(arrAdj));
  930. $j(rounded_to + " input[type='text']").val(roundNum(average));
  931. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  932. });
  933.  
  934. $j(size2).on("keydown keyup change paste", function() {
  935. $j(total_adjust2 + " input[type='text']").val(getTotalAdjustment(arrRectification2,index_price2));
  936. $j(adj_value2 + " input[type='text']").val(getAdjustedValue(index_price2,total_adjust2));
  937. $j(average + " input[type='text']").val(getAverage(arrAdj));
  938. $j(rounded_to + " input[type='text']").val(roundNum(average));
  939. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  940. });
  941.  
  942. $j(shape2).on("keydown keyup change paste", function() {
  943. $j(total_adjust2 + " input[type='text']").val(getTotalAdjustment(arrRectification2,index_price2));
  944. $j(adj_value2 + " input[type='text']").val(getAdjustedValue(index_price2,total_adjust2));
  945. $j(average + " input[type='text']").val(getAverage(arrAdj));
  946. $j(rounded_to + " input[type='text']").val(roundNum(average));
  947. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  948. });
  949.  
  950. $j(cor_influence2).on("keydown keyup change paste", function() {
  951. $j(total_adjust2 + " input[type='text']").val(getTotalAdjustment(arrRectification2,index_price2));
  952. $j(adj_value2 + " input[type='text']").val(getAdjustedValue(index_price2,total_adjust2));
  953. $j(average + " input[type='text']").val(getAverage(arrAdj));
  954. $j(rounded_to + " input[type='text']").val(roundNum(average));
  955. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  956. });
  957.  
  958. $j(tru_lot2).on("keydown keyup change paste", function() {
  959. $j(total_adjust2 + " input[type='text']").val(getTotalAdjustment(arrRectification2,index_price2));
  960. $j(adj_value2 + " input[type='text']").val(getAdjustedValue(index_price2,total_adjust2));
  961. $j(average + " input[type='text']").val(getAverage(arrAdj));
  962. $j(rounded_to + " input[type='text']").val(roundNum(average));
  963. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  964. });
  965.  
  966. $j(elevation2).on("keydown keyup change paste", function() {
  967. $j(total_adjust2 + " input[type='text']").val(getTotalAdjustment(arrRectification2,index_price2));
  968. $j(adj_value2 + " input[type='text']").val(getAdjustedValue(index_price2,total_adjust2));
  969. $j(average + " input[type='text']").val(getAverage(arrAdj));
  970. $j(rounded_to + " input[type='text']").val(roundNum(average));
  971. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  972. });
  973.  
  974. $j(deg_devt2).on("keydown keyup change paste", function() {
  975. $j(total_adjust2 + " input[type='text']").val(getTotalAdjustment(arrRectification2,index_price2));
  976. $j(adj_value2 + " input[type='text']").val(getAdjustedValue(index_price2,total_adjust2));
  977. $j(average + " input[type='text']").val(getAverage(arrAdj));
  978. $j(rounded_to + " input[type='text']").val(roundNum(average));
  979. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  980. });
  981.  
  982. $j(time_element2).on("keydown keyup change paste", function() {
  983. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  984. $j(adj_value1 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  985. $j(average + " input[type='text']").val(getAverage(arrAdj));
  986. $j(rounded_to + " input[type='text']").val(roundNum(average));
  987. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  988. });
  989.  
  990. $j(adj_value2 + " input[type='text']").val(getAdjustedValue(index_price2,total_adjust2));
  991.  
  992. $j(index_price2).on("keydown keyup change paste", function() {
  993. $j(price2 + " input[type='text']").val(getPrice(ask_price2,area2));
  994. $j(discounted_price2 + " input[type='text']").val(getDiscount(price2,discount_rate2));
  995. $j(index_price2 + " input[type='text']").val(getIndexPrice(price2,discounted_price2));
  996. $j(total_adjust2 + " input[type='text']").val(getTotalAdjustment(arrRectification2,index_price2));
  997. $j(average + " input[type='text']").val(getAverage(arrAdj));
  998. $j(rounded_to + " input[type='text']").val(roundNum(average));
  999. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1000. });
  1001.  
  1002. $j(total_adjust2).on("keydown keyup change paste", function() {
  1003. $j(adj_value2 + " input[type='text']").val(getAdjustedValue(index_price2,total_adjust2));
  1004. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1005. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1006. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1007. });
  1008.  
  1009. $j(price3 + " input[type='text']").val(getPrice(ask_price3,area3));
  1010.  
  1011. $j(ask_price3).on("keydown keyup change paste", function() {
  1012. $j(price3 + " input[type='text']").val(getPrice(ask_price3,area3));
  1013. $j(discounted_price3 + " input[type='text']").val(getDiscount(price3,discount_rate3));
  1014. $j(index_price3 + " input[type='text']").val(getIndexPrice(price3,discounted_price3));
  1015. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price3,total_adjust3));
  1016. $j(total_adjust3 + " input[type='text']").val(getTotalAdjustment(arrRectification3,index_price3));
  1017. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1018. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1019. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1020. });
  1021.  
  1022. $j(area3).on("keydown keyup change paste", function() {
  1023. $j(price3 + " input[type='text']").val(getPrice(ask_price3,area3));
  1024. $j(discounted_price3 + " input[type='text']").val(getDiscount(price3,discount_rate3));
  1025. $j(index_price3 + " input[type='text']").val(getIndexPrice(price3,discounted_price3));
  1026. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price3,total_adjust3));
  1027. $j(total_adjust3 + " input[type='text']").val(getTotalAdjustment(arrRectification3,index_price3));
  1028. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1029. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1030. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1031. });
  1032.  
  1033. $j(discounted_price3 + " input[type='text']").val(getDiscount(price3,discount_rate3));
  1034.  
  1035. $j(price3).on("keydown keyup change paste", function() {
  1036. $j(price3 + " input[type='text']").val(getPrice(ask_price3,area3));
  1037. $j(discounted_price3 + " input[type='text']").val(getDiscount(price3,discount_rate3));
  1038. $j(index_price3 + " input[type='text']").val(getIndexPrice(price3,discounted_price3));
  1039. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price3,total_adjust3));
  1040. $j(total_adjust3 + " input[type='text']").val(getTotalAdjustment(arrRectification3,index_price3));
  1041. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1042. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1043. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1044. });
  1045.  
  1046. $j(discount_rate3).on("keydown keyup change paste", function() {
  1047. $j(price3 + " input[type='text']").val(getPrice(ask_price3,area3));
  1048. $j(discounted_price3 + " input[type='text']").val(getDiscount(price3,discount_rate3));
  1049. $j(index_price3 + " input[type='text']").val(getIndexPrice(price3,discounted_price3));
  1050. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price3,total_adjust3));
  1051. $j(total_adjust3 + " input[type='text']").val(getTotalAdjustment(arrRectification3,index_price3));
  1052. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1053. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1054. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1055. });
  1056.  
  1057. $j(index_price3 + " input[type='text']").val(getIndexPrice(price3,discounted_price3));
  1058.  
  1059. $j(price3).on("keydown keyup change paste", function() {
  1060. $j(price3 + " input[type='text']").val(getPrice(ask_price3,area3));
  1061. $j(discounted_price3 + " input[type='text']").val(getDiscount(price3,discount_rate3));
  1062. $j(index_price3 + " input[type='text']").val(getIndexPrice(price3,discounted_price3));
  1063. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price3,total_adjust3));
  1064. $j(total_adjust3 + " input[type='text']").val(getTotalAdjustment(arrRectification3,index_price3));
  1065. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1066. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1067. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1068. });
  1069.  
  1070. $j(discounted_price3).on("keydown keyup change paste", function() {
  1071. $j(price3 + " input[type='text']").val(getPrice(ask_price3,area3));
  1072. $j(discounted_price3 + " input[type='text']").val(getDiscount(price3,discount_rate3));
  1073. $j(index_price3 + " input[type='text']").val(getIndexPrice(price3,discounted_price3));
  1074. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price3,total_adjust3));
  1075. $j(total_adjust3 + " input[type='text']").val(getTotalAdjustment(arrRectification3,index_price3));
  1076. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1077. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1078. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1079. });
  1080.  
  1081. $j(total_adjust3 + " input[type='text']").val(getTotalAdjustment(arrRectification3,index_price3));
  1082.  
  1083. $j(location3).on("keydown keyup change paste", function() {
  1084. $j(total_adjust3 + " input[type='text']").val(getTotalAdjustment(arrRectification3,index_price3));
  1085. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price3,total_adjust3));
  1086. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1087. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1088. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1089. });
  1090.  
  1091. $j(size3).on("keydown keyup change paste", function() {
  1092. $j(total_adjust3 + " input[type='text']").val(getTotalAdjustment(arrRectification3,index_price3));
  1093. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price3,total_adjust3));
  1094. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1095. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1096. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1097. });
  1098.  
  1099. $j(shape3).on("keydown keyup change paste", function() {
  1100. $j(total_adjust3 + " input[type='text']").val(getTotalAdjustment(arrRectification3,index_price3));
  1101. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price3,total_adjust3));
  1102. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1103. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1104. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1105. });
  1106.  
  1107. $j(cor_influence3).on("keydown keyup change paste", function() {
  1108. $j(total_adjust3 + " input[type='text']").val(getTotalAdjustment(arrRectification3,index_price3));
  1109. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price3,total_adjust3));
  1110. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1111. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1112. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1113. });
  1114.  
  1115. $j(tru_lot3).on("keydown keyup change paste", function() {
  1116. $j(total_adjust3 + " input[type='text']").val(getTotalAdjustment(arrRectification3,index_price3));
  1117. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price3,total_adjust3));
  1118. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1119. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1120. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1121. });
  1122.  
  1123. $j(elevation3).on("keydown keyup change paste", function() {
  1124. $j(total_adjust3 + " input[type='text']").val(getTotalAdjustment(arrRectification3,index_price3));
  1125. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price3,total_adjust3));
  1126. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1127. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1128. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1129. });
  1130.  
  1131. $j(deg_devt3).on("keydown keyup change paste", function() {
  1132. $j(total_adjust3 + " input[type='text']").val(getTotalAdjustment(arrRectification3,index_price3));
  1133. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price3,total_adjust3));
  1134. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1135. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1136. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1137. });
  1138.  
  1139. $j(time_element3).on("keydown keyup change paste", function() {
  1140. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  1141. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  1142. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1143. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1144. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1145. });
  1146.  
  1147. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price3,total_adjust3));
  1148.  
  1149. $j(index_price3).on("keydown keyup change paste", function() {
  1150. $j(price3 + " input[type='text']").val(getPrice(ask_price3,area3));
  1151. $j(discounted_price3 + " input[type='text']").val(getDiscount(price3,discount_rate3));
  1152. $j(index_price3 + " input[type='text']").val(getIndexPrice(price3,discounted_price3));
  1153. $j(total_adjust3 + " input[type='text']").val(getTotalAdjustment(arrRectification3,index_price3));
  1154. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1155. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1156. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1157. });
  1158.  
  1159. $j(total_adjust3).on("keydown keyup change paste", function() {
  1160. $j(adj_value3 + " input[type='text']").val(getAdjustedValue(index_price3,total_adjust3));
  1161. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1162. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1163. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1164. });
  1165.  
  1166. $j(price4 + " input[type='text']").val(getPrice(ask_price4,area4));
  1167.  
  1168. $j(ask_price4).on("keydown keyup change paste", function() {
  1169. $j(price4 + " input[type='text']").val(getPrice(ask_price4,area4));
  1170. $j(discounted_price4 + " input[type='text']").val(getDiscount(price4,discount_rate4));
  1171. $j(index_price4 + " input[type='text']").val(getIndexPrice(price4,discounted_price4));
  1172. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price4,total_adjust4));
  1173. $j(total_adjust4 + " input[type='text']").val(getTotalAdjustment(arrRectification4,index_price4));
  1174. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1175. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1176. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1177. });
  1178.  
  1179. $j(area4).on("keydown keyup change paste", function() {
  1180. $j(price4 + " input[type='text']").val(getPrice(ask_price4,area4));
  1181. $j(discounted_price4 + " input[type='text']").val(getDiscount(price4,discount_rate4));
  1182. $j(index_price4 + " input[type='text']").val(getIndexPrice(price4,discounted_price4));
  1183. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price4,total_adjust4));
  1184. $j(total_adjust4 + " input[type='text']").val(getTotalAdjustment(arrRectification4,index_price4));
  1185. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1186. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1187. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1188. });
  1189.  
  1190. $j(discounted_price4 + " input[type='text']").val(getDiscount(price4,discount_rate4));
  1191.  
  1192. $j(price4).on("keydown keyup change paste", function() {
  1193. $j(price4 + " input[type='text']").val(getPrice(ask_price4,area4));
  1194. $j(discounted_price4 + " input[type='text']").val(getDiscount(price4,discount_rate4));
  1195. $j(index_price4 + " input[type='text']").val(getIndexPrice(price4,discounted_price4));
  1196. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price4,total_adjust4));
  1197. $j(total_adjust4 + " input[type='text']").val(getTotalAdjustment(arrRectification4,index_price4));
  1198. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1199. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1200. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1201. });
  1202.  
  1203. $j(discount_rate4).on("keydown keyup change paste", function() {
  1204. $j(price4 + " input[type='text']").val(getPrice(ask_price4,area4));
  1205. $j(discounted_price4 + " input[type='text']").val(getDiscount(price4,discount_rate4));
  1206. $j(index_price4 + " input[type='text']").val(getIndexPrice(price4,discounted_price4));
  1207. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price4,total_adjust4));
  1208. $j(total_adjust4 + " input[type='text']").val(getTotalAdjustment(arrRectification4,index_price4));
  1209. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1210. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1211. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1212. });
  1213.  
  1214. $j(index_price4 + " input[type='text']").val(getIndexPrice(price4,discounted_price4));
  1215.  
  1216. $j(price4).on("keydown keyup change paste", function() {
  1217. $j(price4 + " input[type='text']").val(getPrice(ask_price4,area4));
  1218. $j(discounted_price4 + " input[type='text']").val(getDiscount(price4,discount_rate4));
  1219. $j(index_price4 + " input[type='text']").val(getIndexPrice(price4,discounted_price4));
  1220. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price4,total_adjust4));
  1221. $j(total_adjust4 + " input[type='text']").val(getTotalAdjustment(arrRectification4,index_price4));
  1222. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1223. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1224. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1225. });
  1226.  
  1227. $j(discounted_price4).on("keydown keyup change paste", function() {
  1228. $j(price4 + " input[type='text']").val(getPrice(ask_price4,area4));
  1229. $j(discounted_price4 + " input[type='text']").val(getDiscount(price4,discount_rate4));
  1230. $j(index_price4 + " input[type='text']").val(getIndexPrice(price4,discounted_price4));
  1231. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price4,total_adjust4));
  1232. $j(total_adjust4 + " input[type='text']").val(getTotalAdjustment(arrRectification4,index_price4));
  1233. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1234. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1235. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1236. });
  1237.  
  1238. $j(total_adjust4 + " input[type='text']").val(getTotalAdjustment(arrRectification4,index_price4));
  1239.  
  1240. $j(location4).on("keydown keyup change paste", function() {
  1241. $j(total_adjust4 + " input[type='text']").val(getTotalAdjustment(arrRectification4,index_price4));
  1242. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price4,total_adjust4));
  1243. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1244. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1245. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1246. });
  1247.  
  1248. $j(size4).on("keydown keyup change paste", function() {
  1249. $j(total_adjust4 + " input[type='text']").val(getTotalAdjustment(arrRectification4,index_price4));
  1250. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price4,total_adjust4));
  1251. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1252. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1253. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1254. });
  1255.  
  1256. $j(shape4).on("keydown keyup change paste", function() {
  1257. $j(total_adjust4 + " input[type='text']").val(getTotalAdjustment(arrRectification4,index_price4));
  1258. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price4,total_adjust4));
  1259. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1260. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1261. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1262. });
  1263.  
  1264. $j(cor_influence4).on("keydown keyup change paste", function() {
  1265. $j(total_adjust4 + " input[type='text']").val(getTotalAdjustment(arrRectification4,index_price4));
  1266. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price4,total_adjust4));
  1267. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1268. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1269. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1270. });
  1271.  
  1272. $j(tru_lot4).on("keydown keyup change paste", function() {
  1273. $j(total_adjust4 + " input[type='text']").val(getTotalAdjustment(arrRectification4,index_price4));
  1274. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price4,total_adjust4));
  1275. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1276. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1277. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1278. });
  1279.  
  1280. $j(elevation4).on("keydown keyup change paste", function() {
  1281. $j(total_adjust4 + " input[type='text']").val(getTotalAdjustment(arrRectification4,index_price4));
  1282. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price4,total_adjust4));
  1283. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1284. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1285. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1286. });
  1287.  
  1288. $j(deg_devt4).on("keydown keyup change paste", function() {
  1289. $j(total_adjust4 + " input[type='text']").val(getTotalAdjustment(arrRectification4,index_price4));
  1290. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price4,total_adjust4));
  1291. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1292. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1293. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1294. });
  1295.  
  1296. $j(time_element4).on("keydown keyup change paste", function() {
  1297. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  1298. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  1299. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1300. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1301. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1302. });
  1303.  
  1304. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price4,total_adjust4));
  1305.  
  1306. $j(index_price4).on("keydown keyup change paste", function() {
  1307. $j(price4 + " input[type='text']").val(getPrice(ask_price4,area4));
  1308. $j(discounted_price4 + " input[type='text']").val(getDiscount(price4,discount_rate4));
  1309. $j(index_price4 + " input[type='text']").val(getIndexPrice(price4,discounted_price4));
  1310. $j(total_adjust4 + " input[type='text']").val(getTotalAdjustment(arrRectification4,index_price4));
  1311. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1312. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1313. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1314. });
  1315.  
  1316. $j(total_adjust4).on("keydown keyup change paste", function() {
  1317. $j(adj_value4 + " input[type='text']").val(getAdjustedValue(index_price4,total_adjust4));
  1318. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1319. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1320. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1321. });
  1322.  
  1323. $j(price5 + " input[type='text']").val(getPrice(ask_price5,area5));
  1324.  
  1325. $j(ask_price5).on("keydown keyup change paste", function() {
  1326. $j(price5 + " input[type='text']").val(getPrice(ask_price5,area5));
  1327. $j(discounted_price5 + " input[type='text']").val(getDiscount(price5,discount_rate5));
  1328. $j(index_price5 + " input[type='text']").val(getIndexPrice(price5,discounted_price5));
  1329. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price5,total_adjust5));
  1330. $j(total_adjust5 + " input[type='text']").val(getTotalAdjustment(arrRectification5,index_price5));
  1331. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1332. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1333. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1334. });
  1335.  
  1336. $j(area5).on("keydown keyup change paste", function() {
  1337. $j(price5 + " input[type='text']").val(getPrice(ask_price5,area5));
  1338. $j(discounted_price5 + " input[type='text']").val(getDiscount(price5,discount_rate5));
  1339. $j(index_price5 + " input[type='text']").val(getIndexPrice(price5,discounted_price5));
  1340. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price5,total_adjust5));
  1341. $j(total_adjust5 + " input[type='text']").val(getTotalAdjustment(arrRectification5,index_price5));
  1342. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1343. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1344. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1345. });
  1346.  
  1347. $j(discounted_price5 + " input[type='text']").val(getDiscount(price5,discount_rate5));
  1348.  
  1349. $j(price5).on("keydown keyup change paste", function() {
  1350. $j(price5 + " input[type='text']").val(getPrice(ask_price5,area5));
  1351. $j(discounted_price5 + " input[type='text']").val(getDiscount(price5,discount_rate5));
  1352. $j(index_price5 + " input[type='text']").val(getIndexPrice(price5,discounted_price5));
  1353. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price5,total_adjust5));
  1354. $j(total_adjust5 + " input[type='text']").val(getTotalAdjustment(arrRectification5,index_price5));
  1355. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1356. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1357. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1358. });
  1359.  
  1360. $j(discount_rate5).on("keydown keyup change paste", function() {
  1361. $j(price5 + " input[type='text']").val(getPrice(ask_price5,area5));
  1362. $j(discounted_price5 + " input[type='text']").val(getDiscount(price5,discount_rate5));
  1363. $j(index_price5 + " input[type='text']").val(getIndexPrice(price5,discounted_price5));
  1364. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price5,total_adjust5));
  1365. $j(total_adjust5 + " input[type='text']").val(getTotalAdjustment(arrRectification5,index_price5));
  1366. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1367. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1368. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1369. });
  1370.  
  1371. $j(index_price5 + " input[type='text']").val(getIndexPrice(price5,discounted_price5));
  1372.  
  1373. $j(price5).on("keydown keyup change paste", function() {
  1374. $j(price5 + " input[type='text']").val(getPrice(ask_price5,area5));
  1375. $j(discounted_price5 + " input[type='text']").val(getDiscount(price5,discount_rate5));
  1376. $j(index_price5 + " input[type='text']").val(getIndexPrice(price5,discounted_price5));
  1377. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price5,total_adjust5));
  1378. $j(total_adjust5 + " input[type='text']").val(getTotalAdjustment(arrRectification5,index_price5));
  1379. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1380. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1381. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1382. });
  1383.  
  1384. $j(discounted_price5).on("keydown keyup change paste", function() {
  1385. $j(price5 + " input[type='text']").val(getPrice(ask_price5,area5));
  1386. $j(discounted_price5 + " input[type='text']").val(getDiscount(price5,discount_rate5));
  1387. $j(index_price5 + " input[type='text']").val(getIndexPrice(price5,discounted_price5));
  1388. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price5,total_adjust5));
  1389. $j(total_adjust5 + " input[type='text']").val(getTotalAdjustment(arrRectification5,index_price5));
  1390. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1391. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1392. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1393. });
  1394.  
  1395. $j(total_adjust5 + " input[type='text']").val(getTotalAdjustment(arrRectification5,index_price5));
  1396.  
  1397. $j(location5).on("keydown keyup change paste", function() {
  1398. $j(total_adjust5 + " input[type='text']").val(getTotalAdjustment(arrRectification5,index_price5));
  1399. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price5,total_adjust5));
  1400. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1401. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1402. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1403. });
  1404.  
  1405. $j(size5).on("keydown keyup change paste", function() {
  1406. $j(total_adjust5 + " input[type='text']").val(getTotalAdjustment(arrRectification5,index_price5));
  1407. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price5,total_adjust5));
  1408. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1409. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1410. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1411. });
  1412.  
  1413. $j(shape5).on("keydown keyup change paste", function() {
  1414. $j(total_adjust5 + " input[type='text']").val(getTotalAdjustment(arrRectification5,index_price5));
  1415. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price5,total_adjust5));
  1416. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1417. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1418. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1419. });
  1420.  
  1421. $j(cor_influence5).on("keydown keyup change paste", function() {
  1422. $j(total_adjust5 + " input[type='text']").val(getTotalAdjustment(arrRectification5,index_price5));
  1423. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price5,total_adjust5));
  1424. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1425. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1426. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1427. });
  1428.  
  1429. $j(tru_lot5).on("keydown keyup change paste", function() {
  1430. $j(total_adjust5 + " input[type='text']").val(getTotalAdjustment(arrRectification5,index_price5));
  1431. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price5,total_adjust5));
  1432. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1433. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1434. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1435. });
  1436.  
  1437. $j(elevation5).on("keydown keyup change paste", function() {
  1438. $j(total_adjust5 + " input[type='text']").val(getTotalAdjustment(arrRectification5,index_price5));
  1439. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price5,total_adjust5));
  1440. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1441. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1442. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1443. });
  1444.  
  1445. $j(deg_devt5).on("keydown keyup change paste", function() {
  1446. $j(total_adjust5 + " input[type='text']").val(getTotalAdjustment(arrRectification5,index_price5));
  1447. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price5,total_adjust5));
  1448. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1449. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1450. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1451. });
  1452.  
  1453. $j(time_element5).on("keydown keyup change paste", function() {
  1454. $j(total_adjust1 + " input[type='text']").val(getTotalAdjustment(arrRectification1,index_price1));
  1455. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price1,total_adjust1));
  1456. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1457. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1458. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1459. });
  1460.  
  1461. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price5,total_adjust5));
  1462.  
  1463. $j(index_price5).on("keydown keyup change paste", function() {
  1464. $j(price5 + " input[type='text']").val(getPrice(ask_price5,area5));
  1465. $j(discounted_price5 + " input[type='text']").val(getDiscount(price5,discount_rate5));
  1466. $j(index_price5 + " input[type='text']").val(getIndexPrice(price5,discounted_price5));
  1467. $j(total_adjust5 + " input[type='text']").val(getTotalAdjustment(arrRectification5,index_price5));
  1468. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1469. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1470. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1471. });
  1472.  
  1473. $j(total_adjust5).on("keydown keyup change paste", function() {
  1474. $j(adj_value5 + " input[type='text']").val(getAdjustedValue(index_price5,total_adjust5));
  1475. $j(average + " input[type='text']").val(getAverage(arrAdj));
  1476. $j(rounded_to + " input[type='text']").val(roundNum(average));
  1477. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1478. });
  1479. });
  1480.  
  1481. /*Market Valaution*/
  1482. var mval_total_area = ".valrep_landimp_value_area-inputEx-fieldWrapper";
  1483. var mval_deduction = ".valrep_landimp_value_deduction-inputEx-fieldWrapper";
  1484. var mval_net_area = ".valrep_landimp_value_net_area-inputEx-fieldWrapper";
  1485. var mval_unit_value = ".valrep_landimp_value_unit_value-inputEx-fieldWrapper";
  1486. var mval_total_value = ".valrep_landimp_value_land_value-inputEx-fieldWrapper";
  1487. var mval_length = $j(mval_total_area).length;
  1488. var tval_total_area = ".valrep_landimp_value_total_area-inputEx-fieldWrapper";
  1489. var tval_total_deduction = ".valrep_landimp_value_total_deduction-inputEx-fieldWrapper";
  1490. var tval_total_net_area = ".valrep_landimp_value_total_net_area-inputEx-fieldWrapper";
  1491. var tval_total_value = ".valrep_landimp_value_total_landimp_value-inputEx-fieldWrapper";
  1492.  
  1493. $j(document).ready(function() {
  1494. $j(mval_unit_value).each(function(index, el) {
  1495. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1496.  
  1497. $j(mval_total_area + ":eq("+index+")").on("keydown keyup change paste", function() {
  1498. $j(mval_net_area + " input[type='text']:eq("+index+")").val(getNetArea(mval_total_area,mval_deduction,index));
  1499. $j(mval_total_value + " input[type='text']:eq("+index+")").val(getTotalLandVal(mval_net_area,mval_unit_value,index));
  1500. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1501. $j(tval_total_area + " input[type='text']").val(getTotal(mval_total_area));
  1502. $j(tval_total_value + " input[type='text']").val(getTotal(mval_total_value));
  1503. });
  1504.  
  1505. $j(mval_deduction + ":eq("+index+")").on("keydown keyup change paste", function() {
  1506. $j(mval_net_area + " input[type='text']:eq("+index+")").val(getNetArea(mval_total_area,mval_deduction,index));
  1507. $j(mval_total_value + " input[type='text']:eq("+index+")").val(getTotalLandVal(mval_net_area,mval_unit_value,index));
  1508. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1509. $j(tval_total_deduction + " input[type='text']").val(getTotal(mval_deduction));
  1510. $j(tval_total_value + " input[type='text']").val(getTotal(mval_total_value));
  1511. $j(tval_total_net_area + " input[type='text']").val(getTotal(mval_net_area));
  1512. });
  1513.  
  1514. $j(mval_net_area + ":eq("+index+")").on("keydown keyup change paste", function() {
  1515. $j(mval_total_value + " input[type='text']:eq("+index+")").val(getTotalLandVal(mval_net_area,mval_unit_value,index));
  1516. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1517. $j(tval_total_net_area + " input[type='text']").val(getTotal(mval_net_area));
  1518. $j(tval_total_value + " input[type='text']").val(getTotal(mval_total_value));
  1519. });
  1520. });
  1521. });
  1522.  
  1523. $j(".inputEx-ListField-addButton:eq(4)").click(function(){
  1524. $j(mval_unit_value).each(function(index, el) {
  1525. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1526.  
  1527. if(mval_length === index) {
  1528. $j(mval_total_area + ":eq("+index+")").on("keydown keyup change paste", function() {
  1529. $j(mval_net_area + " input[type='text']:eq("+index+")").val(getNetArea(mval_total_area,mval_deduction,index));
  1530. $j(mval_total_value + " input[type='text']:eq("+index+")").val(getTotalLandVal(mval_net_area,mval_unit_value,index));
  1531. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1532. $j(tval_total_area + " input[type='text']").val(getTotal(mval_total_area));
  1533. $j(tval_total_value + " input[type='text']").val(getTotal(mval_total_value));
  1534. });
  1535.  
  1536. $j(mval_deduction + ":eq("+index+")").on("keydown keyup change paste", function() {
  1537. $j(mval_net_area + " input[type='text']:eq("+index+")").val(getNetArea(mval_total_area,mval_deduction,index));
  1538. $j(mval_total_value + " input[type='text']:eq("+index+")").val(getTotalLandVal(mval_net_area,mval_unit_value,index));
  1539. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1540. $j(tval_total_deduction + " input[type='text']").val(getTotal(mval_deduction));
  1541. $j(tval_total_value + " input[type='text']").val(getTotal(mval_total_value));
  1542. $j(tval_total_net_area + " input[type='text']").val(getTotal(mval_net_area));
  1543. });
  1544.  
  1545. $j(mval_net_area + ":eq("+index+")").on("keydown keyup change paste", function() {
  1546. $j(mval_total_value + " input[type='text']:eq("+index+")").val(getTotalLandVal(mval_net_area,mval_unit_value,index));
  1547. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1548. $j(tval_total_net_area + " input[type='text']").val(getTotal(mval_net_area));
  1549. $j(tval_total_value + " input[type='text']").val(getTotal(mval_total_value));
  1550. });
  1551. }
  1552. });
  1553. mval_length++;
  1554. });
  1555.  
  1556. //Compute Remaining Eco Life
  1557. $j("#valrep_land_improve_description_improve").find($j(".inputEx-ListField-addButton")).on("click", function() {
  1558. $j(eff_life).each(function(index, el) {
  1559. $j(eff_life).on("keydown keyup change paste", function() {
  1560. $j(rem_life + " input[type='text']:eq("+index+")").val(getRemLife(eco_life,eff_life,index));
  1561. });
  1562.  
  1563. $j(eco_life).on("keydown keyup change paste", function() {
  1564. $j(rem_life + " input[type='text']:eq("+index+")").val(getRemLife(eco_life,eff_life,index));
  1565. });
  1566. });
  1567. });
  1568.  
  1569. var ca_floor_area = ".valrep_landimp_imp_value_area-inputEx-fieldWrapper";
  1570. var ca_cost = ".valrep_landimp_imp_value_cost_per_sqm-inputEx-fieldWrapper";
  1571. var rep_cost = ".valrep_landimp_imp_value_reproduction_cost-inputEx-fieldWrapper";
  1572.  
  1573. //Compute Cost Approach
  1574. $j('#valrep_land_improve_cost_approach').on("keydown keyup change paste",ca_floor_area + " input[type='text']", function(){
  1575. var index = $j(ca_floor_area + " input[type='text']").index(this);
  1576. $j(this).parents(ca_floor_area).siblings(rep_cost).find("input[type='text']").val(getRepCost(ca_floor_area,ca_cost,index));
  1577. var parent = $j(this).parents('.inputEx-ListField-subFieldEl').parent();
  1578. var parent_label = '#valrep_land_improve_cost_approach .inputEx-ListField-childContainer';
  1579. var parent_index = $j(parent_label).children('div').index(parent);
  1580. //alert(parent_index);
  1581. $j(this).parents('.inputEx-ListField-subFieldEl').find(".valrep_landimp_imp_value_total_area input[type='text']").val(getTotalArea(parent_label,ca_floor_area,parent_index));
  1582. })
  1583.  
  1584. $j('#valrep_land_improve_cost_approach').on("keydown keyup change paste",ca_cost + " input[type='text']", function(){
  1585. var index = $j(ca_cost + " input[type='text']").index(this);
  1586. $j(this).parents(ca_cost).siblings(rep_cost).find("input[type='text']").val(getRepCost(ca_floor_area,ca_cost,index));
  1587. })
  1588.  
  1589.  
  1590. var desc_tct_no = ".valrep_landimp_propdesc_tct_no-inputEx-fieldWrapper";
  1591. var desc_lot_no = ".valrep_landimp_propdesc_lot-inputEx-fieldWrapper";
  1592. var desc_block_no = ".valrep_landimp_propdesc_block-inputEx-fieldWrapper";
  1593. var desc_area = ".valrep_landimp_propdesc_area-inputEx-fieldWrapper";
  1594. var val_tct_no = ".valrep_landimp_value_tct_no-inputEx-fieldWrapper";
  1595. var val_lot_no = ".valrep_landimp_value_lot_no-inputEx-fieldWrapper";
  1596. var val_block_no = ".valrep_landimp_value_block_no-inputEx-fieldWrapper";
  1597. var val_area = ".valrep_landimp_value_area-inputEx-fieldWrapper";
  1598.  
  1599. //Match the number and value of Ownership & Property Description
  1600. var desc_length = $j("#valrep_land_improve_property_description").find($j(desc_tct_no)).length;
  1601. for(var i=0; i < desc_length; i++) {
  1602. $j("#valrep_land_improve_market_valuation").find($j(".inputEx-ListField-addButton")).eq(0).trigger('click');
  1603. addMarketApproach();
  1604. }
  1605.  
  1606.  
  1607. $j("#valrep_land_improve_property_description").find($j(".inputEx-ListField-addButton")).eq(0).on("click", function() {
  1608. $j("#valrep_land_improve_market_valuation").find($j(".inputEx-ListField-addButton")).eq(0).trigger('click');
  1609. addMarketApproach();
  1610. });
  1611.  
  1612. function addMarketApproach() {
  1613. $j(desc_tct_no).each(function(index, el) {
  1614. $j(desc_tct_no + " input[type='text']:eq("+index+")").focus();
  1615.  
  1616. $j(desc_tct_no + ":eq("+index+")").on("change keydown keyup paste", function() {
  1617. $j(val_tct_no + " input[type='text']:eq("+index+")").val($j(desc_tct_no + " input[type='text']:eq("+index+")").val());
  1618. });
  1619.  
  1620. $j(desc_lot_no + ":eq("+index+")").on("change keydown keyup paste", function() {
  1621. $j(val_lot_no + " input[type='text']:eq("+index+")").val($j(desc_lot_no + " input[type='text']:eq("+index+")").val());
  1622. });
  1623.  
  1624. $j(desc_block_no + ":eq("+index+")").on("change keydown keyup paste", function() {
  1625. $j(val_block_no + " input[type='text']:eq("+index+")").val($j(desc_block_no + " input[type='text']:eq("+index+")").val());
  1626. });
  1627.  
  1628. $j(desc_area + ":eq("+index+")").on("change keydown keyup paste", function() {
  1629. $j(val_area + " input[type='text']:eq("+index+")").val($j(desc_area + " input[type='text']:eq("+index+")").val());
  1630. $j(mval_net_area + " input[type='text']:eq("+index+")").val(getNetArea(mval_total_area,mval_deduction,index));
  1631. $j(mval_total_value + " input[type='text']:eq("+index+")").val(getTotalLandVal(mval_net_area,mval_unit_value,index));
  1632. $j(tval_total_deduction + " input[type='text']").val(getTotal(mval_deduction));
  1633. $j(tval_total_value + " input[type='text']").val(getTotal(mval_total_value));
  1634. $j(tval_total_net_area + " input[type='text']").val(getTotal(mval_net_area));
  1635. });
  1636.  
  1637. //--- try
  1638. $j(mval_unit_value).each(function(index, el) {
  1639. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1640.  
  1641. $j(mval_total_area + ":eq("+index+")").on("keydown keyup change paste", function() {
  1642. $j(mval_net_area + " input[type='text']:eq("+index+")").val(getNetArea(mval_total_area,mval_deduction,index));
  1643. $j(mval_total_value + " input[type='text']:eq("+index+")").val(getTotalLandVal(mval_net_area,mval_unit_value,index));
  1644. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1645. $j(tval_total_area + " input[type='text']").val(getTotal(mval_total_area));
  1646. $j(tval_total_value + " input[type='text']").val(getTotal(mval_total_value));
  1647. });
  1648.  
  1649. $j(mval_deduction + ":eq("+index+")").on("keydown keyup change paste", function() {
  1650. $j(mval_net_area + " input[type='text']:eq("+index+")").val(getNetArea(mval_total_area,mval_deduction,index));
  1651. $j(mval_total_value + " input[type='text']:eq("+index+")").val(getTotalLandVal(mval_net_area,mval_unit_value,index));
  1652. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1653. $j(tval_total_deduction + " input[type='text']").val(getTotal(mval_deduction));
  1654. $j(tval_total_value + " input[type='text']").val(getTotal(mval_total_value));
  1655. $j(tval_total_net_area + " input[type='text']").val(getTotal(mval_net_area));
  1656. });
  1657.  
  1658. $j(mval_net_area + ":eq("+index+")").on("keydown keyup change paste", function() {
  1659. $j(mval_total_value + " input[type='text']:eq("+index+")").val(getTotalLandVal(mval_net_area,mval_unit_value,index));
  1660. $j(mval_unit_value + " input[type='text']").val($j(rounded_to + " input[type='text']").val());
  1661. $j(tval_total_net_area + " input[type='text']").val(getTotal(mval_net_area));
  1662. $j(tval_total_value + " input[type='text']").val(getTotal(mval_total_value));
  1663. });
  1664. });
  1665. //-- end try
  1666. });
  1667. }
  1668.  
  1669. function getPrice(x,y) {
  1670. if($j(x + " input[type='text']").val().replace('PhP', '') === 0) {
  1671. return 0;
  1672. }
  1673. else {
  1674. return $j(x + " input[type='text']").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, '') / $j(y + " input[type='text']").val();
  1675. }
  1676. }
  1677.  
  1678. function getDiscount(x,y) {
  1679. if($j(x + " input[type='text']").val().replace('PhP', '') === 0) {
  1680. return 0;
  1681. }
  1682. else {
  1683. return $j(x + " input[type='text']").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, '') * ($j(y + " input[type='text']").val() / 100);
  1684. }
  1685. }
  1686.  
  1687. function getIndexPrice(x,y) {
  1688. if($j(x + " input[type='text']").val().replace('PhP', '') === 0) {
  1689. return 0;
  1690. }
  1691. else {
  1692. return parseFloat($j(x + " input[type='text']").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, '')) - parseFloat($j(y + " input[type='text']").val());
  1693. }
  1694. }
  1695.  
  1696. function getTotalAdjustment(arrElem,y) {
  1697. var total = 0;
  1698. for (var i = 0; i < arrElem.length; i++) {
  1699. total += parseFloat($j(arrElem[i] + " input[type='text']").val() << 0);
  1700. }
  1701.  
  1702. return $j(y + " input[type='text']").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, '') * (total/100);
  1703. }
  1704.  
  1705. function getAdjustedValue(x,y) {
  1706. var total_adj = 0;
  1707. if($j(x + " input[type='text']").val().replace('PhP', '') === 0) {
  1708. return 0;
  1709. }
  1710. else {
  1711. return parseFloat($j(x + " input[type='text']").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, '')) + parseFloat($j(y + " input[type='text']").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, ''));
  1712. }
  1713. }
  1714.  
  1715. function getAverage(arrAdj) {
  1716. var total = 0;
  1717. var filledOut = 0;
  1718. for (var i = 0; i < arrAdj.length; i++) {
  1719. if($j(arrAdj[i] + " input[type='text']").val() !== "NaN" && $j(arrAdj[i] + " input[type='text']").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, '') !== "0") {
  1720. filledOut++;
  1721. //alert("Adjusted Value= " + $j(arrAdj[i] + " input[type='text']").val() + " filledOut= " + filledOut);
  1722. }
  1723. total += $j(arrAdj[i] + " input[type='text']").val() << 0;
  1724. }
  1725. return total / filledOut;
  1726. }
  1727.  
  1728. function roundNum(x) {
  1729. //return Math.ceil($j(x + " input[type='text']").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, '')).toFixed(2);
  1730. return Math.round($j(x + " input[type='text']").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, '') / 100) * 100;
  1731. }
  1732.  
  1733. function getNetArea(x,y,index) {
  1734. if($j(x + " input[type='text']:eq("+index+")").val() === 0) {
  1735. return 0;
  1736. }
  1737. else {
  1738. return parseFloat($j(x + " input[type='text']:eq("+index+")").val()) - parseFloat($j(y + " input[type='text']:eq("+index+")").val());
  1739. }
  1740. }
  1741.  
  1742. function getTotalLandVal(x,y,index) {
  1743. if($j(x + " input[type='text']:eq("+index+")").val().replace('PhP', '') === "" || $j(x + " input[type='text']:eq("+index+")").val().replace('PhP', '') === "NaN") {
  1744. return 0;
  1745. }
  1746. else {
  1747. return parseFloat($j(x + " input[type='text']:eq("+index+")").val()) * parseFloat($j(y + " input[type='text']:eq("+index+")").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, ''));
  1748. }
  1749. }
  1750.  
  1751. function getTotal(x) {
  1752. var sum_total = 0;
  1753.  
  1754. $j(x).each(function(index, el){
  1755. if($j(x + " input[type='text']:eq("+index+")").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, '') !== "") {
  1756. sum_total += parseFloat($j(x + " input[type='text']:eq("+index+")").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, ''));
  1757. }
  1758. else {
  1759. sum_total += 0;
  1760. }
  1761. });
  1762. return sum_total;
  1763. }
  1764.  
  1765. function getAppraisedTotal(x) {
  1766. var sum_total = 0;
  1767.  
  1768. $j(x).each(function(index, el){
  1769. if($j(x + " input[type='text']:eq("+index+")").val() === "") {
  1770. sum_total += 0;
  1771. }
  1772. else {
  1773. sum_total += parseFloat($j(x + " input[type='text']:eq("+index+")").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, ''));
  1774. }
  1775. });
  1776. return sum_total;
  1777. }
  1778.  
  1779. function getFinalDiscount(x,y) {
  1780. if($j(x + " input[type='text']").val().replace('PhP', '') === 0) {
  1781. return 0;
  1782. }
  1783. else {
  1784. return parseFloat($j(x + " input[type='text']").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, '')) * parseFloat($j(y + " input[type='text']").val() / -100);
  1785. }
  1786. }
  1787.  
  1788. function getAppraisedTotal2(x,y) {
  1789. if($j(x + " input[type='text']").val().replace('PhP', '') === 0) {
  1790. return 0;
  1791. }
  1792. else {
  1793. return parseFloat($j(x + " input[type='text']").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, '')) + parseFloat($j(y + " input[type='text']").val());
  1794. }
  1795. }
  1796.  
  1797. function getFinalAppraised(x,y) {
  1798. if($j(x + " input[type='text']").val().replace('PhP', '') === 0) {
  1799. return 0;
  1800. }
  1801. else {
  1802. return parseFloat($j(x + " input[type='text']").val()) * (parseFloat($j(y + " input[type='text']").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, '')) / 100);
  1803. }
  1804. }
  1805.  
  1806. function getRemLife(x,y,index) {
  1807. if(parseFloat($j(x + " input[type='text']:eq("+index+")").val()) <= parseFloat($j(y + " input[type='text']:eq("+index+")").val())) {
  1808. return 0;
  1809. }
  1810. else {
  1811. return parseFloat($j(x + " input[type='text']:eq("+index+")").val()) - parseFloat($j(y + " input[type='text']:eq("+index+")").val());
  1812. }
  1813. }
  1814.  
  1815. function getRepCost(x,y,idx) {
  1816. return parseFloat($j(x + " input[type='text']:eq("+idx+")").val()) * parseFloat($j(y + " input[type='text']:eq("+idx+")").val().replace('PhP', '').replace(/[^0-9a-zA-Z.]/g, ''));
  1817. }
  1818.  
  1819. function getTotalArea(x,y,idx){
  1820. var total = 0;
  1821. alert($j(x).children('div:eq('+idx+')').length);
  1822. alert($j(x).children('div:eq('+idx+')').find(y).length);
  1823. $j(x).children('div:eq('+idx+')').find(y).each(function(){
  1824. total += parseFloat($j(this).find("input[type='text']").val());
  1825. });
  1826. return total;
  1827. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement