/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Increase/Decrease Fonts size in Articles and Printouts
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
	var article_body_FS = 13; 
	function change_size_for_each(obj_name, raising) { if (obj_name && obj_name.style.fontSize) {
								size_to_change = parseInt(obj_name.style.fontSize);
								if (raising == 1)
								 { obj_name.style.fontSize = size_to_change + 1;
								} else {
								   obj_name.style.fontSize = size_to_change - 1;				
								}
 
							} else if (obj_name) {
								just_for_now = article_body_FS + 'px'; // maybe pt later
								obj_name.style.fontSize = just_for_now;
								}
 
							}
 
	function changeFontSize(found_object, raising) { change_size_for_each(found_object, raising);
							var look_for_these = new Array("LABEL", "SPAN", "DIV", "FONT", "TD", "TR", "P");
 							if (raising == 1) { article_body_FS++; } else { article_body_FS--; }
 							var temp_idx = 0;
			 				for (var i = 0; i < look_for_these.length; i++) { my_items = found_object.getElementsByTagName(look_for_these[i]);
								for (var j = 0; (node = my_items.item(j)); j++) change_size_for_each(node, raising); }
 
							}

/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ToggleLayer (expand +/- from old site)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
function sources_toggleLayer(whichLayer,pictochange)
{
javascript:sources_changeImage(pictochange);
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"block";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
}
function sources_changeImage(pictochange)
{
	obj = document.getElementById(pictochange);
	obj.src = (obj.src=="http://www.sikurmemukad.com/man_images/golshim_plus.png")?"http://www.sikurmemukad.com/man_images/golshim_minus.png":"http://www.sikurmemukad.com/man_images/golshim_plus.png";
}



/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Functions for comments system
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
function addComment()
{
javascript:toggleLayer('addcomment');
var current_url=window.location.href;
var current_url_length=window.location.href.length;
if (current_url.substr((current_url_length-9),9)!='talkbacks')
	window.location.href=window.location.href + '#talkbacks';

}
function switch_divs()
{
javascript:toggleLayer('addcomment');
javascript:toggleLayer('moderatecomment');
}
function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}
function getStyleClass (className) {
	for (var s = 0; s < document.styleSheets.length; s++)
	{
		if(document.styleSheets[s].rules) {
			for (var r = 0; r < document.styleSheets[s].rules.length; r++) {
				if (document.styleSheets[s].rules[r].selectorText == '.' + className) {
					return document.styleSheets[s].rules[r];
				}
			}
		}
		else if(document.styleSheets[s].cssRules) {
			for (var r = 0; r < document.styleSheets[s].cssRules.length; r++)
			{
				if (document.styleSheets[s].cssRules[r].selectorText == '.' + className)
					return document.styleSheets[s].cssRules[r];
			}
		}
	}
	
	return null;
}
function change_label()
{

if(document.getElementsByTagName('label')[6].innerHTML == 'הצג את כל התגובות') {
	javascript:getStyleClass('div-comment-body').style.display='block';
	document.getElementsByTagName('label')[6].innerHTML = 'הסתר את כל התגובות';
	}
else {
	javascript:getStyleClass('div-comment-body').style.display='none';
	document.getElementsByTagName('label')[6].innerHTML = 'הצג את כל התגובות';
	}

}
