function fillCategory(){ 
	// this function is used to fill the category list on load
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/australia/", "Australia", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/austria/", "Austria", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/cambodia/", "Cambodia", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/canada/", "Canada", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/china/", "China", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/czech-republic/", "Czech Republic", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/england/", "England", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/france/", "France", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/hong-kong/", "Hong Kong", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/hungary/", "Hungary", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/indonesia/", "Indonesia", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/laos/", "Laos", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/macau/", "Macau", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/malaysia/", "Malaysia", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/myanmar/", "Myanmar", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/philippines/", "Philippines", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/poland/", "Poland", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/portugal/", "Portugal", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/russia/", "Russia", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/singapore/", "Singapore", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/spain/", "Spain", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/taiwan/", "Taiwan", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/thailand/", "Thailand", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/turkey/", "Turkey", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/united-states-of-america/", "United States of America", "");
	addOption(document.drop_list.Category, "http://www.takemetotravel.com/vietnam/", "Vietnam", "");
}

function SelectSubCat(){
	// ON selection of category this function will work
	removeAllOptions(document.drop_list.SubCat);
	addOption(document.drop_list.SubCat, "", "Select a City", "");

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/cambodia/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/cambodia/phnom-penh/", "Phnom Penh");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/cambodia/siem-reap/", "Siem Reap");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/vietnam/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/vietnam/ho-chi-minh/", "Ho Chi Minh");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/vietnam/hanoi/", "Hanoi");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/vietnam/danang/", "Danang");
		//addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/vietnam/hue/","Hue");
		//addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/vietnam/hoi-an/","Hoi An");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/macau/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/macau/macau/","Macau");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/hong-kong/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/hong-kong/hong-kong/","Hong Kong");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/myanmar/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/myanmar/yangon/","Yangon");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/indonesia/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/indonesia/jakarta/","Jakarta");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/indonesia/bandung/","Bandung");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/indonesia/bali/","Bali");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/indonesia/bintan/","Bintan");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/indonesia/batam/","Batam");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/laos/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/laos/luang-prabang/","Luang Prabang");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/laos/vientiane/","Vientiane");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/laos/huay-xai/","Huay Xai");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/philippines/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/philippines/manila/","Manila");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/philippines/cebu/","Cebu");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/malaysia/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/malaysia/kuala-lumpur/","Kuala Lumpur");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/malaysia/penang/","Penang");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/malaysia/langkawi/","Langkawi");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/malaysia/kuching/","Kuching");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/malaysia/malacca/","Malacca");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/malaysia/redang/","Berjaya Redang");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/malaysia/cameron-highlands/","Cameron Highland");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/malaysia/tioman/","Tioman");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/malaysia/kota-kinabalu/","Kota Kinabalu");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/thailand/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/thailand/bangkok/","Bangkok");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/thailand/phuket/","Phuket");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/thailand/koh-samui/","Koh Samui");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/thailand/chiang-mai/","Chiang Mai");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/australia/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/australia/melbourne/","Melbourne");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/australia/perth/","Perth");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/australia/sydney/","Sydney");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/australia/gold-coast/","Gold Coast");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/australia/cairns/","Cairns");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/czech-republic/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/czech-republic/prague/","Prague");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/hungary/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/hungary/budapest/","Budapest");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/austria/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/austria/vienna/","Vienna");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/spain/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/spain/madrid/","Madrid");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/spain/barcelona/","Barcelona");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/portugal/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/portugal/lisbon/","Lisbon");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/turkey/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/turkey/istanbul/","Istanbul");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/england/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/england/london/","London");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/france/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/france/paris/","Paris");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/russia/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/russia/st-petersburg/","St Petersburg");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/russia/moscow/","Moscow");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/taiwan/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/taiwan/taipei/","Taipei");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/china/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/china/beijing/","Beijing");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/china/shanghai/","Shanghai");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/singapore/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/singapore/singapore/","Singapore");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/poland/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/poland/cracow/","Cracow");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/united-states-of-america/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/united-states-of-america/san-francisco/","San Francisco");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/united-states-of-america/los-angeles/","Los Angeles");
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/united-states-of-america/new-york-city/","New York City");
	}

	if(document.drop_list.Category.value == 'http://www.takemetotravel.com/canada/'){
		addOption(document.drop_list.SubCat, "http://www.takemetotravel.com/canada/vancouver/","Vancouver");
	}
}
////////////////// 

function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}

function gotoOption(cityval, countryval)
{
	if (cityval != "") {
		parent.location = cityval;
	} else {
		if (countryval != "") {
			parent.location = countryval;
		} else {
			alert("Please select a Country or City");
		}
	}
}

