﻿var backComment="A brief account of the Islamic background of the Bayanic faith.";
var histComment="A brief account of the events before and after the proclamation.";
var libComment="Bayanic resources: Scriptures, Books; Manuscripts; Exhibits.";
var calComment="Describes Bayanic Calendar, significant days.";
var teachComment="A summary of the main teachings extracted from Bayanic works.";
var oblComment="Religious obligations in terms of prayers and obligatories.";
var sciComment="Computation of letters and word using ABJAD table and their semantics.";
var whoComment="A brief introduction of persons with positive or adverse impact.";
var privComment="Restricted access to administrative functions and certain resources.";
var bismComment="The openning words in Bayan. The most important formula";
var hay1Comment="(Haykal) Bayanic icon. Manifestation of God in human personality.";
var hay2Comment="Mirror of Haykal. Representing the station of Mirrorship; See Glossary.";
var dateComment="Today's date. B.E for Bayanic Era (dd-mm-yyy) beginning 20th March 1850.";
var helpComment="Help with Persian font and browser compatibility.";
var initComment="Re-set this page back to the initial content.";
var glosComment="A quick reference of some of the terms in Bayanic literature.";
var bahComment="Materials for the study of Bahaism and its claims supported by documentary evidence (in progress).";
var newComment="Find out what is new since you last visited us.";
var verseComment="Quote from Bayanic sacred scriptures generated randomly every time this page is displayed.";

function remRemark(e, imgName)
{
	
     document.getElementById('x1').style.visibility = 'hidden';
     document.mainForm.butDesc.style.backgroundColor= '#99ccff';
     document.mainForm.butDesc.value="";
     document.getElementById('x2').style.visibility = 'hidden';
     
     if (imgName == 'new')
	 changeCol(e, 'cc0000')
     else
         changeCol(e, 'ffcc99');
     
     if (imgName == 'pers')
	document.mainForm.pers.value='Persian'    
}

function addRemark(obj, imgName, color) 
{
     switch (imgName)
     {
        case "back" : document.mainForm.butDesc.value=backComment;
	              document.mainForm.butDesc.style.backgroundColor= '#cccc66';
		      changeCol(obj, color);
	              dispHelper();
	              return;
		      
	case "hist" : document.mainForm.butDesc.value=histComment;
	              document.mainForm.butDesc.style.backgroundColor= '#cccc99';
	              dispHelper();
		      changeCol(obj,color);
	              return;
	case "lib" :  document.mainForm.butDesc.value=libComment;
	              document.mainForm.butDesc.style.backgroundColor= '#ffff99';
	              dispHelper();
		      changeCol(obj,color);
	              return;
	case "cal" :  document.mainForm.butDesc.value=calComment;
	              document.mainForm.butDesc.style.backgroundColor= '#ccffcc';
	              dispHelper();
		      changeCol(obj,color);
	              return;
	case "pers" : document.getElementById('x1').style.backgroundColor= '#99cc99';
	              document.mainForm.butDesc.style.backgroundColor= '#99cccc';
		      document.getElementById('x2').style.visibility = 'hidden';
 	              document.getElementById('x1').style.visibility = 'visible';      
		      changeCol(obj,color);
	              return;
	case "obl"  : document.mainForm.butDesc.value=oblComment;
	              document.mainForm.butDesc.style.backgroundColor= '#ffcccc';
	              dispHelper();
		      changeCol(obj,color);
	              return;
	case "teach": document.mainForm.butDesc.value=teachComment;
	              document.mainForm.butDesc.style.backgroundColor= '#ffccff';
	              dispHelper();
		      changeCol(obj,color);
	              return;
	case "sci"  : document.mainForm.butDesc.value=sciComment;
	              document.mainForm.butDesc.style.backgroundColor= '#99cccc';
	              dispHelper();
		      changeCol(obj,color);
	              return;
	case "who"  : document.mainForm.butDesc.value=whoComment;
	              document.mainForm.butDesc.style.backgroundColor= '#ccffff';
	              dispHelper();
		      changeCol(obj,color);
	              return;
	case "priv" : document.mainForm.butDesc.value=privComment;
	              document.mainForm.butDesc.style.backgroundColor= '#9BCC99';
	              dispHelper();
		      changeCol(obj,color);
	              return;
	case "help" : document.mainForm.butDesc.value=helpComment;
	              document.mainForm.butDesc.style.backgroundColor= '#cccccc';
	              dispHelper();
		      changeCol(obj,color);
	              return;
	case "init" : document.mainForm.butDesc.value=initComment;
	              document.mainForm.butDesc.style.backgroundColor= '#cccc99';
	              dispHelper();
		      changeCol(obj,color);
	              return;
	case "glos" : document.mainForm.butDesc.value=glosComment;
	              document.mainForm.butDesc.style.backgroundColor= '#ffcc66';
	              dispHelper();
		      changeCol(obj,color);
	              return;
	case "bah" : document.mainForm.butDesc.value=bahComment;
	              document.mainForm.butDesc.style.backgroundColor= '#ccccff';
	              dispHelper();
		      changeCol(obj,color);
	              return;
	case "new" :  document.mainForm.butDesc.value=newComment;
	              document.mainForm.butDesc.style.backgroundColor= '#99cc66';
	              dispHelper();
		      changeCol(obj,color);
	              return;
     }

}

function dispHelper()
{
//    document.mainForm.butDesc.style.backgroundColor= '#FFCC99';
    document.getElementById('x2').style.visibility = 'visible';
}


function imgOffOnly()
{
     document.mainForm.butDesc.value="";
     document.mainForm.butDesc.style.backgroundColor= '#99ccff';
}

function showStat()
{
     document.getElementById('libTree').style.visibility = 'hidden';
     document.getElementById('statLib').style.visibility = 'visible';
}

function showDyn()
{
     document.getElementById('statLib').style.visibility = 'hidden';
     document.getElementById('libTree').style.visibility = 'visible';
}

function helpOn(obj,imgName, color)
{
     switch (imgName)
     {
        case "bism" : document.mainForm.butDesc.value=bismComment;
                      document.getElementById('x2').style.visibility = 'visible';
		      document.mainForm.butDesc.style.backgroundColor= '#FFCC99';
		      changeCol(obj,color);
	              return;
        case "hay1"  : document.mainForm.butDesc.value=hay1Comment;
                      document.getElementById('x2').style.visibility = 'visible';
		      document.mainForm.butDesc.style.backgroundColor= '#FFCC99';
		      changeCol(obj,color);
	              return;
        case "hay2"  : document.mainForm.butDesc.value=hay2Comment;
                       document.getElementById('x2').style.visibility = 'visible';
		       document.mainForm.butDesc.style.backgroundColor= '#FFCC99';
		       changeCol(obj,color);
	               return;
	case "date"  : document.mainForm.butDesc.value=dateComment;
                       document.getElementById('x2').style.visibility = 'visible';
		       document.mainForm.butDesc.style.backgroundColor= '#FFFFCC';
		       changeCol(obj,color);
	               return;
	case "verse" : document.mainForm.butDesc.value=verseComment;
                       document.getElementById('x2').style.visibility = 'visible';
		       document.mainForm.butDesc.style.backgroundColor= '#FFCC99';
		       changeCol(obj,color);
	               return;
     }
}

function helpOff(imgName)
{
    document.getElementById('x2').style.visibility = 'hidden';
}

function showDiv(divName)
{
  hideAllDivs();
  document.getElementById(divName).style.visibility = 'visible';
  if (document.getElementById(divName) == document.getElementById('libHeader'))
  {
     document.getElementById('libTree').style.visibility = 'visible'; 
     document.getElementById('home').style.visibility = 'visible';
  }
  else
  if (document.getElementById(divName) == document.getElementById('calHeader'))
  {
     document.getElementById('calTree').style.visibility = 'visible'; 
     document.getElementById('home').style.visibility = 'visible';
  }
  else
  if (document.getElementById(divName) == document.getElementById('bahHeader'))
  {
     document.getElementById('bahaismTree').style.visibility = 'visible'; 
     document.getElementById('home').style.visibility = 'visible';
  }
  else
  if (document.getElementById(divName) == document.getElementById('notAvailable'))
  {
     document.getElementById('home').style.visibility = 'visible';
  }
  else
  if (document.getElementById(divName) == document.getElementById('impDay'))
  {
     document.getElementById('home').style.visibility = 'visible';
  }
}

function hideAllDivs()
{
   document.getElementById('mainPage').style.visibility = 'hidden';
   document.getElementById('home').style.visibility = 'hidden';
   document.getElementById('notAvailable').style.visibility = 'hidden';
   document.getElementById('libHeader').style.visibility = 'hidden'; 
   document.getElementById('calHeader').style.visibility = 'hidden'; 
   document.getElementById('libTree').style.visibility = 'hidden'; 
   document.getElementById('calTree').style.visibility = 'hidden'; 
   document.getElementById('bahHeader').style.visibility = 'hidden'; 
   document.getElementById('bahaismTree').style.visibility = 'hidden'; 
   document.getElementById('statLib').style.visibility = 'hidden'; 
   document.getElementById('impDay').style.visibility = 'hidden'; 
}


function changeCol(e, col)
{
   var el=window.event? event.srcElement: e.target

    if (el.tagName=="INPUT"&&el.type=="button")
       el.style.backgroundColor=col
    if (col == '99cc66')
	el.style.color='black'    
    if (col == 'cc0000')
	el.style.color='white'     
    if (col == '99cc99')
	el.value='فارسی'    
   
}

function linkto(url)
{
    window.location=url
}

