﻿var TABLES_LENGTHES = new Array(new Array('prayingType',50),
					  	  		new Array('cityName',50),
					  	  		new Array('shulName',200),								
					  	  		new Array('shulAddress',200),								
					  	  		new Array('prayingHours',50),								
					  	  		new Array('day',50),								
					  	  		new Array('prayingNosach',50),								
					  	  		new Array('nbhdName',100),								
					  	  		new Array('period',10),
					  	  		new Array('notes',400),
					  	  		new Array('access',1),
					  	  		new Array('endTime',50),
					  	  		new Array('parking',50),
					  	  		new Array('contactPerson',400),
					  	  		new Array('tora',1),
					  	  		new Array('existPeriod',100),
					  	  		new Array('shulSite',100),
					  	  		new Array('shulPlace',100),
					  	  		new Array('refPoints',200),
					  	  		new Array('area',50),
								new Array('updateDate',20),
					  	  		new Array('addingPersonFirstName',50),								
					  	  		new Array('addingPersonLastName',50),								
					  	  		new Array('addingPersonEMail',200),								
					  	  		new Array('addingNotForPublish',10));								

//todo: maybe change this to adding "mandatory" attribute - what about validation then?
var mandatoryFields = new Array('prayingType',
					  	  		'cityName',
					  	  		'shulName',
					  	  		'prayingHours',
					  	  		'daySelect',
					  	  		'prayingNosach');																

/*
  This function gets name and return length (value) - as in Map object
*/
function getLength(name) {
	return getFromMatrix(TABLES_LENGTHES, name, null);
}
								
/*
  This function gets name and return length (value) - as in Map object
*/
function getFromMatrix(mat, name, value) {
//	alert("name = " + name + ", value = " + value); 
	for (var xx in mat)
		if (mat[xx][0] == name)
		   if (value == null || typeof(value) == "undefined")
		   	  return mat[xx][1];
		   else if (mat[xx][1] == value)
		   	  return true;		   	  
	return null;
}

//Get today's date for taarich idkun
function getTodayDate(){
   var d, s = "";           //Declare variables.
   d = new Date();                           //Create Date object.
   s += d.getDate() + "/";                   //Get day
   s += (d.getMonth() + 1) + "/";            //Get month
    s += d.getYear();                         //Get year.
   return(s);                                //Return date.
}

//whatever.com?myParam=147&myCity=111
function getParam(url, paramName) {
 		   var index = url.indexOf(paramName + '=');
 		   if (index == -1)
	   	  return null; 
	   index = url.indexOf('=', index) + 1;
	   var lastIndex = url.indexOf('&', index);
	   if (lastIndex == -1)
	   	  lastIndex = 999;
	   var result = url.substring(index, lastIndex);
	   	   return result;
 }

var panes = new Array(); 

function setupPanes(containerId, defaultTabId) { 
     // go through the DOM, find each tab-container 
     // set up the panes array with named panes 
     panes[containerId] = new Array(); 
     var maxHeight = 0; var maxWidth = 0; 
     var container = document.getElementById(containerId); 
     var paneContainer = container.getElementsByTagName("div")[0]; 
     var paneList = paneContainer.childNodes; 
     for (var i=0; i < paneList.length; i++ ) { 
       var pane = paneList[i]; 
       if (pane.nodeType != 1) continue; 
       panes[containerId][pane.id] = pane; 
       pane.style.display = "none"; 
    } 
     document.getElementById(defaultTabId).onclick(); 
} 

function showPane(paneId, activeTab) { 
     // make tab active class 
     // hide other panes (siblings) 
     // make pane visible 

     for (var con in panes) { 
       activeTab.blur(); 
       activeTab.className = "tab-active"; 
       if (panes[con][paneId] != null) { // tab and pane are members of this container 
         var pane = document.getElementById(paneId); 
         pane.style.display = "block"; 
         var container = document.getElementById(con); 
         var tabs = container.getElementsByTagName("ul")[0]; 
         var tabList = tabs.getElementsByTagName("a") 
         for (var i=0; i < tabList.length; i++ ) { 
           var tab = tabList[i]; 
           if (tab != activeTab) tab.className = "tab-disabled"; 
         } 
         for (var i in panes[con]) { 
           var pane = panes[con][i]; 
           if (pane == undefined) continue; 
           if (pane.id == paneId) continue; 
           pane.style.display = "none" 
         } 
       } 
     } 
       return false; 
	}

var isRadioButtonChecked = false;

function updateForm() {
	var updateShulFormId = document.getElementById('updateShulForm'); 
	updateShulFormId.id.value = getRealText(event.srcElement.parentNode.parentNode.childNodes[1]);
	isRadioButtonChecked = true;		
}	

function buildSearchParam(value, paramString, first)
{
 	var delimiter = (first) ? "?" : "&";	 
 	if (value != null && value !="" && value != 'ALL') {
	   url = delimiter + paramString + '=' + value;
	   return url;   	 
	}
	else
		return "";
}
	
function readShul(update) {
//	var pathName = window.location.pathname;
	var pathName = "index.php";

	var citiesNamesSelectId   = document.getElementById('citiesNamesSelect');
	var citiesNamesSelect2Id  = document.getElementById('citiesNamesSelect2');
	var prayingTypeSelectId   = document.getElementById('prayingTypeSelect');
	var daysSelectId 		  = document.getElementById('daysSelect');
	var shulsNamesSelectId    = document.getElementById('shulsNamesSelect');
	var nbhdsNamesSelectId    = document.getElementById('nbhdsNamesSelect');
	var prayingNosachSelectId = document.getElementById('prayingNosachSelect');
	var periodSelectId 		  = document.getElementById('periodSelect');
	var parkingSelectId 	  = document.getElementById('parkingSelect');
	var toraSelectId 		  = document.getElementById('toraSelect');
	var accessSelectId 		  = document.getElementById('accessSelect');
		
	var citiesNamesSelectValue = citiesNamesSelectId.value;
	var citiesNamesSelectValue2 = citiesNamesSelect2Id.value;
	if (citiesNamesSelectValue == "" && citiesNamesSelectValue2 == "")
	{
	   alert (' !לא נבחר שם יישוב');
	   return;
	}
	var searchUrl = "";
	searchUrl += buildSearchParam(prayingTypeSelectId.value, 
			  					 "prayingTypeSearchParam", true );
	searchUrl += buildSearchParam(citiesNamesSelectValue, 
			  					 "cityNameSearchParam", searchUrl=="" );
	searchUrl += buildSearchParam(daysSelectId.value, 
			  					 "days", searchUrl=="" );
	searchUrl += buildSearchParam(shulsNamesSelectId.value, 
			  					 "shulNameSearchParam", searchUrl=="" );
	searchUrl += buildSearchParam(nbhdsNamesSelectId.value, 
			  					 "nbhdNameSearchParam", searchUrl=="" );
	searchUrl += buildSearchParam(prayingNosachSelectId.value, 
			  					 "prayingNosachSearchParam", searchUrl=="" );
	searchUrl += buildSearchParam(periodSelectId.value, 
			  					 "periodSearchParam", searchUrl=="" );
	searchUrl += buildSearchParam(parkingSelectId.value, 
			  					 "parkingSearchParam", searchUrl=="" );
	searchUrl += buildSearchParam(toraSelectId.checked, 
			  					 "toraSearchParam", searchUrl=="" );
	searchUrl += buildSearchParam(accessSelectId.checked, 
			  					 "accessSearchParam", searchUrl=="" );

	
	//open by third tab
	if (update) 
	{
		searchUrl = searchUrl + "&update";
	}
	searchUrl = pathName+searchUrl; 
	//alert(searchUrl);
	window.open(searchUrl,"_self");	
} 

/*
function modalWin(url,args,params) {
	if (window.showModalDialog) {
	   window.showModalDialog(url,"name",
	   "dialogWidth:255px;dialogHeight:250px");
	} else {
	  window.open('xpopupex.htm','name',
	  'height=255,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes');
	 }
} 
*/

/*
  Convert bool(true/false) value to style.display value ("inline"/"none")
*/
function boolToDisplay(bool)
{
 //"inline" caused problems with the tr
 return (bool) ? "" : "none";
}

/*
  Shows/Discards the advanced search part in the main page
*/
function callAdvancedSearch(show) {
//	var values = window.showModalDialog('advancedSearch.php')

	var shulsNamesSelectId    = document.getElementById('shulsNamesSelect');
	var prayingNosachSelectId = document.getElementById('prayingNosachSelect');
	var findButtonId 		  = document.getElementById('findButton');
	var findButton2Id 	  	  = document.getElementById('findButton2');
	var advSearchId 		  = document.getElementById('advSearch');
	var advSearch2Id 		  = document.getElementById('advSearch2');

	shulsNamesSelectId.parentNode.parentNode.style.display = boolToDisplay(show);
	prayingNosachSelectId.parentNode.parentNode.style.display = boolToDisplay(show);
	advSearch2Id.style.display = boolToDisplay(show);
	findButton2Id.style.display = boolToDisplay(show);
	advSearchId.style.display = boolToDisplay(!show);
	findButtonId.style.display = boolToDisplay(!show);
}

/*
  Writing new shul (from second tab)
  The functino is Called after pressing the "Shlach Reshuma" button
*/
function writeShul() {
	var insertFormId = document.getElementById('insertForm');
	var missingFieldsLabelId = document.getElementById('missingFieldsLabel');
	setRealText(missingFieldsLabelId, '- יש להזין את כל השדות!');

    // Getting the prayingHours values
	var hoursResult = updatePrayingHoursValue();
	if (!hoursResult)
	{
		missingFieldsLabelId.style.display = "inline";
		document.getElementById('prayingHoursRedDiv').style.border='1px solid red';
		return;
	}	
	
	var result = true;
	//start with praying hours values - wrong!
//	var result = updatePrayingHoursValue();
    for (i=0;i<insertFormId.elements.length;i++)
    {
	 	divObj = document.getElementById(insertFormId.elements[i].name+'RedDiv');
		if (divObj != null)
			result &= validateClientValues(insertFormId.elements[i].value, 
			   divObj,
			   getLength(insertFormId.elements[i].name));
    }

    // Special care for the days checkboxes
	var cbResult = updateCheckboxesValue(insertFormId.daysCheckboxs);
	
	if (insertFormId.daySelect.value == "none")
		result &= validateClientValues(cbResult, document.getElementById('daySelectRedDiv'));	
//	alert(cbResult);

	
	if (!result)
		missingFieldsLabelId.style.display = "inline";
	else
	{
	 	//update taarich idkun
	 	insertFormId.updateDate.value = getTodayDate();
		if (insertFormId.daySelect.value == "none") 
			insertFormId.day.value = cbResult;
				
		if (insertFormId.addAnotherRecord.value != 'true')
			insertFormId.action= 'writeShulUTF8.php';
		insertFormId.submit();		
	}
} 

function updateTfila() {
	var updateShulFormId = document.getElementById('updateShulForm');
	//todo: add checking of some check radio button (for over all of them?
	//      is it really that stupid?
	if (!isRadioButtonChecked)
		alert("לא נבחרה אופציה לעדכון")
	else {
		updateShulFormId.action="updateTfilaUTF8.php";	  
		updateShulFormId.submit();
	}
}

function updateShul() {
	var updateShulFormId = document.getElementById('updateShulForm');
	//todo: add checking of some check radio button (for over all of them?
	//      is it really that stupid?
	if (!isRadioButtonChecked)
		alert("לא נבחרה אופציה לעדכון")
	else {
		updateShulFormId.submit();
	}
}

/*
  Like contains in Lists - checks if the array contains the val
*/
function contains(arr, val) {
	for (xx in arr)
		if (arr[xx] == val)
		   return true;
	return false;
}

/*
  This function validates the client values that were inserted
  according to some criteria (null mandatory, length and maybe more)
*/
function validateClientValues(value, divObj, maxLength) {
	 var fieldName = divObj.id.replace('RedDiv','');
	 var labelText = getRealText(document.getElementById(fieldName + 'Label'));
	 var missingFieldsLabelId = document.getElementById('missingFieldsLabel');	 
	 
	 labelText = labelText.replace(':','');
//	 alert("fieldName = " + fieldName);
//	 alert("labelText = " + labelText);
	 var result = true;
	 
	 //1st check - null mandatory:
	 //if field is mandatory and its value is null
	 if (contains(mandatoryFields, fieldName) && isAnyNullMandatoryField(value))
	 {
	  	 if (divObj != null)
		  	 divObj.style.border='1px solid red';
		 result = false;
	 }
//	 alert('value = ' + value + ' :' + ' maxLen = ' + maxLength);
//	 alert('check length = ' + isValueTooLong(value, maxLength));  

	 //2nd check - length:
	 //if value is too long
	 if (isValueTooLong(value, maxLength))
	 {
	  	 if (divObj != null)
		  	 divObj.style.border='1px solid red';

		 var tmpText = 	getRealText(missingFieldsLabelId);
	 	 setRealText(missingFieldsLabelId, tmpText + '\n- אורך השדה ' + labelText + ' ארוך מידי ');
		 result = false;	 
	 }	
 	 return result;
	 	
}

/*
  This function checks if there are any empty mandatory fields
*/
function isAnyNullMandatoryField(value) {
	return (value == null || value == "");
}

/*
  This function checks maximal length of field
*/
function isValueTooLong(value, maxLength) {
//	alert("value = " + value + ", maxLength = " + maxLength);	 
	return (maxLength != null && 
		    maxLength > 0 && 
			value.length > maxLength);
}

//This boolean indicates if the input was selected before keyDown (and we should erase the selected text)
var isSelected = false;

//Handle the selection of the object
function handleSelect(event) {
	var input = event.srcElement;
	isSelected = true;
	event.returnValue = true;
	event.cancelBubble = false;

	return true;
}

//validate that the string input is number and short enough
function validateNumber(event) {
   input = event.srcElement;

   //The text was selected before a NUMBER(!) key was pressed - so we should erase it!
   //We ignore backspace (8) so it won't act as back in the navigations arrows (fixed bug)
   //TODO: if one presses the numlock - it will be ignored!
   if (isSelected && (event.keyCode >= 48 && event.keyCode <= 57)
   /*|| (event.keyCode >= 96 && event.keyCode <= 105))*/) {
   		input.value = "";
//   		alert(event.keyCode);
   }

   //allow only nubmers or backspace or delete
   if (((event.keyCode < 48 || event.keyCode > 57) ||
        input.value.length >= 2) && event.keyCode != 8 && event.keyCode != 46)
		{
		 event.returnValue = false;
		 event.cancelBubble = true;
		return false;		 
		}

   isSelected = false;

		return true;
}

function moveFocus(obj, event) {
//   alert(obj)
//   alert(obj.tagName)
   input = event.srcElement;
   if (input.value.length >= 2)
   	  obj.focus();
} 

function updateCheckboxesValue(cbGroup) {
	var cbQty = document.getElementsByName(cbGroup.item(0).name).length;
	var resultStr = "";
	var commaFlag = false;
	for (var i = 0; i<cbQty; i++)
	{
		if (cbGroup.item(i).checked) {
    	 	if (commaFlag == true) {
    		   resultStr += ",";
    		} 
			resultStr += cbGroup.item(i).value;
			commaFlag = true;
		}
	}
	return resultStr;	   	 
}

/*
  Handles and fixes the praying hours values
  (turn from numbers to correct time strings)
*/
function updatePrayingHoursValue() {
	var insertFormId = document.getElementById('insertForm');

//  alert (insertFormId.hours.value)
//	alert(insertFormId.prayingType.value)
//	alert(insertFormId.period(1).innerText)
//	alert(insertFormId.period(1).value)
//	alert(insertFormId.period.checkedIndex)
//	alert(insertFormId.prayingType.value=='שחרית')

  for (j=0;j<insertFormId.period.length && !insertFormId.period.item(j).checked;j++);
  var period = 	insertFormId.period.item(j).value;

	//alert(period)

  for (i=0;i<insertFormId.dayChoice.length && !insertFormId.dayChoice.item(i).checked;i++);

  var bool = true;
  
  switch(i) {
  case 0:
  	   bool = validateTimeValues(insertFormId.hours.value, true, insertFormId.prayingType.value, period);
  	   bool = bool & validateTimeValues(insertFormId.mins.value, false, insertFormId.prayingType.value, period);

  	   res = insertFormId.hours.value + ":" + insertFormId.mins.value;
	   //return without setting the res to the prayingHours input value	   
	   //if (insertFormId.hours.value == "" || insertFormId.mins.value == "")
	   if (!bool)
	   	  res = "";
  	   break;
  case 1:
  	   bool = bool & validateTimeStringsValues(insertFormId.times.value, insertFormId.prayingType.value, period);

  	   res = insertFormId.minsb4After.value + " דקות " + insertFormId.b4AfterSelect.value + " " + insertFormId.times.value;
	   //return without setting the res to the prayingHours input value  
	   if (insertFormId.minsb4After.value == "" || !bool)
	   	  res = "";
  	   break;
  case 2:
  	   bool = bool & validateTimeStringsValues(insertFormId.times2.value, insertFormId.prayingType.value, period);

  	   res = " בזמן " + insertFormId.times2.value;

	   //return without setting the res to the prayingHours input value	   
	   if (!bool)
	   	  res = "";
  	   break;
  case 3:
  	   bool = validateTimeValues(insertFormId.bHours.value, true, insertFormId.prayingType.value, period);
  	   bool = bool & validateTimeValues(insertFormId.bMins.value, false, insertFormId.prayingType.value, period);
  	   bool = bool & validateTimeValues(insertFormId.eHours.value, true, insertFormId.prayingType.value, period);
  	   bool = bool & validateTimeValues(insertFormId.eMins.value, false, insertFormId.prayingType.value, period);
  
  	   res = "מניינים ברצף מ " + insertFormId.bHours.value + ":" + insertFormId.bMins.value +
	   	   	 " עד " + insertFormId.eHours.value + ":" + insertFormId.eMins.value;
	   //return without setting the res to the prayingHours input value	   
	   if (!bool)
	   	  res = "";
  	   break;

  }
  //alert(res)
  insertFormId.prayingHours.value = res;

  return bool;   
}

/*
  This function validate time correctness
  It's called only from updatePrayingHoursValue (one function above)
  It checks for: emptiness, hours < 24, mins < 60, logic ver. prayingType
*/
function validateTimeValues(time, isHoursField, prayingType, period)
{
 var missingFieldsLabelId = document.getElementById('missingFieldsLabel');

 if (time == "" || time.length < 2)
 	return false;
 //Check if hours > 23 or minutes > 59
 if (isHoursField && time > 23 || !isHoursField && time > 59)
 {
    setRealText(missingFieldsLabelId, 'זמן התפילה הוזן באופן לא חוקי');
 	return false;
 }	
	
 //No more tests for minutes time value!	
 if (!isHoursField)
 	return true;
 
 //More advanced tests  - done only for hours fields!!!
 //Shacharis: 
 if (prayingType == 'שחרית' && (time < 3 || time > 12) )
 {
    setRealText(missingFieldsLabelId, 'זמן התפילה הוזן באופן לא סביר עבור תפילת שחרית');
 	return false;
 }	

 //Mincha:		
 if (prayingType == 'מנחה' && (time < 12 || time > 18) )
 {
    setRealText(missingFieldsLabelId, 'זמן התפילה הוזן באופן לא סביר עבור תפילת מנחה');
 	return false;
 }	

 //Not valid in the Winter	
 if (prayingType == 'מנחה' && (time > 18 && time < 20) && period != 'קיץ' )
 {
    setRealText(missingFieldsLabelId, 'זמן התפילה הוזן באופן לא סביר עבור תפילת ערבית - האם הכוונה לשעון קיץ?');
 	return false;
 }	
	
 //Arvit:	
 if (prayingType == 'ערבית' && (time < 18 && time > 3) )
 {
    setRealText(missingFieldsLabelId, 'זמן התפילה הוזן באופן לא סביר עבור תפילת ערבית');
 	return false;
 }	

 //Not valid in the Summer	
 if (prayingType == 'ערבית' && (time > 16 && time < 18) && period != 'חורף' )
 {
    setRealText(missingFieldsLabelId, 'זמן התפילה הוזן באופן לא סביר עבור תפילת ערבית - האם הכוונה לשעון חורף?');
 	return false;
 }	
	
 return true;	   
}

/*
  This function validate time correctness
  It's called only from updatePrayingHoursValue (one function above)
  It checks for: logic ver. prayingType (shacharis in shkia etc.)
*/
function validateTimeStringsValues(timeString, prayingType, period)
{
 var missingFieldsLabelId = document.getElementById('missingFieldsLabel');

// No need to check for emptiness - comes from select values

 //Shacharis: 
 if (prayingType == 'שחרית' && (timeString!="הנץ" && timeString != "עלות השחר") )
 {
    setRealText(missingFieldsLabelId, 'זמן התפילה הוזן באופן לא סביר עבור תפילת שחרית');
 	return false;
 }	

 //Mincha:		
 if ((prayingType == 'מנחה' || prayingType == 'ערבית') 
	&& (timeString=="הנץ" || timeString == "עלות השחר") )
 {
    setRealText(missingFieldsLabelId, 'זמן התפילה הוזן באופן לא סביר עבור תפילת מנחה או ערבית');
 	return false;
 }	
	
 return true;	   
}





function insertDiv2Input(myDiv, formObject) {
	var shulsNamesSelectId    = document.getElementById('shulsNamesSelect');
	var prayingNosachSelectId = document.getElementById('prayingNosachSelect');
	var insertFormId = document.getElementById('insertForm');	

	shulsNamesSelectId.style.display = "inline";
	prayingNosachSelectId.style.display = "inline";
	insertFormId.times.style.visibility = "visible"

	//insertFormId.blur()	 
	myDiv.style.display = "none";
	if (myDiv.childNodes.length > 0 && formObject.value.length > 0)
	{
	 for (i=0;i<myDiv.childNodes.length;i++)
	 	 if (myDiv.childNodes[i].style.backgroundColor == "yellow")
		 {
		  formObject.value = getRealText(myDiv.childNodes[i]);
		  return;
		 }
	//if none was found
	formObject.value = getRealText(myDiv.childNodes[0]);	
	}
}

//Removes the red border which surrounds the misinputed fields
function removeBorder(obj) {
	obj.style.border = '';
}

function onCheckboxClicked() {
	var insertFormId = document.getElementById('insertForm');
	insertFormId.daySelect.value='none';
	document.getElementById('daySelectRedDiv').style.border='';
}

/*
  Correct the prayingHours field to be in "xx:yy" by adding "0"
  in front of x:yy format
  only used in the "hours" field 
*/
function correctTimeFormat(obj) {
	var val = obj.value; // 6
	if (!isNaN(val) && val.length == 1)
		obj.value = '0' + obj.value; //06
/*
	 var val = obj.value; // 6:40
	 var val1 = val.substring(0,1);			  // 6
	 var val2 = val.substring(1,2);			  // :
	 var val3 = val.substring(2,4);			  // 40
	 if (!isNaN(val1) && val2 == ':' && !isNaN(val3))
	 	obj.value = '0' + obj.value; //06:40
*/			 
}

function openWindow(url,params) {
	if (params)
		window.open(url,null,params);
	else
		window.open(url);	
}

// taken from general sites
// check for the user's Browser Type
function getBrowserType()
{
	if (document.implementation && document.implementation.createDocument)
		browserType = 'mozilla'
	else if (window.ActiveXObject)
		browserType = 'ie'
	else
		browserType = 'unknown'
}

//remove the tags from text - may be used in order
//to replace the nonstandard innerText property with innetHtml 
function replaceTags(xStr){
	var regExp = /<\/?[^>]+>/gi;
	xStr = xStr.replace(regExp,"");
	return xStr;
}

//return the real text: in IE - innerText, in other browsers - from innerHTML
function getRealText(obj) {
	if (obj.innerText != undefined)
	   return (obj.innerText);
	else
	   return(replaceTags(obj.innerHTML));
}

//return the real text: in IE - innerText, in other browsers - from innerHTML
function setRealText(obj, text) {
	if (obj.innerText != undefined)
	   obj.innerText = text;
	else
	   obj.textContent = text;
}

		  //todo: remove the unneeded divs around the inputs - div7 etc.
		  //
		  //done:
		  //todo: add "כל התפילות","כל בתי הכנסת" in the select...
		  //todo: insert tabs of : show details, update details and general info of praying
		  //todo: add possible to show all the data with checkboxes and then update/delete the chosen one.	  
		  //todo: add here checking that all the fields are inserted - by js probably
		  //todo: add password input in the writeShul for admin purposes
		  //		  - maybe add temp db file which I'll be able to control
		  //todo: add temp DB file which will be used by everyone and real one for me
		  //todo: maybe work with sets instead of lists?
		  //todo: check sorting - check the arrows, there's a problem when dir=rtl with &uarr; check it
		  //todo: add general tfilot names (days + rosh-hodesh...)
		  //todo: maybe add Nosach tfila to shulDetails (Ashkenaz, Sepharad etc...)
		  //todo: background? images?
		  //todo: add - for update/delete please contact me (system) by e-mail => also for suggestion
		  //todo: citiesNamesSet may be initialize only once and in everty writeShul... (not urgent)
		  //todo: maybe add db password		  
		  
