﻿var backComment="A brief introduction to the Bayanic faith and its Islamic background.";
var histComment="A brief account of the events before and after the proclamation.";
var libComment="Sacred writings of the religion of Bayan including those of the Primal Point Subh-i Azal and His Holiness Qodous. Much of the writings are in Arabic and Persian text.";
var calComment="This section provides you with information on the origin and details of the Bayanic calendar. A conversion tool can convert any date from Gregorian or Persian to the Bayanic date. Use the tool to convert your birth date or important days to Bayanic era.";
var teachComment="A summary of the main teachings extracted from Bayanic works.";
var oblComment="Prayers, Religious Visitations and Homilies دعا و مناجات.";
var sciComment="On the Science of letters based on Bayanic works using the ABJAD table.";
var whoComment="A brief introduction to persons who have played a significant role in the religion of Bayan.";
var privComment="Restricted access to administrative functions and certain resources.";
var bismComment="The first verse in Bayan. It has 19 letters in the Arabic script. For more information visit Science of Letters.";
var hay1Comment="Tablet of 'Haykal'. Manifestation of God in human personality.";
var hay2Comment="The Mirror of Haykal. This representing the station of Mirrorship conferred on Subh-i Azal.";
var dateComment="This is today's date in B.E (Bayanic Era) with the format (dd/mm/yyy) commencing on 20th March 1850. Click on this button to see important days in the Bayanic calendar.";
var helpComment="Help with Persian font and browser compatibility.";
var initComment="Re-set this page back to the initial content.";
var poemComment="Poetry works by Bayani religious icons and other Bayanis.";
var bahComment="This section provides you with the most detailed analysis of the Bahai claims you can find. The materials are for the study of Bahaism supported by many historical documents. You will also find literature by leading Bayani authors who have revealed the conduct of Mirza Husayn-Ali (Baha) and the incompatability of his claim with Bayanic teachings and principals.";
var newComment="You don't need to spend any time to find new materials posted on bayanic.com. Use this link to find out What Is New since you last visited us.";
var verseComment="New quote from Bayanic sacred writings every time this page is displayed.";
var anncComment="Read abount announcements made by the People of Bayan.";
var mirrorComment="Bayanic.com is now available on our mirror web site: www.ThePrimalPoint.com.                                                     Click on this button to navigate to our new web site.";
var contactComment="Use one of our email accounts to report problems or ask questions.";
var feedComment="Please take a couple of minutes to complete a short survey on the contents and features of bayanic.com";
var googleComment="Search the bayanic.com using the Google's search. Please note that not all pages in bayanic.com have been cached by Google. You could also search for Arabic/Persian text.";

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';
//     document.getElementById('x3').style.visibility = 'visible';
     
     if (imgName == 'new')
	 changeCol(e, 'cc0000')
     else
         changeCol(e, 'ffcc99');
     
     if (imgName == 'pers')
	document.mainForm.pers.value='Persian'    
     else
     if (imgName == 'annc')
     	document.mainForm.annc.value='Announcements'

}

function addRemark(obj, imgName, color) 
{
     switch (imgName)
     {
        case "annc" : document.mainForm.butDesc.value=anncComment;
	              document.mainForm.butDesc.style.backgroundColor= '#e8b4e5';
		      changeCol(obj, color);
	        dispHelper();
	        return;
	
	      case "contact" : document.mainForm.butDesc.value=contactComment;
	        document.mainForm.butDesc.style.backgroundColor= '#e4f203';
		      changeCol(obj, color);
	        dispHelper();
	        return;
	        
	      case "mirror" : document.mainForm.butDesc.value=mirrorComment;
	        document.mainForm.butDesc.style.backgroundColor= '#ffffff';
		      changeCol(obj, color);
	        dispHelper();
	        return;
		      
        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" : if (document.getElementById('mainPage').style.visibility == 'visible') { 
	         document.getElementById('x1').style.backgroundColor= '#99cc99';
	         document.mainForm.butDesc.style.backgroundColor= '#99cccc';
		       document.getElementById('x2').style.visibility = 'hidden';
 	         document.getElementById('x1').style.visibility = 'visible';   
			     document.getElementById('x3').style.visibility = 'hidden';
	     }
		       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 "poem" : document.mainForm.butDesc.value=poemComment;
	              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;
	case "feed" :  document.mainForm.butDesc.value=feedComment;
	              document.mainForm.butDesc.style.backgroundColor= '#cccc66';
	              dispHelper();
		      changeCol(obj,color);
	              return;
	case "search" :  document.mainForm.butDesc.value=googleComment;
	              document.mainForm.butDesc.style.backgroundColor= '#FFFFCC';
	              dispHelper();
		      changeCol(obj,color);
	return;
     }

}

function dispHelper()
{
//    document.mainForm.butDesc.style.backgroundColor= '#FFCC99';
      if (document.getElementById('mainPage').style.visibility == 'visible') {
	    document.getElementById('x3').style.visibility = 'hidden';
	    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)
{
    document.getElementById('x3').style.visibility = 'hidden';
     switch (imgName)
     { 
	     case "bism" : 
	     	     if (document.getElementById('mainPage').style.visibility == 'visible') { 
		         document.mainForm.butDesc.value=bismComment;
			 document.getElementById('x2').style.visibility = 'visible'; 
		         document.mainForm.butDesc.style.backgroundColor= '#FFCC99';
		     }
	              changeCol(obj,color);
	              return; 
	    case "hay1"  : 
	    	      if (document.getElementById('mainPage').style.visibility == 'visible') {   
			  document.mainForm.butDesc.value=hay1Comment;
                          document.getElementById('x2').style.visibility = 'visible';
		          document.mainForm.butDesc.style.backgroundColor= '#FFCC99';
		      }
		      changeCol(obj,color);
	              return;
	    case "hay2"  : 
	              if (document.getElementById('mainPage').style.visibility == 'visible') { 
			  document.mainForm.butDesc.value=hay2Comment;
                          document.getElementById('x2').style.visibility = 'visible';
		          document.mainForm.butDesc.style.backgroundColor= '#FFCC99';
		      }
		      changeCol(obj,color);
		      return;
	    case "date"  : 
	               if (document.getElementById('mainPage').style.visibility == 'visible') { 
			   document.mainForm.butDesc.value=dateComment;
                           document.getElementById('x2').style.visibility = 'visible';
		           document.mainForm.butDesc.style.backgroundColor= '#FFFFCC';
		       }
		       changeCol(obj,color); 
	               return;
	    case "verse" : 
	    	       if (document.getElementById('mainPage').style.visibility == 'visible') { 
		          document.mainForm.butDesc.value=verseComment;
                          document.getElementById('x2').style.visibility = 'visible';
		          document.mainForm.butDesc.style.backgroundColor= '#FFCC99';
		       }
		       changeCol(obj,color);
	               return;
	    case "btnG"  :  
	               if (document.getElementById('mainPage').style.visibility == 'visible') { 
		           document.mainForm.butDesc.value=googleComment;
                           document.getElementById('x2').style.visibility = 'visible';
		           document.mainForm.butDesc.style.backgroundColor= '#FFFFCC';
		       }
		       changeCol(obj,color);
	               return;
     }
}

function helpOff(imgName)
{
    document.getElementById('x2').style.visibility = 'hidden';
//    document.getElementById('x3').style.visibility = 'visible';
}

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';
  }
  if (document.getElementById(divName) == document.getElementById('whoHeader'))
  {
     document.getElementById('whoTree').style.visibility = 'visible'; 
     document.getElementById('home').style.visibility = 'visible';
  }
  if (document.getElementById(divName) == document.getElementById('hisHeader'))
  {
     document.getElementById('hisTree').style.visibility = 'visible'; 
     document.getElementById('home').style.visibility = 'visible';
  }
  else
  if (document.getElementById(divName) == document.getElementById('intHeader'))
  {
     document.getElementById('intTree').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';
  }
  if (document.getElementById(divName) == document.getElementById('poemHeader'))
  {
     document.getElementById('poemTree').style.visibility = 'visible'; 
     document.getElementById('home').style.visibility = 'visible';
  }
  if (document.getElementById(divName) == document.getElementById('teachHeader'))
  {
     document.getElementById('teachTree').style.visibility = 'visible'; 
     document.getElementById('home').style.visibility = 'visible';
  }
  if (document.getElementById(divName) == document.getElementById('prayHeader'))
  {
     document.getElementById('prayTree').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';
  }
  else
  if (document.getElementById(divName) == document.getElementById('scienceHeader'))
  {
     document.getElementById('scienceTree').style.visibility = 'visible'; 
     document.getElementById('home').style.visibility = 'visible';
  }
  document.getElementById('feed').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('whoHeader').style.visibility = 'hidden'; 
   document.getElementById('hisHeader').style.visibility = 'hidden'; 
   document.getElementById('libTree').style.visibility = 'hidden'; 
   document.getElementById('calTree').style.visibility = 'hidden'; 
   document.getElementById('whoTree').style.visibility = 'hidden'; 
   document.getElementById('hisTree').style.visibility = 'hidden'; 
   document.getElementById('intHeader').style.visibility = 'hidden'; 
   document.getElementById('intTree').style.visibility = 'hidden'; 
   document.getElementById('bahHeader').style.visibility = 'hidden'; 
   document.getElementById('bahaismTree').style.visibility = 'hidden'; 
   document.getElementById('poemHeader').style.visibility = 'hidden'; 
   document.getElementById('poemTree').style.visibility = 'hidden'; 
   document.getElementById('teachHeader').style.visibility = 'hidden'; 
   document.getElementById('teachTree').style.visibility = 'hidden'; 
   document.getElementById('prayHeader').style.visibility = 'hidden'; 
   document.getElementById('prayTree').style.visibility = 'hidden'; 
   document.getElementById('statLib').style.visibility = 'hidden'; 
   document.getElementById('impDay').style.visibility = 'hidden'; 
   document.getElementById('scienceTree').style.visibility = 'hidden'; 
   document.getElementById('scienceHeader').style.visibility = 'hidden'; 
   document.getElementById('x1').style.visibility = 'hidden'; 
   document.getElementById('x2').style.visibility = 'hidden'; 
   document.getElementById('x3').style.visibility = 'hidden'; 
}


function changeCol(e, col)
{
   var el=window.event? event.srcElement: e.target

    if (el.tagName=="INPUT" && (el.type=="button" || el.type=="submit" ))
       el.style.backgroundColor=col
    if (col == '99cc66')
	el.style.color='black'    
    if (col == 'cc0000')
	el.style.color='white'     
    if (col == '99cc99')
	el.value='فارسی'    
    else
    if (col == 'e8b4e5')
	el.value= 'اعلا نات مؤمنین بیان'
}

function linkto(url)
{
    window.location=url
}

