Friday, April 23, 2010

Select list for countries by region using javascript

Have have a simple form to input City, State, Country and Region. I though lets make it little easier for users so tried to search for regions list and countries list. Finally realized there is nothing the way I want it, hence took data from net (of-course) and wrote a small pretty much pluggable script.

Location

Region
Country
State
City

var countries = new Array();

var african = new Array(); //African Countries
african["Algeria"] = "Algeria"; 
african["Angola"] = "Angola"; 
african["Benin"] = "Benin"; 

african["Botswana"] = "Botswana";
african["Burkina Faso"] = "Burkina Faso";
african["Burundi"] = "Burundi";
african["Cameroon"] = "Cameroon"; 
african["Cape Verde"] = "Cape Verde"; 
african["Central African Republic"] = "Central African Republic";
african["Chad"] = "Chad"; 
african["Comoros"] = "Comoros"; 
african["Congo"] = "Congo"; 
african["Congo, The Democratic Republic of The"] = "Congo, The Democratic Republic of The";
african["Cote D'ivoire"] = "Cote D'ivoire"; 
african["Djibouti"] = "Djibouti"; 
african["Egypt"] = "Egypt";
african["Equatorial Guinea"] = "Equatorial Guinea"; 
african["Eritrea"] = "Eritrea";
african["Ethiopia"] = "Ethiopia";
african["Gabon"] = "Gabon"; 
african["Gambia"] = "Gambia";
african["Ghana"] = "Ghana"; 
african["Guinea"] = "Guinea"; 
african["Guinea-bissau"] = "Guinea-bissau";
african["Kenya"] = "Kenya"; 
african["Lesotho"] = "Lesotho"; 
african["Liberia"] = "Liberia"; 
african["Libya"] = "Libya";
african["Madagascar"] = "Madagascar"; 
african["Malawi"] = "Malawi";
african["Mali"] = "Mali";
african["Mauritania"] = "Mauritania"; 
african["Mauritius"] = "Mauritius"; 
african["Mayotte"] = "Mayotte";
african["Morocco"] = "Morocco"; 
african["Mozambique"] = "Mozambique";
african["Namibia"] = "Namibia";
african["Niger"] = "Niger"; 
african["Nigeria"] = "Nigeria";
african["Reunion"] = "Reunion";
african["Rwanda"] = "Rwanda"; 
african["Saint Helena"] = "Saint Helena";
african["Sao Tome and Principe"] = "Sao Tome and Principe";
african["Senegal"] = "Senegal";
african["Seychelles"] = "Seychelles"; 
african["Sierra Leone"] = "Sierra Leone"; 
african["Somalia"] = "Somalia"; 
african["South Africa"] = "South Africa";
african["Sudan"] = "Sudan";
african["Swaziland"] = "Swaziland"; 
african["Tanzania, United Republic of"] = "Tanzania, United Republic of";
african["Togo"] = "Togo";
african["Tunisia"] = "Tunisia";
african["Uganda"] = "Uganda";
african["Western Sahara"] = "Western Sahara";
african["Zambia"] = "Zambia"; 
african["Zimbabwe"] = "Zimbabwe";

var  asian = new Array(); //Asian countries
asian["Afghanistan"] = "Afghanistan";
asian["Armenia"] = "Armenia";
asian["Azerbaijan"] = "Azerbaijan";
asian["Bahrain"] = "Bahrain"; 
asian["Bangladesh"] = "Bangladesh";
asian["Bhutan"] = "Bhutan";
asian["British Indian Ocean Territory"] = "British Indian Ocean Territory"; 
asian["Brunei"] = "Brunei";
asian["Cambodia"] = "Cambodia"; 
asian["China"] = "China";
asian["Christmas Island"] = "Christmas Island"; 
asian["Cocos (Keeling) Islands"] = "Cocos (Keeling) Islands";
asian["Cyprus"] = "Cyprus";
asian["Georgia"] = "Georgia"; 
asian["Hong Kong"] = "Hong Kong";
asian["India"] = "India";
asian["Indonesia"] = "Indonesia"; 
asian["Iran"] = "Iran"; 
asian["Iraq"] = "Iraq";
asian["Israel"] = "Israel";
asian["Japan"] = "Japan"; 
asian["Jordan"] = "Jordan"; 
asian["Kazakhstan"] = "Kazakhstan";
asian["Kuwait"] = "Kuwait"; 
asian["Kyrgyzstan"] = "Kyrgyzstan"; 
asian["Laos"] = "Laos";
asian["Lebanon"] = "Lebanon";
asian["Macao"] = "Macao";
asian["Malaysia"] = "Malaysia"; 
asian["Maldives"] = "Maldives";
asian["Mongolia"] = "Mongolia";
asian["Myanmar"] = "Myanmar";
asian["Nepal"] = "Nepal";
asian["North Korea"] = "North Korea";
asian["Oman"] = "Oman"; 
asian["Pakistan"] = "Pakistan";
asian["Palestinian Territory, Occupied"] = "Palestinian Territory, Occupied";
asian["Philippines"] = "Philippines";
asian["Qatar"] = "Qatar";
asian["Saudi Arabia"] = "Saudi Arabia";
asian["Singapore"] = "Singapore";
asian["South Korea"] = "South Korea";
asian["Sri Lanka"] = "Sri Lanka";
asian["Syria"] = "Syria";
asian["Tajikistan"] = "Tajikistan";
asian["Taiwan"] = "Taiwan"; 
asian["Thailand"] = "Thailand";
asian["Timor-leste"] = "Timor-leste";
asian["Turkey"] = "Turkey"; 
asian["Turkmenistan"] = "Turkmenistan";
asian["United Arab Emirates"] = "United Arab Emirates";
asian["Uzbekistan"] = "Uzbekistan"; 
asian["Vietnam"] = "Vietnam";
asian["Yemen"] = "Yemen";

var europian = new Array(); //Europian countries 
europian["Albania"] = "Albania"; 
europian["Andorra"] = "Andorra";
europian["Austria"] = "Austria";
europian["Belarus"] = "Belarus"; 
europian["Belgium"] = "Belgium";
europian["Bosnia and Herzegovina"] = "Bosnia and Herzegovina";
europian["Bulgaria"] = "Bulgaria";
europian["Croatia"] = "Croatia";
europian["Czech Republic"] = "Czech Republic"; 
europian["Denmark"] = "Denmark";
europian["Estonia"] = "Estonia";
europian["Faroe Islands"] = "Faroe Islands"; 
europian["Finland"] = "Finland"; 
europian["France"] = "France";
europian["Germany"] = "Germany";
europian["Gibraltar"] = "Gibraltar"; 
europian["Greece"] = "Greece";
europian["Guernsey"] = "Guernsey";
europian["Hungary"] = "Hungary"; 
europian["Iceland"] = "Iceland";
europian["Ireland"] = "Ireland"; 
europian["Isle of Man"] = "Isle of Man";
europian["Italy"] = "Italy";
europian["Jersey"] = "Jersey";
europian["Kosovo"] = "Kosovo";
europian["Latvia"] = "Latvia";
europian["Liechtenstein"] = "Liechtenstein"; 
europian["Lithuania"] = "Lithuania"; 
europian["Luxembourg"] = "Luxembourg";
europian["Macedonia"] = "Macedonia";
europian["Malta"] = "Malta";
europian["Moldova"] = "Moldova"; 
europian["Monaco"] = "Monaco";
europian["Montenegro"] = "Montenegro";
europian["Netherlands"] = "Netherlands";
europian["Norway"] = "Norway"; 
europian["Poland"] = "Poland"; 
europian["Portugal"] = "Portugal";
europian["Romania"] = "Romania"; 
europian["Russia"] = "Russia";
europian["San Marino"] = "San Marino";
europian["Serbia"] = "Serbia"; 
europian["Slovakia"] = "Slovakia"; 
europian["Slovenia"] = "Slovenia";
europian["Spain"] = "Spain";
europian["Sweden"] = "Sweden"; 
europian["Switzerland"] = "Switzerland";
europian["Ukraine"] = "Ukraine";
europian["United Kingdom"] = "United Kingdom";
europian["Vatican City"] = "Vatican City";

var  northAmerican = new Array(); //North american countries
northAmerican["Anguilla"] = "Anguilla";
northAmerican["Antigua and Barbuda"] = "Antigua and Barbuda";
northAmerican["Aruba"] = "Aruba"; 
northAmerican["Bahamas"] = "Bahamas"; 
northAmerican["Barbados"] = "Barbados"; 
northAmerican["Belize"] = "Belize"; 
northAmerican["Bermuda"] = "Bermuda";
northAmerican["British Virgin Islands"] = "British Virgin Islands";
northAmerican["Canada"] = "Canada"; 
northAmerican["Cayman Islands"] = "Cayman Islands"; 
northAmerican["Clipperton Island"] = "Clipperton Island"; 
northAmerican["Costa Rica"] = "Costa Rica"; 
northAmerican["Cuba"] = "Cuba"; 
northAmerican["Dominica"] = "Dominica"; 
northAmerican["Dominican Republic"] = "Dominican Republic"; 
northAmerican["El Salvador"] = "El Salvador";
northAmerican["Greenland"] = "Greenland"; 
northAmerican["Grenada"] = "Grenada"; 
northAmerican["Guadeloupe"] = "Guadeloupe"; 
northAmerican["Guatemala"] = "Guatemala";
northAmerican["Haiti"] = "Haiti";
northAmerican["Honduras"] = "Honduras";
northAmerican["Jamaica"] = "Jamaica"; 
northAmerican["Martinique"] = "Martinique";
northAmerican["Mexico"] = "Mexico";
northAmerican["Montserrat"] = "Montserrat"; 
northAmerican["Navassa Island"] = "Navassa Island";
northAmerican["Netherlands Antilles"] = "Netherlands Antilles";
northAmerican["Nicaragua"] = "Nicaragua";
northAmerican["Panama"] = "Panama";
northAmerican["Puerto Rico"] = "Puerto Rico";
northAmerican["Saint Barthélemy"] = "Saint Barthélemy";
northAmerican["Saint Kitts and Nevis"] = "Saint Kitts and Nevis";
northAmerican["Saint Lucia"] = "Saint Lucia";
northAmerican["Saint Martin"] = "Saint Martin";
northAmerican["Saint Pierre and Miquelon"] = "Saint Pierre and Miquelon"; 
northAmerican["Saint Vincent and The Grenadines"] = "Saint Vincent and The Grenadines";
northAmerican["Trinidad and Tobago"] = "Trinidad and Tobago";
northAmerican["Turks and Caicos Islands"] = "Turks and Caicos Islands";
northAmerican["United States"] = "United States";
northAmerican["Virgin Islands, U.S."] = "Virgin Islands, U.S.";

var southAmerican = new Array(); //South american countries
southAmerican["Argentina"] = "Argentina";
southAmerican["Bolivia"] = "Bolivia";
southAmerican["Brazil"] = "Brazil";
southAmerican["Chile"] = "Chile"; 
southAmerican["Colombia"] = "Colombia";
southAmerican["Ecuador"] = "Ecuador";
southAmerican["Falkland Islands (Malvinas)"] = "Falkland Islands (Malvinas)";
southAmerican["French Guiana"] = "French Guiana";
southAmerican["Guyana"] = "Guyana"; 
southAmerican["Paraguay"] = "Paraguay"; 
southAmerican["Peru"] = "Peru";
southAmerican["Suriname"] = "Suriname";
southAmerican["Uruguay"] = "Uruguay";
southAmerican["Venezuela"] = "Venezuela";

var oceanian = new Array(); //Oceanian countries
oceanian["American Samoa"] = "American Samoa"; 
oceanian["Australia"] = "Australia"; 
oceanian["Baker Island"] = "Baker Islands";
oceanian["Cook Islands"] = "Cook Islands";
oceanian["Fiji"] = "Fiji"; 
oceanian["French Polynesia"] = "French Polynesia"; 
oceanian["Guam"] = "Guam";
oceanian["Howland Island"] = "Howland Island";
oceanian["Jarvis Island"] = "Jarvis Island";
oceanian["Johnston Atoll"] = "Johnston Atoll";
oceanian["Kingman Reef"] = "Kingman Reef";
oceanian["Kiribati"] = "Kiribati"; 
oceanian["Marshall Islands"] = "Marshall Islands";
oceanian["Micronesia"] = "Micronesia"; 
oceanian["Midway Atoll"] = "Midway Atoll"; 
oceanian["Nauru"] = "Nauru"; 
oceanian["New Caledonia"] = "New Caledonia"; 
oceanian["New Zealand"] = "New Zealand"; 
oceanian["Niue"] = "Niue"; 
oceanian["Norfolk Island"] = "Norfolk Island"; 
oceanian["Northern Mariana Islands"] = "Northern Mariana Islands"; 
oceanian["Palau"] = "Palau";
oceanian["Palmyra Atoll"] = "Palmyra Atoll";
oceanian["Papua New Guinea"] = "Papua New Guinea";
oceanian["Pitcairn Islands"] = "Pitcairn Islands";
oceanian["Samoa"] = "Samoa"; 
oceanian["Solomon Islands"] = "Solomon Islands";
oceanian["Tokelau"] = "Tokelau"; 
oceanian["Tonga"] = "Tonga";
oceanian["Tuvalu"] = "Tuvalu";
oceanian["Vanuatu"] = "Vanuatu";
oceanian["Wake Island"] = "Wake Island";
oceanian["Wallis and Futuna"] = "Wallis and Futuna";

var antarctican = new Array(); //Antarctican countries
antarctican["Antarctica"] = "Antarctica";
antarctican["Bouvet Island"] = "Bouvet Island";
antarctican["French Southern Territories"] = "French Southern Territories"; 
antarctican["Heard Island and Mcdonald Islands"] = "Heard Island and Mcdonald Islands"; 
antarctican["South Georgia and The South Sandwich Islands"] = "South Georgia and The South Sandwich Islands"; 

countries["Africa"] = african;
countries["Asia"] = asian;
countries["Europe"] = europian;
countries["North America"] = northAmerican;
countries["South America"] = southAmerican;
countries["Oceania"] = oceanian;
countries["Antarctica"] = antarctican;

function populateRegions(selObjId){
var selectObj = document.getElementById(selObjId);
  if(selectObj){
    selectObj.options[0] = new Option("Select", "", true, true);
    var counter = 1;
    for (var region in countries){
      selectObj.options[counter++] = new Option(region, region, true, false)
    }
  }
}

function populateCountries(selObjId, region){
  var selectObj = document.getElementById(selObjId);
  if(selectObj){
    selectObj.options.length=0;
    if(countries[region] != null){
      selectObj.options[0] = new Option("Select", "", true, true);
      var counter = 1;
      for (var country in countries[region]){
        selectObj.options[counter++] = new Option(country, country, true, false)
      }
    }
  }
}

Thursday, February 4, 2010

My updates

After a long thought finally decided to stay here for some more time.

We had almost decided to return to India and also started all the planning. Reason being any way we want to go back so as Ram will start his school (first grade) next year; lets move by that time.

One day our friends Barnak and Bharti were at our place and started talking about our decision, they came up with some really sensible points. Considering all the advantages of being here in short term and final reason being for Ram the way we are grooming him (he is comfortable with all the relatives in India) it should not be hard for him to adjust in India even after few years.

There are few more things happening in life. Started some extra work which is giving self satisfaction, I hope to go well and really strike something this time.

Also I love my new hobby; photography. I want to put some more time on that but winter cold is terrible :). Although right now reading some books and preparing myself for the next season.

Preeti is also happy and busy in her activities; which she likes. She has already started planning for summer. Ram is as usual growing fast, talking a lot and having fun. The other we 3 played bingo which was fun.

Not getting time for 2009 photos collection, we already passed one month of new year.

So lot of things are happening and right now I am happy with my life.

Thursday, January 21, 2010

Egypt Tour Part 1 of 3 - Cairo

(Writing in yellow can be skipped, it is just informative)
So this time we wanted to go to some unique destination and we were searching for it. Our colleague came and asked us "How abt Egypt?". Shri wanted to go there from long time since he was in Israel. I was also interested so we decided to go to Egypt.

It was our 7th Anniversary and we were going to celebrate it in air, isn't it exciting :). Just kidding, we started for Egypt on our anniversary day i.e 18th Dec. We all were very much excited. The plane was ok and since we told them veggie option, got something to eat. They gave nice welcome kit too, Ram liked it a lot :)

We landed on Cairo Airport, airport is really nice, we were impressed. Cairo is a big city with 20 million population. It is different than rest of the big places like Luxor and Aswan; seems modern. Two people came to pick up us, one was guide and one was representative. In our group we three, one colleague and his wife and one more family with 13 year old son were there. We were curious to see the new country. We were just peeping out through the window. Saw nice mosques and gardens. Overall feel was like India, roads, traffic and people. On the way to resort, we visited tomb of Unknown Soldiers.

Giza is like a part of Cairo than town in itself, famous for Great Pyramids Complex. There are various Five star hotels in the area, out of which we lived in 'MovenPick Pyramids Resorts'; resort was very good in all respects. From resort's entrance we could get a glimpse of Pyramids. It has Thai restaurant which saved us big time from eating bread-butter, pasta stuff :)
There were fresh flower vases everywhere. Our suite was also decorated nicely. Was very happy to relax there after long journey of 10hrs.


First Glimpse of Pyramids from our resort entrance


In the evening we went to Sound & Light Show of Pyramids and Sphinx. The show was amazing. It was our first time at pyramids, we were far enough that we could see all 3 pyramids and sphinx so the view was like you are getting everything at one place. It was dark and we had no idea how these supposed to be giant pyramids are in front of us like we see on the screen in theater (we would know tomorrow). Ram was bit scared, since voice was little loud and scary. After the show we had dinner in Thai restaurant, which was good.

There are some photos of sound and light show in our album Egypt tour photos album - Sound and Light show

We woke up early and had breakfast and kept all the luggage in van and headed for pyramids. Shri went inside the pyramids and Ram and me enjoyed outside watching police on camels, people climbing pyramid, taking photos and street hawkers.

We had read a lot about pyramids and known enough. One can get a lot more information on wikipedia itself still I would like to add few bits here to have an idea. The Great Pyramids is the biggest and oldest (first) pyramids of all the pyramids in Giza complex is also called Pyramid of Khufu and the Pyramid of Cheops (suppose to be build by king Khufu or Cheops) was build in 2551 BC and is 146.478 meters (480.57 ft) tall build out of big size stones weighing on an average 2 tones and the biggest stone is about 100 tones.
Pyramids are royal tombs where a king is mummified and placed in the chamber for after life. The great pyramid has king's chamber in the center where king's mummy was once kept, it has lot of passages. After the kind was placed in, the entrance to the pyramid was closed and no one knew the way in. The Great Pyramid was the tallest man-made structure in the world for over 3,800 years.

Even though we know that there is nothing to see inside pyramid, we opted to go in. We went from the current entrance which is not far from actual entrance. After about 15-20 ft we had to crawl through 3''5' * 3''5' passage (2 way traffic) for about 25-30 ft after that we reached to Grand Gallery, it is really grand about 50 ft high and very well finished walls and at 45 degree angle. So we had to climb up this gallery to reach to king's chamber which is again big and very well finished. There is broken granite sarcophagus in the chamber other wise there is nothing else. Over all even if there is nothing to see, it was exciting to go inside the pyramid.

(Taken from Wikipedia.org, red lines shows how we went in)

Our guide took us to Panoramic view of pyramids where we could see all 3 pyramids and take (funny) photos.



I liked the sphinx very much and view from sphinx side is very good. Sphinx and in the background 3 pyramids.



Sphinx: Like everything else about pyramids sphinx also has lot of theories, stories and mysteries of its own. It is supposed to be world's largest monolith statue. Who built it and when is still a question but general assumption is, it was built by Kafre (owner of second pyramid).

After pyramids by plan the day was free, our guide suggested us for an optional tour of Sakkara and Memphis with a bonus of visit to carpet factory :). So we opted for this optional tour and headed for Sakkara which is 30 km from Giza.

Sakkara is famous for its step pyramid which is also called Pyramid of Djoser. This is supposed to be first pyramid made out of stones and which is still in good condition. Before pyramids, they used to make mastabas, that is one step. Step pyramid is built in Djoser complex which was once surrounded by 10 meter high stone walls with beautiful work and complex entrance is roofed colonnade.
When we reach there we saw a huge wall with a small door and thats it, there was all dessert all over. Once we enter through this small door there are these huge pillars corridor, everything is so well finished that when you touch these walls they feel like our modern day oil paint walls (these walls were build more than 4500 years before and still have this feel).



There is a small museum of the artifacts they found in this complex which is very interesting. There were lot of pots, statues, some parts of wall; there was some wooden tool (forgot the name) which was a delicate work and supposed to be 5000 years old. There was one mummy as well.

Memphis is 10-15 minutes from Sakkara which is famous for its open air museum and a huge status of king Ramses II, Ramses the Great. This statue is really huge, it was found abandon and the reason being, it was rejected for some fault which is not known. It weights 1000 tons and made out of single piece of granite. There were some more statues in the garden. Usually all the statues of kings are very very well crafted showing their muscles and detailed to the level of their nails and suppose to depict their face as it is.




King Ramses II: Here it is important to mention some details about king Ramses II or Ramses the Great. He is often regarded as Egypt's greatest, most celebrated, and most powerful pharaoh. He was born around 1303 BC and believed to have taken the throne in his early 20s and to have ruled Egypt from 1279 BC to 1213 BC for a total of 66 years; said to have lived to be 99 years old when the average life expectancy at that time was 50 years. He had 9 wives and more than 150 children. It seems he was obsessed with his name; he placed his name on almost all the monuments previously build in Egypt. He also built new temples and monuments; famous one is Temple of Abu Simbel. Today about 70% of the temples and monuments in Egypt bear his name.

We were very hungry now, our guide took us to authentic Egyptian restaurant. The tables were in the shade of trees and they served starters as pita bread, falafel, hummas, pickles. Food was good.  For main course they served us one veggie curry, Egyptian style with brown rice.

Then guide took us to papyrus factory. Papyrus is an ancient Egyptian paper. It seems paper word came from Papyrus. It is made from a tree called papyrus, if properly made it lasts for long time. They have found many ancient Egyptian writings on Papyrus. There were many nice Egyptian mythological scenes painting done on Papyrus. Papyrus was also a symbol of ancient lower Egypt.

Upper and Lower Egypt: Theory of ancient upper and lower Egypt is also interesting. As Nile river being exception which flows from south to north; northern part of Egypt was Lower Egypt and southern part was Upper Egypt. During old kingdom these were two different countries. One king united these two countries and built a new kingdom. Memphis being center of both was the capitol. All over the monuments of new kingdom we can find depictions to represent union of lower and upper Egypt using various symbols like - columns bearing papyrus and lotus flowers, blue crown and white crown worn by kings. Every king had to show his affection for both sides using such depictions.

After lunch we visited carpet factory where they showed us how they make various kinds of carpets and then showed us their sales area. Carpets made of silk were very beautiful but too much expensive.

Next was visit to perfume factory. Every such place our guide took us, they first give us brief demonstration and then offer some drink and then start talking about money :).

In Egypt they make all kinds of perfumes from mint to lotus from flowers. Some perfumes are famous for being ingredient for making world best perfumes like CK5, Armani, polo etc. Some perfumes are used for very effective aroma therapy. They also had many kind of glass bottle for perfumes which looked beautiful.



By this time it was time for our overnight train to Luxor. Our guide dropped us to Giza train station, which was small. Cairo has a big train station it seems. Train was good, all first class and specially designed for tourists.

50% of Egypt's revenue come from tourism and government takes tourism (and tourists) seriously. They have graduation and post graduation level studies in Egyptian history which leads to a career in tourism (guides etc); all our guides and representatives were well educated mostly in Egyptian history.

In train they have one compartment for two people with wash basin, towels, soap and bed with nice comforter. It was cozy. Ram had special compartment but was not ready to sleep alone so Ram and me shared the upper berth and Shri slept on lower berth. We had dinner in train, which was good. There was one well dressed person to serve and he will wake up you when your station comes. He actually woke up us before half and hour and gave breakfast which was also good.