var limit_to_country_count = 10;


function get_country_all_by_continent_with_limit(continent){
    var result = "";
    var i = 0;
    if(continent=="Europe"){
        for ( i=0;i<country_of_Europe.length && i<limit_to_country_count;i++ ) {
            result += ' <span  class="dest_on_mouseover_hand"  onclick="get_city_by_country_with_comma(\''+country_of_Europe[i]+'\')" >'+country_of_Europe[i]+'</span>, ';
        }
        if(country_of_Europe.length<=limit_to_country_count)
            result = result.substr(0, result.length-2);
        else
        result += ' <span  class="dest_on_mouseover_hand"  onclick="get_country_by_continent_no_limit(\''+continent+'\')" >Others...</span> ';
    }

    if(continent=="Asia"){
        for ( i=0;i<country_of_Asia.length && i<limit_to_country_count;i++ ) {
            result += ' <span  class="dest_on_mouseover_hand"  onclick="get_city_by_country_with_comma(\''+country_of_Asia[i]+'\')" >'+country_of_Asia[i]+'</span>, ';
        }
        if(country_of_Asia.length<=limit_to_country_count)
            result = result.substr(0, result.length-2);
        else
        result += ' <span  class="dest_on_mouseover_hand"  onclick="get_country_by_continent_no_limit(\''+continent+'\')" >Others...</span> ';
    }

    if(continent=="Australia"){
        for ( i=0;i<country_of_Australia.length && i<limit_to_country_count;i++ ) {
            result += ' <span  class="dest_on_mouseover_hand"  onclick="get_city_by_country_with_comma(\''+country_of_Australia[i]+'\')" >'+country_of_Australia[i]+'</span>, ';
        }
        if(country_of_Australia.length<=limit_to_country_count)
            result = result.substr(0, result.length-2);
        else
            result += ' <span  class="dest_on_mouseover_hand"  onclick="get_country_by_continent_no_limit(\''+continent+'\')" >Others...</span> ';
    }

    if(continent=="North America"){
        for ( i=0;i<country_of_North_America.length && i<limit_to_country_count;i++ ) {
            result += ' <span  class="dest_on_mouseover_hand"  onclick="get_city_by_country_with_comma(\''+country_of_North_America[i]+'\')" >'+country_of_North_America[i]+'</span>, ';
        }
        if(country_of_North_America.length<=limit_to_country_count)
            result = result.substr(0, result.length-2);
        else
            result += ' <span  class="dest_on_mouseover_hand"  onclick="get_country_by_continent_no_limit(\''+continent+'\')" >Others...</span> ';
    }

    if(continent=="Africa"){
        for ( i=0;i<country_of_Africa.length && i<limit_to_country_count;i++ ) {
            result += ' <span  class="dest_on_mouseover_hand"  onclick="get_city_by_country_with_comma(\''+country_of_Africa[i]+'\')" >'+country_of_Africa[i]+'</span>, ';
        }
        if(country_of_Africa.length<=limit_to_country_count)
            result = result.substr(0, result.length-2);
        else
            result += ' <span  class="dest_on_mouseover_hand"  onclick="get_country_by_continent_no_limit(\''+continent+'\')" >Others...</span> ';
    }

    if(continent=="South America"){
        for ( i=0;i<country_of_South_America.length && i<limit_to_country_count;i++ ) {
            result += ' <span  class="dest_on_mouseover_hand"  onclick="get_city_by_country_with_comma(\''+country_of_South_America[i]+'\')" >'+country_of_South_America[i]+'</span>, ';
        }
        if(country_of_South_America.length<=limit_to_country_count)
            result = result.substr(0, result.length-2);
        else
        result += ' <span  class="dest_on_mouseover_hand"  onclick="get_country_by_continent_no_limit(\''+continent+'\')" >Others...</span> ';
    }

    document.getElementById('countries_by_continents').innerHTML = result;

    var cont = "<span  class=\"dest_on_mouseover_hand\" href=\"javascript:;\" onclick=\"get_country_all_by_continent_with_limit('"+continent+"')\" >" + continent + "</span>" + " &#187; ";
    document.getElementById('world_map_part_continent').innerHTML = cont;
    document.getElementById('hidden_continent').value = cont;
    document.getElementById('continent').value = continent;

}

function get_country_by_continent_no_limit(continent){
	var result = "";
    var i = 0;
    if(continent=="Europe"){
        for ( i=0;i<(country_of_Europe).length;i++ ) {
            result += ' <span  class="dest_on_mouseover_hand"  onclick="get_city_by_country_with_comma(\''+country_of_Europe[i]+'\')" >'+country_of_Europe[i]+'</span>, ';
        }
        result = result.substr(0, result.length-2);
    }

    if(continent=="Asia"){
        for ( i=0;i<country_of_Asia.length;i++ ) {
            result += ' <span  class="dest_on_mouseover_hand"  onclick="get_city_by_country_with_comma(\''+country_of_Asia[i]+'\')" >'+country_of_Asia[i]+'</span>, ';
        }
        result = result.substr(0, result.length-2);
    }

     if(continent=="Australia"){
        for ( i=0;i<country_of_Australia.length;i++ ) {
            result += ' <span  class="dest_on_mouseover_hand"  onclick="get_city_by_country_with_comma(\''+country_of_Australia[i]+'\')" >'+country_of_Australia[i]+'</span>, ';
        }
        result = result.substr(0, result.length-2);
    }

    if(continent=="North America"){
        for ( i=0;i<country_of_North_America.length;i++ ) {
            result += ' <span  class="dest_on_mouseover_hand"  onclick="get_city_by_country_with_comma(\''+country_of_North_America[i]+'\')" >'+country_of_North_America[i]+'</span>, ';
        }
        result = result.substr(0, result.length-2);
    }

    if(continent=="Africa"){
        for ( i=0;i<country_of_Africa.length;i++ ) {
            result += ' <span  class="dest_on_mouseover_hand"  onclick="get_city_by_country_with_comma(\''+country_of_Africa[i]+'\')" >'+country_of_Africa[i]+'</span>, ';
        }
        result = result.substr(0, result.length-2);
    }

    if(continent=="South America"){
        for ( i=0;i<country_of_South_America.length;i++ ) {
            result += ' <span  class="dest_on_mouseover_hand"  onclick="get_city_by_country_with_comma(\''+country_of_South_America[i]+'\')" >'+country_of_South_America[i]+'</span>, ';
        }
        result = result.substr(0, result.length-2);
    }

    document.getElementById('countries_by_continents').innerHTML = result;

	var cont = "<span  class=\"dest_on_mouseover_hand\" onclick=\"get_country_all_by_continent_with_limit('"+continent+"')\" >" + continent + "</span>" + " &#187; ";
	document.getElementById('world_map_part_continent').innerHTML = cont;
	document.getElementById('hidden_continent').value = cont;
	document.getElementById('continent').value = continent;
}
var country_of_Asia = ["United Arab Emirates","Saudi Arabia","Philippines","China","Japan","Thailand","India","Sri Lanka","Singapore","Republic Of Korea","Malaysia","Cambodia","Indonesia","Taiwan","Vietnam","Armenia","Bahrain","Israel","Jordan","Kuwait","Lebanon","Oman","Qatar","Syrian Arab Republic"];
var country_of_Europe = ["United Kingdom","Italy","Spain","France","Greece","Switzerland","Germany","Malta","Finland","Turkey","Macedonia (Fyrom)","Moldova, Republic Of","Netherlands","Latvia","Andorra","Slovakia","Slovenia","Sweden","Russian Federation","Romania","Portugal","Poland","Norway","Luxembourg","Lithuania","Albania","Austria","Bosnia And Herzegovina","Belgium","Bulgaria"];
var country_of_Australia = ["Australia","Fiji","New Zealand"];
var country_of_North_America = ["Canada","Usa","Belize","Colombia","Costa Rica","Ecuador","Guatemala","Honduras","Mexico","Nicaragua","Panama","El Salvador"];
var country_of_Africa = ["Angola","Egypt","Kenya","Morocco","Seychelles","Senegal","Tunisia","Tanzania, United Republic Of","South Africa","Zambia"];
var country_of_South_America = ["Argentina","Bolivia","Brazil","Chile","Peru","Paraguay","Uruguay","Venezuela","Antigua And Barbuda","Anguilla","Netherlands Antilles","Aruba","Barbados","Bermuda","Bahamas","Dominican Republic","Grenada","Guadeloupe","Jamaica","Saint Kitts And Nevis","Cayman Islands","Saint Lucia","Martinique","Puerto Rico","Turks And Caicos Islands","Trinidad And Tobago","Saint Vincent And The Grenadines","British Virgin Islands","U.S. Virgin Islands"];


