1
';
//var url = window.location.href;
//alert (url);
//alert("inside gettreeviewbook");
//alert(xmlname);
//alert(type);
/*if (edition.indexOf("#") > 0){
edition1 = edition
edition = edition.substring(0,edition.indexOf("#"));
bookpath=getbookpath(xmlname,edition1,language);
}else{
bookpath=getbookpath(xmlname,edition,language);
}*/
//alert(edition);
//alert(language);
bookpath=getbookpath(xmlname,edition,language);
//alert ("book path=="+bookpath);
if(History!='Back')
load(bookpath);
//alert(window.location.href);
//document.location.reload();
if(document.getElementById('next')!==null){
if(document.getElementById('next').style.display=='block'){
document.getElementById('next').style.display="none";
document.getElementById('prev').style.display="none";
}
}
if(document.getElementById('download')!==null){
document.getElementById('download').style.display="none";
}
//url='http://'+location.hostname+'/readfromxml.php?keyword='+xmlname+'&type='+type+'&edition='+edition+'&language='+language;
//alert(url);
$.ajax({
url: 'https://'+location.hostname+'/readfromxml.php?keyword='+xmlname+'&type='+type+'&edition='+edition+'&language='+language,
type: 'post',
data: {'action': 'follow', 'userid': '11239528343'},
success: function(data, status) {
document.getElementById('bodycontent').innerHTML=data;
prepareList();
},
error: function(xhr, desc, err) {
console.log(xhr);
console.log("Details: " + desc + "\nError:" + err);
}
});
$('.dropdown.open .dropdown-toggle').dropdown('toggle');
}
function getbookpath(xmlname,edition,language){
//alert('xmlname= '+xmlname);
//alert('edition= '+edition);
//alert('language= '+language);
//added by Arindra
/*if(edition.indexOf("/") >= 0){
//alert('yes');
var slashpos = edition.search("/");
var reststr = edition.substring(slashpos);
//alert(reststr);
}*/
var xml=xmlname.replace(/\\/g,'/').replace( /.*\//, '' );
var bookpath="_StaticContent/SriAurobindoAshram/-09 E-Library/";
if(xml.indexOf("sriaurobindo") >=0){
bookpath+="-01 Works of Sri Aurobindo";
}else if(xml.indexOf("worksofthemother") >=0){
bookpath+="-02 Works of The Mother";
}else if(xml.indexOf("disciples") >=0){
bookpath+="-03 Disciples";
}else if(xml.indexOf("compilations") >=0){
bookpath+="-04 Compilations";
}else if(xml.indexOf("magazines") >=0){
bookpath+="-05 Magazines";
}else if(xml.indexOf("authorsfromothercenters") >=0){
bookpath+="-06 Authors from Other Centers";
}else if(xml.indexOf("authorsfromauroville") >=0){
bookpath+="-07 Authors from Auroville";
}else if(xml.indexOf("otherauthors") >=0){
bookpath+="-08 Other Authors";
}
if(language=="english"){
bookpath+="/-01 English";
}else if(language=="french"){
bookpath+="/-02 French";
}else if(language=="german"){
bookpath+="/-03 German";
}else if(language=="russian"){
bookpath+="/-04 Russian";
}else if(language=="tamil"){
bookpath+="/-05 Tamil";
}else if(language=="gujarati"){
bookpath+="/-06 Gujarati";
}else if(language=="marathi"){
bookpath+="/-07 Marathi";
}else if(language=="oriya"){
bookpath+="/-08 Oriya";
}else if(language=="hindi"){
bookpath+="/-09 Hindi";
}else if(language=="kannada"){
bookpath+="/-10 Kannada";
}else if(language=="spanish"){
bookpath+="/-11 Spanish";
}else if(language=="kannada"){
bookpath+="/-10 Kannada";
}else if(language=="spanish"){
bookpath+="/-11 Spanish";
}else if(language=="bengali"){
bookpath+="/-12 Bengali";
}else if(language=="telugu"){
bookpath+="/-13 Telugu";
}else if(language=="sanskrit"){
bookpath+="/-14 Sanskrit";
}else{
if(xml.indexOf("disciples") >=0 || xml.indexOf("authorsfromothercenters") >=0 || xml.indexOf("otherauthors") >=0 || xml.indexOf("authorsfromauroville") >=0){
bookpath+="/"+language.toProperCase();
}
}
// we have to add new languages if more is available
if(edition=='sabcl'){
bookpath+="/-01_SABCL";
}else if(edition=='other editions'){
bookpath+="/-02_Other Editions";
}else if(edition=='manuscripts'){
bookpath+="/-04_Manuscripts";
}else if(edition=='cwsa'){
bookpath+="/-03_CWSA";
}else if(edition=='manuscript'){
bookpath+="/-05_Manuscript";
}else if(edition=='cwmce'){
bookpath+="/-01_CWMCE";
}else if(edition=='agenda'){
bookpath+="/-03_Agenda";
}else if(edition=='sraddha'){
bookpath+="/Sraddha";
}else if(edition=='sri aurobindo - archives and research'){
bookpath+="/Sri Aurobindo - Archives and Research";
}else if(edition=='the advent'){
bookpath+="/The Advent";
}else if(edition=='bulletin'){
bookpath+="/-01_Bulletin";
}else if(edition=='arpan'){
bookpath+="/Arpan";
}else if(edition=='sahaj satsang'){
bookpath+="/Sahaj Satsang";
}else if(edition=='sanjeevan'){
bookpath+="/Sanjeevan";
}else{
if(edition!=""){
if(xml.indexOf("disciples") >=0 || xml.indexOf("authorsfromothercenters") >=0){
if(edition.indexOf("/") >=0){
var splitstr=edition.split("/");
for (var i=0;i


