//////////////////////////////////////////////////////////////////////
/* ***************************************************************************
Word Meanings
*************************************************************************** */
mArea = ".KKMmm";
wArea = ".KKMwordmeaning";
function KKMm(w) {
if(w == ""){return;}
$(wArea).html("<div class='KKMloader'></div>");
$(".KKMloader").css("display", "block");
var pData = {"w" : w};
jQuery.ajax({
url: "/kk/otherapps/dictionary/LalitKumarSystemF5RE3V-FindMeaning.php",
data: pData,
type: "POST",
async: false,
success:function(data){$(mArea).animate({bottom: "+=50px",}, "fast");$(wArea).html(data);}
});
}
function KKMc(){
mAreaC = ".KKMwordmeaningC";
$(mAreaC).css("display", "block");
}
function KKMo(){ $(".KKMmm").css("display", "block"); $(mAreaC).css("display", "none");}
function KKMShowMeaning(){
var t = true;
if ($(".poem p").length != 0){t = true;}
if ($("#mw-normal-catlinks ul li a:contains(' रचना')").length != 0){t = false;}
if ($("#mw-normal-catlinks ul li a:contains('प्रसिद्ध रचना')").length != 0){t = true;}
if ($("#mw-normal-catlinks ul li a:contains('लम्बी रचना')").length != 0){t = true;}
if ($("#mw-normal-catlinks ul li a:contains('दलित रचना')").length != 0){t = true;}
if ($("#mw-normal-catlinks ul li a:contains('नज़्म')").length != 0){t = false;}
if ($("#mw-normal-catlinks ul li a:contains('ग़ज़ल')").length != 0){t = false;}
return t;
}
$(document).ready(function() {
if(KKMShowMeaning()){
KKMc();
var p = $('.poem p');
var wmAv = $('.poem').prepend("<div class='wmAv'>हिन्दी शब्दों के अर्थ उपलब्ध हैं। शब्द पर डबल क्लिक करें। अन्य शब्दों पर कार्य जारी है।</div>");
p.css({ cursor: 'pointer' });
p.dblclick(function(e) {
$(mArea).animate({bottom: "-=50px"}, "fast")
KKMc();
var range = window.getSelection() || document.getSelection() || document.selection.createRange();
var w = $.trim(range.toString());
if(w != '') {
KKMm(w);
KKMo();
}
range.collapse();
e.stopPropagation();
});
$(mAreaC).css("display", "none");
$(".KKMcloseMeaning").click(function(e) {
$(".KKMmm").css("display", "none");
});
}
});
//////////////////////////////////////////////////////////////////////
/* ***************************************************************************
Function for showing star volunteers' random photo
*************************************************************************** */
var randomImagesArray = ["1.jpg",
"2.jpg",
"3.jpg",
"4.jpg",
"5.jpg",
"6.jpg",
"7.jpg"];
var rImageBase = "http://kavitakosh.org/kk/otherapps/ramdom-photo/star-volunteers/";
function displayRPic(){
var num = Math.floor(Math.random() * 7); // 0...6
document.getElementById("rPicStarVolunteers").src = rImageBase+randomImagesArray[num];
}
displayRPic();