//**************************************************** Mp3 ********************************************************
//var warsh_number = 16;
//var qaloon_number = 22;
//var shoubaa_number = 29;
//var warsh_number = 20;
//var qaloon_number = 26;
//var shoubaa_number = 33;
var warsh_number = 30;
var qaloon_number = 37;
var shoubaa_number = 43;
//alert(warsh_number);
function get_ayah_mp3file(sel_reciter_list_id, sel_reciter, sel_surah, sel_Ayah) {
var sel_mp3
// var ok = UrlExists(sel_reciter + "/" + ppad(sel_surah, 3) + ppad(sel_Ayah, 3) + '.mp3')
// if (ok = true) {
// alert("هذا الملف غير موجود" + sel_reciter + "/" + ppad(sel_surah, 3) + ppad(sel_Ayah, 3) + '.mp3')
// return false
// }
var reciter_index = document.getElementById(sel_reciter_list_id).selectedIndex
// if (reciter_index < 12) {
if (reciter_index < 0 ) {
if (sel_surah > 0 && sel_surah < 8) {
sel_mp3 = sel_reciter + "/" + ppad(sel_surah, 3) + ppad(sel_Ayah, 3) + '.mp3';
};
if (sel_surah > 7 && sel_surah < 20) {
sel_mp3 = sel_reciter + "_2/" + ppad(sel_surah, 3) + ppad(sel_Ayah, 3) + '.mp3';
};
if (sel_surah > 19 && sel_surah < 30) {
sel_mp3 = sel_reciter + "_3/" + ppad(sel_surah, 3) + ppad(sel_Ayah, 3) + '.mp3';
};
if (sel_surah > 29 && sel_surah < 44) {
sel_mp3 = sel_reciter + "_4/" + ppad(sel_surah, 3) + ppad(sel_Ayah, 3) + '.mp3';
};
if (sel_surah > 43 && sel_surah < 67) {
sel_mp3 = sel_reciter + "_5/" + ppad(sel_surah, 3) + ppad(sel_Ayah, 3) + '.mp3';
};
if (sel_surah > 66) {
sel_mp3 = sel_reciter + "_6/" + ppad(sel_surah, 3) + ppad(sel_Ayah, 3) + '.mp3';
};
}
else {
sel_mp3 = sel_reciter + ppad(sel_surah, 3) + ppad(sel_Ayah, 3) + '.mp3';
}
//****************************************************************************************************************************************
return sel_mp3;
};
//********************************************************************************************************************************
function get_page_ayah_source(surah_no) {
//alert(surah_no)
if (surah_no > 0) {
if (surah_no > 0 && surah_no < 8) {
return "https://archive.org/download/Quran4u_Quran_Page_Ayah/"
}
if (surah_no > 7 && surah_no < 20) {
return "https://archive.org/download/Quran4u_Quran_Page_Ayah_2/"
}
if (surah_no > 19 && surah_no < 30) {
return "https://archive.org/download/Quran4u_Quran_Page_Ayah_3/"
}
if (surah_no > 29 && surah_no < 44) {
return "https://archive.org/download/Quran4u_Quran_Page_Ayah_4/"
}
if (surah_no > 43 && surah_no < 67) {
return "https://archive.org/download/Quran4u_Quran_Page_Ayah_5/"
}
if (surah_no > 66) {
return "https://archive.org/download/Quran4u_Quran_Page_Ayah_6/"
}
}
else {
return "https://archive.org/download/Quran4u_Quran_Ayat/"
}
};
//*********************************************************************************************************************************
function play_mp3(div_name,mp3_file) {
document.getElementById(div_name).innerHTML = ''
}
function center_image2(surah_num, ayah_num) {
var topPos = document.getElementById("Ayaimg" + parseInt(surah_num) + "_" + parseInt(ayah_num)).offsetTop;
document.getElementById('Put_Here').scrollTop = topPos - 80;
};
function center_image(ayah_num) {
var topPos = document.getElementById("Ayaimg" + parseInt(ayah_num)).offsetTop;
document.getElementById('Put_Here').scrollTop = topPos - 80;
};
function un_select_all_ayahs(surah_no) {
var j = 1;
for (j = 1; j <= surahsayahs[surah_no]; j++) {
document.getElementById("Ayaimg" + (j)).style.background = "#E3E9F2";
document.getElementById("Ayaimg" + (j)).style.border = "0";
}
}
function un_select_all_ayahs2(surah_no) {
var j = 1;
for (j = 1; j <= surahsayahs[surah_no]; j++) {
document.getElementById("Ayaimg" + surah_no + "_" + (j)).style.background = "#E3E9F2";
document.getElementById("Ayaimg" + surah_no + "_" + (j)).style.border = "0";
}
}
//***********************************************************************************************************
function select_Ayah(Ayah_no) {
//------------------------------------------------------- UnSelect Ayah ------------------------------------------------------
if (Ayah_no > 1) {
document.getElementById("Ayaimg" + (Ayah_no - 1)).style.background = "#E3E9F2";
document.getElementById("Ayaimg" + (Ayah_no - 1)).style.border = "0";
};
//-------------------------------------------------------- Select Ayah ---------------------------------------------------------
document.getElementById("Ayaimg" + Ayah_no).style.background = "#FFE7C1";
document.getElementById("Ayaimg" + Ayah_no).style.border = "thick solid #FFE7C1";
//------------------------------------------------------- Center Ayah -----------------------------------------------------------
var topPos = document.getElementById("Ayaimg" + Ayah_no).offsetTop;
document.getElementById('Put_Here').scrollTop = topPos - 80;
};
//***********************************************************************************************************
function select_Ayah2(Surah_no,Ayah_no) {
//------------------------------------------------------- UnSelect Ayah ------------------------------------------------------
if (Ayah_no > 1) {
document.getElementById("Ayaimg" + Surah_no +"_" + (Ayah_no - 1)).style.background = "#E3E9F2";
document.getElementById("Ayaimg" + Surah_no + "_" + (Ayah_no - 1)).style.border = "0";
};
//-------------------------------------------------------- Select Ayah ---------------------------------------------------------
document.getElementById("Ayaimg" + Surah_no + "_" + Ayah_no).style.background = "#FFE7C1";
document.getElementById("Ayaimg" + Surah_no + "_" + Ayah_no).style.border = "thick solid #FFE7C1";
//------------------------------------------------------- Center Ayah -----------------------------------------------------------
var topPos = document.getElementById("Ayaimg" + Surah_no + "_" + Ayah_no).offsetTop;
document.getElementById('Put_Here').scrollTop = topPos - 80;
};
//*****************************************************************************************************************************
function ppad(number, length) {
var str = '' + number;
while (str.length < length) {
str = '0' + str;
}
return str;
}
//*********************************************************************************************************************************
function UrlExists(url) {
var http = new XMLHttpRequest();
http.open('HEAD', url, false);
http.send();
return http.status != 404;
}
//********************************************************************************************************************************
function get_ayah_source(surah_no) {
//alert(surah_no)
if (surah_no > 0) {
if (surah_no > 0 && surah_no < 8) {
return "https://archive.org/download/Quran4u_Quran_Ayah/"
}
if (surah_no > 7 && surah_no < 20) {
return "https://archive.org/download/Quran4u_Quran_Ayah_2/"
}
if (surah_no > 19 && surah_no < 30) {
return "https://archive.org/download/Quran4u_Quran_Ayah_3/"
}
if (surah_no > 29 && surah_no < 44) {
return "https://archive.org/download/Quran4u_Quran_Ayah_4/"
}
if (surah_no > 43 && surah_no < 67) {
return "https://archive.org/download/Quran4u_Quran_Ayah_5/"
}
if (surah_no > 66) {
return "https://archive.org/download/Quran4u_Quran_Ayah_6/"
}
}
else {
return "https://archive.org/download/Quran4u_Quran_Ayat/"
}
};
//--------------------------------------------------------------------------
var FlashDetect = new function () {
var self = this;
self.installed = false;
self.raw = "";
self.major = -1;
self.minor = -1;
self.revision = -1;
self.revisionStr = "";
var activeXDetectRules = [
{
"name": "ShockwaveFlash.ShockwaveFlash.7",
"version": function (obj) {
return getActiveXVersion(obj);
}
},
{
"name": "ShockwaveFlash.ShockwaveFlash.6",
"version": function (obj) {
var version = "6,0,21";
try {
obj.AllowScriptAccess = "always";
version = getActiveXVersion(obj);
} catch (err) { }
return version;
}
},
{
"name": "ShockwaveFlash.ShockwaveFlash",
"version": function (obj) {
return getActiveXVersion(obj);
}
}
];
/**
* Extract the ActiveX version of the plugin.
*
* @param {Object} The flash ActiveX object.
* @type String
*/
var getActiveXVersion = function (activeXObj) {
var version = -1;
try {
version = activeXObj.GetVariable("$version");
} catch (err) { }
return version;
};
/**
* Try and retrieve an ActiveX object having a specified name.
*
* @param {String} name The ActiveX object name lookup.
* @return One of ActiveX object or a simple object having an attribute of activeXError with a value of true.
* @type Object
*/
var getActiveXObject = function (name) {
var obj = -1;
try {
obj = new ActiveXObject(name);
} catch (err) {
obj = { activeXError: true };
}
return obj;
};
/**
* Parse an ActiveX $version string into an object.
*
* @param {String} str The ActiveX Object GetVariable($version) return value.
* @return An object having raw, major, minor, revision and revisionStr attributes.
* @type Object
*/
var parseActiveXVersion = function (str) {
var versionArray = str.split(","); //replace with regex
return {
"raw": str,
"major": parseInt(versionArray[0].split(" ")[1], 10),
"minor": parseInt(versionArray[1], 10),
"revision": parseInt(versionArray[2], 10),
"revisionStr": versionArray[2]
};
};
/**
* Parse a standard enabledPlugin.description into an object.
*
* @param {String} str The enabledPlugin.description value.
* @return An object having raw, major, minor, revision and revisionStr attributes.
* @type Object
*/
var parseStandardVersion = function (str) {
var descParts = str.split(/ +/);
var majorMinor = descParts[2].split(/\./);
var revisionStr = descParts[3];
return {
"raw": str,
"major": parseInt(majorMinor[0], 10),
"minor": parseInt(majorMinor[1], 10),
"revisionStr": revisionStr,
"revision": parseRevisionStrToInt(revisionStr)
};
};
/**
* Parse the plugin revision string into an integer.
*
* @param {String} The revision in string format.
* @type Number
*/
var parseRevisionStrToInt = function (str) {
return parseInt(str.replace(/[a-zA-Z]/g, ""), 10) || self.revision;
};
/**
* Is the major version greater than or equal to a specified version.
*
* @param {Number} version The minimum required major version.
* @type Boolean
*/
self.majorAtLeast = function (version) {
return self.major >= version;
};
/**
* Is the minor version greater than or equal to a specified version.
*
* @param {Number} version The minimum required minor version.
* @type Boolean
*/
self.minorAtLeast = function (version) {
return self.minor >= version;
};
/**
* Is the revision version greater than or equal to a specified version.
*
* @param {Number} version The minimum required revision version.
* @type Boolean
*/
self.revisionAtLeast = function (version) {
return self.revision >= version;
};
/**
* Is the version greater than or equal to a specified major, minor and revision.
*
* @param {Number} major The minimum required major version.
* @param {Number} (Optional) minor The minimum required minor version.
* @param {Number} (Optional) revision The minimum required revision version.
* @type Boolean
*/
self.versionAtLeast = function (major) {
var properties = [self.major, self.minor, self.revision];
var len = Math.min(properties.length, arguments.length);
for (i = 0; i < len; i++) {
if (properties[i] >= arguments[i]) {
if (i + 1 < len && properties[i] == arguments[i]) {
continue;
} else {
return true;
}
} else {
return false;
}
}
};
/**
* Constructor, sets raw, major, minor, revisionStr, revision and installed public properties.
*/
self.FlashDetect = function () {
if (navigator.plugins && navigator.plugins.length > 0) {
var type = 'application/x-shockwave-flash';
var mimeTypes = navigator.mimeTypes;
if (mimeTypes && mimeTypes[type] && mimeTypes[type].enabledPlugin && mimeTypes[type].enabledPlugin.description) {
var version = mimeTypes[type].enabledPlugin.description;
var versionObj = parseStandardVersion(version);
self.raw = versionObj.raw;
self.major = versionObj.major;
self.minor = versionObj.minor;
self.revisionStr = versionObj.revisionStr;
self.revision = versionObj.revision;
self.installed = true;
}
} else if (navigator.appVersion.indexOf("Mac") == -1 && window.execScript) {
var version = -1;
for (var i = 0; i < activeXDetectRules.length && version == -1; i++) {
var obj = getActiveXObject(activeXDetectRules[i].name);
if (!obj.activeXError) {
self.installed = true;
version = activeXDetectRules[i].version(obj);
if (version != -1) {
var versionObj = parseActiveXVersion(version);
self.raw = versionObj.raw;
self.major = versionObj.major;
self.minor = versionObj.minor;
self.revision = versionObj.revision;
self.revisionStr = versionObj.revisionStr;
}
}
}
}
} ();
};
FlashDetect.JS_RELEASE = "1.0.4";
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function falsh_detect() {
if (FlashDetect.installed) {
// document.getElementById("Detect_Flash").src = 'images_Browsers/All.gif' //.style.width = "0px";
// document.getElementById("Detect_Flash").style.width = "0px";
// document.getElementById("Detect_Flash").style.height = "0px";
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// document.getElementById("Detect_Flash").src = 'images_12/Flash_Detect_Ramadan.gif'
document.getElementById("Detect_Flash").src = 'images_Browsers\/All.gif'
}
if (!FlashDetect.installed) {
document.getElementById("Detect_Flash").src = 'images_12/Flash_Detect.gif' //.style.width = "620px";
}
}
//----------------------------------------------------------------------------------------------------------------------------------
function open_sharawy(file_num) {
width = 820;
height = 500;
x = (800 - width) / 2, y = (600 - height) / 2;
if (screen) {
y = (screen.availHeight - height) / 2;
x = (screen.availWidth - width) / 2;
}
window.open('http://elsharawy.com/sharawy.aspx?p_name_english=s' + file_num , 'newWin', 'width=' + width + ',height=' + height + ',screenX=' + x + ',scrollbars=yes,screenY=' + y + ',top=' + y + ',left=' + x);
}
function open_saady_sound(file_num) {
width = 500;
height = 300;
x = (800 - width) / 2, y = (600 - height) / 2;
if (screen) {
y = (screen.availHeight - height) / 2;
x = (screen.availWidth - width) / 2;
}
window.open('Surah_And_Tafsir/' + file_num + '.htm', 'newWin', 'width=' + width + ',height=' + height + ',screenX=' + x + ',scrollbars=yes,screenY=' + y + ',top=' + y + ',left=' + x);
}
//----------------------------------------------------------------------------------------------------------------------------------
function openNabawy() {
width = 660;
height = 500;
x = (800 - width) / 2, y = (600 - height) / 2;
if (screen) {
y = (screen.availHeight - height) / 2;
x = (screen.availWidth - width) / 2;
}
window.open('Tafsir_Nabawy_prog.aspx', 'newWin', 'width=' + width + ',height=' + height + ',screenX=' + x + ',scrollbars=yes,screenY=' + y + ',top=' + y + ',left=' + x);
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------
function openWindow(SS, AA) {
width = 500;
height = 350;
x = (800 - width) / 2, y = (600 - height) / 2;
if (screen) {
y = (screen.availHeight - height) / 2;
x = (screen.availWidth - width) / 2;
}
window.open('PopupTafseer.aspx?surah=' + SS + '&Ayah=' + AA, 'newWin', 'width=' + width + ',height=' + height + ',screenX=' + x + ',scrollbars=yes,screenY=' + y + ',top=' + y + ',left=' + x);
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------
function openWindow2(SS, AA) {
width = 500;
height = 470;
x = (800 - width) / 2, y = (600 - height) / 2;
if (screen) {
y = (screen.availHeight - height) / 2;
x = (screen.availWidth - width) / 2;
}
window.open('http://www.qurancomplex.org/quran/ayat_services.asp?l=arb&nSora=' + SS + '&nAya=' + AA, 'newWin', 'width=' + width + ',height=' + height + ',screenX=' + x + ',scrollbars=yes,screenY=' + y + ',top=' + y + ',left=' + x);
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------
function PopupVideo(SS) {
width = 485;
height = 430;
x = (800 - width) / 2, y = (600 - height) / 2;
if (screen) {
y = (screen.availHeight - height) / 2;
x = (screen.availWidth - width) / 2;
}
window.open('Video_AbdelBasit/' + SS + '.htm', 'newWin', 'width=' + width + ',height=' + height + ',screenX=' + x + ',scrollbars=yes,screenY=' + y + ',top=' + y + ',left=' + x);
}
var goto_top_type = -1;
var goto_top_itv = 0;
function goto_top_timer() {
var y = goto_top_type == 1 ? document.documentElement.scrollTop : document.body.scrollTop;
//alert(y);
var moveby = 15; // set this to control scroll seed. minimum is fast
y -= Math.ceil(y * moveby / 100);
if (y < 0)
y = 0;
if (goto_top_type == 1)
document.documentElement.scrollTop = y;
else
document.body.scrollTop = y;
if (y == 0) {
clearInterval(goto_top_itv);
goto_top_itv = 0;
}
}
function goto_top() {
if (goto_top_itv == 0) {
if (document.documentElement && document.documentElement.scrollTop)
goto_top_type = 1;
else if (document.body && document.body.scrollTop)
goto_top_type = 2;
else
goto_top_type = 0;
if (goto_top_type > 0)
goto_top_itv = setInterval('goto_top_timer()', 25);
}
}
function PopupSharawy(SS) {
width = 800;
height = 430;
x = (800 - width) / 2, y = (600 - height) / 2;
if (screen) {
y = (screen.availHeight - height) / 2;
x = (screen.availWidth - width) / 2;
}
window.open('http://elsharawy.com/sharawy.aspx?p_name_english=s' + SS, 'newWin', 'width=' + width + ',height=' + height + ',screenX=' + x + ',scrollbars=yes,screenY=' + y + ',top=' + y + ',left=' + x);
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------
function Image_preload(images) {
if (document.images) {
var i = 0;
var imageArray = new Array();
imageArray = images.split(',');
var imageObj = new Image();
for (i = 0; i <= imageArray.length - 1; i++) {
//document.write('');// Write to page (uncomment to check images)
imageObj.src = imageArray[i];
}
}
}
function PopupWarsh()
{
width = 1000;
height = 600;
x = (1280 - width) / 2, y = (720 - height) / 2;
if (screen)
{
y = (screen.availHeight - height) / 2;
x = (screen.availWidth - width) / 2;
}
window.open('http://v3.quranflash.com/books/Warsh2/?ar', 'newWin', 'width=' + width + ',height=' + height + ',screenX=' + x + ',menubar=no,toolbar=no,scrollbars=yes,screenY=' + y + ',top=' + y + ',left=' + x);
}