			
	var isRunFirst3 = 0;
	var sp3 = document.createElement('SPAN');
	sp3.innerHTML = '<form id="scanpic3_refresh" name="scanpic3_refresh" action="http://www.negba.org.il/cgi-webaxy/scanpicadmin.pl" method="post" target="hidden_iframe">'+
				'<input type="hidden" name="username" value="">'+
				'<input type="hidden" name="password" value="">'+
				'<input type="hidden" name="ID" value="371011_negba">'+
				'<input type="hidden" name="lang" value="he">'+
				'<input type="hidden" name="id_to_edit" value="3">'+
				'<input type="hidden" name="action" value="refresh">'+
				'<input type="hidden" name="del" value="">'+
		'</form>'+
		'<form id="scanpicCA3_refresh" name="scanpicCA3_refresh" action="http://www.negba.org.il/cgi-webaxy/scanpicadmin.pl" method="post" target="hidden_iframe">'+
				'<input type="hidden" name="username" value="">'+
				'<input type="hidden" name="password" value="">'+
				'<input type="hidden" name="ID" value="371011_negba">'+
				'<input type="hidden" name="lang" value="he">'+
				'<input type="hidden" name="id_to_edit" value="3">'+
				'<input type="hidden" name="action" value="refresh">'+
				'<input type="hidden" name="del" value="">'+
	'</form>';
	
	sp3.id = 'scanpic3-span';
	var scanpic3Oldonload = window.onload;
	var scanpic3Loaded = 0;
  if (typeof window.onload != 'function') {
    window.onload = function() {
    	if (scanpic3Loaded == 0) {
    		scanpic3Loaded = 1;
    		var _body3 = document.getElementsByTagName('body')[0];
				_body3.appendChild(sp3);	
				runFirst3();
			}
    };
  } else {
    window.onload = function() {
      if (scanpic3Oldonload) {
        scanpic3Oldonload();
      }
      if (scanpic3Loaded == 0) {
    		scanpic3Loaded = 1;
    		var _body3 = document.getElementsByTagName('body')[0];
				_body3.appendChild(sp3);	
				runFirst3();
			}
    }
  }
  
	//var _body3 = document.getElementsByTagName('body')[0];
	//_body3.appendChild(sp3);
	var alowToEdit3  = 0;
	var new_order3;
	var imgArr3 = new Array( 'andarta.jpg','5_aogost_09_050.jpg','War48_33.jpg','1.gif','2.gif','3.gif','4.gif' );
	var scans_url3 = new Array ( '','','','','','','' );
	var imgArrW3;
	if ('215,500,500,111,111,111,111'.search(/,/) != -1) { imgArrW3 = new Array( 215,500,500,111,111,111,111);}
	else {imgArrW3 = new Array();(imgArrW3)[0] = 215,500,500,111,111,111,111;}
	var imgArrH3;
	if ('290,375,334,68,68,68,68'.search(/,/) != -1) { imgArrH3 = new Array( 290,375,334,68,68,68,68);}
	else {imgArrH3 = new Array();(imgArrH3)[0] = 290,375,334,68,68,68,68;}
	var curImgArrW3;
	if ('94,94,94,94,94,94,94'.search(/,/) != -1) { curImgArrW3 = new Array( 94,94,94,94,94,94,94);}
	else {curImgArrW3 = new Array();(curImgArrW3)[0] = 94,94,94,94,94,94,94;}
	var curImgArrH3;
	if ('71,71,71,71,71,71,71'.search(/,/) != -1) { curImgArrH3 = new Array( 71,71,71,71,71,71,71);}
	else {curImgArrH3 = new Array();(curImgArrH3)[0] = 71,71,71,71,71,71,71;}
	var maxFullScreenImgHeight3;
	var opacitySpeed = 8;
	var lbSpeed = 15;
	var lbsizeSpeed = 8;
	
	var images_details3 = new Array ( 'title=<DD>description=<DD>photog=<DD>author=Liav Alaluf- liav<DD>date=<DD>keywords=<DD>previewImage=<DD>nonew=<DD>nosearch=0<DD>noscandir=<DD>imageLink=','title=<DD>description=<DD>photog=<DD>author=מאשקה ליטבק- mashka<DD>date=<DD>keywords=<DD>previewImage=<DD>nonew=<DD>nosearch=0<DD>noscandir=<DD>imageLink=','title=<DD>description=<DD>photog=<DD>author=Liav Alaluf- liav<DD>date=<DD>keywords=<DD>previewImage=<DD>nonew=<DD>nosearch=0<DD>noscandir=<DD>imageLink=','title=<DD>description=<DD>photog=<DD>author=Liav Alaluf- liav<DD>date=<DD>keywords=<DD>previewImage=<DD>nonew=<DD>nosearch=0<DD>noscandir=<DD>imageLink=','title=<DD>description=<DD>photog=<DD>author=Liav Alaluf- liav<DD>date=<DD>keywords=<DD>previewImage=<DD>nonew=<DD>nosearch=0<DD>noscandir=<DD>imageLink=','title=<DD>description=<DD>photog=<DD>author=Liav Alaluf- liav<DD>date=<DD>keywords=<DD>previewImage=<DD>nonew=<DD>nosearch=0<DD>noscandir=<DD>imageLink=','title=<DD>description=<DD>photog=<DD>author=Liav Alaluf- liav<DD>date=<DD>keywords=<DD>previewImage=<DD>nonew=<DD>nosearch=0<DD>noscandir=<DD>imageLink=' );
	if ('' == 'random') new_order3 = shuffle3();
	
	var positions = new Array ( 'up_right','up_center','up_left','right_center','center_center','left_center','down_right','down_center','down_left' );
	var icon_positions = new Array ( 'icon_up_right','icon_up_center','icon_up_left','icon_right_center','icon_center_center','icon_left_center','icon_down_right','icon_down_center','icon_down_left' );
	var num_per_page3 = 1;
	var num_film_per_page3 = 5;
	var scaling_by = '';
	var scaling_value = '';
	var imgClass = '';
	
	// popup variables
	var myWidth3, myHeight3, myScroll3;
	var myScrollWidth3, myScrollHeight3;
	var incX3, incY3, incW3, incH3, incOpacity3;
	var incW_Resize3 = new Array();
	var incH_Resize3 = new Array();
	var incX_PU3 = new Array();
	var incY_PU3 = new Array();
	var incW_PU3 = new Array();
	var incH_PU3 = new Array();
	var popupSpeed = 5;
	
	var ifseArray3 = new Array();
	
	// check if user choose on mouse click light box effect
	var rel = '';
	if ('light_box' == 'light_box') {
			/*rel = 'rel="lightbox[migvan]"';			*/
	}
	
	var images_spacing3 = parseInt('0px'.replace(/px/,''));
	var image_padding3 = 5;
	
	// settimeour pointer
	//var curretTimeout = new Array();
	
	//
	var maxImageWidth3 = 500;
	var maxImageHeight3 = 375;
	var curMaxImageWidth3 = 94;
	var curMaxImageHeight3 = 71;
	var curMaxFilmWidth3 = ('onlyfilm' != 'film')?94:0;
	var curMaxFilmHeight3 = ('onlyfilm' != 'film')?71:0;
	var currDivIndex3;
	var runInTheEnd3;
	var target;
	var blindSpeed = 12;
	function pictureDataEstimateHeight3(index) {
	
			var images_details = images_details3;
			var data = images_details[index].split("<DD>");
			var height = 0;
			for (var p=0; p<data.length;p++) {
				field = (data[p].split("="))[0];
				value = ((data[p].split("="))[1])?(data[p].split("="))[1].replace(/<SHAVE>/g, '='):'';
				if (!value || value.length == 0) { value = '';}
				if (field == 'title' && '' && value) height += parseInt('13px'.replace(/px/,''));
				if (field == 'description' && '' && value) height += parseInt('13px'.replace(/px/,''));
				if (field == 'photog' && '' && value) {
							if ('') ;
							else height += parseInt('13px'.replace(/px/,''));
				}
				if (field == 'date' && '') {
							if (value && '') height += parseInt('13px'.replace(/px/,''));
							//else if (!value) info = info.replace(/,$/,'<br>');
				}
				if (field == 'link' && '' && value) height += parseInt('13px'.replace(/px/,''));				
			}
			return height;
	}
	
	function pictureData3(index) {
				
			var images_details = images_details3;
			var data = images_details[index].split("<DD>");
			var info = '';
			for (var p=0; p<data.length;p++) {
						field = (data[p].split("="))[0];
						value = ((data[p].split("="))[1])?(data[p].split("="))[1].replace(/<SHAVE>/g, '='):'';
						if (!value || value.length == 0) { value = '';}
						//else { value = value + '<br>';}
						if (field == 'title' && '' && value) info += value + '<br>';
						if (field == 'description' && '' && value) info += value + '<br>';
						if (field == 'photog' && '' && value) {
							if ('') info += value+',';
							else info += value + '<br>';
						}
						if (field == 'date' && '') {
							if (value && '') info += value+'<br>';
							else if (!value) info = info.replace(/,$/,'<br>');
						}
						if (field == 'link' && '' && value) info += value + '<br>';						
			}
			//info = info.replace(/\'/g,"&quota;");
			//info = info.replace(/\"/g,"&quot;");
			return info;
	
	}
	
	function pictureBulletData3(index) {
	
		if ('' == '') return '';
		var images_details = images_details3;
		var data = images_details[index].split("<DD>");
		var info = '';
			for (var p=0; p<data.length;p++) {
						field = (data[p].split("="))[0];
						value = ((data[p].split("="))[1])?(data[p].split("="))[1].replace(/<SHAVE>/g, '='):'';
						if (!value || value.length == 0) { value = '';}
						//else { value = value + '<br>';}
						if (field == 'title' && '' && value) info += value + '<br>';
						if (field == 'description' && '' && value) info += value + '<br>';
						if (field == 'photog' && '' && value) {
							if ('') info += value+',';
							else info += value + '<br>';
						}
						if (field == 'date' && '') {
							if (value && '') info += value+'<br>';
							else if (!value) info = info.replace(/,$/,'<br>');
						}
						if (field == 'link' && '' && value) info += value + '<br>';						
			}
		if (info) {
			info = '<a href="javascript:void(0)" onmouseover="return overlib(\''+info+'\', BUBBLE, BUBBLETYPE, \'roundcorners\',TEXTCOLOR , \'#000000\', TEXTSIZE , \'13px\');" onmouseout="nd();"></a>';
			//info = info.replace(/\'/g,"&quota;");
			//info = info.replace(/\"/g,"&quot;");
		}
		return info;
	
	}
	function light_box3(imgIndex, isNext) {
		
		getSize3();
		document.getElementById('scanpic3-curLBIndex').value = imgIndex;
		var lb = document.getElementById('lightbox');
		/*if (navigator.appVersion.indexOf("MSIE")!=-1) {
			lb.style.filter = "alpha(opacity=100)";
		}
		else {
			lb.style.opacity = 1;
		}
		*/
		if (!isNext) {
			var hide = document.getElementById('scanpic3-hideAllDiv');
			//document.getElementById('imageDataContainer').style.display = 'none';
			hide.style.height = '0px';
			hide.style.display = 'block';
			hide.style.width = myWidth3+'px';
			hide.style.zIndex = 1111;
			var fullScreenHideSpeed = 10;
			//inc = (myHeight3+myScroll3)/fullScreenHideSpeed;
			//inc = myScrollHeight/fullScreenHideSpeed;			
			inc = (myHeight3+myScrollHeight3)/fullScreenHideSpeed;			
			light_box2_3(inc, fullScreenHideSpeed, imgIndex, isNext);
		}
		else {
			window.setTimeout("light_box3_3("+imgIndex+", "+isNext+")",150);
		}
		
	}
	
	function light_box2_3(inc, index, imgIndex, isNext) {
	
		document.getElementById('loading').style.display = 'block';
		var hide = document.getElementById('scanpic3-hideAllDiv');
		index--;
		if (index >= 0) {
				hide.style.height = (parseFloat(hide.style.height.replace(/px/,'')) + inc)+'px';
				window.setTimeout("light_box2_3("+inc+", "+index+","+imgIndex+","+isNext+")",50);
		}
		else {
				light_box3_3(imgIndex, isNext);
		}	
			
	}
	
	function light_box3_3(index, isNext) {
		
		var lb = document.getElementById('lightbox');
		var lbPadding = 10;
		var pageIndex = index % num_per_page3;
		if (navigator.appVersion.indexOf("MSIE")!=-1) {
			document.getElementById('lightboxImage').style.filter = "alpha(opacity=0)";
		}
		else {
			document.getElementById('lightboxImage').style.opacity = 0;
		}
		
		document.getElementById('caption').style.color = '#000000';
		document.getElementById('caption').style.fontSize = '13px';
		document.getElementById('caption').innerHTML = pictureData3(index);
		var data = pictureBulletData3(index);
		if (data) document.getElementById('caption').innerHTML += data;
		document.getElementById('numberDisplay').innerHTML = 'תמונה '+(1+index)+' מתוך '+imgArr3.length;
		// calculate maximum height of image in full screen: = window height - panel height (30) - padding (20).
		var imageDataContainerH = document.getElementById('imageDataContainer').clientHeight?document.getElementById('imageDataContainer').clientHeight:50;
		var keep = imageDataContainerH + 2*lbPadding;
		var maxLBImgHeight = myHeight3 - keep;
		//document.getElementById('imageDataContainer').style.position = 'relative';
		//document.getElementById('imageDataContainer').style.top = -imageDataContainerH +'px';
		//document.getElementById('imageDataContainer').style.height = '0px';
		var height, contHeight, contWidth;
		var imgArrW = imgArrW3;
		var imgArrH = imgArrH3;
		if (imgArrH[index] > maxLBImgHeight) {
			var ratio = maxLBImgHeight/ imgArrH[index];
			document.getElementById('lightboxImage').style.width = (imgArrW[index] * ratio)+'px';
			document.getElementById('lightboxImage').style.height = maxLBImgHeight+'px';
			height = 0;
			contHeight = maxLBImgHeight + 2*lbPadding;
			contWidth = imgArrW[index] * ratio + 2*lbPadding;		
		}
		else {
			document.getElementById('lightboxImage').style.width = 'auto';
			document.getElementById('lightboxImage').style.height = 'auto';
			height = (myHeight3-(2*lbPadding)-imgArrH[index])/2;
			contHeight = imgArrH[index] + 2*lbPadding;
			contWidth = imgArrW[index] + 2*lbPadding;		
		}
		height += myScroll3;
		//my width = (myWidth3-(2*lbPadding)-imgArrW[index])/2;
		//only when display lightbox div
		if (!isNext) {
			lb.style.left = '0px';
			lb.style.top = height+'px';
			lb.style.display = 'block';		
		}
		//check if outerImageContainer width and height have to be changed
		var curWidth = document.getElementById('outerImageContainer').style.width.replace(/px/,'')?document.getElementById('outerImageContainer').style.width.replace(/px/,''):250;
		var curHeight = document.getElementById('outerImageContainer').style.height.replace(/px/,'')?document.getElementById('outerImageContainer').style.height.replace(/px/,''):250;
		if (curWidth != contWidth || curHeight != contHeight) {
				//change container size
				document.getElementById('outerImageContainer').style.width = curWidth+'px';
				document.getElementById('outerImageContainer').style.height = curHeight+'px';
				var incW = (contWidth - curWidth)/lbsizeSpeed;
				var incH = (contHeight - curHeight)/lbsizeSpeed;
				update_lb_height3(lbsizeSpeed, incW, incH, index, isNext);
		}
		else {
				light_box4_3(index, isNext);
		}
		
	}
	
	function update_lb_height3(index, incW, incH, imgIndex, isNext) {
			
		var oic = document.getElementById('outerImageContainer');
		index--;
		if (index >= 0) {
				oic.style.height = (parseFloat(oic.style.height.replace(/px/,'')) + incH)+'px';
				//oic.style.width = (parseFloat(oic.style.width.replace(/px/,'')) + incW)+'px';
				window.setTimeout("update_lb_height3("+index+", "+incW+","+incH+","+imgIndex+","+isNext+")",50);
		}
		else {
				//document.getElementById('imageDataContainer').style.width = oic.style.width;
				update_lb_width3(lbsizeSpeed, incW, incH, imgIndex, isNext);
		}	
						
	}
	
	function update_lb_width3(index, incW, incH, imgIndex, isNext) {
			
		var oic = document.getElementById('outerImageContainer');
		index--;
		if (index >= 0) {
				//oic.style.height = (parseFloat(oic.style.height.replace(/px/,'')) + incH)+'px';
				oic.style.width = (parseFloat(oic.style.width.replace(/px/,'')) + incW)+'px';
				window.setTimeout("update_lb_width3("+index+", "+incW+","+incH+","+imgIndex+","+isNext+")",50);
		}
		else {
				document.getElementById('imageDataContainer').style.width = oic.style.width;
				light_box4_3(imgIndex, isNext);
		}	
						
	}
	
	function light_box4_3(index, isNext) {
		
		document.onkeypress = getKey2_3;
		document.getElementById('loading').style.display = 'none';
		var imgArr = imgArr3;
		var tmp_img = new Image();
		//wait for load
		tmp_img.onload=function() {
				document.getElementById('lightboxImage').src = 'http://www.negba.org.il/gallery/'+imgArr[index];
				if (navigator.appVersion.indexOf("MSIE")!=-1) {
					document.getElementById('imageDataContainer').style.filter = "alpha(opacity=0)";
				}
				else {
					document.getElementById('imageDataContainer').style.opacity = 0;
				}
				putLBOpacity3(1/lbSpeed, lbSpeed, index, "putLBCOpacity3("+1/lbSpeed+","+lbSpeed+")" );
		}
		tmp_img.src = 'http://www.negba.org.il/gallery/'+imgArr[index];
				
	}
	
	function getNextLBPage3(inc) {
		
		var curIndex = document.getElementById('scanpic3-curLBIndex').value;
		if (inc == '+1') curIndex++;
		else if (inc == '-1') curIndex--;
		if(curIndex==-1) {
			document.getElementById('scanpic3-curLBIndex').value = imgArr3.length-1;
			curIndex = imgArr3.length-1;
		}
		if(curIndex >= imgArr3.length) {
			document.getElementById('scanpic3-curLBIndex').value = 0;
			curIndex = 0;
		}
		var runMe = "light_box3("+curIndex+","+true+")";
		
		putLBCOpacity3(-1/lbSpeed, lbSpeed, curIndex);
		putLBOpacity3(-1/lbSpeed, lbSpeed, curIndex, "light_box3("+curIndex+","+true+")" );
			
	}
	
	function putLBOpacity3(inc, index, curFullIndex1, evalMe) {
		
		var curOpacity;
		if (navigator.appVersion.indexOf("MSIE")!=-1) {
			 curOpacity = document.getElementById('lightboxImage').style.filter;
			 var opacityPattern=new RegExp("[0-9]+");
			 curOpacity = parseFloat(opacityPattern.exec(curOpacity));
		}
		else {
			curOpacity = parseFloat(document.getElementById('lightboxImage').style.opacity);	
		}
		index--;
		if (index >= 0) {
				if (navigator.appVersion.indexOf("MSIE")!=-1) {
					curOpacity = curOpacity + inc*100;
					if (curOpacity < 0.1) curOpacity = 0;
					document.getElementById('lightboxImage').style.filter = "alpha(opacity=" + curOpacity + ")";
				}
				else {
					curOpacity = curOpacity + inc;
					if (curOpacity < 0.001) curOpacity = 0;
					document.getElementById('lightboxImage').style.opacity = curOpacity;
				}
				window.setTimeout("putLBOpacity3("+inc+", "+index+", "+curFullIndex1+", '"+evalMe+"')",30);
		}
		else {
			if (evalMe != "undefined") {
				eval(evalMe);				
			}			
		}
	}
	
	function putLBCOpacity3(inc, index, curFullIndex1, evalMe) {
		
		var curOpacity;
		if (navigator.appVersion.indexOf("MSIE")!=-1) {
			 curOpacity = document.getElementById('imageDataContainer').style.filter;
			 var opacityPattern=new RegExp("[0-9]+");
			 curOpacity = parseFloat(opacityPattern.exec(curOpacity));
		}
		else {
			curOpacity = parseFloat(document.getElementById('imageDataContainer').style.opacity);	
		}
		index--;
		if (index >= 0) {
				if (navigator.appVersion.indexOf("MSIE")!=-1) {
					curOpacity = curOpacity + inc*100;
					if (curOpacity < 0.1) curOpacity = 0;
					document.getElementById('imageDataContainer').style.filter = "alpha(opacity=" + curOpacity + ")";
				}
				else {
					curOpacity = curOpacity + inc;
					if (curOpacity < 0.001) curOpacity = 0;
					document.getElementById('imageDataContainer').style.opacity = curOpacity;
				}
				window.setTimeout("putLBCOpacity3("+inc+", "+index+", "+curFullIndex1+", '"+evalMe+"')",30);
		}
		else {
			if (evalMe != "undefined") {
				eval(evalMe);				
			}
			else if (inc < 0) {
				//getNextPageFull2_3(curFullIndex1,opacitySpeed);				
			}
		}
		
	}
	
	function regularScreenLBOpacity3(inc, index) {
		
		var curOpacity;
		if (navigator.appVersion.indexOf("MSIE")!=-1) {
			 curOpacity = document.getElementById('lightbox').style.filter;
			 var opacityPattern=new RegExp("[0-9]+");
			 curOpacity = parseFloat(opacityPattern.exec(curOpacity));
		}
		else {
			curOpacity = parseFloat(document.getElementById('lightbox').style.opacity);	
		}
		index--;
		if (index >= 0) {
				if (navigator.appVersion.indexOf("MSIE")!=-1) {
					curOpacity = curOpacity + inc*100;
					if (curOpacity < 0.1) curOpacity = 0;
					document.getElementById('lightbox').style.filter = "alpha(opacity=" + curOpacity + ")";
				}
				else {
					curOpacity = curOpacity + inc;
					if (curOpacity < 0.001) curOpacity = 0;
					document.getElementById('lightbox').style.opacity = curOpacity;
				}
				window.setTimeout("regularScreenLBOpacity3("+inc+", "+index+")",30);
		}
		else {
			putFSOpacity3(-1/opacitySpeed, opacitySpeed, document.getElementById('scanpic3-curFullIndex').value, 'regularScreen1_3()');
		}
	}
	
	function regularScreen3() {
		
		var lb = document.getElementById('lightbox');
		if (lb && lb.style.display != 'none') regularScreenLBOpacity3(-1/opacitySpeed, opacitySpeed);
		else putFSOpacity3(-1/opacitySpeed, opacitySpeed, document.getElementById('scanpic3-curFullIndex').value, 'regularScreen1_3()');
				
	}
	
	function putFSOpacity3(inc, index, curFullIndex1, evalMe) {
		
		var curOpacity;
		if (navigator.appVersion.indexOf("MSIE")!=-1) {
			 curOpacity = document.getElementById('scanpic3-fullScreenImg').style.filter;
			 var opacityPattern=new RegExp("[0-9]+");
			 curOpacity = parseFloat(opacityPattern.exec(curOpacity));
		}
		else {
			curOpacity = parseFloat(document.getElementById('scanpic3-fullScreenImg').style.opacity);	
		}
		index--;
		if (index >= 0) {
				if (navigator.appVersion.indexOf("MSIE")!=-1) {
					curOpacity = curOpacity + inc*100;
					if (curOpacity < 0.1) curOpacity = 0;
					document.getElementById('scanpic3-fullScreenImg').style.filter = "alpha(opacity=" + curOpacity + ")";
				}
				else {
					curOpacity = curOpacity + inc;
					if (curOpacity < 0.001) curOpacity = 0;
					document.getElementById('scanpic3-fullScreenImg').style.opacity = curOpacity;
				}
				window.setTimeout("putFSOpacity3("+inc+", "+index+", "+curFullIndex1+", '"+evalMe+"')",30);
		}
		else {
			if (evalMe != "undefined") {
				eval(evalMe);				
			}
			else if (inc < 0) {
				getNextPageFull2_3(curFullIndex1,opacitySpeed);
				if ('' || '') {
						updatePageCounterFS3();
				}
			}
		}
	}
		
	function regularScreen1_3() {
		
		var hide = document.getElementById('scanpic3-hideAllDiv');
		var fullScreenHideSpeed = 10;
		//inc = myScrollHeight/fullScreenHideSpeed;
		hide.style.height = myHeight3+'px';
		inc = myHeight3/fullScreenHideSpeed;
		regularScreen2_3(inc, fullScreenHideSpeed);
		
	}
	
	function regularScreen2_3(inc, index) {
	
		var hide = document.getElementById('scanpic3-hideAllDiv');
		index--;
		if (index >= 0) {
				var h = parseFloat(hide.style.height.replace(/px/,'')) - inc;
				if (h < 0) h = 0;
				hide.style.height = h+'px';
				window.setTimeout("regularScreen2_3("+inc+", "+index+")",50);
		}
		else {
				regularScreen3_3();
		}	
		
	}
	
	function regularScreen3_3() {
	
		var fullSD = document.getElementById('scanpic3-fullScreenDiv');
		var lb = document.getElementById('lightbox');
		var hide = document.getElementById('scanpic3-hideAllDiv');
		hide.style.display = 'none';
		hide.style.zIndex = 0;
		if (fullSD) {
			fullSD.style.display = 'none';
			fullSD.style.zIndex = 0;
		}
		if (lb) {
			lb.style.display = 'none';
			//lb.style.zIndex = 0;
		}
		document.getElementById('scanpic3-slide_show_full').value='s';
		
	}
	
	function slideShowFull3(val){
					
					var ss = document.getElementById('scanpic3-slide_show_full');
					if (val) {
							ss.value = val;
					}
					
					if (ss.value == 'r') {
						if (document.getElementById('scanpic3-pageDone').value == '') {
							window.setTimeout("getNextPageFull3('+');",1000);
							window.setTimeout("slideShowFull3();",1000);
						}
						else {
								window.setTimeout("slideShowFull3();",100);
								return;
						}
					}									
					
	}
	
	
	function getKey2_3(evt) {
		if (! evt) {
			theKey = event.keyCode;
		} else {
			theKey = evt.keyCode;
		}
		
		if (theKey == 27 || theKey == 11) { // ESC OR Enter
				regularScreen3();
		}
	}
		
	function slideShow3(val, getPage, isFirst){
					
					var ss = document.getElementById('scanpic3-slide_show');
					if (val) {
							ss.value = val;
					}
					
					if (ss.value == 'r') {
						if (document.getElementById('scanpic3-pageDone').value == '' && 'onlyfilm' != 'onlyfilm') {
								if (typeof(getPage) != 'undefined' && typeof(isFirst) != 'undefined') {
									setTimeout("getNextPage3('"+getPage+"', '', "+isFirst+")", 150);
								}
								else {
									window.setTimeout("getNextPage3('+');",1000);
								}
								window.setTimeout("slideShow3();",1000);
								return;
						}
						else if (document.getElementById('scanpic3-onGoing').value == '' && 'onlyfilm' == 'onlyfilm') {
								window.setTimeout("nextFilmPage3('-');",1000);
								window.setTimeout("slideShow3();",1000);
								return;
						}
						else {
								window.setTimeout("slideShow3();",100);
								return;
						}
					}
					
	}
	function nextFilmPage3(str) {
		
		if (document.getElementById('scanpic3-onGoing').value) {
				//window.setTimeout("nextFilmPage3('"+str+"');",100);
				return;
		}
		var inc = document.getElementById('scanpic3-film_strip_move').getAttribute('inc');
		
		if (str) {
			( str.charAt(0)  == '+' ? inc = inc * 1 : inc = inc * -1);
		}
		document.getElementById('scanpic3-onGoing').value = 'going';
		if (inc > 0) document.getElementById('scanpic3-curFilmPage').value--;
		else document.getElementById('scanpic3-curFilmPage').value++;
		var curFilmIndex = (parseInt(document.getElementById('scanpic3-curFilmPage').value)>= 0)?(parseInt(document.getElementById('scanpic3-curFilmPage').value) + parseInt('5')) % imgArr3.length:parseInt(document.getElementById('scanpic3-curFilmPage').value)+imgArr3.length;
		if (document.getElementById('scanpic3-film_strip_img'+curFilmIndex) && document.getElementById('scanpic3-film_strip_img'+curFilmIndex).getAttribute('tosrc') != '' && document.getElementById('scanpic3-film_strip_img'+curFilmIndex).getAttribute('tosrc') != null) {
			var src;
			src = document.getElementById('scanpic3-film_strip_img'+curFilmIndex).getAttribute('tosrc');
			var tmp_img = new Image();
			tmp_img.onload=function() {
						document.getElementById('scanpic3-film_strip_img'+curFilmIndex).src = document.getElementById('scanpic3-film_strip_img'+curFilmIndex).getAttribute('tosrc');
						document.getElementById('scanpic3-film_strip_img'+curFilmIndex).setAttribute('tosrc', '');
						nextFilmPage13(inc, str);
			}
			tmp_img.src = src;	
		}
		else {
			nextFilmPage13(inc, str);
		}
		
	}
	
	function nextFilmPage13(inc, str) {
	
		var dir = '';
		var divs = document.getElementById('scanpic3-film_strip_move').style;
		var divW;
		if ('horizon' == 'up' || 'horizon' == 'down' || 'horizon' == 'horizon') {
			divW = parseFloat(divs.width.replace(/px/,''));
			divall = parseFloat(document.getElementById('scanpic3-film_strip_all').style.width.replace(/px/,''));
			/*if ('rtl' == 'rtl') dir = 'right';
			else dir = 'left';*/
			dir = 'right';
		}
		else {
			divW = parseFloat(divs.height.replace(/px/,''));
			divall = parseFloat(document.getElementById('scanpic3-film_strip_all').style.height.replace(/px/,''));
			dir = 'top';
		}
			
		var size = parseFloat(divs[dir].replace(/px/,''));
		var curSize = size;
		size = size + inc;
		var plus = parseInt(document.getElementById('scanpic3-film_strip_all').getAttribute('plus'));
		var minus = parseInt(document.getElementById('scanpic3-film_strip_all').getAttribute('minus'));
		//if (((size * -1) + divall) >  divW || size > 0) size = 0;
		//if (((size * -1) + divall) >  divW || size > 0) {
		//if (((size * -1) + divall) >  divW) {
		var cur = parseInt(document.getElementById('scanpic3-curFilmPage').value);
		if (str.charAt(0) == '-') {
				if (minus == 0) {
					var toMove = (cur + parseInt('5') - 1) % imgArr3.length;
					var last = (toMove + imgArr3.length - 1) % imgArr3.length;
					if ('horizon' == 'up' || 'horizon' == 'down' || 'horizon' == 'horizon') {
						document.getElementById('scanpic3-film_strip_item'+toMove).style.right = (document.getElementById('scanpic3-film_strip_item'+last).style.right.replace(/px/,'')-inc)+'px';
					}
					else {
						document.getElementById('scanpic3-film_strip_item'+toMove).style.top = (document.getElementById('scanpic3-film_strip_item'+last).style.top.replace(/px/,'')-inc)+'px';
					}
				}
				else {
					document.getElementById('scanpic3-film_strip_all').setAttribute('minus', minus-1);
					document.getElementById('scanpic3-film_strip_all').setAttribute('plus', plus+1);
				}
		}
		else if (str.charAt(0) == '+') {
				if (plus == 0) {
					var toMove = cur % imgArr3.length;
					if (toMove < 0) toMove += imgArr3.length;
					var last = (toMove + 1) % imgArr3.length;
					if ('horizon' == 'up' || 'horizon' == 'down' || 'horizon' == 'horizon') {
							document.getElementById('scanpic3-film_strip_item'+toMove).style.right = (document.getElementById('scanpic3-film_strip_item'+last).style.right.replace(/px/,'')-inc)+'px';
					}
					else {
							document.getElementById('scanpic3-film_strip_item'+toMove).style.top = (document.getElementById('scanpic3-film_strip_item'+last).style.top.replace(/px/,'')-inc)+'px';
					}
				}
				else {
					document.getElementById('scanpic3-film_strip_all').setAttribute('minus', minus+1);
					document.getElementById('scanpic3-film_strip_all').setAttribute('plus', plus-1);
				}
		}
		
		var speed;
		if ('horizon' == 'up' || 'horizon' == 'down' || 'horizon' == 'horizon') speed = curMaxFilmWidth3/10;
		else speed = curMaxFilmHeight3/10;
		if (Math.floor(speed) < speed) speed = Math.floor(speed)+1;
		if (speed % 4 == 1) speed += 3;
		else if (speed % 4 == 2) speed += 2;
		else if (speed % 4 == 3) speed += 1;
		var hSpeed = speed/2;
		var to = 40;
		var toInc = to/hSpeed;		
		var pxInc = (size - curSize) / speed;
		document.getElementById('scanpic3-onGoing').value = 'going';
		//setDivOffset3('scanpic3-film_strip_move', dir, speed, pxInc, hSpeed, to, toInc);
		window.setTimeout("setDivOffset3('scanpic3-film_strip_move','"+dir+"', "+speed+", "+pxInc+", "+hSpeed+", "+to+", "+toInc+", "+size+")",to);
		
		if ('onlyfilm' == 'onlyfilm') {
				if ('light_box' == 'popup' || '' == 'popup') {
						var current,position;
						var PUplusPos = parseInt(document.getElementById('scanpic3-film_strip_all').getAttribute('PUplusPos'));
						var PUminusPos = parseInt(document.getElementById('scanpic3-film_strip_all').getAttribute('PUminusPos'));
						var PUplusIndex = parseInt(document.getElementById('scanpic3-film_strip_all').getAttribute('PUplusIndex'));
						var PUminusIndex = parseInt(document.getElementById('scanpic3-film_strip_all').getAttribute('PUminusIndex'));
						if (str.charAt(0) == '-') {
									PUminusPos++;
									PUminusPos = PUminusPos % parseInt('5');
									PUplusPos++;
									PUplusPos = PUplusPos % parseInt('5');
									position = PUminusPos;
									PUminusIndex++;
									PUminusIndex = PUminusIndex % imgArr3.length;
									current = PUminusIndex;
									PUplusIndex++;
									PUplusIndex = PUplusIndex % imgArr3.length;
									document.getElementById('scanpic3-film_strip_all').setAttribute('PUminusPos',PUminusPos);
									document.getElementById('scanpic3-film_strip_all').setAttribute('PUplusPos', PUplusPos);
									document.getElementById('scanpic3-film_strip_all').setAttribute('PUminusIndex', PUminusIndex);
									document.getElementById('scanpic3-film_strip_all').setAttribute('PUplusIndex', PUplusIndex);
						}
						else {
									PUminusPos--;
									if (PUminusPos < 0) PUminusPos += parseInt('5');
									PUplusPos--;
									if (PUplusPos < 0) PUplusPos += parseInt('5');
									position = PUplusPos;
									PUminusIndex--;
									if (PUminusIndex < 0) PUminusIndex += imgArr3.length;
									PUplusIndex--;
									if (PUplusIndex < 0) PUplusIndex += imgArr3.length;
									current = PUplusIndex;
									document.getElementById('scanpic3-film_strip_all').setAttribute('PUminusPos',PUminusPos);
									document.getElementById('scanpic3-film_strip_all').setAttribute('PUplusPos', PUplusPos);
									document.getElementById('scanpic3-film_strip_all').setAttribute('PUminusIndex', PUminusIndex);
									document.getElementById('scanpic3-film_strip_all').setAttribute('PUplusIndex', PUplusIndex);						
						}
						var img = document.getElementById('scanpic3-film_strip_img'+current);
						var src = img.src;
						img.setAttribute('popup_position', position);
						var popup_img = document.getElementById('scanpic3-popup_img'+position);
						popup_img.src = src.replace(/http:\/\/www.negba.org.il\/gallery\/scanpic3\/\/round\//,"");
				}
				else if ('light_box' == 'resizing' || '' == 'resizing') {
						var current,position;
						var RplusPos = parseInt(document.getElementById('scanpic3-film_strip_all').getAttribute('RplusPos'));
						var RminusPos = parseInt(document.getElementById('scanpic3-film_strip_all').getAttribute('RminusPos'));
						var RplusIndex = parseInt(document.getElementById('scanpic3-film_strip_all').getAttribute('RplusIndex'));
						var RminusIndex = parseInt(document.getElementById('scanpic3-film_strip_all').getAttribute('RminusIndex'));
						if (str.charAt(0) == '-') {
									RminusPos++;
									RminusPos = RminusPos % parseInt('5');
									RplusPos++;
									RplusPos = RplusPos % parseInt('5');
									position = RminusPos;
									RminusIndex++;
									RminusIndex = RminusIndex % imgArr3.length;
									current = RminusIndex;
									RplusIndex++;
									RplusIndex = RplusIndex % imgArr3.length;
									document.getElementById('scanpic3-film_strip_all').setAttribute('RminusPos',RminusPos);
									document.getElementById('scanpic3-film_strip_all').setAttribute('RplusPos', RplusPos);
									document.getElementById('scanpic3-film_strip_all').setAttribute('RminusIndex', RminusIndex);
									document.getElementById('scanpic3-film_strip_all').setAttribute('RplusIndex', RplusIndex);
						}
						else {
									RminusPos--;
									if (RminusPos < 0) RminusPos += parseInt('5');
									RplusPos--;
									if (RplusPos < 0) RplusPos += parseInt('5');
									position = RplusPos;
									RminusIndex--;
									if (RminusIndex < 0) RminusIndex += imgArr3.length;
									RplusIndex--;
									if (RplusIndex < 0) RplusIndex += imgArr3.length;
									current = RplusIndex;
									document.getElementById('scanpic3-film_strip_all').setAttribute('RminusPos',RminusPos);
									document.getElementById('scanpic3-film_strip_all').setAttribute('RplusPos', RplusPos);
									document.getElementById('scanpic3-film_strip_all').setAttribute('RminusIndex', RminusIndex);
									document.getElementById('scanpic3-film_strip_all').setAttribute('RplusIndex', RplusIndex);						
						}
						var img = document.getElementById('scanpic3-film_strip_img'+current);
						var src = img.src;
						img.setAttribute('resize_position', position);
						var resize_img = document.getElementById('scanpic3-resizing_img'+position);
						resize_img.src = src.replace(/http:\/\/www.negba.org.il\/gallery\/scanpic3\/\/round\//,"");
				}
		}
		var moveStatus = document.getElementById('scanpic3-film_strip_move').getAttribute('run');
		if (moveStatus && moveStatus == 'r') {
				runFilm3(str);				
		}
		
	}
	
	function runFilm3(str) {
			
			//var moveStatus = document.getElementById('scanpic3-film_strip_move').getAttribute('run');
			//if (moveStatus && moveStatus == 'r') {
			if (document.getElementById('scanpic3-onGoing').value) {
						window.setTimeout("runFilm3('"+str+"');",200);
						return;
			}
			window.setTimeout("nextFilmPage3('"+str+"');",200);
					
	}
	
	function stopFilm3() {
				
				document.getElementById('scanpic3-film_strip_move').setAttribute('run','');
				
	}
	
	function setDivOffset3(id, dir, speed, inc, middle, to ,toInc, finalPx) {
		
		var elem = document.getElementById(id).style;
		var curOffset = elem[dir];
		if (speed > 0) {
			var val = parseFloat(elem[dir].replace(/px/,'')) + inc;
			elem[dir] = val+'px';
			speed--;
			if (speed <= 0.5*middle) {
					speed = middle;
					middle = speed/2
					inc = inc / 2;
					to = 20;
					toInc = to/middle;
					window.setTimeout("setDivOffsetFinish3('"+id+"','"+dir+"', "+speed+", "+inc+", "+middle+", "+to+", "+toInc+", "+finalPx+")",to);
			}
			else {
				if (speed == middle) ;
				else if (speed > middle) to -= toInc;
				else to += toInc;
				window.setTimeout("setDivOffset3('"+id+"','"+dir+"', "+speed+", "+inc+", "+middle+", "+to+", "+toInc+", "+finalPx+")",to);
			}
			return;			
		}
		else {
			document.getElementById('scanpic3-onGoing').value = '';
		}
	}
	function setDivOffsetFinish3(id, dir, speed, inc, middle, to ,toInc, finalPx) {
		
		var elem = document.getElementById(id).style;
		var curOffset = elem[dir];
		if (speed > 0) {
			var val = parseFloat(elem[dir].replace(/px/,'')) + inc;
			//alert(speed+':'+inc+':'+middle+':'+to+':'+toInc+':'+val);
			elem[dir] = val+'px';
			speed--;
			to += toInc;
			window.setTimeout("setDivOffsetFinish3('"+id+"','"+dir+"', "+speed+", "+inc+", "+middle+", "+to+", "+toInc+", "+finalPx+")",to);
			return;
		}
		else {
			if (finalPx != parseFloat(elem[dir])) elem[dir] = finalPx+'px';
			document.getElementById('scanpic3-onGoing').value = '';
		}
	}
	// ************** getNextPage ******************* //	
	
	function getNextPage3(str, putPageNum, firstTime) {
		
		document.getElementById('scanpic3-pageDone').value = 'work';
		if (str == 'last' && document.getElementById('scanpic3-curPage').value == (Math.ceil(imgArr3.length/num_per_page3)-1)) {
				return;
		}
		else if (str == 'first' && document.getElementById('scanpic3-curPage').value == 0) {
				return;
		}
		
		/*if (document.getElementById('scanpic3-onGoingNexPage').value) {
					if (!str) str = '';
					if (!putPageNum && putPageNum != 0) putPageNum = '';
					setTimeout("getNextPage3('"+str+"', '"+putPageNum+"',"+firstTime+")",500);
					return;
		}*/
		if ('' == 'popup' || 'light_box' == 'popup') {
				for (i = 0 ; i < num_per_page3 ; i++) {
					document.getElementById('scanpic3-popup'+i).style.display = 'none';
				}
		}
		if ('light_box' == 'resizing' || '' == 'resizing') {
				for (i = 0 ; i < num_per_page3 ; i++) {
					document.getElementById('scanpic3-resizing'+i).style.display = 'none';
				}
		}
	
		for (i = 0 ; i < num_per_page3 && i < imgArr3.length ; i++) {
			document.getElementById('scanpic3-td_pics'+i).style.visibility = 'visible';
		}
		var origCurPage = document.getElementById('scanpic3-curPage').value;
		if (putPageNum) document.getElementById('scanpic3-curPage').value = parseInt(putPageNum);
		
		var curPage = document.getElementById('scanpic3-curPage').value;
		var curIndex = curPage * num_per_page3;
		
		if (str == 'last') {
				document.getElementById('scanpic3-curPage').value = Math.ceil(imgArr3.length/num_per_page3)-1;
				curPage = document.getElementById('scanpic3-curPage').value;
		}
		else if (str == 'first') {
				document.getElementById('scanpic3-curPage').value = 0;
				curPage = document.getElementById('scanpic3-curPage').value;
		}
		else if (str && str.search(/^[0-9]+$/) == 0) {
			document.getElementById('scanpic3-curPage').value = str;
		}
		else if (str) {
			( str.charAt(0)  == '+' ? document.getElementById('scanpic3-curPage').value++ : document.getElementById('scanpic3-curPage').value--);
		}
		curPage = document.getElementById('scanpic3-curPage').value;
		
		if(curPage==-1) {
			document.getElementById('scanpic3-curPage').value = Math.ceil(imgArr3.length/num_per_page3)-1;
			curPage = document.getElementById('scanpic3-curPage').value;
		} {
		if(curPage >= Math.ceil((imgArr3.length)/num_per_page3)) 
			document.getElementById('scanpic3-curPage').value = 0;
			curPage = document.getElementById('scanpic3-curPage').value;
		}
		
		if (curPage == origCurPage && !firstTime) return;
		
		//CLEAR previous data
		for (i = 0 ; i < num_per_page3 && i < imgArr3.length ; i++) {
			for (k = 0 ; k < positions.length ; k++) {
				if (positions[k] != 'center_center') {
					document.getElementById('scanpic3-pics'+i+'_table_'+positions[k]).style.visibility = 'hidden';
					document.getElementById('scanpic3-pics'+i+'_table_'+positions[k]).innerHTML = document.getElementById('scanpic3-pics'+i+'_table_'+positions[k]+'_value').value;
				}
			}
			for (k = 0 ; k < icon_positions.length ; k++) {
				if (icon_positions[k] != 'icon_center_center') {
					document.getElementById('scanpic3-pics'+i+'_table_'+icon_positions[k]).style.visibility = 'hidden';
					document.getElementById('scanpic3-pics'+i+'_table_'+icon_positions[k]).innerHTML = document.getElementById('scanpic3-pics'+i+'_table_'+icon_positions[k]+'_value').value;
				}
			}
		}
		
		curIndex = curPage * num_per_page3;
		var target = '';
		
		if ('' && 'light_box' == '') {
				target = 'target=""';
		}
		currDivIndex3 = 0;
				
		var i;
		var onMouseOver, onMouseOut, onLoad, addStyle;
		//run this lines in the end of load
		runInTheEnd3 = '';
		// CHECK if lock is released
		//checkOnGoing(curIndex);
		getNextPage2_3(curIndex,curIndex, firstTime);
		
	}
	
	function getNextPage2_3(i, curIndex, firstTime) {
		
		var next = 1;
		/*for (j=0;j<imgArr3.length;j++) {
				if (curImgArrW[j]*curImgArrH[j]*imgArrH[j]*imgArrW[j] == 0 || !curImgArrW[j] || curImgArrH[j] == "undefined" || imgArrH[j] == "undefined" || imgArrW[j] == "undefined") {
					next = 0;
					window.setTimeout("getNextPage2_3("+i+", "+curIndex+", "+firstTime+")",50);
					return;
				}
		}
		if (!next) return;*/
		//for (i = curIndex ; i < (num_per_page3+curIndex) && i < imgArr3.length ; i++) {
		if (i < (num_per_page3+curIndex) && i < imgArr3.length ) {
				if ('') document.getElementById('scanpic3-pics'+currDivIndex3).style.backgroundImage='url()';
				//first time, set lock 
				if (i == curIndex) {
						document.getElementById('scanpic3-onGoingNexPage').value = curIndex;
				}
				var onClick = '';
				var title = '';				
				var href = 'javascript:void(0);';
				var addStyle = '';
				var addStyle0 = '';
				var addStyle2 = '';
				var imgArr = imgArr3;
				var scans_url = scans_url3;
				if ('0') href = scans_url[i];
				else if ('light_box' == 'link') href = '?pict='+imgArr[i];
				else if ('light_box' == 'imageLink') ;
				else if ('light_box' != 'nolink') href = 'http://www.negba.org.il/gallery/scanpic3//round/'+imgArr[i];
				else {target = '';addStyle += 'cursor:default;';addStyle0 += 'cursor:default;';}
				onMouseOver = onMouseOut = onLoad = '';
				
				var startPx = 1, startXPx = 0, startYPx = 0, blindDir ='';
				var curImgArrW = curImgArrW3;
				var curImgArrH = curImgArrH3;
				//CHECK if there is image load effetcs
				if ('fade'.search(/enter_from_/) == 0) {
					var re = new RegExp('enter_from_');
					dir = 'fade'.replace(re,'');
					//runInTheEnd3 = runInTheEnd3 + 'insertFromSideEffect3('+i+', "'+dir+'");';
					ifseArray3.push(i);
					addStyle0 = 'visibility: hidden;';
					addStyle = 'visibility: hidden;';
				}
				else if ('fade' == 'blindX') {
					startXPx = curImgArrW[i]?curImgArrW[i]:'94';
					addStyle0 = 'position: absolute; left: 0px; top:0px;';
					addStyle = 'position: absolute; left: '+startXPx+'px;';
					blindDir = 'left';
				}
				else if ('fade' == 'blindY') {
					startYPx = curImgArrH[i]?curImgArrH[i]:'94';
					addStyle0 = 'position: absolute; top: 0px; left:0px';
					addStyle = 'position: absolute; top: '+startYPx+'px;';
					blindDir = 'top';
				}
				else if ('fade' == 'blindZ') {
					startXPx = curImgArrW[i]?curImgArrW[i]:'94';
					startYPx = curImgArrH[i]?curImgArrH[i]:'94';
					addStyle0 = 'position: absolute; top: 0px; left: 0px;';
					addStyle = 'position: absolute; left: '+startXPx+'px; top: '+startYPx+'px;';
				}
				else if ('fade' == 'cover') {
					startXPx = curImgArrW[i]?curImgArrW[i]:'94';
					addStyle0 = 'position: absolute; left: 0px; top:0px;';
					addStyle = 'position: absolute; left: '+startXPx+'px;';
					blindDir = 'left';
				}
				else if ('fade' == 'fadeZoom') {
					startXPx = curImgArrW[i]?curImgArrW[i]:'94';
					startYPx = curImgArrH[i]?curImgArrH[i]:'94';
					startXPx = startXPx/2;
					startYPx = startYPx/2;
					addStyle0 = 'position: absolute; top: 0px; left: 0px; display: block';
					addStyle = 'position: absolute; left: '+startXPx+'px; top: '+startYPx+'px; display: block';
					if (navigator.appVersion.indexOf("MSIE")!=-1) {addStyle0+= 'filter:alpha(opacity=100);'; addStyle+= 'filter:alpha(opacity=100);';}
					else {addStyle0+= 'opacity: 1;';addStyle+= 'opacity: 1;';}
				}
				if ('light_box' == 'resizing') {
					onClick='onClick="prevResizeImage3('+i+');return false;"';
					href = 'javascript:void(0);'; 
				}
				else if ('light_box' == 'popup') {
					onClick = 'onClick="zoom3('+i+');return false;"';
					href = 'javascript:void(0);'; 
				}
				else if ('light_box' == 'light_box') {
					onClick = 'onClick="light_box3('+i+');return false;"';
					href = 'javascript:void(0);'; 
				}
					
				if ('' == 'popup') {
					onMouseOver = 'onmouseover="zoom3('+i+');"';
					//onMouseOut = 'onmouseout="zoomOut3('+popupSpeed+');"';
				}
				else if ('' == 'resizing') {
					onMouseOver = 'onmouseover="prevResizeImage3('+i+');"';
					//onMouseOut = 'onmouseout="prevResizeImage3('+i+');"';
				}
				else if ('' == 'light_box') {
					onMouseOver = 'onmouseover="light_box3('+i+');"';
				}
				var images_details = images_details3;
				var data = images_details[i].split("<DD>");
				for (var p=0; p<data.length;p++) {
						field = (data[p].split("="))[0];
						if (field == 'imageLink') field = 'link';
						field1 = '%%'+field+'%%';
						field2 = '%%icon_'+field+'%%';
						value = ((data[p].split("="))[1])?(data[p].split("="))[1].replace(/<SHAVE>/g, '='):'';
						//if (rel != '' && field == 'title') {		
						if (field == 'title' && value) title = 'title="'+value+'"';
						if (field == 'link') {
							if (value != '') {
								if ('light_box' == 'imageLink') href = value;	
								value = '<a href="'+value+'"><img '+target+' src="http://www.negba.org.il/htm-webaxy/multimedia/tel/link1.png" border="0"></a>';							
							}
							else {
								//href = 'javascript:void(0);';	
							}
						}
						if (!value || value.length == 0) { value = '';}
						else { value = value + '<br>';}
						var re1 = new RegExp(field1);
						var re2 = new RegExp(field2);
						for (k = 0 ; k < positions.length ; k++) {
								if (positions[k] != 'center_center') {
									document.getElementById('scanpic3-pics'+currDivIndex3+'_table_'+positions[k]).innerHTML = document.getElementById('scanpic3-pics'+currDivIndex3+'_table_'+positions[k]).innerHTML.replace(re1,value);
									document.getElementById('scanpic3-pics'+currDivIndex3+'_table_'+positions[k]).style.visibility = 'visible';
								}
						}
						for (k = 0 ; k < icon_positions.length ; k++) {
								if (icon_positions[k] != 'icon_center_center') {
									document.getElementById('scanpic3-pics'+currDivIndex3+'_table_'+icon_positions[k]).innerHTML = document.getElementById('scanpic3-pics'+currDivIndex3+'_table_'+icon_positions[k]).innerHTML.replace(re2,value);
									document.getElementById('scanpic3-pics'+currDivIndex3+'_table_'+icon_positions[k]).style.visibility = 'visible';
								}
						}
				}
				
				for (k = 0 ; k < icon_positions.length ; k++) {
					var val = document.getElementById('scanpic3-pics'+currDivIndex3+'_table_'+icon_positions[k]);
					if (icon_positions[k] != 'icon_center_center' && val.innerHTML != '' && '') {
						//val.innerHTML = val.innerHTML.replace(/\"/g,"\\\"");
						val.innerHTML = val.innerHTML.replace(/\"/g,"\\'");
						val.innerHTML = '<a href="javascript:void(0)" onmouseover="return overlib(\''+val.innerHTML+'\', BUBBLE, BUBBLETYPE, \'roundcorners\',TEXTCOLOR , \'#000000\', TEXTSIZE , \'13px\');" onmouseout="nd();"></a>';
					}
				} //internal for
				if ('fade' == 'fade') {
						if (navigator.appVersion.indexOf("MSIE")!=-1) {addStyle0+= 'filter:alpha(opacity=20);'; addStyle+= 'filter:alpha(opacity=20);';}
						else {addStyle0+= 'opacity: 0.2;';addStyle+= 'opacity: 0.2;';}
				}
				if (addStyle0 != '') {
						addStyle0 = 'style="'+addStyle0+'"';
				}
				if (addStyle != '') {
						addStyle2 = 'style="'+addStyle+'display:none;"';
						addStyle = 'style="'+addStyle+'"';						
				}
				var innerH;
				var divPictStyle = '';
				//if (curMaxImageWidth > 0 && curMaxImageHeight > 0) divPictStyle = 'width: '+curMaxImageWidth+'px; height:'+curMaxImageHeight+'px';
				//else if (navigator.appVersion.indexOf("MSIE")!=-1 && '94') divPictStyle = 'width: 94px; height: 94px';
				divPictStyle = 'width: '+curImgArrW[i]+'px; height: '+curImgArrH[i]+'px';
				var divOnClick = '';
				if (!onClick) {
					if ('' == '_new') {
						if (href && ('light_box' != 'imageLink' || ('light_box' == 'imageLink' && href != 'javascript:void(0);'))) divOnClick = 'onclick="window.open(\''+href+'\');"';
						else divOnClick = 'onclick="javascript:void(0);"';
						href = 'javascript:void(0);';
					}
					else {
						if (href && ('light_box' != 'imageLink' || ('light_box' == 'imageLink' && href != 'javascript:void(0);'))) divOnClick = 'onclick="location.href=\''+href+'\';"';
						else divOnClick = 'onclick="javascript:void(0);"';
					}
				}
				//else divOnClick = onClick;
				var imgArr = imgArr3;
				var src = 'http://www.negba.org.il/gallery/scanpic3//round/'+imgArr[i];
				onClickDiv = '';
				var aStyle = '';
				if ('') {
					divOnClick = onClick;
					onClick = '';
					aStyle = 'style="cursor: default;"';
				}
				if ('' == 'iome1' && document.getElementById('scanpic3-pics'+currDivIndex3+'_table_up_right').innerHTML != '') {
						if (document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td') && document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').firstChild) {
								innerH = '<a '+aStyle+' '+onMouseOver+' '+onMouseOut+' '+rel+' '+title+' '+imgClass+' '+onClick+' onmouseover="return overlib(\''+document.getElementById('scanpic3-pics'+currDivIndex3+'_table_up_right').innerHTML+'\', BUBBLE, BUBBLETYPE, \'roundcorners\',TEXTCOLOR , \'#000000\', TEXTSIZE , \'13px\');" onmouseout="nd();" href="'+href+'" '+target+'><div '+divOnClick+' class="scanpic-div_img scanpic3-div_img" id="scanpic3-divPict'+currDivIndex3+'" style="cursor: pointer; overflow: hidden; position: relative; '+divPictStyle+'"><img '+addStyle0+' '+onLoad+' class="scanpic3-img" name="picture'+i+'" id="scanpic3-picture'+i+'" '+scaling_value+' border="0" src="'+src+'"><img '+addStyle+' '+onLoad+' name="" id="" '+scaling_value+' border="0" src=""></div></a>';
						}
						else {
								if ('fade' == 'cover' || 'fade' == 'fadeZoom') addStyle = addStyle0;
								innerH = '<a '+aStyle+' '+onMouseOver+' '+onMouseOut+' '+rel+' '+title+' '+imgClass+' '+onClick+' onmouseover="return overlib(\''+document.getElementById('scanpic3-pics'+currDivIndex3+'_table_up_right').innerHTML+'\', BUBBLE, BUBBLETYPE, \'roundcorners\',TEXTCOLOR , \'#000000\', TEXTSIZE , \'13px\');" onmouseout="nd();" href="'+href+'" '+target+'><div '+divOnClick+' class="scanpic-div_img scanpic3-div_img" id="scanpic3-divPict'+currDivIndex3+'" style="cursor: pointer; overflow: hidden; position: relative; '+divPictStyle+'"><img '+addStyle+' '+onLoad+' name="picture'+i+'" class="scanpic3-img" id="scanpic3-picture'+i+'" '+scaling_value+' border="0" src="'+src+'"><img '+addStyle2+' '+onLoad+' name="" id="" '+scaling_value+' border="0" src=""></div></a>';
						}
					}
				else {
						if (document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td') && document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').firstChild) {
								innerH = '<a '+aStyle+' '+onMouseOver+' '+onMouseOut+' '+rel+' '+title+' '+imgClass+' '+onClick+' href="'+href+'" '+target+'><div '+divOnClick+' class="scanpic-div_img scanpic3-div_img" id="scanpic3-divPict'+currDivIndex3+'" style="cursor: pointer; overflow: hidden; position: relative; '+divPictStyle+'"><img '+addStyle0+' '+onLoad+' class="scanpic3-img" name="picture'+i+'" id="scanpic3-picture'+i+'" '+scaling_value+' border="0" src="'+src+'"><img '+addStyle+' '+onLoad+' name="" id="" '+scaling_value+' border="0" src=""></div></a>';
						}
						else {
								if ('fade' == 'cover' || 'fade' == 'fadeZoom') addStyle = addStyle0;
								//addStyle = 'style="position: absolute; top: 0px; left: 0px;"';
								innerH = '<a '+aStyle+' '+onMouseOver+' '+onMouseOut+' '+rel+' '+title+' '+imgClass+' '+onClick+' href="'+href+'" '+target+'><div '+divOnClick+' class="scanpic-div_img scanpic3-div_img" id="scanpic3-divPict'+currDivIndex3+'" style="cursor: pointer; overflow: hidden; position: relative; '+divPictStyle+'"><img '+addStyle+' '+onLoad+' class="scanpic3-img" name="picture'+i+'" id="scanpic3-picture'+i+'" '+scaling_value+' border="0" src="'+src+'"><img '+addStyle2+' '+onLoad+' name="" id="" '+scaling_value+' border="0" src=""></div></a>';
						}
				}
				
				var innerHTML, myId, myId2;
				var tmp_img = new Image();
			  tmp_img.onload=function() {
			  		if (document.getElementById('scanpic3-divPict'+currDivIndex3)) {
							innerHTML = document.getElementById('scanpic3-divPict'+currDivIndex3).innerHTML;
							document.getElementById('scanpic3-divPict'+currDivIndex3).firstChild.nextSibling.id = 'scanpic3-picture'+i;
							document.getElementById('scanpic3-divPict'+currDivIndex3).firstChild.nextSibling.name = 'scanpic3-picture'+i;
							document.getElementById('scanpic3-divPict'+currDivIndex3).firstChild.nextSibling.src = src;
							document.getElementById('scanpic3-divPict'+currDivIndex3).firstChild.nextSibling.style.display = 'block';
						}
						
				    if ('fade' == 'blindX' || 'fade' == 'blindY' || 'fade' == 'blindZ') {
								if (document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td') && document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').firstChild) {
									innerH = innerH.replace(/\'/g,"&quota;");
									innerH = innerH.replace(/\"/g,"&quot;");
									myId = document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').firstChild.firstChild.firstChild.id;
									myId2 = document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').firstChild.firstChild.firstChild.nextSibling.id;
									//blind3(startXPx/blindSpeed, startYPx/blindSpeed, blindSpeed, myId, myId2, i, curIndex, innerH, blindDir);
									window.setTimeout("blind3("+(startXPx/blindSpeed)+", "+(startYPx/blindSpeed)+", "+blindSpeed+", '"+myId+"', '"+myId2+"', "+i+", "+curIndex+", '"+innerH+"', '"+blindDir+"')",50);
								}
								else {
									document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').innerHTML = innerH;
									innerH = innerH.replace(/\'/g,"&quota;");
									innerH = innerH.replace(/\"/g,"&quot;");
									//blind3(-startXPx/blindSpeed, -startYPx/blindSpeed, blindSpeed, 'picture'+i, '', i, curIndex, innerH, blindDir);
									window.setTimeout("blind3("+(-startXPx/blindSpeed)+", "+(-startYPx/blindSpeed)+", "+blindSpeed+", 'scanpic3-picture"+i+"', '', "+i+", "+curIndex+", '"+innerH+"', '"+blindDir+"')",50);
								}
						}
						else if ('fade' == 'cover') {
								if (document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td') && document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').firstChild) {
									innerH = innerH.replace(/\'/g,"&quota;");
									innerH = innerH.replace(/\"/g,"&quot;");							
									myId = document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').firstChild.firstChild.firstChild.id;
									myId2 = document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').firstChild.firstChild.firstChild.nextSibling.id;
									//cover3(-startXPx/blindSpeed, startYPx/blindSpeed, blindSpeed, myId2, i, curIndex, innerH, blindDir);
									window.setTimeout("cover3("+(-startXPx/blindSpeed)+", "+(startYPx/blindSpeed)+", "+blindSpeed+", '"+myId2+"', "+i+", "+curIndex+", '"+innerH+"', '"+blindDir+"')",50);
								}
								else {
									document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').innerHTML = innerH;
									innerH = innerH.replace(/\'/g,"&quota;");
									innerH = innerH.replace(/\"/g,"&quot;");							
									//cover3(-startXPx/blindSpeed, -startYPx/blindSpeed, blindSpeed, 'picture'+i, i, curIndex, innerH, blindDir);
									window.setTimeout("cover3("+(-startXPx/blindSpeed)+", "+(startYPx/blindSpeed)+", "+blindSpeed+", 'scanpic3-picture"+i+"', "+i+", "+curIndex+", '"+innerH+"', '"+blindDir+"')",50);
								}
						}				
						else if ('fade' == 'fadeZoom') {
								if (document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td') && document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').firstChild) {
									//other than first time page load
									document.getElementById('scanpic3-divPict'+currDivIndex3).firstChild.nextSibling.id = 'scanpic3-picture'+i;
									document.getElementById('scanpic3-divPict'+currDivIndex3).firstChild.nextSibling.name = 'scanpic3-picture'+i;
									document.getElementById('scanpic3-divPict'+currDivIndex3).firstChild.nextSibling.src = src;
									document.getElementById('scanpic3-divPict'+currDivIndex3).firstChild.nextSibling.style.left = startXPx+'px';
									document.getElementById('scanpic3-divPict'+currDivIndex3).firstChild.nextSibling.style.top = startYPx+'px';
									document.getElementById('scanpic3-divPict'+currDivIndex3).firstChild.nextSibling.style.width = '0px';
									document.getElementById('scanpic3-divPict'+currDivIndex3).firstChild.nextSibling.style.height = '0px';
									myId = document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').firstChild.firstChild.firstChild.id;
									myId2 = document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').firstChild.firstChild.firstChild.nextSibling.id;
									innerH = innerH.replace(/\'/g,"&quota;");
									innerH = innerH.replace(/\"/g,"&quot;");
									//fadeZoom3(-startXPx/blindSpeed, -startYPx/blindSpeed, blindSpeed, myId, myId2, i, curIndex, innerH);
									window.setTimeout("fadeZoom3("+(-startXPx/blindSpeed)+", "+(-startYPx/blindSpeed)+", "+blindSpeed+", '"+myId+"', '"+myId2+"', "+i+", "+curIndex+", '"+innerH+"')",50);
								}
								else { //first time page load
									document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').innerHTML = innerH;
									try {
										eval(run4Eachpicture);
									} catch(e) {}
									currDivIndex3++;
									i++;
									getNextPage2_3(i,curIndex,firstTime);
								}
						}
						else if ('fade' == 'fade') {
							var myId = ' ';
							if (document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td') && document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').firstChild) {
								myId = document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').firstChild.firstChild.firstChild.id;
								if (navigator.appVersion.indexOf("MSIE")!=-1) {
									document.getElementById(myId).style.filter = "alpha(opacity=100)";
								}
								else {
									document.getElementById(myId).style.opacity = 1;
								}
							}
							innerH = innerH.replace(/\'/g,"&quota;");
							innerH = innerH.replace(/\"/g,"&quot;");
							//fade3(-1/opacitySpeed, opacitySpeed, myId ,i, curIndex, innerH);
							window.setTimeout("fade3("+(-0.8/opacitySpeed)+", "+opacitySpeed+", '"+myId+"', "+i+", "+curIndex+", '"+innerH+"')",50);
						}
						else {
							document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').innerHTML = innerH;
							document.getElementById('scanpic3-divPict'+currDivIndex3).firstChild.nextSibling.style.display = 'none';
							if ('') document.getElementById('scanpic3-pics'+currDivIndex3).style.backgroundImage='';
							try {
								eval(run4Eachpicture);
							} catch(e) {}
							currDivIndex3++;
							i++;
							getNextPage2_3(i,curIndex,firstTime);
						}
				}
				tmp_img.src = src;
  						
		} //main for
		// release lock
		else {
			document.getElementById('scanpic3-onGoingNexPage').value = '';
			getNextPage3_3();
		}
				
	}
	function fade3(inc, index, id,i, curIndex, innerH) {
		
		var next = 0;
		if (!document.getElementById(id)) {
				next = 1;
				index = 0;
		}
		var curOpacity;
		if (!next) {
			if (document.getElementById(id)) {
				if (navigator.appVersion.indexOf("MSIE")!=-1) {
					 curOpacity = document.getElementById(id).style.filter;
					 var opacityPattern=new RegExp("[0-9]+");
					 curOpacity = parseFloat(opacityPattern.exec(curOpacity));
				}
				else {
					curOpacity = parseFloat(document.getElementById(id).style.opacity);	
				}
			}
		}
		index--;
		if (index >= 0) {
				if (document.getElementById(id)) {
					if (navigator.appVersion.indexOf("MSIE")!=-1) {
						curOpacity = curOpacity + inc*100;
						if (curOpacity < 0.1) curOpacity = 0;
						document.getElementById(id).style.filter = "alpha(opacity=" + curOpacity + ")";
					}
					else {
						curOpacity = curOpacity + inc;
						if (curOpacity < 0.001) curOpacity = 0;
						document.getElementById(id).style.opacity = curOpacity;
					}
				}
				window.setTimeout("fade3("+inc+", "+index+", '"+id+"', "+i+", "+curIndex+", '"+innerH+"')",30);
		}
		else {
			if (inc < 0) {
				var myId = 'scanpic3-picture'+i;
				var innerH1 = innerH.replace(/&quot;/g,'"');
				innerH1 = innerH1.replace(/&quota;/g,"'");
				var imgArr = imgArr3;
			  var tmp_img = new Image();
			  tmp_img.onload=function() {
		    		window.setTimeout("fade3("+(0.8/opacitySpeed)+", "+opacitySpeed+", '"+myId+"', "+i+", "+curIndex+", '"+innerH+"')",50);
		    		if (document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td'))
							document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').innerHTML = innerH1;
				}
				tmp_img.src = 'http://www.negba.org.il/gallery/scanpic3//round/'+imgArr[curIndex];
				////if (document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td'))
					////document.getElementById('scanpic3-pics'+currDivIndex3+'_table_td').innerHTML = innerH1;
				////window.setTimeout("fade3("+(1/opacitySpeed)+", "+opacitySpeed+", '"+myId+"', "+i+", "+curIndex+", '"+innerH+"')",150);
				//fade3(1/opacitySpeed, opacitySpeed, myId ,i, curIndex, innerH);
			}
			else {
				if (navigator.appVersion.indexOf("MSIE")!=-1) {
					try { 
						if (document.getElementById(id).style.filter == 'alpha(opacity=100)')
							document.getElementById(id).style.filter = '';
					} catch (e) {
						
					}
				}
				try {
					if ('') document.getElementById('scanpic3-pics'+currDivIndex3).style.backgroundImage='';
				} catch (e) {}
				try {
				eval(run4Eachpicture);
			} catch(e) {}
				currDivIndex3++;
				i++;
				getNextPage2_3(i,curIndex, false);
			}
		}
	}
	function getNextPage3_3() {		
		
		//hide images div which are empty (not enough images on last page)
		while ( currDivIndex3 < num_per_page3 && currDivIndex3 < imgArr3.length ) {
				document.getElementById('scanpic3-td_pics'+currDivIndex3).style.visibility = 'hidden';
				currDivIndex3++				
		}
		
		if ('' == 'iome2') opacityPictures3();
		document.getElementById('scanpic3-currentIndexResize').value = '';
		document.getElementById('scanpic3-imageresize').value = '+';
		
		if ('fade'.search(/enter_from_/) == 0) {
				var re = new RegExp('enter_from_');
				var dir = 'fade'.replace(re,'');
				ifseArray3 = ifseArray3.reverse();
				mainInsertFromSideEffect3(dir);
		}
					
		eval(runInTheEnd3);
		if ('' || '') {
				updatePageCounter3();
		}
		/*if ('checked' == '') {
				updateControlPanel3();
		}*/
		
		var ss = document.getElementById('scanpic3-slide_show');
		var curPage = document.getElementById('scanpic3-curPage').value;
		var start = num_per_page3 * curPage;
				
		/*if (ss.value == 'r') {
				window.setTimeout("getNextPage3('+');",1000);
		}
		else */
		if ('light_box' == 'resizing' || '' == 'resizing') {
				for (i = start ; i < start + num_per_page3 && i < imgArr3.length; i++) {
					var img = document.getElementById('scanpic3-picture'+i);
					var src = img.src;
					var j = i - start;
					var re_img = document.getElementById('scanpic3-resizing_img'+j);
					re_img.src = src.replace(/http:\/\/www.negba.org.il\/gallery\/scanpic3\/\/round\//,"");
				}
		}
		else if ('light_box' == 'popup' || '' == 'popup') {
				for (i = start ; i < start + num_per_page3 && i < imgArr3.length; i++) {
					var img = document.getElementById('scanpic3-picture'+i);
					var src = img.src;
					var j = i - start;
					var popup_img = document.getElementById('scanpic3-popup_img'+j);
					popup_img.src = src.replace(/http:\/\/www.negba.org.il\/gallery\/scanpic3\/\/round\//,"");
				}
		}
		
		if (alowToEdit3 && '0' != '1') {
			for (i = 0 ; i < num_per_page3 && i < imgArr3.length ; i++) {
							var div = document.getElementById('scanpic3-pics'+i);
							var div1 = document.createElement('DIV');
							var div2 = document.createElement('DIV');
							var imgArr = imgArr3;
							div1.id = 'scanpic3-1ca'+i;
							div1.style.position = 'relative';
							div1.style.height = '24px';
							div1.style.top = '-24px';
							div1.style.backgroundColor = '#000000';
							div2.id = 'scanpic3-2ca'+i;
							div2.style.position = 'relative';
							div2.style.textAlign = 'center';
							div2.style.top = '-48px';
							div2.style.height = '0px';
							if (navigator.appVersion.indexOf("MSIE")!=-1) {
									div1.style.filter = "alpha(opacity=40)";
							}
							else {
									div1.style.opacity = 0.4;
							}
							try {
								div.removeChild(document.getElementById('scanpic3-1ca'+i));
								div.removeChild(document.getElementById('scanpic3-2ca'+i));
							} catch(e){}
									
							var index = i + start;
							div2.innerHTML = '<img src="http://www.negba.org.il/htm-webaxy/ndel.gif" border="0" title="Delete page from http://www.negba.org.il/gallery/" onclick="clickDel(\'http://www.negba.org.il/gallery/'+imgArr[index]+'\')" style="cursor: pointer" onMouseOver="this.parentNode.parentNode.style.backgroundColor=\'silver\';" onMouseOut="this.parentNode.parentNode.style.backgroundColor=\'transparent\'">' +
																	'<img src="http://www.negba.org.il/htm-webaxy/pagedit.gif" border="0" title="עריכה" onclick="clickEditSP3(\'http://www.negba.org.il/gallery/'+imgArr[index]+'\','+index+')" style="cursor: pointer" onMouseOver="this.parentNode.parentNode.style.backgroundColor=\'silver\';" onMouseOut="this.parentNode.parentNode.style.backgroundColor=\'transparent\'">';
							div.appendChild(div1);
							div.appendChild(div2);
			}			
			/*for (i = 0 ; i < num_per_page3 && i < imgArr3.length ; i++) {
					var div = document.getElementById('scanpic3-pics'+i);
					var tb = document.createElement('TABLE');
					var id = 'pic'+i+'-CA';
					tb.id = id;
					tb.align = "center";
					var newRow=tb.insertRow(0);
					var newCell=newRow.insertCell(0);
					var index = i + start;
					var imgArr = imgArr3;
					newCell.innerHTML = '<img src="http://www.negba.org.il/htm-webaxy/ndel.gif" border="0" title="Delete page from http://www.negba.org.il/gallery/" onclick="clickDel(\'http://www.negba.org.il/gallery/'+imgArr[index]+'\')" style="cursor: pointer" onMouseOver="this.parentNode.parentNode.style.backgroundColor=\'silver\';" onMouseOut="this.parentNode.parentNode.style.backgroundColor=\'transparent\'">' +
															'<img src="http://www.negba.org.il/htm-webaxy/pagedit.gif" border="0" title="עריכה" onclick="clickEditSP3(\'http://www.negba.org.il/gallery/'+imgArr[index]+'\','+index+')" style="cursor: pointer" onMouseOver="this.parentNode.parentNode.style.backgroundColor=\'silver\';" onMouseOut="this.parentNode.parentNode.style.backgroundColor=\'transparent\'">';
					if (document.getElementById(id)) div.removeChild(document.getElementById(id));
					div.appendChild(tb);
			}	*/		
		}
		document.getElementById('scanpic3-pageDone').value = '';
		
	}
	
	function updateControlPanel3() {
		
			var pages = Math.ceil(imgArr3.length/num_per_page3);
			var curP = parseInt(document.getElementById('scanpic3-curPage').value);
			curP++;
			var firstP = document.getElementById('scanpic3-firstpage');
			var lastP = document.getElementById('scanpic3-lastpage');
			//var prvP = document.getElementById('scanpic3-prvpage');
			//var nxtP = document.getElementById('scanpic3-nxtpage');
			if (curP == 1 && firstP) {
				firstP.style.cursor = 'default';
				firstP.className = 'hideMe';
				if (navigator.appVersion.indexOf("MSIE")!=-1) {
					firstP.style.filter = "alpha(opacity=50)";
				}
				else {
					firstP.style.opacity = 0.5;
				}
			}
			else if (firstP) {
				firstP.style.cursor = 'pointer';
				if (navigator.appVersion.indexOf("MSIE")!=-1) {
					firstP.style.filter = "alpha(opacity=100)";
				}
				else {
					firstP.style.opacity = 1;
				} 
			}
			if (curP == pages && lastP) {
				lastP.style.cursor = 'default';
				if (navigator.appVersion.indexOf("MSIE")!=-1) {
					lastP.style.filter = "alpha(opacity=50)";
				}
				else {
					lastP.style.opacity = 0.5;
				}
			}
			else if (lastP) {
				lastP.style.cursor = 'pointer';
				if (navigator.appVersion.indexOf("MSIE")!=-1) {
					lastP.style.filter = "alpha(opacity=100)";
				}
				else {
					lastP.style.opacity = 1;
				} 
			}
			
	}
		
	function getPosition3(myTarget) {
		
		var top = 0, left = 0;
		while(myTarget!= document.body && myTarget != null) { 
		     top += myTarget.offsetTop; 
		     left += myTarget.offsetLeft; 
		     myTarget = myTarget.offsetParent; 
		 } 
		var result = new Array();
		result[0] = left;
		result[1] = top;
		return result;
			
	}
	function getSize3() {

	// Window Size
		if (self.innerHeight) { // Everyone but IE
			myWidth3 = window.innerWidth;
			myHeight3 = window.innerHeight;
			myScroll3 = window.pageYOffset;
		} else if (document.documentElement && document.documentElement.clientHeight) { // IE6 Strict
			myWidth3 = document.documentElement.clientWidth;
			myHeight3 = document.documentElement.clientHeight;
			myScroll3 = document.documentElement.scrollTop;
		} else if (document.body) { // Other IE, such as IE7
			myWidth3 = document.body.clientWidth;
			myHeight3 = document.body.clientHeight;
			myScroll3 = document.body.scrollTop;
		}
		// Page size w/offscreen areas
	
		if (window.innerHeight && window.scrollMaxY) {	
			myScrollWidth3 = document.body.scrollWidth;
			myScrollHeight3 = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac
			myScrollWidth3 = document.body.scrollWidth;
			myScrollHeight3 = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			myScrollWidth3 = document.body.offsetWidth;
			myScrollHeight3 = document.body.offsetHeight;
		}
	}
	function runFirst3() {
		
		if (isRunFirst3 == 1) return;
		isRunFirst3 = 1;
		//var _body3 = document.getElementsByTagName('body')[0];
		//_body3.appendChild(sp3);
		document.getElementById('scanpic3-curPage').value = 0;
		document.getElementById('scanpic3-curFullIndex').value = 0;
		document.getElementById('scanpic3-curFilmPage').value = 0;
		getSize3();
		var href = location.href;
		var index = href.indexOf("pict=");
		var getPage = '';
		var isFirst = true;
		
		//setTimeout("loadImages3();", 20);
		
		// click admin
		clickadmin='';
		if (document.cookie.length > 0) { // if there are any cookies
			var search =  "clickadmin&";
			var search1 = "clickadmin=";
			offset = document.cookie.indexOf(search);
			if (offset == -1) offset = document.cookie.indexOf(search1);
			if (offset != -1) { // if cookie exists 
				offset += search.length ;  // set index of beginning of value
				end = document.cookie.indexOf("&", offset); // set index of end of cookie value
				if (end == -1) 
					end = document.cookie.length;
				clickadmin= unescape(document.cookie.substring(offset, end));
				if (clickadmin != "" && clickadmin != '0' && clickadmin.search(/^0/) == -1 )
					alowToEdit3 = 1;
			}
			if (alowToEdit3 && '0' != '1') {
				var caRow = document.getElementById('scanpic3-main_table').insertRow(-1);
				var caCell = caRow.insertCell(-1);
				caCell.align = 'center';
				caCell.id = 'scanpic3-caEditAll';
				caCell.innerHTML = '<a href="javascript:clickEditSP3(\'http://www.negba.org.il/gallery/\', -1)" target="_self"><img src="http://www.negba.org.il/htm-webaxy/edit_all_docs.gif" border="0" title="ערוך כל המסמכים" hspace="1"></a>';
				if (!document.getElementById('scanpic3')) document.getElementById('scanpic3-caEditAll').style.position = 'static';
			}
		}
		// click admin
		
		if (index != -1) {
			index2 = href.indexOf("&", index);
			if (index2 == -1) pict = href.substring(index+5);
			else pict = href.substring(index+5,index2);
			pict = decodeURIComponent(pict);
			var imgArr = imgArr3;
			for (i = 0 ; i < imgArr3.length ; i++) {
					if (imgArr[i] == pict) {getPage = i;isFirst=true;}
			}
			getPage += '';
		}
		//set last arrow function
		var num_of_pages = Math.ceil(imgArr3.length/num_per_page3)-1;
		var scaling_value = 94;
		
		if ('checked' == '') {
			var fullSD = document.getElementById('scanpic3-fullScreenDiv');
			//fullSD.innerHTML = fullSD.innerHTML + '<br><br>' + '<div id="scanpic3-fullScreenPanel">' + document.getElementById('scanpic3-panel').innerHTML + '</div>';
			if ('' == 'down') {
				fullSD.innerHTML = fullSD.innerHTML + '<div id="scanpic3-fullScreenPanel" style="height:30px;">' + document.getElementById('scanpic3-panel').innerHTML + '</div>';
			}
			else {
				fullSD.innerHTML = '<div id="scanpic3-fullScreenPanel" style="height:30px;">' + document.getElementById('scanpic3-panel').innerHTML + '</div>' + fullSD.innerHTML;
			}
			fullSD.innerHTML = fullSD.innerHTML.replace(/fullscreen/g,'regularscreen');
			fullSD.innerHTML = fullSD.innerHTML.replace(/prvpage/g,'prvpage_f');
			fullSD.innerHTML = fullSD.innerHTML.replace(/nxtpage/g,'nxtpage_f');
			fullSD.innerHTML = fullSD.innerHTML.replace(/firstpage/g,'firstpage_f');
			fullSD.innerHTML = fullSD.innerHTML.replace(/lastpage/g,'lastpage_f');
			fullSD.innerHTML = fullSD.innerHTML.replace(/slide_show/g,'slide_show_full');
			fullSD.innerHTML = fullSD.innerHTML.replace(/play/,'play_full');
			if ('' == '') {
				document.getElementById('scanpic3-prvpage_f').onclick =  function () { getNextPageFull3('-1');};
				document.getElementById('scanpic3-nxtpage_f').onclick =  function () { getNextPageFull3('+1');};
			}
			if ('checked' == '') {
				document.getElementById('scanpic3-firstpage_f').onclick =  function () { getNextPageFull3('first');};
				document.getElementById('scanpic3-lastpage_f').onclick =  function () { getNextPageFull3('last');};
			}
			document.getElementById('scanpic3-regularscreen').onclick =  function () { regularScreen3();};
			document.getElementById('scanpic3-regularscreen').title = 'מסך רגיל';
			if ('checked' == '') {
				document.getElementById('scanpic3-play_full').onclick =  function () { slideShowFull3('r');};
			}
			var keepPlace = 0;
			var keepGoTo = 0;
			var keepPagesCounter = 25;
			if (imgArr3.length >= 5 * 2) keepGoTo = 25;
			if ('') keepPlace += keepPagesCounter + keepGoTo;
			if ('') keepPlace += keepPagesCounter + keepGoTo;
			document.getElementById('scanpic3-fullScreenDivImg').style.height = (myHeight3 - 40 - keepPlace) + 'px';
		}
		if ('' || '') {
				updatePageCounter3();
				//updatePageCounterFS3();
		}
		if ('onlyfilm' != 'onlyfilm') {
			if ('' == '') setTimeout("getNextPage3('"+getPage+"', '', "+isFirst+")", 150);			
		}
		else if ('' == 'iome2') opacityFilmPictures3();
		
		if ('onlyfilm' == 'onlyfilm') {
				if ('light_box' == 'popup' || '' == 'popup') {
					for (i = 0 ; i < 5 && i < imgArr3.length; i++) {
						var img = document.getElementById('scanpic3-film_strip_img'+i);
						var src = img.src;
						//var j = i - start;
						var popup_img = document.getElementById('scanpic3-popup_img'+i);
						popup_img.src = src.replace(/http:\/\/www.negba.org.il\/gallery\/scanpic3\/\/round\//,"");
					}
				}
				else if ('light_box' == 'resizing' || '' == 'resizing') {
					for (i = 0 ; i < 5 && i < imgArr3.length; i++) {
						var img = document.getElementById('scanpic3-film_strip_img'+i);
						var src = img.src;
						var re_img = document.getElementById('scanpic3-resizing_img'+i);
						re_img.src = src.replace(/http:\/\/www.negba.org.il\/gallery\/scanpic3\/\/round\//,"");
					}
				}
				if (alowToEdit3 && '0' != '1') {
					for (i = 0 ; i < imgArr3.length ; i++) {
							var div = document.getElementById('scanpic3-film_strip_item'+i);
							var div1 = document.createElement('DIV');
							var div2 = document.createElement('DIV');
							var imgArr = imgArr3;
							div1.style.position = 'relative';
							div1.style.height = '24px';
							div1.style.top = '-24px';
							div1.style.backgroundColor = '#000000';
							div2.style.position = 'relative';
							div2.style.top = '-48px';
							if (navigator.appVersion.indexOf("MSIE")!=-1) {
									div1.style.filter = "alpha(opacity=40)";
								}
								else {
									div1.style.opacity = 0.4;
								}
							div2.innerHTML = '<img src="http://www.negba.org.il/htm-webaxy/ndel.gif" border="0" title="Delete page from http://www.negba.org.il/gallery/" onclick="clickDel(\'http://www.negba.org.il/gallery/'+imgArr[i]+'\')" style="cursor: pointer" onMouseOver="this.parentNode.parentNode.style.backgroundColor=\'silver\';" onMouseOut="this.parentNode.parentNode.style.backgroundColor=\'transparent\'">' +
																	'<img src="http://www.negba.org.il/htm-webaxy/pagedit.gif" border="0" title="עריכה" onclick="clickEditSP3(\'http://www.negba.org.il/gallery/'+imgArr[i]+'\','+i+')" style="cursor: pointer" onMouseOver="this.parentNode.parentNode.style.backgroundColor=\'silver\';" onMouseOut="this.parentNode.parentNode.style.backgroundColor=\'transparent\'">';
							div.appendChild(div1);
							div.appendChild(div2);
					}			
				}
		}
		if ('onlyfilm' == 'onlyfilm' || 'onlyfilm' == 'film') {
			document.getElementById('scanpic3-film_strip_all').setAttribute('minus', imgArr3.length - parseInt('5'));
			document.getElementById('scanpic3-film_strip_all').setAttribute('plus', 0);
			document.getElementById('scanpic3-film_strip_all').setAttribute('PUminusPos',parseInt('5')-1);
			document.getElementById('scanpic3-film_strip_all').setAttribute('PUplusPos', 0);
			document.getElementById('scanpic3-film_strip_all').setAttribute('PUminusIndex', parseInt('5')-1);
			document.getElementById('scanpic3-film_strip_all').setAttribute('PUplusIndex', 0);
			document.getElementById('scanpic3-film_strip_all').setAttribute('RminusPos',parseInt('5')-1);
			document.getElementById('scanpic3-film_strip_all').setAttribute('RplusPos', 0);
			document.getElementById('scanpic3-film_strip_all').setAttribute('RminusIndex', parseInt('5')-1);
			document.getElementById('scanpic3-film_strip_all').setAttribute('RplusIndex', 0);
		}
		
		try {
			if (parseInt(getPage) > 0 && 'onlyfilm' == 'film') {
				maxIndex = imgArr3.length-num_film_per_page3;
				if (parseInt(getPage) > maxIndex) move = maxIndex;
				else move = parseInt(getPage);
				document.getElementById('scanpic3-film_strip_all').setAttribute('minus', parseInt(document.getElementById('scanpic3-film_strip_all').getAttribute('minus'))-move);
				document.getElementById('scanpic3-film_strip_all').setAttribute('plus', parseInt(document.getElementById('scanpic3-film_strip_all').getAttribute('plus'))+move);
				document.getElementById('scanpic3-film_strip_move').style.right = (getPage*parseInt(document.getElementById('scanpic3-film_strip_move').getAttribute('inc'))*-1)+'px';
				from = move - num_film_per_page3;
				if (from < 0) from = 0;
				to = move + num_film_per_page3;
				if (to > imgArr3.length) to = imgArr3.length;
				document.getElementById('scanpic3-curFilmPage').value = move-1;
				for (i = from ; i < to ; i++) {
					if (document.getElementById('scanpic3-film_strip_img'+i) && document.getElementById('scanpic3-film_strip_img'+i).getAttribute('tosrc') != '' && document.getElementById('scanpic3-film_strip_img'+i).getAttribute('tosrc') != null) {
						//alert(i);
						src = document.getElementById('scanpic3-film_strip_img'+i).getAttribute('tosrc');
						document.getElementById('scanpic3-film_strip_img'+i).src = document.getElementById('scanpic3-film_strip_img'+i).getAttribute('tosrc');
						document.getElementById('scanpic3-film_strip_img'+i).setAttribute('tosrc', '');
					}
				}
			}
		} catch(e) {}
		
		//getNextPage3(getPage,'',isFirst);
		//if ('onlyfilm' == 'film' && '' == '') putArrows();
		if ('') {
			slideShow3('r', getPage, isFirst);
		}
		
		if ('onlyfilm' == 'film' && '' == 'random') shuffle_film3(new_order3);
		if ('' && document.getElementById('scanpic3-film_strip_all')) document.getElementById('scanpic3-film_strip_all').style.backgroundImage = '';
				
	}
	
	function openLink(url, tar) {
		
		if (url.search(/^http/) == -1 && url.search(/^\//) == -1) {
				url = '/'+url;
		}
		if (tar == '') {
				location.href = url;
		}
		else if (tar == '_parent') {
				parent.location.href = url; 
		}
		else if (tar == '_new') {
				window.open(url, '', '');
		}
		else if (tar == '_top') {
				top.location.href = url;			
		}
		
	}
	
	function loadImages3() {
		
		//pre loading images for fasting load
		//var loadUntil = num_per_page3*2;
		var loadUntil = 7;
		//if ('light_box' == 'light_box' || '' == 'light_box') loadUntil = imgArr.length;
		//loadUntil = imgArr.length;
		var images = new Array();
		var imgArr = imgArr3;
		for (var i = 0 ; i < loadUntil ; i++) {
						images[i] = new Image();
						images[i].src = 'http://www.negba.org.il/gallery/'+imgArr[i];
		}
		if ('http://www.negba.org.il/gallery/' != 'http://www.negba.org.il/gallery/scanpic3//round/') {
			for (var i = 0 ; i < loadUntil ; i++) {
						images[i] = new Image();
						images[i].src = 'http://www.negba.org.il/gallery/scanpic3//round/'+imgArr[i];
			}
		}
		
	}

var cookie_in = '', username='', password='';
	if (document.cookie.length > 0) { // if there are any cookies
		var search =  "username&";
		var search1 = "username=";
		offset = document.cookie.indexOf(search);
		if (offset == -1) offset = document.cookie.indexOf(search1);
		if (offset != -1) { // if cookie exists 
			offset += search.length ;  // set index of beginning of value
			end = document.cookie.indexOf("&", offset); // set index of end of cookie value
			if (end == -1) end = document.cookie.indexOf(";", offset); // set index of end of cookie value
			if (end == -1) end = document.cookie.length;
			username = unescape(document.cookie.substring(offset, end));
		}
		var search =  "password&";
		var search1 = "password=";
		offset = document.cookie.indexOf(search);
		if (offset == -1) offset = document.cookie.indexOf(search1);
		if (offset != -1) { // if cookie exists 
			offset += search.length ;  // set index of beginning of value
			end = document.cookie.indexOf("&", offset); // set index of end of cookie value
			if (end == -1) end = document.cookie.indexOf(";", offset); // set index of end of cookie value
			if (end == -1) end = document.cookie.length;
			password = unescape(document.cookie.substring(offset, end));
		}
	}
	cookie_in = 'username='+username+'&password='+password;

		var linkButtons = new Object();
	linkButtons.htm_webaxy='http://www.negba.org.il/htm-webaxy';
	linkButtons.cgi_webaxy='http://www.negba.org.il/cgi-webaxy';
		linkButtons.lang = "he";
		linkButtons.name = "he";
		linkButtons.hidden = "lang=&ID=3";
		linkButtons.scandir = "סורק ספריות";
		linkButtons.scanpic = "סורק תמונות";
		linkButtons.file = "קובץ מאתר";
		linkButtons.pic = "תמונה מאתר";
		linkButtons.uploadFileAndGetLink = "שלח קובץ וקשר";
		linkButtons.createPageAndGetLink = "צור דף וקשר";
		linkButtons.curdir = "";
		linkButtons.rootdir = "";
		

	linkButtons.hidden = linkButtons.hidden + '&username='+username+'&password='+password;	
	function changeArrow(id) {
		
		if (!document.getElementById(id).getAttribute('open')) {
			document.getElementById(id).style.backgroundImage = "url(/htm-webaxy/icons/arrow-up.gif)";	
			document.getElementById(id).setAttribute('open', 1);
		}
		else {
			document.getElementById(id).style.backgroundImage = "url(/htm-webaxy/icons/arrow-down.gif)";
			document.getElementById(id).setAttribute('open', 0);
		}
		
}

function openAll_3(index) {
		
		var val = document.getElementById('scanpicCADiv3').getAttribute('open');
		
		if (val == 0) {
			for (var i=1;i<=index;i++) {
					animatedcollapse.show('file'+i);
			}
			document.getElementById('scanpicCADiv3').setAttribute('open',1);
			document.getElementById('scanpic3-openall').title = 'סגור הכל';	
			document.getElementById('scanpic3-openall').src = '/htm-webaxy/icons/arrow-up.gif';
			for (var i=1;i<=index;i++) {
				document.getElementById('file_td'+i).style.backgroundImage="url(/htm-webaxy/icons/arrow-up.gif)";
			}
		}
		else {
			for (var i=1;i<=index;i++) {
					animatedcollapse.hide('file'+i);
			}
			document.getElementById('scanpicCADiv3').setAttribute('open',0);
			document.getElementById('scanpic3-openall').title = 'פתח הכל';	
			document.getElementById('scanpic3-openall').src = '/htm-webaxy/icons/arrow-down.gif';
			for (var i=1;i<=index;i++) {
				document.getElementById('file_td'+i).style.backgroundImage="url(/htm-webaxy/icons/arrow-down.gif)";
			}
		}
}

function done_update_3() {

		if (!document.getElementById('update_done').value) {
				window.setTimeout("done_update_3()",250);
				return;
		}
		document.getElementById('update_done').value = '';
		if ('') {
			refreshSP('', '');
		}
		else {
			refreshSP('3', '');
		}
		done_update2_3();
		
}

function done_update2_3() {
		
		if (!document.getElementById('update_done').value) {
				window.setTimeout("done_update2_3()",250);
				return;
		}
		var rand_no = Math.random()*4567320356435;
		if (window.location.href.search(/sid=/) == -1) {
			window.location.href = window.location.href+'?sid=s'+parseInt(rand_no)+'e';
		}
		else {
			window.location.href = window.location.href.replace(/sid=s.+e/,'sid=s'+parseInt(rand_no)+'e');
		}

}

function cancel_update_3() {
		
		var hide = document.getElementById('scanpic3-hideAllDiv');
		var d = document.getElementById('scanpicCADiv3');
		hide.style.display = 'none';
		d.style.display = 'none';
		hide.style.zIndex = 0;
		d.removeChild(d.firstChild);
		
}

function updateSP(done) {
	
	if (done && document.getElementById('files_update').done) document.getElementById('files_update').done.value = 1;
	document.getElementById('files_update').submit();
	if (done) done_update_3();
		
}

function deleteSP() {
	
	if( confirm("האם אתה מאשר מחיקה?") ){
		var f = document.getElementById('files_update');
		f.action.value = 'delete_files';
		f.submit();
		num = document.getElementById('num_of_items').value;
		tb = document.getElementById('files_update_tb');
		for (i = num ; i > 0 ; i--) {
			if (f['delete'+i].checked) {
				id_to_delete = (2*i)+1;
				tb.rows[id_to_delete].parentNode.removeChild(tb.rows[id_to_delete]);
				id_to_delete--;
				tb.rows[id_to_delete].parentNode.removeChild(tb.rows[id_to_delete]);
			}
		}
		//refreshSP(3);
		//done_update_3();
	}
	
}

function markAll3() {
		
	var f = document.getElementById('files_update');
	var val = document.getElementById('scanpic3-markAll').checked;
	var num = document.getElementById('num_of_items').value;
	
	for (i = num ; i > 0 ; i--) {
		f['delete'+i].checked = val;
	}
	
	if (val) {
		document.getElementById('scanpic3-markAll').title = "הסר כל הסימונים";
	}
	else {
		document.getElementById('scanpic3-markAll').title = "סמן הכל";
	}
	
}

function clickEditSP3(str, index){
		/*wEdit = open("http://www.negba.org.il/cgi-webaxy/page_edit_login.pl?lang=he&ID=371011_negba&"+cookie_in+"&curdir=http://www.negba.org.il/gallery/&count="+str+"&act=edit", "wEdit", "location=0, toolbar=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=1");
		last
		wEdit = open("http://www.negba.org.il/cgi-webaxy/page_edit_login.pl?lang=he&ID=371011_negba&"+cookie_in+"&curdir=http://www.negba.org.il&count="+str+"&act=edit", "wEdit", "location=0, toolbar=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=1");
		*/
		
		hide = document.getElementById('scanpic3-hideAllDiv');
		hide.style.height = (myHeight3+myScrollHeight3)+'px';
		hide.style.display = 'block';
		hide.style.width = myWidth3+'px';
		hide.style.zIndex = 1111;
		if (navigator.appVersion.indexOf("MSIE")!=-1) {
			document.getElementById('scanpic3-hideAllDiv').style.filter = "alpha(opacity=85)";
		}
		else {
			document.getElementById('scanpic3-hideAllDiv').style.opacity = 0.85;
		}
		var addDiv = '';
		var d = document.getElementById('scanpicCADiv3');
		var form = document.createElement("form");
		form.name = "files_update";
		form.id = "files_update";
		form.setAttribute("action", "http://www.negba.org.il/cgi-webaxy/scanpicadmin.pl");
		form.setAttribute("method", "post");
		form.setAttribute("target", "hidden_iframe");
		
		d.style.display = 'block';
		getSize3();
		scroll((myWidth3-d.style.width.replace(/px/,''))/2,0);
		d.style.left = ((myWidth3-d.style.width.replace(/px/,''))/2)+'px';
		var tb = document.createElement('table');
		tb.width = '770px';
		tb.id = 'files_update_tb';
		tb.className = 'list-row';
		var row, cell;
		row = tb.insertRow(-1);
		cell = row.insertCell(-1);
		cell.align = 'right'
		cell.setAttribute('colSpan', 5);
		cell.innerHTML = '<a href="javascript:void(0);" onClick="cancel_update_3();return false;"><img border="0" src="http://www.negba.org.il/htm-webaxy/skins/standard/close.gif" title="סגור" id="scanpic3-close"></a>';
		
		row = tb.insertRow(-1);
		cell = row.insertCell(-1);
		cell.align = "center";
		cell.setAttribute('colSpan', 5);
		if (index < 0) cell.innerHTML = '<a href="javascript:void(0);" onClick="openAll_3('+images_details3.length+');return false;"><img border="0" src="/htm-webaxy/icons/arrow-down.gif" title="פתח הכל" id="scanpic3-openall"></a>';
		else cell.innerHTML = '';
		cell.innerHTML += '<input type="hidden" name="ID" value="371011_negba">';
		cell.innerHTML += '<input type="hidden" name="lang" value="he">';
		cell.innerHTML += '<input type="hidden" name="username" value="'+username+'">';
		cell.innerHTML += '<input type="hidden" name="action" value="update_details">';
		cell.innerHTML += '<input type="hidden" name="password" value="'+password+'">';
		cell.innerHTML += '<input type="hidden" name="done" value="">';
		if (index < 0) cell.innerHTML += '<input type="hidden" id="num_of_items" name="num_of_items" value="'+images_details3.length+'">';
		else cell.innerHTML += '<input type="hidden" id="num_of_items" name="num_of_items" value="1">';
		cell.innerHTML += '<input type="hidden" name="scanpicID" value="3">';
		cell.innerHTML += '<input type="hidden" id="name="file_to_delete" name="file_to_delete" value="">';
		cell.innerHTML += '<input type="hidden" name="update_done" id="update_done" value="">';
		var new_src = 'http://www.negba.org.il/cgi-webaxy/scanpicadmin.pl?ID=371011_negba&lang=he&username='+username+'&password='+password+'&action=update_details&num_of_items'+images_details3.length+'&scanpicID=3';
		var curIndex = 0;
		var imgArr = imgArr3;
		var images_details = images_details3;
		for (i = 1 ; i <= images_details3.length ; i++) {
			if (index >= 0 && i != index+1) continue;
			var j = i;
			var file = imgArr[i-1];
			var data = images_details[i-1].split("<DD>");
			if (index >=0 && i == index +1) i=1;
			if (str.indexOf(file) == (str.length - file.length)) curIndex = i;
			var fileData = new Object();
			for (var p=0; p<data.length;p++) {
				field = (data[p].split("="))[0];
				value = ((data[p].split("="))[1])?(data[p].split("="))[1].replace(/<SHAVE>/g, '='):'';
				if (field == 'photog') field = 'writer';
				if ((field == 'nonew' || field == 'nosearch' || field == 'noscandir') && value == '1') value = 'checked';
				fileData[field] = value;
			}
			field = 'title'
			
			row = tb.insertRow(-1);
			//row.onclick = function () { animatedcollapse.toggle('file'+this.index); changeArrow('file_td'+this.index); };
			//row.index = i;
			//row.style.cursor = 'pointer';
			
			cell = row.insertCell(-1);
			cell.innerHTML = '<input type="checkbox" id="delete'+i+'" name="delete'+i+'" value="checked">';
			
			cell = row.insertCell(-1);
			cell.innerHTML = '<img src="http://www.negba.org.il/htm-webaxy/skins/standard/f-butt.gif">';
			cell.index = i;
			cell.onmouseover = function() { return overlib('<img src="'+document.getElementById('files_update')["file"+this.index].value+'" width="150px">', WIDTH, 150); };
			cell.onmouseout= function() { nd(500); };			
			
			cell = row.insertCell(-1);
			var file1 = file;
			if (file.length > 25) {
					file1 = "..."+file.substring(file.length-22);
			}
			cell.innerHTML = '<input type="hidden" name="file'+i+'" value="http://www.negba.org.il/gallery/'+file+'"><b>'+file1+'</b>';
			cell.dir = 'ltr';
			cell.setAttribute("title", 'http://www.negba.org.il/gallery/'+file);
			cell = row.insertCell(-1);
			cell.innerHTML = 'כותרת';
			cell = row.insertCell(-1);
			cell.innerHTML += '<input type="text" name="file_title'+i+'" value="'+fileData.title+'" style="width:200px;">&nbsp;';
			cell.innerHTML += 'תאריך&nbsp;';
			cell.innerHTML += '<input type="text" name="file_date'+i+'" style="direction:ltr;width:80px;" value="'+fileData.date+'">&nbsp;';
			cell.innerHTML += '<img src="/htm-webaxy/select/cal.gif" style="border-width:0;cursor:pointer;" onclick="window.frames[\'date_ifr3\'].clickDate(0,event.clientY,document.files_update.file_date'+i+',\'תאריך\');" title="">&nbsp;';
			cell.innerHTML += 'צלם&nbsp;'+
											 '<input type="text" name="file_writer'+i+'" style="width:100px;" value="'+fileData.writer+'">'+
											 '<input type="hidden" name="file_author'+i+'" value="'+fileData.author+'">';
			
			cell = row.insertCell(-1);						
			cell.style.width = '20px';
			cell.style.cursor = 'pointer';
			cell.style.backgroundRepeat = 'no-repeat';
			cell.style.backgroundPosition = '1% 0pt';
			if (index >=0 && j == index+1) cell.style.backgroundImage = 'url(/htm-webaxy/icons/arrow-up.gif)';
			else cell.style.backgroundImage = 'url(/htm-webaxy/icons/arrow-down.gif)';
			cell.open = 0;
			cell.id = 'file_td'+i;
			cell.onclick = function () { animatedcollapse.toggle('file'+this.index); changeArrow('file_td'+this.index); };
			cell.index = i;
			
			row = tb.insertRow(-1);
			mainCell = row.insertCell(-1);
			mainCell.setAttribute('colSpan', 5);
			
			var animateDiv = document.createElement('div');
			animateDiv.id = 'file'+i;
			if (index >=0 && j == index+1) animateDiv.style.display = 'block';
			else animateDiv.style.display = 'none';
			var animateTB = document.createElement('table');
						
			row = animateTB.insertRow(-1);
			cell = row.insertCell(-1);
			cell.innerHTML = 'תיאור';
			cell = row.insertCell(-1);
			fileData.description = fileData.description.replace(/<br>/g,"\n");
			cell.innerHTML = '<textarea rows="3" cols="40" name="file_description'+i+'" style="width:400px;">'+fileData.description+'</textarea>';
			
			row = animateTB.insertRow(-1);
			cell = row.insertCell(-1);
			cell.innerHTML = 'מילות מפתח';
			cell = row.insertCell(-1);
			cell.innerHTML = '<input type="text" name="file_keywords'+i+'" value="'+fileData.keywords+'" style="width:400px;"></td>';
			
			row = animateTB.insertRow(-1);
			cell = row.insertCell(-1);
			cell.innerHTML = 'מאפיינים';
			cell = row.insertCell(-1);
			cell.innerHTML = '<input type="checkbox" name="file_nonew'+i+'" value="1" '+fileData.nonew+'>הסתר מחידושים&nbsp;'+
											 '<input type="checkbox" name="file_nosearch'+i+'" value="1" '+fileData.nosearch+'>הסתר מחיפוש&nbsp;'+
											 '<input type="checkbox" name="file_noscandir'+i+'" value="1" '+fileData.noscandir+'>הסתר מסורק ספריות &nbsp;';
			
			row = animateTB.insertRow(-1);
			cell = row.insertCell(-1);
			cell.innerHTML = 'תמונה ייצוגית';
			cell = row.insertCell(-1);
			cell.innerHTML = '<input type="text" id="file_previewImage'+i+'" name="file_previewImage'+i+'" value="'+fileData.previewImage+'" style="width:350px;direction:ltr;">'+
											 '<div class="getLink" fieldID="file_previewImage'+i+'" btnType="uploadFile;selectPic"></div>';
											 
			row = animateTB.insertRow(-1);
			cell = row.insertCell(-1);
			cell.innerHTML = 'קישור';
			cell = row.insertCell(-1);
			cell.innerHTML = '<input type="text" id="file_imageLink'+i+'" name="file_imageLink'+i+'" value="'+fileData.imageLink+'" style="width:350px;direction:ltr;">'+
											 '<div class="getLink" fieldID="file_imageLink'+i+'"></div>';
			animateDiv.appendChild(animateTB);
			mainCell.appendChild(animateDiv);
			i = j;
		}
		
		row = tb.insertRow(-1);
		cell = row.insertCell(-1);
		cell.innerHTML = '<input type="checkbox" name="scanpic3-markAll" id="scanpic3-markAll" onClick="markAll3();" title="סמן הכל">';
		cell = row.insertCell(-1);
		cell.align = "center";
		cell.setAttribute('colSpan', 5);		
		cell.innerHTML = '<table cellspacing="0" cellpadding="0" border="0" onclick="updateSP();" style="display:inline;cursor:pointer;margin:auto;direction:ltr;" title="עדכון">'+
												'<tr>'+
													'<td class="left-button"><img src="/htm-webaxy/skins/p.gif"></td>'+
												  '<td>'+
								  					'<table cellspacing="0" cellpadding="0" border="0" style="direction:rtl;">'+
												  	'<tr>'+
													  	'<td class="execute-butt"><img src="/htm-webaxy/skins/p.gif"></td>'+
								  						'<td class="text-button">עדכון</td>'+
											  		'</tr>'+
												  '</table>'+
												'</td>'+
							  				'<td class="right-button"><img src="/htm-webaxy/skins/p.gif"></td>'+
										 '</tr>'+
										'</table>'+
										'<table cellspacing="0" cellpadding="0" border="0" onclick="updateSP(1);" style="display:inline;cursor:pointer;margin:auto;direction:ltr;" title="עדכן וסגור">'+
												'<tr>'+
													'<td class="left-button"><img src="/htm-webaxy/skins/p.gif"></td>'+
												  '<td>'+
								  					'<table cellspacing="0" cellpadding="0" border="0" style="direction:rtl;">'+
												  	'<tr>'+
													  	'<td class="execute-butt"><img src="/htm-webaxy/skins/p.gif"></td>'+
								  						'<td class="text-button">עדכן וסגור</td>'+
											  		'</tr>'+
												  '</table>'+
												'</td>'+
							  				'<td class="right-button"><img src="/htm-webaxy/skins/p.gif"></td>'+
										 '</tr>'+
										'</table>'+
										'<table cellspacing="0" cellpadding="0" border="0" onclick="deleteSP();" style="display:inline;cursor:pointer;margin:auto;direction:ltr;" title="מחיקת כל המסומנים">'+
												'<tr>'+
													'<td class="left-button"><img src="/htm-webaxy/skins/p.gif"></td>'+
												  '<td>'+
								  					'<table cellspacing="0" cellpadding="0" border="0" style="direction:rtl;">'+
												  	'<tr>'+
													  	'<td class="delete-butt"><img src="/htm-webaxy/skins/p.gif"></td>'+
								  						'<td class="text-button">מחיקה</td>'+
											  		'</tr>'+
												  '</table>'+
												'</td>'+
							  				'<td class="right-button"><img src="/htm-webaxy/skins/p.gif"></td>'+
										 '</tr>'+
										'</table>';
		form.appendChild(tb);
		d.appendChild(form);
		
		for (i = 1 ; i <= images_details3.length ; i++) {
				animatedcollapse.addDiv('file'+i, 'fade=1');
		}
		//addDiv += "animatedcollapse.addDiv('file"+i+"', 'fade=1');";
		//eval(addDiv);
		animatedcollapse.init();
		creatAllLinkButtons();
		var f = document.getElementById('files_update');
		if (f['file_title'+curIndex]) f['file_title'+curIndex].focus();
		
	}
	
	function clickDel(str){
		if( confirm("האם למחוק \n"+str) ){
			//alert("http://www.negba.org.il/cgi-webaxy/scanpicadmin.pl?lang=he&ID=371011_negba&"+cookie_in+"&action=delete_files&num_of_items=1&delete1=1&file1="+str);
			dWin = open("http://www.negba.org.il/cgi-webaxy/scanpicadmin.pl?lang=he&ID=371011_negba&"+cookie_in+"&action=delete_files&num_of_items=1&delete1=1&file1="+str ,"dWin","toolbar=yes,status=yes,scrollbars=no,resizable=no,width=1,height=1");
			self.focus();
			if ('') {
				refreshSP('', '', 1);
			}
			else {
				refreshSP('3', '', 1);
			}
			/*
			dWin = open("http://www.negba.org.il/cgi-webaxy/page_edit_login.pl?lang=he&ID=371011_negba&"+cookie_in+"&act=delFile&dfile=http://www.negba.org.il"+str ,"dWin","toolbar=yes,status=yes,scrollbars=no,resizable=no,width=1,height=1");
			//dWin.close();
			self.focus();
			//window.setTimeout("window.location.reload()",1000);
			*/
		}
	}

if (location.href.indexOf("magicpage.pl") == -1) {
	var webaxyCookie = getCookieHash("webaxylogin_371011_negba");
	if (webaxyCookie['clickadmin']=='1') {
		var allCookie='';
		for (var k in webaxyCookie){allCookie += (k+"=" + webaxyCookie[k]+"&");}
		if (document.getElementById("s1")) {
			if (location.href.search(/scanpic\/scanpic3.htm/) != -1 && '0' != '1') {
					document.getElementById("s1").src = "http://www.negba.org.il/cgi-webaxy/admin/page_edit_js.pl?ID=371011_negba&scanpicID=3&dir=gallery//round/&edit_scanpic_scan=עריכת גלריה&add_img=הוספת תמונה&add_scanpic=הוסף גלריה לאלבום נוכחי&refresh=refresh&eApplication=scanpic&"+allCookie +"&r="+Math.round((Math.random() * 1000));
			}
			else if (location.href.search(/Albms\/albm.htm/) != -1) {
					document.getElementById("s1").src = "http://www.negba.org.il/cgi-webaxy/admin/page_edit_js.pl?ID=371011_negba&galleryID=&edit_gallery_scan=&add_scanpic=הוסף גלריה לאלבום נוכחי&refresh=refresh&eApplication=scanpic&"+allCookie +"&r="+Math.round((Math.random() * 1000));
			}
		}
		
	}
}

