var url= '';
(function ($, Drupal, drupalSettings) {
$(".block-title").empty();
var lang = $(".lang").val();
var catname = $(".catname").val();
var address = $(".cat_address").val();
var data_th = 'รายชื่อธุรกิจในหมวด "'+catname+'" ที่อยู่ใน '+address+'';
var data_en = 'Business on category "'+catname+'" at '+address+'';
if(lang == "th") {
$(".block-title").css({'line-height':'1.75','border':'solid 1px #ddd','border-bottom':'0','background-color':'#fff'}).append(data_th);
}else{
$(".block-title").css({'line-height':'1.75','border':'solid 1px #ddd','border-bottom':'0','background-color':'#fff'}).append(data_en);
}
})(jQuery, Drupal, drupalSettings);
function print_content(){
var printContents = jQuery("#block-bootstrap-content").html();
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
}
function hover_share(data){
var src = data.getAttribute('src');
var hover = src.replace("1","2");
data.setAttribute('src',hover);
}
function out_share(data){
var src = data.getAttribute('src');
var hover = src.replace("2","1");
data.setAttribute('src',hover);
}
function sendmail(obj){
var data = jQuery(obj).attr('data-value');
var data_from = jQuery(obj).attr('data-from');
var from = data_from;
var content = data;
var link = "mailto:email@address.com"
+ "?subject="+from
+ "&body="+content;
window.location.href = link;
}