$(document).ready( function() {
	var tld_select = $("select[id = 'domains-search-select']");

	if(typeof(tlds_index) != "undefined" && typeof(tld_select) != "undefined") {
		tld_select.append("<option disabled=\"disabled\">----Popular domains----</option>");
		tld_select.append("<option value=\"" + tlds_index[".co"] + "\">co" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".me"] + "\" selected=\"\">me" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".co.uk"] + "\">co.uk" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".eu"] + "\">eu" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".mobi"] + "\">mobi" + "</option>");		
		tld_select.append("<option value=\"" + tlds_index[".com"] + "\">com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".net"] + "\">net" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".org"] + "\">org" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".biz"] + "\">biz" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".info"] + "\">info" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".im"] + "\">im" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".tel"] + "\">tel" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".tv"] + "\">tv" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".ie"] + "\">ie" + "</option>");
		
		tld_select.append("<option disabled=\"disabled\">----European domains----</option>");
		tld_select.append("<option value=\"" + tlds_index[".am"] + "\">am" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".be"] + "\">be" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".ch"] + "\">ch" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".co.nl"] + "\">co.nl" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".de.com"] + "\">de.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".es"] + "\">es" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".eu.com"] + "\">eu.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".gb.com"] + "\">gb.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".gb.net"] + "\">gb.net" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".gg"] + "\">gg" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".gl"] + "\">gl" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".gs"] + "\">gs" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".hu.com"] + "\">hu.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".io"] + "\">io" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".it"] + "\">it" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".je"] + "\">je" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".li"] + "\">li" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".me.uk"] + "\">me.uk" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".ms"] + "\">ms" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".no.com"] + "\">no.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".org.uk"] + "\">org.uk" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".ru.com"] + "\">ru.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".se.com"] + "\">se.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".se.net"] + "\">se.net" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".sh"] + "\">sh" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".tc"] + "\">tc" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".uk.com"] + "\">uk.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".uk.net"] + "\">uk.net" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".vg"] + "\">vg" + "</option>");

		tld_select.append("<option disabled=\"disabled\">----Asian / Australian domains----</option>");
		tld_select.append("<option value=\"" + tlds_index[".ae.org"] + "\">ae.org" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".asia"] + "\">asia" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".cc"] + "\">cc" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".com.tw"] + "\">com.tw" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".cn.com"] + "\">cn.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".co.nz"] + "\">co.nz" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".idv.tw"] + "\">idv.tw" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".in"] + "\">in" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".io"] + "\">io" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".jpn.com"] + "\">jpn.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".kr.com"] + "\">kr.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".la"] + "\">la" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".org.tw"] + "\">org.tw" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".ru.com"] + "\">ru.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".sa.com"] + "\">sa.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".tw"] + "\">tw" + "</option>");

		tld_select.append("<option disabled=\"disabled\">----American / Pacific domains----</option>");
		tld_select.append("<option value=\"" + tlds_index[".ac"] + "\">ac" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".ar.com"] + "\">ar.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".br.com"] + "\">br.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".bz"] + "\">bz" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".co"] + "\">co" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".fm"] + "\">fm" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".ms"] + "\">ms" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".nu"] + "\">nu" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".qc.com"] + "\">qc.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".sh"] + "\">sh" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".tc"] + "\">tc" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".us"] + "\">us" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".us.com"] + "\">us.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".uy.com"] + "\">uy.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".vg"] + "\">vg" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".ws"] + "\">ws" + "</option>");

		tld_select.append("<option disabled=\"disabled\">----African domains----</option>");
		tld_select.append("<option value=\"" + tlds_index[".cm"] + "\">cm" + "</option>");		
		tld_select.append("<option value=\"" + tlds_index[".co.za"] + "\">co.za" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".za.com"] + "\">za.com" + "</option>");
		tld_select.append("<option value=\"" + tlds_index[".sc"] + "\">sc" + "</option>");

		tld_select.append("<option disabled=\"disabled\">----Other domains----</option>");
        tld_select.append("<option value=\"" + tlds_index[".name"] + "\">name" + "</option>");

	}
});


