			
	var alowToEdit1  = 0;
	var new_order1;
	var imgArr1 = new Array( 'eld-006.jpg','eld-011.jpg','eld-045.jpg','eld-043.jpg' );
	var scans_url1 = new Array ( '','','','' );
	var imgArrW1;
	if ('600,600,600,600'.search(/,/) != -1) { imgArrW1 = new Array( 600,600,600,600);}
	else {imgArrW1 = new Array();(imgArrW1)[0] = 600,600,600,600;}
	var imgArrH1;
	if ('402,402,402,402'.search(/,/) != -1) { imgArrH1 = new Array( 402,402,402,402);}
	else {imgArrH1 = new Array();(imgArrH1)[0] = 402,402,402,402;}
	var curImgArrW1;
	if ('90,90,90,90'.search(/,/) != -1) { curImgArrW1 = new Array( 90,90,90,90);}
	else {curImgArrW1 = new Array();(curImgArrW1)[0] = 90,90,90,90;}
	var curImgArrH1;
	if ('60,60,60,60'.search(/,/) != -1) { curImgArrH1 = new Array( 60,60,60,60);}
	else {curImgArrH1 = new Array();(curImgArrH1)[0] = 60,60,60,60;}
	var maxFullScreenImgHeight1;
	var opacitySpeed = 8;
	var lbSpeed = 15;
	var lbsizeSpeed = 8;
	
	var images_details1 = new Array ( 'title=<DD>description=<DD>photog=<DD>author=טלי סופר- itali<DD>date=<DD>link=<DD>keywords=<DD>previewImage=<DD>nonew=<DD>nosearch=0<DD>noscandir=<DD>imageLink=','title=<DD>description=<DD>photog=<DD>author=טלי סופר- itali<DD>date=<DD>link=<DD>keywords=<DD>previewImage=<DD>nonew=<DD>nosearch=0<DD>noscandir=<DD>imageLink=','title=<DD>description=<DD>photog=<DD>author=טלי סופר- itali<DD>date=<DD>link=<DD>keywords=<DD>previewImage=<DD>nonew=<DD>nosearch=0<DD>noscandir=<DD>imageLink=','title=<DD>description=<DD>photog=<DD>author=טלי סופר- itali<DD>date=<DD>link=<DD>keywords=<DD>previewImage=<DD>nonew=<DD>nosearch=0<DD>noscandir=<DD>imageLink=' );
	if ('' == 'random') new_order1 = shuffle1();
	
	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_page1 = 3;
	var num_film_per_page = 3;
	var scaling_by = '';
	var scaling_value = '';
	var imgClass = '';
	
	// popup variables
	var myWidth1, myHeight1, myScroll1;
	var myScrollWidth1, myScrollHeight1;
	var incX1, incY1, incW1, incH1, incOpacity1;
	var incW_Resize1 = new Array();
	var incH_Resize1 = new Array();
	var incX_PU1 = new Array();
	var incY_PU1 = new Array();
	var incW_PU1 = new Array();
	var incH_PU1 = new Array();
	var popupSpeed = 5;
	
	var ifseArray = 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_spacing1 = parseInt('1px'.replace(/px/,''));
	var image_padding1 = 5;
	
	// settimeour pointer
	//var curretTimeout = new Array();
	
	//
	var maxImageWidth1 = 600;
	var maxImageHeight1 = 402;
	var curMaxImageWidth1 = 90;
	var curMaxImageHeight1 = 60;
	var curMaxFilmWidth1 = ('onlyfilm' != 'film')?90:0;
	var curMaxFilmHeight1 = ('onlyfilm' != 'film')?60:0;
	var currDivIndex1;
	var runInTheEnd1;
	var target;
	var blindSpeed = 12;
	function pictureDataEstimateHeight1(index) {
	
			var images_details = images_details1;
			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];
				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 pictureData1(index) {
				
			var images_details = images_details1;
			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];
						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 pictureBulletData1(index) {
	
		if ('' == '') return '';
		var images_details = images_details1;
		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];
						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_box1(imgIndex, isNext) {
		
		getSize1();
		document.getElementById('scanpic1-curLBIndex').value = imgIndex;
		lb = document.getElementById('lightbox');
		if (navigator.appVersion.indexOf("MSIE")!=-1) {
			lb.style.filter = "alpha(opacity=100)";
		}
		else {
			lb.style.opacity = 1;
		}
		if (!isNext) {
			hide = document.getElementById('scanpic1-hideAllDiv');
			//document.getElementById('imageDataContainer').style.display = 'none';
			hide.style.height = '0px';
			hide.style.display = 'block';
			hide.style.width = myWidth1+'px';
			hide.style.zIndex = 1111;
			var fullScreenHideSpeed = 10;
			//inc = (myHeight1+myScroll1)/fullScreenHideSpeed;
			//inc = myScrollHeight/fullScreenHideSpeed;			
			inc = (myHeight1+myScrollHeight1)/fullScreenHideSpeed;			
			light_box2_1(inc, fullScreenHideSpeed, imgIndex, isNext);
		}
		else {
			window.setTimeout("light_box3_1("+imgIndex+", "+isNext+")",150);
		}
		
	}
	
	function light_box2_1(inc, index, imgIndex, isNext) {
	
		document.getElementById('loading').style.display = 'block';
		hide = document.getElementById('scanpic1-hideAllDiv');
		index--;
		if (index >= 0) {
				hide.style.height = (parseFloat(hide.style.height.replace(/px/,'')) + inc)+'px';
				window.setTimeout("light_box2_1("+inc+", "+index+","+imgIndex+","+isNext+")",50);
		}
		else {
				light_box3_1(imgIndex, isNext);
		}	
			
	}
	
	function light_box3_1(index, isNext) {
		
		lb = document.getElementById('lightbox');
		var lbPadding = 10;
		var pageIndex = index % num_per_page1;
		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 = pictureData1(index);
		var data = pictureBulletData1(index);
		if (data) document.getElementById('caption').innerHTML += data;
		document.getElementById('numberDisplay').innerHTML = 'תמונה '+(1+index)+' מתוך '+imgArr1.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;
		maxLBImgHeight = myHeight1 - 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 = imgArrW1;
		var imgArrH = imgArrH1;
		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 = (myHeight1-(2*lbPadding)-imgArrH[index])/2;
			contHeight = imgArrH[index] + 2*lbPadding;
			contWidth = imgArrW[index] + 2*lbPadding;		
		}
		height += myScroll1;
		//my width = (myWidth1-(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_height1(lbsizeSpeed, incW, incH, index, isNext);
		}
		else {
				light_box4_1(index, isNext);
		}
		
	}
	
	function update_lb_height1(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_height1("+index+", "+incW+","+incH+","+imgIndex+","+isNext+")",50);
		}
		else {
				//document.getElementById('imageDataContainer').style.width = oic.style.width;
				update_lb_width1(lbsizeSpeed, incW, incH, imgIndex, isNext);
		}	
						
	}
	
	function update_lb_width1(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_width1("+index+", "+incW+","+incH+","+imgIndex+","+isNext+")",50);
		}
		else {
				document.getElementById('imageDataContainer').style.width = oic.style.width;
				light_box4_1(imgIndex, isNext);
		}	
						
	}
	
	function light_box4_1(index, isNext) {
		
		document.onkeypress = getKey2_1;
		document.getElementById('loading').style.display = 'none';
		var imgArr = imgArr1;
		tmp_img = new Image();
		//wait for load
		tmp_img.onload=function() {
				document.getElementById('lightboxImage').src = '/gallery/gallery1/'+imgArr[index];
				if (navigator.appVersion.indexOf("MSIE")!=-1) {
					document.getElementById('imageDataContainer').style.filter = "alpha(opacity=0)";
				}
				else {
					document.getElementById('imageDataContainer').style.opacity = 0;
				}
				putLBOpacity1(1/lbSpeed, lbSpeed, index, "putLBCOpacity1("+1/lbSpeed+","+lbSpeed+")" );
		}
		tmp_img.src = '/gallery/gallery1/'+imgArr[index];
				
	}
	
	function getNextLBPage1(inc) {
		
		var curIndex = document.getElementById('scanpic1-curLBIndex').value;
		if (inc == '+1') curIndex++;
		else if (inc == '-1') curIndex--;
		if(curIndex==-1) {
			document.getElementById('scanpic1-curLBIndex').value = imgArr1.length-1;
			curIndex = imgArr1.length-1;
		}
		if(curIndex >= imgArr1.length) {
			document.getElementById('scanpic1-curLBIndex').value = 0;
			curIndex = 0;
		}
		var runMe = "light_box1("+curIndex+","+true+")";
		
		putLBCOpacity1(-1/lbSpeed, lbSpeed, curIndex);
		putLBOpacity1(-1/lbSpeed, lbSpeed, curIndex, "light_box1("+curIndex+","+true+")" );
			
	}
	
	function putLBOpacity1(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("putLBOpacity1("+inc+", "+index+", "+curFullIndex1+", '"+evalMe+"')",30);
		}
		else {
			if (evalMe != "undefined") {
				eval(evalMe);				
			}			
		}
	}
	
	function putLBCOpacity1(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("putLBCOpacity1("+inc+", "+index+", "+curFullIndex1+", '"+evalMe+"')",30);
		}
		else {
			if (evalMe != "undefined") {
				eval(evalMe);				
			}
			else if (inc < 0) {
				//getNextPageFull2_1(curFullIndex1,opacitySpeed);				
			}
		}
		
	}
	
	function regularScreenLBOpacity1(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("regularScreenLBOpacity1("+inc+", "+index+")",30);
		}
		else {
			putFSOpacity1(-1/opacitySpeed, opacitySpeed, document.getElementById('scanpic1-curFullIndex').value, 'regularScreen1_1()');
		}
	}
	
	function regularScreen1() {
		
		lb = document.getElementById('lightbox');
		if (lb && lb.style.display != 'none') regularScreenLBOpacity1(-1/opacitySpeed, opacitySpeed);
		else putFSOpacity1(-1/opacitySpeed, opacitySpeed, document.getElementById('scanpic1-curFullIndex').value, 'regularScreen1_1()');
				
	}
	
	function putFSOpacity1(inc, index, curFullIndex1, evalMe) {
		
		var curOpacity;
		if (navigator.appVersion.indexOf("MSIE")!=-1) {
			 curOpacity = document.getElementById('scanpic1-fullScreenImg').style.filter;
			 var opacityPattern=new RegExp("[0-9]+");
			 curOpacity = parseFloat(opacityPattern.exec(curOpacity));
		}
		else {
			curOpacity = parseFloat(document.getElementById('scanpic1-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('scanpic1-fullScreenImg').style.filter = "alpha(opacity=" + curOpacity + ")";
				}
				else {
					curOpacity = curOpacity + inc;
					if (curOpacity < 0.001) curOpacity = 0;
					document.getElementById('scanpic1-fullScreenImg').style.opacity = curOpacity;
				}
				window.setTimeout("putFSOpacity1("+inc+", "+index+", "+curFullIndex1+", '"+evalMe+"')",30);
		}
		else {
			if (evalMe != "undefined") {
				eval(evalMe);				
			}
			else if (inc < 0) {
				getNextPageFull2_1(curFullIndex1,opacitySpeed);
				if ('' || '') {
						updatePageCounterFS1();
				}
			}
		}
	}
		
	function regularScreen1_1() {
		
		hide = document.getElementById('scanpic1-hideAllDiv');
		var fullScreenHideSpeed = 10;
		//inc = myScrollHeight/fullScreenHideSpeed;
		hide.style.height = myHeight1+'px';
		inc = myHeight1/fullScreenHideSpeed;
		regularScreen2_1(inc, fullScreenHideSpeed);
		
	}
	
	function regularScreen2_1(inc, index) {
	
		hide = document.getElementById('scanpic1-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_1("+inc+", "+index+")",50);
		}
		else {
				regularScreen3_1();
		}	
		
	}
	
	function regularScreen3_1() {
	
		fullSD = document.getElementById('scanpic1-fullScreenDiv');
		lb = document.getElementById('lightbox');
		hide = document.getElementById('scanpic1-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('scanpic1-slide_show_full').value='s';
		
	}
	
	function slideShowFull1(val){
					
					ss = document.getElementById('scanpic1-slide_show_full');
					if (val) {
							ss.value = val;
					}
					
					if (ss.value == 'r') {
						if (document.getElementById('scanpic1-pageDone').value == '') {
							window.setTimeout("getNextPageFull1('+');",1000);
							window.setTimeout("slideShowFull1();",1000);
						}
						else {
								window.setTimeout("slideShowFull1();",100);
								return;
						}
					}									
					
	}
	
	
	function getKey2_1(evt) {
		if (! evt) {
			theKey = event.keyCode;
		} else {
			theKey = evt.keyCode;
		}
		
		if (theKey == 27 || theKey == 11) { // ESC OR Enter
				regularScreen1();
		}
	}
		
	function slideShow1(val){
					
					ss = document.getElementById('scanpic1-slide_show');
					if (val) {
							ss.value = val;
					}
					
					if (ss.value == 'r') {
						if (document.getElementById('scanpic1-pageDone').value == '' && 'onlyfilm' != 'onlyfilm') {
								window.setTimeout("getNextPage1('+');",1000);
								window.setTimeout("slideShow1();",1000);
						}
						else if (document.getElementById('scanpic1-onGoing').value == '' && 'onlyfilm' == 'onlyfilm') {
								window.setTimeout("nextFilmPage1('-');",1000);
								window.setTimeout("slideShow1();",1000);
						}
						else {
								window.setTimeout("slideShow1();",100);
								return;
						}
					}
					
	}
	function nextFilmPage1(str) {
		
		if (document.getElementById('scanpic1-onGoing').value) {
				window.setTimeout("nextFilmPage1('"+str+"');",100);
				return;
		}
		var inc = document.getElementById('scanpic1-film_strip_move').getAttribute('inc');
		
		if (str) {
			( str.charAt(0)  == '+' ? inc = inc * 1 : inc = inc * -1);
		}
		if (inc > 0) document.getElementById('scanpic1-curFilmPage').value--;
		else document.getElementById('scanpic1-curFilmPage').value++;
		var curFilmIndex = (parseInt(document.getElementById('scanpic1-curFilmPage').value)>= 0)?(parseInt(document.getElementById('scanpic1-curFilmPage').value) + parseInt('3')) % imgArr1.length:parseInt(document.getElementById('scanpic1-curFilmPage').value)+imgArr1.length;
		if (document.getElementById('scanpic1-film_strip_img'+curFilmIndex) && document.getElementById('scanpic1-film_strip_img'+curFilmIndex).getAttribute('tosrc') != '' && document.getElementById('scanpic1-film_strip_img'+curFilmIndex).getAttribute('tosrc') != null) {
			var src;
			src = document.getElementById('scanpic1-film_strip_img'+curFilmIndex).getAttribute('tosrc');
			tmp_img = new Image();
			tmp_img.onload=function() {
						document.getElementById('scanpic1-film_strip_img'+curFilmIndex).src = document.getElementById('scanpic1-film_strip_img'+curFilmIndex).getAttribute('tosrc');
						document.getElementById('scanpic1-film_strip_img'+curFilmIndex).setAttribute('tosrc', '');
						nextFilmPage11(inc, str);
			}
			tmp_img.src = src;	
		}
		else {
			nextFilmPage11(inc, str);
		}
		
	}
	
	function nextFilmPage11(inc, str) {
	
		var dir = '';
		var divs = document.getElementById('scanpic1-film_strip_move').style;
		var divW;
		if ('horizon' == 'up' || 'horizon' == 'down' || 'horizon' == 'horizon') {
			divW = parseFloat(divs.width.replace(/px/,''));
			divall = parseFloat(document.getElementById('scanpic1-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('scanpic1-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('scanpic1-film_strip_all').getAttribute('plus'));
		var minus = parseInt(document.getElementById('scanpic1-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('scanpic1-curFilmPage').value);
		if (str.charAt(0) == '-') {
				if (minus == 0) {
					var toMove = (cur + parseInt('3') - 1) % imgArr1.length;
					var last = (toMove + imgArr1.length - 1) % imgArr1.length;
					if ('horizon' == 'up' || 'horizon' == 'down' || 'horizon' == 'horizon') {
						document.getElementById('scanpic1-film_strip_item'+toMove).style.right = (document.getElementById('scanpic1-film_strip_item'+last).style.right.replace(/px/,'')-inc)+'px';
					}
					else {
						document.getElementById('scanpic1-film_strip_item'+toMove).style.top = (document.getElementById('scanpic1-film_strip_item'+last).style.top.replace(/px/,'')-inc)+'px';
					}
				}
				else {
					document.getElementById('scanpic1-film_strip_all').setAttribute('minus', minus-1);
					document.getElementById('scanpic1-film_strip_all').setAttribute('plus', plus+1);
				}
		}
		else if (str.charAt(0) == '+') {
				if (plus == 0) {
					var toMove = cur % imgArr1.length;
					if (toMove < 0) toMove += imgArr1.length;
					var last = (toMove + 1) % imgArr1.length;
					if ('horizon' == 'up' || 'horizon' == 'down' || 'horizon' == 'horizon') {
							document.getElementById('scanpic1-film_strip_item'+toMove).style.right = (document.getElementById('scanpic1-film_strip_item'+last).style.right.replace(/px/,'')-inc)+'px';
					}
					else {
							document.getElementById('scanpic1-film_strip_item'+toMove).style.top = (document.getElementById('scanpic1-film_strip_item'+last).style.top.replace(/px/,'')-inc)+'px';
					}
				}
				else {
					document.getElementById('scanpic1-film_strip_all').setAttribute('minus', minus+1);
					document.getElementById('scanpic1-film_strip_all').setAttribute('plus', plus-1);
				}
		}
		
		var speed;
		if ('horizon' == 'up' || 'horizon' == 'down' || 'horizon' == 'horizon') speed = curMaxFilmWidth1/10;
		else speed = curMaxFilmHeight1/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;		
		pxInc = (size - curSize) / speed;
		document.getElementById('scanpic1-onGoing').value = 'going';
		//setDivOffset1('scanpic1-film_strip_move', dir, speed, pxInc, hSpeed, to, toInc);
		window.setTimeout("setDivOffset1('scanpic1-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('scanpic1-film_strip_all').getAttribute('PUplusPos'));
						var PUminusPos = parseInt(document.getElementById('scanpic1-film_strip_all').getAttribute('PUminusPos'));
						var PUplusIndex = parseInt(document.getElementById('scanpic1-film_strip_all').getAttribute('PUplusIndex'));
						var PUminusIndex = parseInt(document.getElementById('scanpic1-film_strip_all').getAttribute('PUminusIndex'));
						if (str.charAt(0) == '-') {
									PUminusPos++;
									PUminusPos = PUminusPos % parseInt('3');
									PUplusPos++;
									PUplusPos = PUplusPos % parseInt('3');
									position = PUminusPos;
									PUminusIndex++;
									PUminusIndex = PUminusIndex % imgArr1.length;
									current = PUminusIndex;
									PUplusIndex++;
									PUplusIndex = PUplusIndex % imgArr1.length;
									document.getElementById('scanpic1-film_strip_all').setAttribute('PUminusPos',PUminusPos);
									document.getElementById('scanpic1-film_strip_all').setAttribute('PUplusPos', PUplusPos);
									document.getElementById('scanpic1-film_strip_all').setAttribute('PUminusIndex', PUminusIndex);
									document.getElementById('scanpic1-film_strip_all').setAttribute('PUplusIndex', PUplusIndex);
						}
						else {
									PUminusPos--;
									if (PUminusPos < 0) PUminusPos += parseInt('3');
									PUplusPos--;
									if (PUplusPos < 0) PUplusPos += parseInt('3');
									position = PUplusPos;
									PUminusIndex--;
									if (PUminusIndex < 0) PUminusIndex += imgArr1.length;
									PUplusIndex--;
									if (PUplusIndex < 0) PUplusIndex += imgArr1.length;
									current = PUplusIndex;
									document.getElementById('scanpic1-film_strip_all').setAttribute('PUminusPos',PUminusPos);
									document.getElementById('scanpic1-film_strip_all').setAttribute('PUplusPos', PUplusPos);
									document.getElementById('scanpic1-film_strip_all').setAttribute('PUminusIndex', PUminusIndex);
									document.getElementById('scanpic1-film_strip_all').setAttribute('PUplusIndex', PUplusIndex);						
						}
						var img = document.getElementById('scanpic1-film_strip_img'+current);
						var src = img.src;
						img.setAttribute('popup_position', position);
						var popup_img = document.getElementById('scanpic1-popup_img'+position);
						popup_img.src = src.replace(/\/gallery\/gallery1\/scanpic1\//,"");
				}
				else if ('light_box' == 'resizing' || '' == 'resizing') {
						var current,position;
						var RplusPos = parseInt(document.getElementById('scanpic1-film_strip_all').getAttribute('RplusPos'));
						var RminusPos = parseInt(document.getElementById('scanpic1-film_strip_all').getAttribute('RminusPos'));
						var RplusIndex = parseInt(document.getElementById('scanpic1-film_strip_all').getAttribute('RplusIndex'));
						var RminusIndex = parseInt(document.getElementById('scanpic1-film_strip_all').getAttribute('RminusIndex'));
						if (str.charAt(0) == '-') {
									RminusPos++;
									RminusPos = RminusPos % parseInt('3');
									RplusPos++;
									RplusPos = RplusPos % parseInt('3');
									position = RminusPos;
									RminusIndex++;
									RminusIndex = RminusIndex % imgArr1.length;
									current = RminusIndex;
									RplusIndex++;
									RplusIndex = RplusIndex % imgArr1.length;
									document.getElementById('scanpic1-film_strip_all').setAttribute('RminusPos',RminusPos);
									document.getElementById('scanpic1-film_strip_all').setAttribute('RplusPos', RplusPos);
									document.getElementById('scanpic1-film_strip_all').setAttribute('RminusIndex', RminusIndex);
									document.getElementById('scanpic1-film_strip_all').setAttribute('RplusIndex', RplusIndex);
						}
						else {
									RminusPos--;
									if (RminusPos < 0) RminusPos += parseInt('3');
									RplusPos--;
									if (RplusPos < 0) RplusPos += parseInt('3');
									position = RplusPos;
									RminusIndex--;
									if (RminusIndex < 0) RminusIndex += imgArr1.length;
									RplusIndex--;
									if (RplusIndex < 0) RplusIndex += imgArr1.length;
									current = RplusIndex;
									document.getElementById('scanpic1-film_strip_all').setAttribute('RminusPos',RminusPos);
									document.getElementById('scanpic1-film_strip_all').setAttribute('RplusPos', RplusPos);
									document.getElementById('scanpic1-film_strip_all').setAttribute('RminusIndex', RminusIndex);
									document.getElementById('scanpic1-film_strip_all').setAttribute('RplusIndex', RplusIndex);						
						}
						var img = document.getElementById('scanpic1-film_strip_img'+current);
						var src = img.src;
						img.setAttribute('resize_position', position);
						var resize_img = document.getElementById('scanpic1-resizing_img'+position);
						resize_img.src = src.replace(/\/gallery\/gallery1\/scanpic1\//,"");
				}
		}
		var moveStatus = document.getElementById('scanpic1-film_strip_move').getAttribute('run');
		if (moveStatus && moveStatus == 'r') {
				runFilm1(str);				
		}
		
	}
	
	function runFilm1(str) {
			
			//var moveStatus = document.getElementById('scanpic1-film_strip_move').getAttribute('run');
			//if (moveStatus && moveStatus == 'r') {
			if (document.getElementById('scanpic1-onGoing').value) {
						window.setTimeout("runFilm1('"+str+"');",200);
						return;
			}
			window.setTimeout("nextFilmPage1('"+str+"');",200);
			//}
			
					
	}
	
	function stopFilm1() {
				
				document.getElementById('scanpic1-film_strip_move').setAttribute('run','');
				
	}
	
	function setDivOffset1(id, dir, speed, inc, middle, to ,toInc, finalPx) {
		
		var elem = document.getElementById(id).style;
		var curOffset = elem[dir];
		if (speed > 0) {
			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("setDivOffsetFinish1('"+id+"','"+dir+"', "+speed+", "+inc+", "+middle+", "+to+", "+toInc+", "+finalPx+")",to);
			}
			else {
				if (speed == middle) ;
				else if (speed > middle) to -= toInc;
				else to += toInc;
				window.setTimeout("setDivOffset1('"+id+"','"+dir+"', "+speed+", "+inc+", "+middle+", "+to+", "+toInc+", "+finalPx+")",to);
			}
			return;			
		}
		else {
			document.getElementById('scanpic1-onGoing').value = '';
		}
	}
	function setDivOffsetFinish1(id, dir, speed, inc, middle, to ,toInc, finalPx) {
		
		var elem = document.getElementById(id).style;
		var curOffset = elem[dir];
		if (speed > 0) {
			val = parseFloat(elem[dir].replace(/px/,'')) + inc;
			//alert(speed+':'+inc+':'+middle+':'+to+':'+toInc+':'+val);
			elem[dir] = val+'px';
			speed--;
			to += toInc;
			window.setTimeout("setDivOffsetFinish1('"+id+"','"+dir+"', "+speed+", "+inc+", "+middle+", "+to+", "+toInc+", "+finalPx+")",to);
			return;
		}
		else {
			if (finalPx != parseFloat(elem[dir])) elem[dir] = finalPx+'px';
			document.getElementById('scanpic1-onGoing').value = '';
		}
	}
	// ************** getNextPage ******************* //	
	
	function getNextPage1(str, putPageNum, firstTime) {
		
		document.getElementById('scanpic1-pageDone').value = 'work';
		if (str == 'last' && document.getElementById('scanpic1-curPage').value == (Math.ceil(imgArr1.length/num_per_page1)-1)) {
				return;
		}
		else if (str == 'first' && document.getElementById('scanpic1-curPage').value == 0) {
				return;
		}
		
		/*if (document.getElementById('scanpic1-onGoingNexPage').value) {
					if (!str) str = '';
					if (!putPageNum && putPageNum != 0) putPageNum = '';
					setTimeout("getNextPage1('"+str+"', '"+putPageNum+"',"+firstTime+")",500);
					return;
		}*/
		if ('' == 'popup' || 'light_box' == 'popup') {
				for (i = 0 ; i < num_per_page1 ; i++) {
					document.getElementById('scanpic1-popup'+i).style.display = 'none';
				}
		}
		if ('light_box' == 'resizing' || '' == 'resizing') {
				for (i = 0 ; i < num_per_page1 ; i++) {
					document.getElementById('scanpic1-resizing'+i).style.display = 'none';
				}
		}
	
		for (i = 0 ; i < num_per_page1 && i < imgArr1.length ; i++) {
			document.getElementById('scanpic1-td_pics'+i).style.visibility = 'visible';
		}
		var origCurPage = document.getElementById('scanpic1-curPage').value;
		if (putPageNum) document.getElementById('scanpic1-curPage').value = parseInt(putPageNum);
		
		var curPage = document.getElementById('scanpic1-curPage').value;
		var curIndex = curPage * num_per_page1;
		
		if (str == 'last') {
				document.getElementById('scanpic1-curPage').value = Math.ceil(imgArr1.length/num_per_page1)-1;
				curPage = document.getElementById('scanpic1-curPage').value;
		}
		else if (str == 'first') {
				document.getElementById('scanpic1-curPage').value = 0;
				curPage = document.getElementById('scanpic1-curPage').value;
		}
		else if (str && str.search(/^[0-9]+$/) == 0) {
			document.getElementById('scanpic1-curPage').value = str;
		}
		else if (str) {
			( str.charAt(0)  == '+' ? document.getElementById('scanpic1-curPage').value++ : document.getElementById('scanpic1-curPage').value--);
		}
		curPage = document.getElementById('scanpic1-curPage').value;
		
		if(curPage==-1) {
			document.getElementById('scanpic1-curPage').value = Math.ceil(imgArr1.length/num_per_page1)-1;
			curPage = document.getElementById('scanpic1-curPage').value;
		} {
		if(curPage >= Math.ceil((imgArr1.length)/num_per_page1)) 
			document.getElementById('scanpic1-curPage').value = 0;
			curPage = document.getElementById('scanpic1-curPage').value;
		}
		
		if (curPage == origCurPage && !firstTime) return;
		
		//CLEAR previous data
		for (i = 0 ; i < num_per_page1 && i < imgArr1.length ; i++) {
			for (k = 0 ; k < positions.length ; k++) {
				if (positions[k] != 'center_center') {
					document.getElementById('scanpic1-pics'+i+'_table_'+positions[k]).style.visibility = 'hidden';
					document.getElementById('scanpic1-pics'+i+'_table_'+positions[k]).innerHTML = document.getElementById('scanpic1-pics'+i+'_table_'+positions[k]+'_value').value;
				}
			}
			for (k = 0 ; k < icon_positions.length ; k++) {
				if (icon_positions[k] != 'icon_center_center') {
					document.getElementById('scanpic1-pics'+i+'_table_'+icon_positions[k]).style.visibility = 'hidden';
					document.getElementById('scanpic1-pics'+i+'_table_'+icon_positions[k]).innerHTML = document.getElementById('scanpic1-pics'+i+'_table_'+icon_positions[k]+'_value').value;
				}
			}
		}
		
		curIndex = curPage * num_per_page1;
		var target = '';
		
		if ('' && 'light_box' == '') {
				target = 'target=""';
		}
		currDivIndex1 = 0;
				
		var i;
		var onMouseOver, onMouseOut, onLoad, addStyle;
		//run this lines in the end of load
		runInTheEnd1 = '';
		// CHECK if lock is released
		//checkOnGoing(curIndex);
		getNextPage2_1(curIndex,curIndex, firstTime);
		
	}
	
	function getNextPage2_1(i, curIndex, firstTime) {
		
		var next = 1;
		/*for (j=0;j<imgArr1.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_1("+i+", "+curIndex+", "+firstTime+")",50);
					return;
				}
		}
		if (!next) return;*/
		//for (i = curIndex ; i < (num_per_page1+curIndex) && i < imgArr1.length ; i++) {
		if (i < (num_per_page1+curIndex) && i < imgArr1.length ) {
				if ('') document.getElementById('scanpic1-pics'+currDivIndex1).style.backgroundImage='url()';
				//first time, set lock 
				if (i == curIndex) {
						document.getElementById('scanpic1-onGoingNexPage').value = curIndex;
				}
				var onClick = '';
				var title = '';				
				var href = 'javascript:void(0);';
				addStyle = '';
				addStyle0 = '';
				addStyle2 = '';
				var imgArr = imgArr1;
				var scans_url = scans_url1;
				if ('') href = scans_url[i];
				else if ('light_box' == 'link') href = '?pict='+imgArr[i];
				else if ('light_box' != 'nolink') href = '/gallery/gallery1/scanpic1/'+imgArr[i];
				else {target = '';addStyle += 'cursor:default;';addStyle0 += 'cursor:default;';}
				onMouseOver = onMouseOut = onLoad = '';
				
				var startPx = 1, startXPx = 0, startYPx = 0, blindDir ='';
				var curImgArrW = curImgArrW1;
				var curImgArrH = curImgArrH1;
				//CHECK if there is image load effetcs
				if ('fade'.search(/enter_from_/) == 0) {
					var re = new RegExp('enter_from_');
					dir = 'fade'.replace(re,'');
					//runInTheEnd1 = runInTheEnd1 + 'insertFromSideEffect1('+i+', "'+dir+'");';
					ifseArray.push(i);
					addStyle0 = 'visibility: hidden;';
					addStyle = 'visibility: hidden;';
				}
				else if ('fade' == 'blindX') {
					startXPx = curImgArrW[i]?curImgArrW[i]:'90';
					addStyle0 = 'position: absolute; left: 0px; top:0px;';
					addStyle = 'position: absolute; left: '+startXPx+'px;';
					blindDir = 'left';
				}
				else if ('fade' == 'blindY') {
					startYPx = curImgArrH[i]?curImgArrH[i]:'90';
					addStyle0 = 'position: absolute; top: 0px; left:0px';
					addStyle = 'position: absolute; top: '+startYPx+'px;';
					blindDir = 'top';
				}
				else if ('fade' == 'blindZ') {
					startXPx = curImgArrW[i]?curImgArrW[i]:'90';
					startYPx = curImgArrH[i]?curImgArrH[i]:'90';
					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]:'90';
					addStyle0 = 'position: absolute; left: 0px; top:0px;';
					addStyle = 'position: absolute; left: '+startXPx+'px;';
					blindDir = 'left';
				}
				else if ('fade' == 'fadeZoom') {
					startXPx = curImgArrW[i]?curImgArrW[i]:'90';
					startYPx = curImgArrH[i]?curImgArrH[i]:'90';
					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=1);'; addStyle+= 'filter:alpha(opacity=1);';}
					else {addStyle0+= 'opacity: 1;';addStyle+= 'opacity: 1;';}
				}
				if ('light_box' == 'resizing') {
					onClick='onClick="prevResizeImage1('+i+');"';
					href = 'javascript:void(0);'; 
				}
				else if ('light_box' == 'popup') {
					onClick = 'onClick="zoom1('+i+');"';
					href = 'javascript:void(0);'; 
				}
				else if ('light_box' == 'light_box') {
					onClick = 'onClick="light_box1('+i+');"';
					href = 'javascript:void(0);'; 
				}
					
				if ('' == 'popup') {
					onMouseOver = 'onmouseover="zoom1('+i+');"';
					//onMouseOut = 'onmouseout="zoomOut1('+popupSpeed+');"';
				}
				else if ('' == 'resizing') {
					onMouseOver = 'onmouseover="prevResizeImage1('+i+');"';
					//onMouseOut = 'onmouseout="prevResizeImage1('+i+');"';
				}
				else if ('' == 'light_box') {
					onMouseOver = 'onmouseover="light_box1('+i+');"';
				}
				var images_details = images_details1;
				var data = images_details[i].split("<DD>");
				for (var p=0; p<data.length;p++) {
						field = (data[p].split("="))[0];
						field1 = '%%'+field+'%%';
						field2 = '%%icon_'+field+'%%';
						value = (data[p].split("="))[1];
						//if (rel != '' && field == 'title') {		
						if (field == 'title' && value) title = 'title="'+value+'"';
						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('scanpic1-pics'+currDivIndex1+'_table_'+positions[k]).innerHTML = document.getElementById('scanpic1-pics'+currDivIndex1+'_table_'+positions[k]).innerHTML.replace(re1,value);
									document.getElementById('scanpic1-pics'+currDivIndex1+'_table_'+positions[k]).style.visibility = 'visible';
								}
						}
						for (k = 0 ; k < icon_positions.length ; k++) {
								if (icon_positions[k] != 'icon_center_center') {
									document.getElementById('scanpic1-pics'+currDivIndex1+'_table_'+icon_positions[k]).innerHTML = document.getElementById('scanpic1-pics'+currDivIndex1+'_table_'+icon_positions[k]).innerHTML.replace(re2,value);
									document.getElementById('scanpic1-pics'+currDivIndex1+'_table_'+icon_positions[k]).style.visibility = 'visible';
								}
						}
				}
				
				for (k = 0 ; k < icon_positions.length ; k++) {
					var val = document.getElementById('scanpic1-pics'+currDivIndex1+'_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 && '90') divPictStyle = 'width: 90px; height: 90px';
				divPictStyle = 'width: '+curImgArrW[i]+'px; height: '+curImgArrH[i]+'px';
				divOnClick = '';
				if (!onClick) divOnClick = 'onclick="location.href=\''+href+'\';"'; 
				//else divOnClick = onClick;
				var imgArr = imgArr1;
				var src = '/gallery/gallery1/scanpic1/'+imgArr[i];
				if ('' == 'iome1' && document.getElementById('scanpic1-pics'+currDivIndex1+'_table_up_right').innerHTML != '') {
						if (document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td') && document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').firstChild) {
								innerH = '<a '+onMouseOver+' '+onMouseOut+' '+rel+' '+title+' '+imgClass+' '+onClick+' onmouseover="return overlib(\''+document.getElementById('scanpic1-pics'+currDivIndex1+'_table_up_right').innerHTML+'\', BUBBLE, BUBBLETYPE, \'roundcorners\',TEXTCOLOR , \'#000000\', TEXTSIZE , \'13px\');" onmouseout="nd();" href="'+href+'" '+target+'><div '+divOnClick+' class="scanpic1-div_img" id="scanpic1-divPict'+currDivIndex1+'" style="cursor: pointer; overflow: hidden; position: relative; '+divPictStyle+'"><img '+addStyle0+' '+onLoad+' class="scanpic1-img" name="picture'+i+'" id="scanpic1-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 '+onMouseOver+' '+onMouseOut+' '+rel+' '+title+' '+imgClass+' '+onClick+' onmouseover="return overlib(\''+document.getElementById('scanpic1-pics'+currDivIndex1+'_table_up_right').innerHTML+'\', BUBBLE, BUBBLETYPE, \'roundcorners\',TEXTCOLOR , \'#000000\', TEXTSIZE , \'13px\');" onmouseout="nd();" href="'+href+'" '+target+'><div '+divOnClick+' class="scanpic1-div_img" id="scanpic1-divPict'+currDivIndex1+'" style="cursor: pointer; overflow: hidden; position: relative; '+divPictStyle+'"><img '+addStyle+' '+onLoad+' name="picture'+i+'" class="scanpic1-img" id="scanpic1-picture'+i+'" '+scaling_value+' border="0" src="'+src+'"><img '+addStyle2+' '+onLoad+' name="" id="" '+scaling_value+' border="0" src=""></div></a>';
						}
					}
				else {
						if (document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td') && document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').firstChild) {
								innerH = '<a '+onMouseOver+' '+onMouseOut+' '+rel+' '+title+' '+imgClass+' '+onClick+' href="'+href+'" '+target+'><div  class="scanpic1-div_img" id="scanpic1-divPict'+currDivIndex1+'" style="cursor: pointer; overflow: hidden; position: relative; '+divPictStyle+'"><img '+addStyle0+' '+onLoad+' class="scanpic1-img" name="picture'+i+'" id="scanpic1-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 '+onMouseOver+' '+onMouseOut+' '+rel+' '+title+' '+imgClass+' '+onClick+' href="'+href+'" '+target+'><div '+divOnClick+' class="scanpic1-div_img" id="scanpic1-divPict'+currDivIndex1+'" style="cursor: pointer; overflow: hidden; position: relative; '+divPictStyle+'"><img '+addStyle+' '+onLoad+' class="scanpic1-img" name="picture'+i+'" id="scanpic1-picture'+i+'" '+scaling_value+' border="0" src="'+src+'"><img '+addStyle2+' '+onLoad+' name="" id="" '+scaling_value+' border="0" src=""></div></a>';
						}
				}
				
				tmp_img = new Image();
			  tmp_img.onload=function() {
			  		if (document.getElementById('scanpic1-divPict'+currDivIndex1)) {
							var innerHTML = document.getElementById('scanpic1-divPict'+currDivIndex1).innerHTML;
							document.getElementById('scanpic1-divPict'+currDivIndex1).firstChild.nextSibling.id = 'scanpic1-picture'+i;
							document.getElementById('scanpic1-divPict'+currDivIndex1).firstChild.nextSibling.name = 'scanpic1-picture'+i;
							document.getElementById('scanpic1-divPict'+currDivIndex1).firstChild.nextSibling.src = src;
							document.getElementById('scanpic1-divPict'+currDivIndex1).firstChild.nextSibling.style.display = 'block';
						}
						
				    if ('fade' == 'blindX' || 'fade' == 'blindY' || 'fade' == 'blindZ') {
								if (document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td') && document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').firstChild) {
									innerH = innerH.replace(/\'/g,"&quota;");
									innerH = innerH.replace(/\"/g,"&quot;");
									myId = document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').firstChild.firstChild.firstChild.id;
									myId2 = document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').firstChild.firstChild.firstChild.nextSibling.id;
									//blind1(startXPx/blindSpeed, startYPx/blindSpeed, blindSpeed, myId, myId2, i, curIndex, innerH, blindDir);
									window.setTimeout("blind1("+(startXPx/blindSpeed)+", "+(startYPx/blindSpeed)+", "+blindSpeed+", '"+myId+"', '"+myId2+"', "+i+", "+curIndex+", '"+innerH+"', '"+blindDir+"')",50);
								}
								else {
									document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').innerHTML = innerH;
									innerH = innerH.replace(/\'/g,"&quota;");
									innerH = innerH.replace(/\"/g,"&quot;");
									//blind1(-startXPx/blindSpeed, -startYPx/blindSpeed, blindSpeed, 'picture'+i, '', i, curIndex, innerH, blindDir);
									window.setTimeout("blind1("+(-startXPx/blindSpeed)+", "+(-startYPx/blindSpeed)+", "+blindSpeed+", 'scanpic1-picture"+i+"', '', "+i+", "+curIndex+", '"+innerH+"', '"+blindDir+"')",50);
								}
						}
						else if ('fade' == 'cover') {
								if (document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td') && document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').firstChild) {
									innerH = innerH.replace(/\'/g,"&quota;");
									innerH = innerH.replace(/\"/g,"&quot;");							
									myId = document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').firstChild.firstChild.firstChild.id;
									myId2 = document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').firstChild.firstChild.firstChild.nextSibling.id;
									//cover1(-startXPx/blindSpeed, startYPx/blindSpeed, blindSpeed, myId2, i, curIndex, innerH, blindDir);
									window.setTimeout("cover1("+(-startXPx/blindSpeed)+", "+(startYPx/blindSpeed)+", "+blindSpeed+", '"+myId2+"', "+i+", "+curIndex+", '"+innerH+"', '"+blindDir+"')",50);
								}
								else {
									document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').innerHTML = innerH;
									innerH = innerH.replace(/\'/g,"&quota;");
									innerH = innerH.replace(/\"/g,"&quot;");							
									//cover1(-startXPx/blindSpeed, -startYPx/blindSpeed, blindSpeed, 'picture'+i, i, curIndex, innerH, blindDir);
									window.setTimeout("cover1("+(-startXPx/blindSpeed)+", "+(startYPx/blindSpeed)+", "+blindSpeed+", 'scanpic1-picture"+i+"', "+i+", "+curIndex+", '"+innerH+"', '"+blindDir+"')",50);
								}
						}				
						else if ('fade' == 'fadeZoom') {
								if (document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td') && document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').firstChild) {
									//other than first time page load
									document.getElementById('scanpic1-divPict'+currDivIndex1).firstChild.nextSibling.id = 'scanpic1-picture'+i;
									document.getElementById('scanpic1-divPict'+currDivIndex1).firstChild.nextSibling.name = 'scanpic1-picture'+i;
									document.getElementById('scanpic1-divPict'+currDivIndex1).firstChild.nextSibling.src = src;
									document.getElementById('scanpic1-divPict'+currDivIndex1).firstChild.nextSibling.style.left = startXPx+'px';
									document.getElementById('scanpic1-divPict'+currDivIndex1).firstChild.nextSibling.style.top = startYPx+'px';
									document.getElementById('scanpic1-divPict'+currDivIndex1).firstChild.nextSibling.style.width = '0px';
									document.getElementById('scanpic1-divPict'+currDivIndex1).firstChild.nextSibling.style.height = '0px';
									myId = document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').firstChild.firstChild.firstChild.id;
									myId2 = document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').firstChild.firstChild.firstChild.nextSibling.id;
									innerH = innerH.replace(/\'/g,"&quota;");
									innerH = innerH.replace(/\"/g,"&quot;");
									//fadeZoom1(-startXPx/blindSpeed, -startYPx/blindSpeed, blindSpeed, myId, myId2, i, curIndex, innerH);
									window.setTimeout("fadeZoom1("+(-startXPx/blindSpeed)+", "+(-startYPx/blindSpeed)+", "+blindSpeed+", '"+myId+"', '"+myId2+"', "+i+", "+curIndex+", '"+innerH+"')",50);
								}
								else { //first time page load
									document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').innerHTML = innerH;
									currDivIndex1++;
									i++;
									getNextPage2_1(i,curIndex,firstTime);
								}
						}
						else if ('fade' == 'fade') {
							var myId = ' ';
							if (document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td') && document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').firstChild) {
								myId = document.getElementById('scanpic1-pics'+currDivIndex1+'_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;");
							//fade1(-1/opacitySpeed, opacitySpeed, myId ,i, curIndex, innerH);
							window.setTimeout("fade1("+(-0.8/opacitySpeed)+", "+opacitySpeed+", '"+myId+"', "+i+", "+curIndex+", '"+innerH+"')",50);
						}
						else {
							document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').innerHTML = innerH;
							document.getElementById('scanpic1-divPict'+currDivIndex1).firstChild.nextSibling.style.display = 'none';
							if ('') document.getElementById('scanpic1-pics'+currDivIndex1).style.backgroundImage='';
							currDivIndex1++;
							i++;
							getNextPage2_1(i,curIndex,firstTime);
						}
				}
				tmp_img.src = src;
  						
		} //main for
		// release lock
		else {
			document.getElementById('scanpic1-onGoingNexPage').value = '';
			getNextPage3_1();
		}
				
	}
	function fade1(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("fade1("+inc+", "+index+", '"+id+"', "+i+", "+curIndex+", '"+innerH+"')",30);
		}
		else {
			if (inc < 0) {
				myId = 'scanpic1-picture'+i;
				innerH1 = innerH.replace(/&quot;/g,'"');
				innerH1 = innerH1.replace(/&quota;/g,"'");
				imgArr = imgArr1;
			  tmp_img = new Image();
			  tmp_img.onload=function() {
		    		window.setTimeout("fade1("+(0.8/opacitySpeed)+", "+opacitySpeed+", '"+myId+"', "+i+", "+curIndex+", '"+innerH+"')",50);
		    		if (document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td'))
							document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').innerHTML = innerH1;
				}
				tmp_img.src = '/gallery/gallery1/scanpic1/'+imgArr[curIndex];
				////if (document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td'))
					////document.getElementById('scanpic1-pics'+currDivIndex1+'_table_td').innerHTML = innerH1;
				////window.setTimeout("fade1("+(1/opacitySpeed)+", "+opacitySpeed+", '"+myId+"', "+i+", "+curIndex+", '"+innerH+"')",150);
				//fade1(1/opacitySpeed, opacitySpeed, myId ,i, curIndex, innerH);
			}
			else {
				if ('') document.getElementById('scanpic1-pics'+currDivIndex1).style.backgroundImage='';
				currDivIndex1++;
				i++;
				getNextPage2_1(i,curIndex, false);
			}
		}
	}
	function getNextPage3_1() {		
		
		//hide images div which are empty (not enough images on last page)
		while ( currDivIndex1 < num_per_page1 && currDivIndex1 < imgArr1.length ) {
				document.getElementById('scanpic1-td_pics'+currDivIndex1).style.visibility = 'hidden';
				currDivIndex1++				
		}
		
		if ('' == 'iome2') opacityPictures1();
		document.getElementById('scanpic1-currentIndexResize').value = '';
		document.getElementById('scanpic1-imageresize').value = '+';
		
		if ('fade'.search(/enter_from_/) == 0) {
				var re = new RegExp('enter_from_');
				dir = 'fade'.replace(re,'');
				ifseArray = ifseArray.reverse();
				mainInsertFromSideEffect1(dir);
		}
					
		eval(runInTheEnd1);
		if ('' || '') {
				updatePageCounter1();
		}
		/*if ('checked' == '') {
				updateControlPanel1();
		}*/
		
		ss = document.getElementById('scanpic1-slide_show');
		var curPage = document.getElementById('scanpic1-curPage').value;
		var start = num_per_page1 * curPage;
				
		/*if (ss.value == 'r') {
				window.setTimeout("getNextPage1('+');",1000);
		}
		else */
		if ('light_box' == 'resizing' || '' == 'resizing') {
				for (i = start ; i < start + num_per_page1 && i < imgArr1.length; i++) {
					var img = document.getElementById('scanpic1-picture'+i);
					var src = img.src;
					var j = i - start;
					var re_img = document.getElementById('scanpic1-resizing_img'+j);
					re_img.src = src.replace(/\/gallery\/gallery1\/scanpic1\//,"");
				}
		}
		else if ('light_box' == 'popup' || '' == 'popup') {
				for (i = start ; i < start + num_per_page1 && i < imgArr1.length; i++) {
					var img = document.getElementById('scanpic1-picture'+i);
					var src = img.src;
					var j = i - start;
					var popup_img = document.getElementById('scanpic1-popup_img'+j);
					popup_img.src = src.replace(/\/gallery\/gallery1\/scanpic1\//,"");
				}
		}
		
		if (alowToEdit1 && '' != '1') {
			for (i = 0 ; i < num_per_page1 && i < imgArr1.length ; i++) {
							var div = document.getElementById('scanpic1-pics'+i);
							var div1 = document.createElement('DIV');
							var div2 = document.createElement('DIV');
							var imgArr = imgArr1;
							div1.id = 'scanpic1-1ca'+i;
							div1.style.position = 'relative';
							div1.style.height = '24px';
							div1.style.top = '-24px';
							div1.style.backgroundColor = '#000000';
							div2.id = 'scanpic1-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('scanpic1-1ca'+i));
								div.removeChild(document.getElementById('scanpic1-2ca'+i));
							} catch(e){}
									
							var index = i + start;
							div2.innerHTML = '<img src="/htm-webaxy/ndel.gif" border="0" title="Delete page from /gallery/gallery1/" onclick="clickDel(\'/gallery/gallery1/'+imgArr[index]+'\')" style="cursor: pointer" onMouseOver="this.parentNode.parentNode.style.backgroundColor=\'silver\';" onMouseOut="this.parentNode.parentNode.style.backgroundColor=\'transparent\'">' +
																	'<img src="/htm-webaxy/pagedit.gif" border="0" title="עריכה" onclick="clickEditSP1(\'/gallery/gallery1/'+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_page1 && i < imgArr1.length ; i++) {
					var div = document.getElementById('scanpic1-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 = imgArr1;
					newCell.innerHTML = '<img src="/htm-webaxy/ndel.gif" border="0" title="Delete page from /gallery/gallery1/" onclick="clickDel(\'/gallery/gallery1/'+imgArr[index]+'\')" style="cursor: pointer" onMouseOver="this.parentNode.parentNode.style.backgroundColor=\'silver\';" onMouseOut="this.parentNode.parentNode.style.backgroundColor=\'transparent\'">' +
															'<img src="/htm-webaxy/pagedit.gif" border="0" title="עריכה" onclick="clickEditSP1(\'/gallery/gallery1/'+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('scanpic1-pageDone').value = '';
		
	}
	
	function updateControlPanel1() {
		
			var pages = Math.ceil(imgArr1.length/num_per_page1);
			var curP = parseInt(document.getElementById('scanpic1-curPage').value);
			curP++;
			var firstP = document.getElementById('scanpic1-firstpage');
			var lastP = document.getElementById('scanpic1-lastpage');
			//var prvP = document.getElementById('scanpic1-prvpage');
			//var nxtP = document.getElementById('scanpic1-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 getPosition1(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 getSize1() {

	// Window Size
		if (self.innerHeight) { // Everyone but IE
			myWidth1 = window.innerWidth;
			myHeight1 = window.innerHeight;
			myScroll1 = window.pageYOffset;
		} else if (document.documentElement && document.documentElement.clientHeight) { // IE6 Strict
			myWidth1 = document.documentElement.clientWidth;
			myHeight1 = document.documentElement.clientHeight;
			myScroll1 = document.documentElement.scrollTop;
		} else if (document.body) { // Other IE, such as IE7
			myWidth1 = document.body.clientWidth;
			myHeight1 = document.body.clientHeight;
			myScroll1 = document.body.scrollTop;
		}
		// Page size w/offscreen areas
	
		if (window.innerHeight && window.scrollMaxY) {	
			myScrollWidth1 = document.body.scrollWidth;
			myScrollHeight1 = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac
			myScrollWidth1 = document.body.scrollWidth;
			myScrollHeight1 = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			myScrollWidth1 = document.body.offsetWidth;
			myScrollHeight1 = document.body.offsetHeight;
		}
	}
	function runFirst1() {
		
		document.getElementById('scanpic1-curPage').value = 0;
		document.getElementById('scanpic1-curFullIndex').value = 0;
		document.getElementById('scanpic1-curFilmPage').value = 0;
		getSize1();
		var href = location.href;
		var index = href.indexOf("pict=");
		var getPage = '';
		var isFirst = true;
		
		//setTimeout("loadImages1();", 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 )
					alowToEdit1 = 1;
			}
			if (alowToEdit1 && '' != '1') {
				var caRow = document.getElementById('scanpic1-main_table').insertRow(-1);
				var caCell = caRow.insertCell(-1);
				caCell.align = 'center';
				caCell.innerHTML = '<a href="javascript:clickEditSP1(\'/gallery/gallery1/\', -1)" target="_self"><img src="/htm-webaxy/edit_all_docs.gif" border="0" title="ערוך כל המסמכים" hspace="1"></a>';
			}
		}
		// click admin
		
		if (index != -1) {
			index2 = href.indexOf("&", index);
			if (index2 == -1) pict = href.substring(index+5);
			else pict = href.substring(index+5,index2);
			var imgArr = imgArr1;
			for (i = 0 ; i < imgArr1.length ; i++) {
					if (imgArr[i] == pict) {getPage = i;isFirst=true;}
			}
			getPage += '';
		}
		//set last arrow function
		var num_of_pages = Math.ceil(imgArr1.length/num_per_page1)-1;
		var scaling_value = 90;
		
		if ('checked' == '') {
			fullSD = document.getElementById('scanpic1-fullScreenDiv');
			//fullSD.innerHTML = fullSD.innerHTML + '<br><br>' + '<div id="scanpic1-fullScreenPanel">' + document.getElementById('scanpic1-panel').innerHTML + '</div>';
			if ('' == 'down') {
				fullSD.innerHTML = fullSD.innerHTML + '<div id="scanpic1-fullScreenPanel" style="height:30px;">' + document.getElementById('scanpic1-panel').innerHTML + '</div>';
			}
			else {
				fullSD.innerHTML = '<div id="scanpic1-fullScreenPanel" style="height:30px;">' + document.getElementById('scanpic1-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('scanpic1-prvpage_f').onclick =  function () { getNextPageFull1('-1');};
				document.getElementById('scanpic1-nxtpage_f').onclick =  function () { getNextPageFull1('+1');};
			}
			if ('checked' == '') {
				document.getElementById('scanpic1-firstpage_f').onclick =  function () { getNextPageFull1('first');};
				document.getElementById('scanpic1-lastpage_f').onclick =  function () { getNextPageFull1('last');};
			}
			document.getElementById('scanpic1-regularscreen').onclick =  function () { regularScreen1();};
			document.getElementById('scanpic1-regularscreen').title = 'מסך רגיל';
			if ('checked' == '') {
				document.getElementById('scanpic1-play_full').onclick =  function () { slideShowFull1('r');};
			}
			var keepPlace = 0;
			var keepGoTo = 0;
			var keepPagesCounter = 25;
			if (imgArr1.length >= 5 * 2) keepGoTo = 25;
			if ('') keepPlace += keepPagesCounter + keepGoTo;
			if ('') keepPlace += keepPagesCounter + keepGoTo;
			document.getElementById('scanpic1-fullScreenDivImg').style.height = (myHeight1 - 40 - keepPlace) + 'px';
		}
		if ('' || '') {
				updatePageCounter1();
				//updatePageCounterFS1();
		}
		if ('onlyfilm' != 'onlyfilm') setTimeout("getNextPage1('"+getPage+"', '', "+isFirst+")", 150);
		else if ('' == 'iome2') opacityFilmPictures1();
		
		if ('onlyfilm' == 'onlyfilm') {
				if ('light_box' == 'popup' || '' == 'popup') {
					for (i = 0 ; i < 3 && i < imgArr1.length; i++) {
						var img = document.getElementById('scanpic1-film_strip_img'+i);
						var src = img.src;
						//var j = i - start;
						var popup_img = document.getElementById('scanpic1-popup_img'+i);
						popup_img.src = src.replace(/\/gallery\/gallery1\/scanpic1\//,"");
					}
				}
				else if ('light_box' == 'resizing' || '' == 'resizing') {
					for (i = 0 ; i < 3 && i < imgArr1.length; i++) {
						var img = document.getElementById('scanpic1-film_strip_img'+i);
						var src = img.src;
						var re_img = document.getElementById('scanpic1-resizing_img'+i);
						re_img.src = src.replace(/\/gallery\/gallery1\/scanpic1\//,"");
					}
				}
				if (alowToEdit1 && '' != '1') {
					for (i = 0 ; i < imgArr1.length ; i++) {
							var div = document.getElementById('scanpic1-film_strip_item'+i);
							var div1 = document.createElement('DIV');
							var div2 = document.createElement('DIV');
							var imgArr = imgArr1;
							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="/htm-webaxy/ndel.gif" border="0" title="Delete page from /gallery/gallery1/" onclick="clickDel(\'/gallery/gallery1/'+imgArr[i]+'\')" style="cursor: pointer" onMouseOver="this.parentNode.parentNode.style.backgroundColor=\'silver\';" onMouseOut="this.parentNode.parentNode.style.backgroundColor=\'transparent\'">' +
																	'<img src="/htm-webaxy/pagedit.gif" border="0" title="עריכה" onclick="clickEditSP1(\'/gallery/gallery1/'+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('scanpic1-film_strip_all').setAttribute('minus', imgArr1.length - parseInt('3'));
			document.getElementById('scanpic1-film_strip_all').setAttribute('plus', 0);
			document.getElementById('scanpic1-film_strip_all').setAttribute('PUminusPos',parseInt('3')-1);
			document.getElementById('scanpic1-film_strip_all').setAttribute('PUplusPos', 0);
			document.getElementById('scanpic1-film_strip_all').setAttribute('PUminusIndex', parseInt('3')-1);
			document.getElementById('scanpic1-film_strip_all').setAttribute('PUplusIndex', 0);
			document.getElementById('scanpic1-film_strip_all').setAttribute('RminusPos',parseInt('3')-1);
			document.getElementById('scanpic1-film_strip_all').setAttribute('RplusPos', 0);
			document.getElementById('scanpic1-film_strip_all').setAttribute('RminusIndex', parseInt('3')-1);
			document.getElementById('scanpic1-film_strip_all').setAttribute('RplusIndex', 0);
		}
		
		//getNextPage1(getPage,'',isFirst);
		//if ('onlyfilm' == 'film' && '' == '') putArrows();
		if ('') {
			slideShow1('r');
		}
		
		if ('onlyfilm' == 'film' && '' == 'random') shuffle_film1(new_order1);
		if ('' && document.getElementById('scanpic1-film_strip_all')) document.getElementById('scanpic1-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 loadImages1() {
		
		//pre loading images for fasting load
		//var loadUntil = num_per_page1*2;
		var loadUntil = 7;
		//if ('light_box' == 'light_box' || '' == 'light_box') loadUntil = imgArr.length;
		//loadUntil = imgArr.length;
		var images = new Array();
		var imgArr = imgArr1;
		for (var i = 0 ; i < loadUntil ; i++) {
						images[i] = new Image();
						images[i].src = '/gallery/gallery1/'+imgArr[i];
		}
		if ('/gallery/gallery1/' != '/gallery/gallery1/scanpic1/') {
			for (var i = 0 ; i < loadUntil ; i++) {
						images[i] = new Image();
						images[i].src = '/gallery/gallery1/scanpic1/'+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='/htm-webaxy';
	linkButtons.cgi_webaxy='/cgi-webaxy';
		linkButtons.lang = "he";
		linkButtons.name = "he";
		linkButtons.hidden = "lang=he&ID=283662_ghi";
		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_1(index) {
		
		var val = document.getElementById('scanpicCADiv1').getAttribute('open');
		
		if (val == 0) {
			for (var i=1;i<=index;i++) {
					animatedcollapse.show('file'+i);
			}
			document.getElementById('scanpicCADiv1').setAttribute('open',1);
			document.getElementById('scanpic1-openall').title = 'סגור הכל';	
			document.getElementById('scanpic1-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('scanpicCADiv1').setAttribute('open',0);
			document.getElementById('scanpic1-openall').title = 'פתח הכל';	
			document.getElementById('scanpic1-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_1() {

		if (!document.getElementById('update_done').value) {
				window.setTimeout("done_update_1()",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_1() {
		
		var hide = document.getElementById('scanpic1-hideAllDiv');
		var d = document.getElementById('scanpicCADiv1');
		hide.style.display = 'none';
		d.style.display = 'none';
		hide.style.zIndex = 0;
		d.removeChild(d.firstChild);
		
}

function updateSP(done) {
	
	document.getElementById('files_update').submit();
	if (done) done_update_1();
		
}

function clickEditSP1(str, index){
		/*wEdit = open("/cgi-webaxy/page_edit_login.pl?lang=he&ID=283662_ghi&"+cookie_in+"&curdir=/gallery/gallery1/&count="+str+"&act=edit", "wEdit", "location=0, toolbar=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=1");
		last
		wEdit = open("/cgi-webaxy/page_edit_login.pl?lang=he&ID=283662_ghi&"+cookie_in+"&curdir=http://www.ghi.org.il&count="+str+"&act=edit", "wEdit", "location=0, toolbar=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=1");
		*/
		
		hide = document.getElementById('scanpic1-hideAllDiv');
		hide.style.height = (myHeight1+myScrollHeight1)+'px';
		hide.style.display = 'block';
		hide.style.width = myWidth1+'px';
		hide.style.zIndex = 1111;
		if (navigator.appVersion.indexOf("MSIE")!=-1) {
			document.getElementById('scanpic1-hideAllDiv').style.filter = "alpha(opacity=85)";
		}
		else {
			document.getElementById('scanpic1-hideAllDiv').style.opacity = 0.85;
		}
		var addDiv = '';
		var d = document.getElementById('scanpicCADiv1');
		var form = document.createElement("form");
		form.name = "files_update";
		form.id = "files_update";
		form.setAttribute("action", "/cgi-webaxy/scanpicadmin.pl");
		form.setAttribute("method", "post");
		form.setAttribute("target", "hidden_iframe");
		
		d.style.display = 'block';
		getSize1();
		scroll((myWidth1-d.style.width.replace(/px/,''))/2,0);
		d.style.left = ((myWidth1-d.style.width.replace(/px/,''))/2)+'px';
		var tb = document.createElement('table');
		tb.width = '770px';
		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_1();"><img border="0" src="/htm-webaxy/skins/standard/close.gif" title="סגור" id="scanpic1-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_1('+images_details1.length+');"><img border="0" src="/htm-webaxy/icons/arrow-down.gif" title="פתח הכל" id="scanpic1-openall"></a>';
		else cell.innerHTML = '';
		cell.innerHTML += '<input type="hidden" name="ID" value="283662_ghi">';
		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+'">';
		if (index < 0) cell.innerHTML += '<input type="hidden" name="num_of_items" value="'+images_details1.length+'">';
		else cell.innerHTML += '<input type="hidden" name="num_of_items" value="1">';
		cell.innerHTML += '<input type="hidden" name="scanpicID" value="1">';
		cell.innerHTML += '<input type="hidden" name="update_done" id="update_done" value="">';
		var new_src = '/cgi-webaxy/scanpicadmin.pl?ID=283662_ghi&lang=he&username='+username+'&password='+password+'&action=update_details&num_of_items'+images_details1.length+'&scanpicID=1';
		var curIndex = 0;
		var imgArr = imgArr1;
		var images_details = images_details1;
		for (i = 1 ; i <= images_details1.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];
				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 = '<img src="/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="/gallery/gallery1/'+file+'"><b>'+file1+'</b>';
			cell.dir = 'ltr';
			cell.setAttribute("title", '/gallery/gallery1/'+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_ifr\'].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.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>';
		form.appendChild(tb);
		d.appendChild(form);
		
		for (i = 1 ; i <= images_details1.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) ){
			dWin = open("/cgi-webaxy/page_edit_login.pl?lang=he&ID=283662_ghi&"+cookie_in+"&act=delFile&dfile=http://www.ghi.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_283662_ghi");
	if (webaxyCookie['clickadmin']=='1') {
		var allCookie='';
		for (var k in webaxyCookie){allCookie += (k+"=" + webaxyCookie[k]+"&");}
		if (document.getElementById("s1")) {
			if (location.href.search(/scanpic\/scanpic1.htm/) != -1 && '' != '1') {
					document.getElementById("s1").src = "/cgi-webaxy/admin/page_edit_js.pl?ID=283662_ghi&scanpicID=1&edit_scanpic_scan=&refresh=refresh&eApplication=scanpic&"+allCookie +"&r="+Math.round((Math.random() * 1000));
			}
			else if (location.href.search(/Albms\/albm.htm/) != -1) {
					document.getElementById("s1").src = "/cgi-webaxy/admin/page_edit_js.pl?ID=283662_ghi&galleryID=&edit_gallery_scan=&refresh=refresh&eApplication=scanpic&"+allCookie +"&r="+Math.round((Math.random() * 1000));
			}
		}
		
	}
}
