var alowToEdit2 = 0;
var new_order2;
var imgArr2 = new Array( 'IMG_2246.JPG','IMG_2247.JPG','IMG_2249.JPG','IMG_2250_1.JPG','IMG_2252.JPG','IMG_2254.JPG','IMG_2256_1.JPG','IMG_2259.JPG','IMG_2264.JPG' );
var scans_url2 = new Array ( '','','','','','','','','' );
var imgArrW2;
if ('550,550,550,550,550,550,550,550,550'.search(/,/) != -1) { imgArrW2 = new Array( 550,550,550,550,550,550,550,550,550);}
else {imgArrW2 = new Array();(imgArrW2)[0] = 550,550,550,550,550,550,550,550,550;}
var imgArrH2;
if ('366,366,366,366,366,366,366,366,366'.search(/,/) != -1) { imgArrH2 = new Array( 366,366,366,366,366,366,366,366,366);}
else {imgArrH2 = new Array();(imgArrH2)[0] = 366,366,366,366,366,366,366,366,366;}
var curImgArrW2;
if ('400,400,400,400,400,400,400,400,400'.search(/,/) != -1) { curImgArrW2 = new Array( 400,400,400,400,400,400,400,400,400);}
else {curImgArrW2 = new Array();(curImgArrW2)[0] = 400,400,400,400,400,400,400,400,400;}
var curImgArrH2;
if ('266,266,266,266,266,266,266,266,266'.search(/,/) != -1) { curImgArrH2 = new Array( 266,266,266,266,266,266,266,266,266);}
else {curImgArrH2 = new Array();(curImgArrH2)[0] = 266,266,266,266,266,266,266,266,266;}
var maxFullScreenImgHeight2;
var opacitySpeed = 8;
var lbSpeed = 15;
var lbsizeSpeed = 8;
var images_details2 = new Array ( 'title=
description=
photog=
author=Beto Bessudo- beto
date=
link=
keywords=
previewImage=
nonew=
nosearch=0
noscandir=
imageLink=','title=
description=
photog=
author=Beto Bessudo- beto
date=
link=
keywords=
previewImage=
nonew=
nosearch=0
noscandir=
imageLink=','title=
description=
photog=
author=Beto Bessudo- beto
date=
link=
keywords=
previewImage=
nonew=
nosearch=0
noscandir=
imageLink=','title=
description=
photog=
author=Beto Bessudo- beto
date=
link=
keywords=
previewImage=
nonew=
nosearch=0
noscandir=
imageLink=','title=
description=
photog=
author=Beto Bessudo- beto
date=
link=
keywords=
previewImage=
nonew=
nosearch=0
noscandir=
imageLink=','title=
description=
photog=
author=Beto Bessudo- beto
date=
link=
keywords=
previewImage=
nonew=
nosearch=0
noscandir=
imageLink=','title=
description=
photog=
author=Beto Bessudo- beto
date=
link=
keywords=
previewImage=
nonew=
nosearch=0
noscandir=
imageLink=','title=
description=
photog=
author=Beto Bessudo- beto
date=
link=
keywords=
previewImage=
nonew=
nosearch=0
noscandir=
imageLink=','title=
description=
photog=
author=Beto Bessudo- beto
date=
link=
keywords=
previewImage=
nonew=
nosearch=0
noscandir=
imageLink=' );
if ('date' == 'random') new_order2 = shuffle2();
var positions = new Array ( 'up_left','up_center','up_right','left_center','center_center','right_center','up_left','down_center','down_right' );
var icon_positions = new Array ( 'icon_up_left','icon_up_center','icon_up_right','icon_left_center','icon_center_center','icon_right_center','icon_up_left','icon_down_center','icon_down_right' );
var num_per_page2 = 1;
var num_film_per_page = 4;
var scaling_by = '';
var scaling_value = '';
var imgClass = '';
// popup variables
var myWidth2, myHeight2, myScroll2;
var myScrollWidth2, myScrollHeight2;
var incX2, incY2, incW2, incH2, incOpacity2;
var incW_Resize2 = new Array();
var incH_Resize2 = new Array();
var incX_PU2 = new Array();
var incY_PU2 = new Array();
var incW_PU2 = new Array();
var incH_PU2 = 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_spacing2 = parseInt('2px'.replace(/px/,''));
var image_padding2 = 5;
// settimeour pointer
//var curretTimeout = new Array();
//
var maxImageWidth2 = 550;
var maxImageHeight2 = 366;
var curMaxImageWidth2 = 400;
var curMaxImageHeight2 = 266;
var curMaxFilmWidth2 = ('film' != 'film')?400:100;
var curMaxFilmHeight2 = ('film' != 'film')?266:80;
var currDivIndex2;
var runInTheEnd2;
var target;
var blindSpeed = 12;
function pictureDataEstimateHeight2(index) {
var images_details = images_details2;
var data = images_details[index].split("
");
var height = 0;
for (var p=0; p');
}
if (field == 'link' && 'checked' && value) height += parseInt('12px'.replace(/px/,''));
}
return height;
}
function pictureData2(index) {
var images_details = images_details2;
var data = images_details[index].split("
");
var info = '';
for (var p=0; p';}
if (field == 'title' && 'checked' && value) info += value + ' ';
if (field == 'description' && 'checked' && value) info += value + ' ';
if (field == 'photog' && 'checked' && value) {
if ('checked') info += value+',';
else info += value + ' ';
}
if (field == 'date' && 'checked') {
if (value && 'checked') info += value+' ';
else if (!value) info = info.replace(/,$/,' ');
}
if (field == 'link' && 'checked' && value) info += value + ' ';
}
//info = info.replace(/\'/g,""a;");
//info = info.replace(/\"/g,""");
return info;
}
function pictureBulletData2(index) {
if ('' == '') return '';
var images_details = images_details2;
var data = images_details[index].split("
");
var info = '';
for (var p=0; p';}
if (field == 'title' && '' && value) info += value + ' ';
if (field == 'description' && '' && value) info += value + ' ';
if (field == 'photog' && '' && value) {
if ('') info += value+',';
else info += value + ' ';
}
if (field == 'date' && '') {
if (value && '') info += value+' ';
else if (!value) info = info.replace(/,$/,' ');
}
if (field == 'link' && '' && value) info += value + ' ';
}
if (info) {
info = '';
//info = info.replace(/\'/g,""a;");
//info = info.replace(/\"/g,""");
}
return info;
}
function light_box2(imgIndex, isNext) {
getSize2();
document.getElementById('scanpic2-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('scanpic2-hideAllDiv');
//document.getElementById('imageDataContainer').style.display = 'none';
hide.style.height = '0px';
hide.style.display = 'block';
hide.style.width = myWidth2+'px';
hide.style.zIndex = 1111;
var fullScreenHideSpeed = 10;
//inc = (myHeight2+myScroll2)/fullScreenHideSpeed;
//inc = myScrollHeight/fullScreenHideSpeed;
inc = (myHeight2+myScrollHeight2)/fullScreenHideSpeed;
light_box2_2(inc, fullScreenHideSpeed, imgIndex, isNext);
}
else {
window.setTimeout("light_box3_2("+imgIndex+", "+isNext+")",150);
}
}
function light_box2_2(inc, index, imgIndex, isNext) {
document.getElementById('loading').style.display = 'block';
hide = document.getElementById('scanpic2-hideAllDiv');
index--;
if (index >= 0) {
hide.style.height = (parseFloat(hide.style.height.replace(/px/,'')) + inc)+'px';
window.setTimeout("light_box2_2("+inc+", "+index+","+imgIndex+","+isNext+")",50);
}
else {
light_box3_2(imgIndex, isNext);
}
}
function light_box3_2(index, isNext) {
lb = document.getElementById('lightbox');
var lbPadding = 10;
var pageIndex = index % num_per_page2;
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 = '#808080';
document.getElementById('caption').style.fontSize = '12px';
document.getElementById('caption').innerHTML = pictureData2(index);
var data = pictureBulletData2(index);
if (data) document.getElementById('caption').innerHTML += data;
document.getElementById('numberDisplay').innerHTML = 'Image '+(1+index)+' of '+imgArr2.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 = myHeight2 - 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 = imgArrW2;
var imgArrH = imgArrH2;
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 = (myHeight2-(2*lbPadding)-imgArrH[index])/2;
contHeight = imgArrH[index] + 2*lbPadding;
contWidth = imgArrW[index] + 2*lbPadding;
}
height += myScroll2;
//my width = (myWidth2-(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_height2(lbsizeSpeed, incW, incH, index, isNext);
}
else {
light_box4_2(index, isNext);
}
}
function update_lb_height2(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_height2("+index+", "+incW+","+incH+","+imgIndex+","+isNext+")",50);
}
else {
//document.getElementById('imageDataContainer').style.width = oic.style.width;
update_lb_width2(lbsizeSpeed, incW, incH, imgIndex, isNext);
}
}
function update_lb_width2(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_width2("+index+", "+incW+","+incH+","+imgIndex+","+isNext+")",50);
}
else {
document.getElementById('imageDataContainer').style.width = oic.style.width;
light_box4_2(imgIndex, isNext);
}
}
function light_box4_2(index, isNext) {
document.onkeypress = getKey2_2;
document.getElementById('loading').style.display = 'none';
var imgArr = imgArr2;
tmp_img = new Image();
//wait for load
tmp_img.onload=function() {
document.getElementById('lightboxImage').src = '/info/gallery/immamsrabbies/'+imgArr[index];
if (navigator.appVersion.indexOf("MSIE")!=-1) {
document.getElementById('imageDataContainer').style.filter = "alpha(opacity=0)";
}
else {
document.getElementById('imageDataContainer').style.opacity = 0;
}
putLBOpacity2(1/lbSpeed, lbSpeed, index, "putLBCOpacity2("+1/lbSpeed+","+lbSpeed+")" );
}
tmp_img.src = '/info/gallery/immamsrabbies/'+imgArr[index];
}
function getNextLBPage2(inc) {
var curIndex = document.getElementById('scanpic2-curLBIndex').value;
if (inc == '+1') curIndex++;
else if (inc == '-1') curIndex--;
if(curIndex==-1) {
document.getElementById('scanpic2-curLBIndex').value = imgArr2.length-1;
curIndex = imgArr2.length-1;
}
if(curIndex >= imgArr2.length) {
document.getElementById('scanpic2-curLBIndex').value = 0;
curIndex = 0;
}
var runMe = "light_box2("+curIndex+","+true+")";
putLBCOpacity2(-1/lbSpeed, lbSpeed, curIndex);
putLBOpacity2(-1/lbSpeed, lbSpeed, curIndex, "light_box2("+curIndex+","+true+")" );
}
function putLBOpacity2(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("putLBOpacity2("+inc+", "+index+", "+curFullIndex1+", '"+evalMe+"')",30);
}
else {
if (evalMe != "undefined") {
eval(evalMe);
}
}
}
function putLBCOpacity2(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("putLBCOpacity2("+inc+", "+index+", "+curFullIndex1+", '"+evalMe+"')",30);
}
else {
if (evalMe != "undefined") {
eval(evalMe);
}
else if (inc < 0) {
//getNextPageFull2_2(curFullIndex1,opacitySpeed);
}
}
}
function regularScreenLBOpacity2(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("regularScreenLBOpacity2("+inc+", "+index+")",30);
}
else {
putFSOpacity2(-1/opacitySpeed, opacitySpeed, document.getElementById('scanpic2-curFullIndex').value, 'regularScreen1_2()');
}
}
function regularScreen2() {
lb = document.getElementById('lightbox');
if (lb && lb.style.display != 'none') regularScreenLBOpacity2(-1/opacitySpeed, opacitySpeed);
else putFSOpacity2(-1/opacitySpeed, opacitySpeed, document.getElementById('scanpic2-curFullIndex').value, 'regularScreen1_2()');
}
function putFSOpacity2(inc, index, curFullIndex1, evalMe) {
var curOpacity;
if (navigator.appVersion.indexOf("MSIE")!=-1) {
curOpacity = document.getElementById('scanpic2-fullScreenImg').style.filter;
var opacityPattern=new RegExp("[0-9]+");
curOpacity = parseFloat(opacityPattern.exec(curOpacity));
}
else {
curOpacity = parseFloat(document.getElementById('scanpic2-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('scanpic2-fullScreenImg').style.filter = "alpha(opacity=" + curOpacity + ")";
}
else {
curOpacity = curOpacity + inc;
if (curOpacity < 0.001) curOpacity = 0;
document.getElementById('scanpic2-fullScreenImg').style.opacity = curOpacity;
}
window.setTimeout("putFSOpacity2("+inc+", "+index+", "+curFullIndex1+", '"+evalMe+"')",30);
}
else {
if (evalMe != "undefined") {
eval(evalMe);
}
else if (inc < 0) {
getNextPageFull2_2(curFullIndex1,opacitySpeed);
if ('' || '') {
updatePageCounterFS2();
}
}
}
}
function regularScreen1_2() {
hide = document.getElementById('scanpic2-hideAllDiv');
var fullScreenHideSpeed = 10;
//inc = myScrollHeight/fullScreenHideSpeed;
hide.style.height = myHeight2+'px';
inc = myHeight2/fullScreenHideSpeed;
regularScreen2_2(inc, fullScreenHideSpeed);
}
function regularScreen2_2(inc, index) {
hide = document.getElementById('scanpic2-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_2("+inc+", "+index+")",50);
}
else {
regularScreen3_2();
}
}
function regularScreen3_2() {
fullSD = document.getElementById('scanpic2-fullScreenDiv');
lb = document.getElementById('lightbox');
hide = document.getElementById('scanpic2-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('scanpic2-slide_show_full').value='s';
}
function slideShowFull2(val){
ss = document.getElementById('scanpic2-slide_show_full');
if (val) {
ss.value = val;
}
if (ss.value == 'r') {
if (document.getElementById('scanpic2-pageDone').value == '') {
window.setTimeout("getNextPageFull2('+');",3000);
window.setTimeout("slideShowFull2();",3000);
}
else {
window.setTimeout("slideShowFull2();",100);
return;
}
}
}
function getKey2_2(evt) {
if (! evt) {
theKey = event.keyCode;
} else {
theKey = evt.keyCode;
}
if (theKey == 27 || theKey == 11) { // ESC OR Enter
regularScreen2();
}
}
function slideShow2(val){
ss = document.getElementById('scanpic2-slide_show');
if (val) {
ss.value = val;
}
if (ss.value == 'r') {
if (document.getElementById('scanpic2-pageDone').value == '' && 'film' != 'onlyfilm') {
window.setTimeout("getNextPage2('+');",3000);
window.setTimeout("slideShow2();",3000);
}
else if (document.getElementById('scanpic2-onGoing').value == '' && 'film' == 'onlyfilm') {
window.setTimeout("nextFilmPage2('-');",3000);
window.setTimeout("slideShow2();",3000);
}
else {
window.setTimeout("slideShow2();",100);
return;
}
}
}
function nextFilmPage2(str) {
if (document.getElementById('scanpic2-onGoing').value) {
window.setTimeout("nextFilmPage2('"+str+"');",100);
return;
}
var inc = document.getElementById('scanpic2-film_strip_move').getAttribute('inc');
if (str) {
( str.charAt(0) == '+' ? inc = inc * 1 : inc = inc * -1);
}
if (inc > 0) document.getElementById('scanpic2-curFilmPage').value--;
else document.getElementById('scanpic2-curFilmPage').value++;
var curFilmIndex = (parseInt(document.getElementById('scanpic2-curFilmPage').value)>= 0)?(parseInt(document.getElementById('scanpic2-curFilmPage').value) + parseInt('4')) % imgArr2.length:parseInt(document.getElementById('scanpic2-curFilmPage').value)+imgArr2.length;
if (document.getElementById('scanpic2-film_strip_img'+curFilmIndex) && document.getElementById('scanpic2-film_strip_img'+curFilmIndex).getAttribute('tosrc') != '' && document.getElementById('scanpic2-film_strip_img'+curFilmIndex).getAttribute('tosrc') != null) {
var src;
src = document.getElementById('scanpic2-film_strip_img'+curFilmIndex).getAttribute('tosrc');
tmp_img = new Image();
tmp_img.onload=function() {
document.getElementById('scanpic2-film_strip_img'+curFilmIndex).src = document.getElementById('scanpic2-film_strip_img'+curFilmIndex).getAttribute('tosrc');
document.getElementById('scanpic2-film_strip_img'+curFilmIndex).setAttribute('tosrc', '');
nextFilmPage12(inc, str);
}
tmp_img.src = src;
}
else {
nextFilmPage12(inc, str);
}
}
function nextFilmPage12(inc, str) {
var dir = '';
var divs = document.getElementById('scanpic2-film_strip_move').style;
var divW;
if ('down' == 'up' || 'down' == 'down' || 'down' == 'horizon') {
divW = parseFloat(divs.width.replace(/px/,''));
divall = parseFloat(document.getElementById('scanpic2-film_strip_all').style.width.replace(/px/,''));
/*if ('ltr' == 'rtl') dir = 'right';
else dir = 'left';*/
dir = 'right';
}
else {
divW = parseFloat(divs.height.replace(/px/,''));
divall = parseFloat(document.getElementById('scanpic2-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('scanpic2-film_strip_all').getAttribute('plus'));
var minus = parseInt(document.getElementById('scanpic2-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('scanpic2-curFilmPage').value);
if (str.charAt(0) == '-') {
if (minus == 0) {
var toMove = (cur + parseInt('4') - 1) % imgArr2.length;
var last = (toMove + imgArr2.length - 1) % imgArr2.length;
if ('down' == 'up' || 'down' == 'down' || 'down' == 'horizon') {
document.getElementById('scanpic2-film_strip_item'+toMove).style.right = (document.getElementById('scanpic2-film_strip_item'+last).style.right.replace(/px/,'')-inc)+'px';
}
else {
document.getElementById('scanpic2-film_strip_item'+toMove).style.top = (document.getElementById('scanpic2-film_strip_item'+last).style.top.replace(/px/,'')-inc)+'px';
}
}
else {
document.getElementById('scanpic2-film_strip_all').setAttribute('minus', minus-1);
document.getElementById('scanpic2-film_strip_all').setAttribute('plus', plus+1);
}
}
else if (str.charAt(0) == '+') {
if (plus == 0) {
var toMove = cur % imgArr2.length;
if (toMove < 0) toMove += imgArr2.length;
var last = (toMove + 1) % imgArr2.length;
if ('down' == 'up' || 'down' == 'down' || 'down' == 'horizon') {
document.getElementById('scanpic2-film_strip_item'+toMove).style.right = (document.getElementById('scanpic2-film_strip_item'+last).style.right.replace(/px/,'')-inc)+'px';
}
else {
document.getElementById('scanpic2-film_strip_item'+toMove).style.top = (document.getElementById('scanpic2-film_strip_item'+last).style.top.replace(/px/,'')-inc)+'px';
}
}
else {
document.getElementById('scanpic2-film_strip_all').setAttribute('minus', minus+1);
document.getElementById('scanpic2-film_strip_all').setAttribute('plus', plus-1);
}
}
var speed;
if ('down' == 'up' || 'down' == 'down' || 'down' == 'horizon') speed = curMaxFilmWidth2/10;
else speed = curMaxFilmHeight2/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('scanpic2-onGoing').value = 'going';
//setDivOffset2('scanpic2-film_strip_move', dir, speed, pxInc, hSpeed, to, toInc);
window.setTimeout("setDivOffset2('scanpic2-film_strip_move','"+dir+"', "+speed+", "+pxInc+", "+hSpeed+", "+to+", "+toInc+", "+size+")",to);
if ('film' == 'onlyfilm') {
if ('light_box' == 'popup' || '' == 'popup') {
var current,position;
var PUplusPos = parseInt(document.getElementById('scanpic2-film_strip_all').getAttribute('PUplusPos'));
var PUminusPos = parseInt(document.getElementById('scanpic2-film_strip_all').getAttribute('PUminusPos'));
var PUplusIndex = parseInt(document.getElementById('scanpic2-film_strip_all').getAttribute('PUplusIndex'));
var PUminusIndex = parseInt(document.getElementById('scanpic2-film_strip_all').getAttribute('PUminusIndex'));
if (str.charAt(0) == '-') {
PUminusPos++;
PUminusPos = PUminusPos % parseInt('4');
PUplusPos++;
PUplusPos = PUplusPos % parseInt('4');
position = PUminusPos;
PUminusIndex++;
PUminusIndex = PUminusIndex % imgArr2.length;
current = PUminusIndex;
PUplusIndex++;
PUplusIndex = PUplusIndex % imgArr2.length;
document.getElementById('scanpic2-film_strip_all').setAttribute('PUminusPos',PUminusPos);
document.getElementById('scanpic2-film_strip_all').setAttribute('PUplusPos', PUplusPos);
document.getElementById('scanpic2-film_strip_all').setAttribute('PUminusIndex', PUminusIndex);
document.getElementById('scanpic2-film_strip_all').setAttribute('PUplusIndex', PUplusIndex);
}
else {
PUminusPos--;
if (PUminusPos < 0) PUminusPos += parseInt('4');
PUplusPos--;
if (PUplusPos < 0) PUplusPos += parseInt('4');
position = PUplusPos;
PUminusIndex--;
if (PUminusIndex < 0) PUminusIndex += imgArr2.length;
PUplusIndex--;
if (PUplusIndex < 0) PUplusIndex += imgArr2.length;
current = PUplusIndex;
document.getElementById('scanpic2-film_strip_all').setAttribute('PUminusPos',PUminusPos);
document.getElementById('scanpic2-film_strip_all').setAttribute('PUplusPos', PUplusPos);
document.getElementById('scanpic2-film_strip_all').setAttribute('PUminusIndex', PUminusIndex);
document.getElementById('scanpic2-film_strip_all').setAttribute('PUplusIndex', PUplusIndex);
}
var img = document.getElementById('scanpic2-film_strip_img'+current);
var src = img.src;
img.setAttribute('popup_position', position);
var popup_img = document.getElementById('scanpic2-popup_img'+position);
popup_img.src = src.replace(/\/info\/gallery\/immamsrabbies\/scanpic2\//,"");
}
else if ('light_box' == 'resizing' || '' == 'resizing') {
var current,position;
var RplusPos = parseInt(document.getElementById('scanpic2-film_strip_all').getAttribute('RplusPos'));
var RminusPos = parseInt(document.getElementById('scanpic2-film_strip_all').getAttribute('RminusPos'));
var RplusIndex = parseInt(document.getElementById('scanpic2-film_strip_all').getAttribute('RplusIndex'));
var RminusIndex = parseInt(document.getElementById('scanpic2-film_strip_all').getAttribute('RminusIndex'));
if (str.charAt(0) == '-') {
RminusPos++;
RminusPos = RminusPos % parseInt('4');
RplusPos++;
RplusPos = RplusPos % parseInt('4');
position = RminusPos;
RminusIndex++;
RminusIndex = RminusIndex % imgArr2.length;
current = RminusIndex;
RplusIndex++;
RplusIndex = RplusIndex % imgArr2.length;
document.getElementById('scanpic2-film_strip_all').setAttribute('RminusPos',RminusPos);
document.getElementById('scanpic2-film_strip_all').setAttribute('RplusPos', RplusPos);
document.getElementById('scanpic2-film_strip_all').setAttribute('RminusIndex', RminusIndex);
document.getElementById('scanpic2-film_strip_all').setAttribute('RplusIndex', RplusIndex);
}
else {
RminusPos--;
if (RminusPos < 0) RminusPos += parseInt('4');
RplusPos--;
if (RplusPos < 0) RplusPos += parseInt('4');
position = RplusPos;
RminusIndex--;
if (RminusIndex < 0) RminusIndex += imgArr2.length;
RplusIndex--;
if (RplusIndex < 0) RplusIndex += imgArr2.length;
current = RplusIndex;
document.getElementById('scanpic2-film_strip_all').setAttribute('RminusPos',RminusPos);
document.getElementById('scanpic2-film_strip_all').setAttribute('RplusPos', RplusPos);
document.getElementById('scanpic2-film_strip_all').setAttribute('RminusIndex', RminusIndex);
document.getElementById('scanpic2-film_strip_all').setAttribute('RplusIndex', RplusIndex);
}
var img = document.getElementById('scanpic2-film_strip_img'+current);
var src = img.src;
img.setAttribute('resize_position', position);
var resize_img = document.getElementById('scanpic2-resizing_img'+position);
resize_img.src = src.replace(/\/info\/gallery\/immamsrabbies\/scanpic2\//,"");
}
}
var moveStatus = document.getElementById('scanpic2-film_strip_move').getAttribute('run');
if (moveStatus && moveStatus == 'r') {
runFilm2(str);
}
}
function runFilm2(str) {
//var moveStatus = document.getElementById('scanpic2-film_strip_move').getAttribute('run');
//if (moveStatus && moveStatus == 'r') {
if (document.getElementById('scanpic2-onGoing').value) {
window.setTimeout("runFilm2('"+str+"');",200);
return;
}
window.setTimeout("nextFilmPage2('"+str+"');",200);
//}
}
function stopFilm2() {
document.getElementById('scanpic2-film_strip_move').setAttribute('run','');
}
function setDivOffset2(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("setDivOffsetFinish2('"+id+"','"+dir+"', "+speed+", "+inc+", "+middle+", "+to+", "+toInc+", "+finalPx+")",to);
}
else {
if (speed == middle) ;
else if (speed > middle) to -= toInc;
else to += toInc;
window.setTimeout("setDivOffset2('"+id+"','"+dir+"', "+speed+", "+inc+", "+middle+", "+to+", "+toInc+", "+finalPx+")",to);
}
return;
}
else {
document.getElementById('scanpic2-onGoing').value = '';
}
}
function setDivOffsetFinish2(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("setDivOffsetFinish2('"+id+"','"+dir+"', "+speed+", "+inc+", "+middle+", "+to+", "+toInc+", "+finalPx+")",to);
return;
}
else {
if (finalPx != parseFloat(elem[dir])) elem[dir] = finalPx+'px';
document.getElementById('scanpic2-onGoing').value = '';
}
}
// ************** getNextPage ******************* //
function getNextPage2(str, putPageNum, firstTime) {
document.getElementById('scanpic2-pageDone').value = 'work';
if (str == 'last' && document.getElementById('scanpic2-curPage').value == (Math.ceil(imgArr2.length/num_per_page2)-1)) {
return;
}
else if (str == 'first' && document.getElementById('scanpic2-curPage').value == 0) {
return;
}
/*if (document.getElementById('scanpic2-onGoingNexPage').value) {
if (!str) str = '';
if (!putPageNum && putPageNum != 0) putPageNum = '';
setTimeout("getNextPage2('"+str+"', '"+putPageNum+"',"+firstTime+")",500);
return;
}*/
if ('' == 'popup' || 'light_box' == 'popup') {
for (i = 0 ; i < num_per_page2 ; i++) {
document.getElementById('scanpic2-popup'+i).style.display = 'none';
}
}
if ('light_box' == 'resizing' || '' == 'resizing') {
for (i = 0 ; i < num_per_page2 ; i++) {
document.getElementById('scanpic2-resizing'+i).style.display = 'none';
}
}
for (i = 0 ; i < num_per_page2 && i < imgArr2.length ; i++) {
document.getElementById('scanpic2-td_pics'+i).style.visibility = 'visible';
}
var origCurPage = document.getElementById('scanpic2-curPage').value;
if (putPageNum) document.getElementById('scanpic2-curPage').value = parseInt(putPageNum);
var curPage = document.getElementById('scanpic2-curPage').value;
var curIndex = curPage * num_per_page2;
if (str == 'last') {
document.getElementById('scanpic2-curPage').value = Math.ceil(imgArr2.length/num_per_page2)-1;
curPage = document.getElementById('scanpic2-curPage').value;
}
else if (str == 'first') {
document.getElementById('scanpic2-curPage').value = 0;
curPage = document.getElementById('scanpic2-curPage').value;
}
else if (str && str.search(/^[0-9]+$/) == 0) {
document.getElementById('scanpic2-curPage').value = str;
}
else if (str) {
( str.charAt(0) == '+' ? document.getElementById('scanpic2-curPage').value++ : document.getElementById('scanpic2-curPage').value--);
}
curPage = document.getElementById('scanpic2-curPage').value;
if(curPage==-1) {
document.getElementById('scanpic2-curPage').value = Math.ceil(imgArr2.length/num_per_page2)-1;
curPage = document.getElementById('scanpic2-curPage').value;
} {
if(curPage >= Math.ceil((imgArr2.length)/num_per_page2))
document.getElementById('scanpic2-curPage').value = 0;
curPage = document.getElementById('scanpic2-curPage').value;
}
if (curPage == origCurPage && !firstTime) return;
//CLEAR previous data
for (i = 0 ; i < num_per_page2 && i < imgArr2.length ; i++) {
for (k = 0 ; k < positions.length ; k++) {
if (positions[k] != 'center_center') {
document.getElementById('scanpic2-pics'+i+'_table_'+positions[k]).style.visibility = 'hidden';
document.getElementById('scanpic2-pics'+i+'_table_'+positions[k]).innerHTML = document.getElementById('scanpic2-pics'+i+'_table_'+positions[k]+'_value').value;
}
}
for (k = 0 ; k < icon_positions.length ; k++) {
if (icon_positions[k] != 'icon_center_center') {
document.getElementById('scanpic2-pics'+i+'_table_'+icon_positions[k]).style.visibility = 'hidden';
document.getElementById('scanpic2-pics'+i+'_table_'+icon_positions[k]).innerHTML = document.getElementById('scanpic2-pics'+i+'_table_'+icon_positions[k]+'_value').value;
}
}
}
curIndex = curPage * num_per_page2;
var target = '';
if ('' && 'light_box' == '') {
target = 'target=""';
}
currDivIndex2 = 0;
var i;
var onMouseOver, onMouseOut, onLoad, addStyle;
//run this lines in the end of load
runInTheEnd2 = '';
// CHECK if lock is released
//checkOnGoing(curIndex);
getNextPage2_2(curIndex,curIndex, firstTime);
}
function getNextPage2_2(i, curIndex, firstTime) {
var next = 1;
/*for (j=0;j");
for (var p=0; p';}
var re1 = new RegExp(field1);
var re2 = new RegExp(field2);
for (k = 0 ; k < positions.length ; k++) {
if (positions[k] != 'center_center') {
document.getElementById('scanpic2-pics'+currDivIndex2+'_table_'+positions[k]).innerHTML = document.getElementById('scanpic2-pics'+currDivIndex2+'_table_'+positions[k]).innerHTML.replace(re1,value);
document.getElementById('scanpic2-pics'+currDivIndex2+'_table_'+positions[k]).style.visibility = 'visible';
}
}
for (k = 0 ; k < icon_positions.length ; k++) {
if (icon_positions[k] != 'icon_center_center') {
document.getElementById('scanpic2-pics'+currDivIndex2+'_table_'+icon_positions[k]).innerHTML = document.getElementById('scanpic2-pics'+currDivIndex2+'_table_'+icon_positions[k]).innerHTML.replace(re2,value);
document.getElementById('scanpic2-pics'+currDivIndex2+'_table_'+icon_positions[k]).style.visibility = 'visible';
}
}
}
for (k = 0 ; k < icon_positions.length ; k++) {
var val = document.getElementById('scanpic2-pics'+currDivIndex2+'_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 = '';
}
} //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 && '400') divPictStyle = 'width: 400px; height: 400px';
divPictStyle = 'width: '+curImgArrW[i]+'px; height: '+curImgArrH[i]+'px';
divOnClick = '';
if (!onClick) divOnClick = 'onclick="location.href=\''+href+'\';"';
//else divOnClick = onClick;
var imgArr = imgArr2;
var src = '/info/gallery/immamsrabbies/scanpic2/'+imgArr[i];
if ('' == 'iome1' && document.getElementById('scanpic2-pics'+currDivIndex2+'_table_up_right').innerHTML != '') {
if (document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td') && document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').firstChild) {
innerH = '';
}
else {
if ('fade' == 'cover' || 'fade' == 'fadeZoom') addStyle = addStyle0;
innerH = '';
}
}
else {
if (document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td') && document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').firstChild) {
innerH = '';
}
else {
if ('fade' == 'cover' || 'fade' == 'fadeZoom') addStyle = addStyle0;
//addStyle = 'style="position: absolute; top: 0px; left: 0px;"';
innerH = '';
}
}
tmp_img = new Image();
tmp_img.onload=function() {
if (document.getElementById('scanpic2-divPict'+currDivIndex2)) {
var innerHTML = document.getElementById('scanpic2-divPict'+currDivIndex2).innerHTML;
document.getElementById('scanpic2-divPict'+currDivIndex2).firstChild.nextSibling.id = 'scanpic2-picture'+i;
document.getElementById('scanpic2-divPict'+currDivIndex2).firstChild.nextSibling.name = 'scanpic2-picture'+i;
document.getElementById('scanpic2-divPict'+currDivIndex2).firstChild.nextSibling.src = src;
document.getElementById('scanpic2-divPict'+currDivIndex2).firstChild.nextSibling.style.display = 'block';
}
if ('fade' == 'blindX' || 'fade' == 'blindY' || 'fade' == 'blindZ') {
if (document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td') && document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').firstChild) {
innerH = innerH.replace(/\'/g,""a;");
innerH = innerH.replace(/\"/g,""");
myId = document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').firstChild.firstChild.firstChild.id;
myId2 = document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').firstChild.firstChild.firstChild.nextSibling.id;
//blind2(startXPx/blindSpeed, startYPx/blindSpeed, blindSpeed, myId, myId2, i, curIndex, innerH, blindDir);
window.setTimeout("blind2("+(startXPx/blindSpeed)+", "+(startYPx/blindSpeed)+", "+blindSpeed+", '"+myId+"', '"+myId2+"', "+i+", "+curIndex+", '"+innerH+"', '"+blindDir+"')",50);
}
else {
document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').innerHTML = innerH;
innerH = innerH.replace(/\'/g,""a;");
innerH = innerH.replace(/\"/g,""");
//blind2(-startXPx/blindSpeed, -startYPx/blindSpeed, blindSpeed, 'picture'+i, '', i, curIndex, innerH, blindDir);
window.setTimeout("blind2("+(-startXPx/blindSpeed)+", "+(-startYPx/blindSpeed)+", "+blindSpeed+", 'scanpic2-picture"+i+"', '', "+i+", "+curIndex+", '"+innerH+"', '"+blindDir+"')",50);
}
}
else if ('fade' == 'cover') {
if (document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td') && document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').firstChild) {
innerH = innerH.replace(/\'/g,""a;");
innerH = innerH.replace(/\"/g,""");
myId = document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').firstChild.firstChild.firstChild.id;
myId2 = document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').firstChild.firstChild.firstChild.nextSibling.id;
//cover2(-startXPx/blindSpeed, startYPx/blindSpeed, blindSpeed, myId2, i, curIndex, innerH, blindDir);
window.setTimeout("cover2("+(-startXPx/blindSpeed)+", "+(startYPx/blindSpeed)+", "+blindSpeed+", '"+myId2+"', "+i+", "+curIndex+", '"+innerH+"', '"+blindDir+"')",50);
}
else {
document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').innerHTML = innerH;
innerH = innerH.replace(/\'/g,""a;");
innerH = innerH.replace(/\"/g,""");
//cover2(-startXPx/blindSpeed, -startYPx/blindSpeed, blindSpeed, 'picture'+i, i, curIndex, innerH, blindDir);
window.setTimeout("cover2("+(-startXPx/blindSpeed)+", "+(startYPx/blindSpeed)+", "+blindSpeed+", 'scanpic2-picture"+i+"', "+i+", "+curIndex+", '"+innerH+"', '"+blindDir+"')",50);
}
}
else if ('fade' == 'fadeZoom') {
if (document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td') && document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').firstChild) {
//other than first time page load
document.getElementById('scanpic2-divPict'+currDivIndex2).firstChild.nextSibling.id = 'scanpic2-picture'+i;
document.getElementById('scanpic2-divPict'+currDivIndex2).firstChild.nextSibling.name = 'scanpic2-picture'+i;
document.getElementById('scanpic2-divPict'+currDivIndex2).firstChild.nextSibling.src = src;
document.getElementById('scanpic2-divPict'+currDivIndex2).firstChild.nextSibling.style.left = startXPx+'px';
document.getElementById('scanpic2-divPict'+currDivIndex2).firstChild.nextSibling.style.top = startYPx+'px';
document.getElementById('scanpic2-divPict'+currDivIndex2).firstChild.nextSibling.style.width = '0px';
document.getElementById('scanpic2-divPict'+currDivIndex2).firstChild.nextSibling.style.height = '0px';
myId = document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').firstChild.firstChild.firstChild.id;
myId2 = document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').firstChild.firstChild.firstChild.nextSibling.id;
innerH = innerH.replace(/\'/g,""a;");
innerH = innerH.replace(/\"/g,""");
//fadeZoom2(-startXPx/blindSpeed, -startYPx/blindSpeed, blindSpeed, myId, myId2, i, curIndex, innerH);
window.setTimeout("fadeZoom2("+(-startXPx/blindSpeed)+", "+(-startYPx/blindSpeed)+", "+blindSpeed+", '"+myId+"', '"+myId2+"', "+i+", "+curIndex+", '"+innerH+"')",50);
}
else { //first time page load
document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').innerHTML = innerH;
try {
eval(run4Eachpicture);
} catch(e) {}
currDivIndex2++;
i++;
getNextPage2_2(i,curIndex,firstTime);
}
}
else if ('fade' == 'fade') {
var myId = ' ';
if (document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td') && document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').firstChild) {
myId = document.getElementById('scanpic2-pics'+currDivIndex2+'_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,""a;");
innerH = innerH.replace(/\"/g,""");
//fade2(-1/opacitySpeed, opacitySpeed, myId ,i, curIndex, innerH);
window.setTimeout("fade2("+(-0.8/opacitySpeed)+", "+opacitySpeed+", '"+myId+"', "+i+", "+curIndex+", '"+innerH+"')",50);
}
else {
document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').innerHTML = innerH;
document.getElementById('scanpic2-divPict'+currDivIndex2).firstChild.nextSibling.style.display = 'none';
if ('') document.getElementById('scanpic2-pics'+currDivIndex2).style.backgroundImage='';
try {
eval(run4Eachpicture);
} catch(e) {}
currDivIndex2++;
i++;
getNextPage2_2(i,curIndex,firstTime);
}
}
tmp_img.src = src;
} //main for
// release lock
else {
document.getElementById('scanpic2-onGoingNexPage').value = '';
getNextPage3_2();
}
}
function fade2(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("fade2("+inc+", "+index+", '"+id+"', "+i+", "+curIndex+", '"+innerH+"')",30);
}
else {
if (inc < 0) {
myId = 'scanpic2-picture'+i;
innerH1 = innerH.replace(/"/g,'"');
innerH1 = innerH1.replace(/"a;/g,"'");
imgArr = imgArr2;
tmp_img = new Image();
tmp_img.onload=function() {
window.setTimeout("fade2("+(0.8/opacitySpeed)+", "+opacitySpeed+", '"+myId+"', "+i+", "+curIndex+", '"+innerH+"')",50);
if (document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td'))
document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').innerHTML = innerH1;
}
tmp_img.src = '/info/gallery/immamsrabbies/scanpic2/'+imgArr[curIndex];
////if (document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td'))
////document.getElementById('scanpic2-pics'+currDivIndex2+'_table_td').innerHTML = innerH1;
////window.setTimeout("fade2("+(1/opacitySpeed)+", "+opacitySpeed+", '"+myId+"', "+i+", "+curIndex+", '"+innerH+"')",150);
//fade2(1/opacitySpeed, opacitySpeed, myId ,i, curIndex, innerH);
}
else {
try {
if ('') document.getElementById('scanpic2-pics'+currDivIndex2).style.backgroundImage='';
} catch (e) {}
try {
eval(run4Eachpicture);
} catch(e) {}
currDivIndex2++;
i++;
getNextPage2_2(i,curIndex, false);
}
}
}
function getNextPage3_2() {
//hide images div which are empty (not enough images on last page)
while ( currDivIndex2 < num_per_page2 && currDivIndex2 < imgArr2.length ) {
document.getElementById('scanpic2-td_pics'+currDivIndex2).style.visibility = 'hidden';
currDivIndex2++
}
if ('' == 'iome2') opacityPictures2();
document.getElementById('scanpic2-currentIndexResize').value = '';
document.getElementById('scanpic2-imageresize').value = '+';
if ('fade'.search(/enter_from_/) == 0) {
var re = new RegExp('enter_from_');
dir = 'fade'.replace(re,'');
ifseArray = ifseArray.reverse();
mainInsertFromSideEffect2(dir);
}
eval(runInTheEnd2);
if ('' || '') {
updatePageCounter2();
}
/*if ('checked' == '') {
updateControlPanel2();
}*/
ss = document.getElementById('scanpic2-slide_show');
var curPage = document.getElementById('scanpic2-curPage').value;
var start = num_per_page2 * curPage;
/*if (ss.value == 'r') {
window.setTimeout("getNextPage2('+');",3000);
}
else */
if ('light_box' == 'resizing' || '' == 'resizing') {
for (i = start ; i < start + num_per_page2 && i < imgArr2.length; i++) {
var img = document.getElementById('scanpic2-picture'+i);
var src = img.src;
var j = i - start;
var re_img = document.getElementById('scanpic2-resizing_img'+j);
re_img.src = src.replace(/\/info\/gallery\/immamsrabbies\/scanpic2\//,"");
}
}
else if ('light_box' == 'popup' || '' == 'popup') {
for (i = start ; i < start + num_per_page2 && i < imgArr2.length; i++) {
var img = document.getElementById('scanpic2-picture'+i);
var src = img.src;
var j = i - start;
var popup_img = document.getElementById('scanpic2-popup_img'+j);
popup_img.src = src.replace(/\/info\/gallery\/immamsrabbies\/scanpic2\//,"");
}
}
if (alowToEdit2 && '' != '1') {
for (i = 0 ; i < num_per_page2 && i < imgArr2.length ; i++) {
var div = document.getElementById('scanpic2-pics'+i);
var div1 = document.createElement('DIV');
var div2 = document.createElement('DIV');
var imgArr = imgArr2;
div1.id = 'scanpic2-1ca'+i;
div1.style.position = 'relative';
div1.style.height = '24px';
div1.style.top = '-24px';
div1.style.backgroundColor = '#000000';
div2.id = 'scanpic2-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('scanpic2-1ca'+i));
div.removeChild(document.getElementById('scanpic2-2ca'+i));
} catch(e){}
var index = i + start;
div2.innerHTML = '' +
'';
div.appendChild(div1);
div.appendChild(div2);
}
/*for (i = 0 ; i < num_per_page2 && i < imgArr2.length ; i++) {
var div = document.getElementById('scanpic2-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 = imgArr2;
newCell.innerHTML = '' +
'';
if (document.getElementById(id)) div.removeChild(document.getElementById(id));
div.appendChild(tb);
} */
}
document.getElementById('scanpic2-pageDone').value = '';
}
function updateControlPanel2() {
var pages = Math.ceil(imgArr2.length/num_per_page2);
var curP = parseInt(document.getElementById('scanpic2-curPage').value);
curP++;
var firstP = document.getElementById('scanpic2-firstpage');
var lastP = document.getElementById('scanpic2-lastpage');
//var prvP = document.getElementById('scanpic2-prvpage');
//var nxtP = document.getElementById('scanpic2-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 getPosition2(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 getSize2() {
// Window Size
if (self.innerHeight) { // Everyone but IE
myWidth2 = window.innerWidth;
myHeight2 = window.innerHeight;
myScroll2 = window.pageYOffset;
} else if (document.documentElement && document.documentElement.clientHeight) { // IE6 Strict
myWidth2 = document.documentElement.clientWidth;
myHeight2 = document.documentElement.clientHeight;
myScroll2 = document.documentElement.scrollTop;
} else if (document.body) { // Other IE, such as IE7
myWidth2 = document.body.clientWidth;
myHeight2 = document.body.clientHeight;
myScroll2 = document.body.scrollTop;
}
// Page size w/offscreen areas
if (window.innerHeight && window.scrollMaxY) {
myScrollWidth2 = document.body.scrollWidth;
myScrollHeight2 = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac
myScrollWidth2 = document.body.scrollWidth;
myScrollHeight2 = document.body.scrollHeight;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
myScrollWidth2 = document.body.offsetWidth;
myScrollHeight2 = document.body.offsetHeight;
}
}
function runFirst2() {
document.getElementById('scanpic2-curPage').value = 0;
document.getElementById('scanpic2-curFullIndex').value = 0;
document.getElementById('scanpic2-curFilmPage').value = 0;
getSize2();
var href = location.href;
var index = href.indexOf("pict=");
var getPage = '';
var isFirst = true;
//setTimeout("loadImages2();", 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 )
alowToEdit2 = 1;
}
if (alowToEdit2 && '' != '1') {
var caRow = document.getElementById('scanpic2-main_table').insertRow(-1);
var caCell = caRow.insertCell(-1);
caCell.align = 'center';
caCell.innerHTML = '';
}
}
// 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 = imgArr2;
for (i = 0 ; i < imgArr2.length ; i++) {
if (imgArr[i] == pict) {getPage = i;isFirst=true;}
}
getPage += '';
}
//set last arrow function
var num_of_pages = Math.ceil(imgArr2.length/num_per_page2)-1;
var scaling_value = 400;
if ('checked' == '') {
fullSD = document.getElementById('scanpic2-fullScreenDiv');
//fullSD.innerHTML = fullSD.innerHTML + '