/*function refresh_rates()
{
   $.ajax({
        url: "ajax_refresh_rates.php",
        cache: false,
        success: function(html){
            $("#rates_data").html(html);
        }
    });
}*/

function openNews(press_release_id, domain_url_www)
{
    $.ajax({
        url: domain_url_www+"/pages/ajax_open_news.php?press_release_id="+press_release_id,
        cache: false,
        success: function(html){
            $("#news_"+press_release_id).html(html);
        }
    });
}

function submitform()
{
    document.forms["registration_form"].submit();
}

function captcha_refresh()
{
    $.ajax({
        url: "captcha/ajax_captcha_refresh.php",
        cache: false,
        success: function(html){
            $("#captcha_image").html(html);
        }
    });
}

function captcha_refresh2()
{
    $.ajax({
        url: "captcha/ajax_captcha_refresh2.php",
        cache: false,
        success: function(html){
            $("#captcha_image2").html(html);
        }
    });
}

function captcha_refresh_registration()
{
    $.ajax({
        url: "captcha/ajax_captcha_refresh_registration.php",
        cache: false,
        success: function(html){
            $("#registration_captcha_image").html(html);
        }
    });
}
        
function feedback_send(domain_url_www)
{
    $.ajax({
        url: domain_url_www+"/pages/ajax_send_feedback.php?feedback_form_name="+$("#feedback_form_name").val()+"&feedback_form_mail="+$("#feedback_form_mail").val()+"&feedback_form_text="+$("#feedback_form_text").val()+"&captcha="+$("#captcha").val(),
        cache: false,
        success: function(html){
            $("#feedback_form").html(html);
        }
    });
}

function message_send_contact(domain_url_www)
{
    $.ajax({
        url: domain_url_www+"/pages/ajax_send_message_contact.php?form_name="+$("#form_name").val()+"&form_mail="+$("#form_email").val()+"&form_text="+$("#form_text").val()+"&captcha="+$("#captcha2").val(),
        cache: false,
        success: function(html){
            if(html == 'error') alert("An error occurred. Your message has not been sent. Please, fill the form correctly");
            else $("#news_block").html(html);
        }
    });
}
        
function message_send_callme_back(domain_url_www)
{
    $.ajax({
        url: domain_url_www+"/pages/ajax_send_message_callme_back.php?form_name="+$("#form_name").val()+"&form_email="+$("#form_email").val()+"&form_phone="+$("#form_phone").val()+"&form_time="+$("#form_time").val()+"&form_country="+$("#form_country").val()+"&form_language="+$("#form_language").val()+"&form_text="+$("#form_text").val()+"&captcha="+$("#captcha2").val(),
        cache: false,
        success: function(html){
            if(html == 'error') alert("An error occurred. Your message has not been sent. Please, fill the form correctly");
            else $("#news_block").html(html);
        }
    });
}

function message_send_callus()
{
    $.ajax({
        url: "ajax_send_message_callus.php?form_name="+$("#form_name").val()+"&form_mail="+$("#form_mail").val()+"&form_phone="+$("#form_phone").val()+"&form_time="+$("#form_time").val()+"&form_country="+$("#form_country").val()+"&form_language="+$("#form_language").val()+"&form_text="+$("#form_text").val()+"&captcha="+$("#captcha2").val(),
        cache: false,
        success: function(html){
            $("#news_block").html(html);
        }
    });
}

function addbookmark(url,desc){

    var nonie = 'Sorry, only Internet Explorer supports this method to add a bookmark/favourite\n But please feel free to visit the site\'s home page to add a bookmark manually';

    if(!url && !desc){
        var bookmarkurl		= "http://www.uwcfs.com/";
        var bookmarktitle	= "UWC Financial Services Limited - Money transmitting services, Bank transfers services, Exchange Money services";
    }else{
        var bookmarkurl		= url;
        var bookmarktitle	= desc;
    }


    if (window.sidebar) { // Mozilla Firefox Bookmark
        alert('Due to security restrictions placed in Firefox, we are unable to automatically add a bookmark.\nPlease navigate to the home page and press: CTRL+D to add one manually.');
    } else if(document.all){ // IE Favourites
        window.external.AddFavorite(bookmarkurl,bookmarktitle);
    } else {
        alert(nonie);
    }
}

function open_modal()
{

    $('#basic-modal-content').modal();

}

function open_live_chat()
{

    $('#basic-modal-content-sm').modal();

}

function jump(link)
{document.location.href = link + "&back_url=" + document.location.href;}

function ShowHide_Room_Description(ElementId)
{
 thistd = document.getElementById(ElementId);
 thistd.style.display = (thistd.style.display == 'none' || thistd.style.display == '' ? 'block' : 'none');
}

function HideShow_Room_Description(ElementId)
{
 thistd = document.getElementById(ElementId);
 thistd.style.display = (thistd.style.display == 'block' || thistd.style.display == '' ? 'none' : 'block');
}

function Hide_Room_Description(ElementId)
{
 thistd = document.getElementById(ElementId);
 thistd.style.display="none";
}

function Show_Room_Description(ElementId)
{
 thistd = document.getElementById(ElementId);
 thistd.style.display="block";
}
function openLiveChat() {
  var live_chat_id = window.document.getElementById('php_live_id');
  var function_name = 'launch_support_'+live_chat_id.value+'';
  //top.function_name();
  eval(function_name)();
}
function hrefLiveChat() {
  var php_live_link = window.document.getElementById('php_live_link');
  php_live_link.style.borderBottom="1px solid rgb(91, 187, 1)";
  php_live_link.style.color="rgb(91, 187, 1)";
}
function outLiveChat() {
  var php_live_link = window.document.getElementById('php_live_link');
  php_live_link.style.borderBottom="none";
  php_live_link.style.color="#6A6A6A";
}
function show_faq_content(faq_id) {
  var faq_content = window.document.getElementById('faq_content_'+faq_id);

  if(faq_content.style.display == "none") {
    faq_content.style.display = "";
  } else {
    faq_content.style.display = "none";
  }
}
function soc_change_text(soc_text) {
  var soc_text_cont = window.document.getElementById('soc_text_cont');
  soc_text_cont.innerHTML = soc_text;
}