var myurl = window.location.href;
var currentLang = myurl.replace(/\w+:\/\/[\w:.]+/, '');

$("#countryList option").each(
    function(){            
        if ($(this).val() == currentLang) {
            $(this).attr("selected", "selected");
        }
    }
);


function Show_Popup(action, userid) {
$('#popup').fadeIn('fast');
$('#window').fadeIn('fast');
}
function Close_Popup() {
$('#popup').fadeOut('fast');
$('#window').fadeOut('fast');
}

    
$(document).ready(function(){
    $('#countryList').change(function() {
        window.location = $('#countryList option:selected').val();
    });

    $('a.external').click(function(event) {
        window.open(this.href);
        return false;
    });


    $('var.parent').each(function() {
        var target = this;
        $.each(this.className.split(' '), function() {
            if (this == 'parent') target = $(target).parent();
            else  $(target).addClass(this);
        });
    });
});
