/*
LaudaView
*/

var t = 200;  //timing de cada página (ms)
var buttondelay = 100; //button delay (ms)
var changingSize = false;
var wrap_around = false;
var sizes = [];
sizes[0] = 668;
sizes[1] = 800;
var page0content = '<div style="text-align:left;margin:0px;padding:1em;width:90%;heigth:100%"><p class="intro1">Instruções de utilização</p>\
	<p class="intro2"><strong>Virar páginas </strong><br />\
	Pode folhear a publicação usando os botões laterais circulares ou as setas na barra de navegação.</p>\
	<p class="intro2"><strong>Ampliar e mover</strong><br />\
	Para leitura das páginas clique sobre o texto, fotografias ou o contorno dos anúncios. <br />\
	Quando ampliada a página, clique e segure o cursor para mover a página\
	, no canto inferior direito pode avançar, recuar ou reduzir.</p>\
	<p class="intro2"><strong>Índice </strong><br />\
	Permite visualizar amostras de todas as páginas, pode aceder directamente a qualquer página.</p>\
	<p class="intro2"><strong>Arquivo </strong><br />Permite visualizar e aceder a outras publicações relacionadas.</p>\
	<p class="intro2"><strong>PDF </strong><br />\
	Pode fazer o download da publicação em formato PDF para imprimir ou enviar por correio electrónico.</p>\
	<div>';
//dont change

var pages = [];
var limit;
var currentSize = 0;
var h; // window heigth
var r;
var l;
var nr;
var pl;


// Initialize ShadowBox
	var sboptions = {
		loadingImage:		'images/loading.gif',
		animate:			false,
        resizeLgImages:     false,
		handleLgImages:		'drag',
        displayNav:         true,
        handleUnsupported:  'remove',
        keysClose:          ['c', 27], // c or esc
        autoplayMovies:     false,
		viewportPadding:	0,
		overlayOpacity:     0.8
	
    };

function Pad(n, totalDigits){ 
	n = n.toString();
	var pd = '';
	if (totalDigits > n.length){
		for (i=0; i < (totalDigits-n.length); i++){
			pd += '0';
		}
	}
	return pd + n.toString();
};

// find size
function findSize(){
	if (typeof(window.innerHeigth) == 'number') {
		// not IE
		h = window.innerHeight;
	}
	else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
		// IE 7
		h = document.documentElement.clientHeight;
	}
	else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		// IE 6
		h = document.body.clientHeight;
	}
	if (h < sizes[0]) return 1;
	if ((h >=sizes[0]) && (h < sizes[1])) return 2;
	if (h >= sizes[1]) return 3;
}

// stack
function buildStackPages(size){	// martelada
	pages.splice(0,pages.length);
	pages[0] = page0content;
	pages[1] = '<a href="magazine/zoom/z-00-01.jpg" class="shadowbox" rel="shadowbox[ZoomImages];options={counterType:\'skip\',continuous:true,animate:false}"><img src="magazine/size' + size + '/s' + size + '-01.jpg" width="100%" height="100%" /></a>';
	var ii = 2;
	while (ii <= totalpages) {
		//pages[ii] = '<a href="magazine/zoom/z-' + Pad(ii, 2) + '_' + Pad(ii + 1, 2) + '.jpg" class="shadowbox" rel="shadowbox[ZoomImages];options={counterType:\'skip\',continuous:true,animate:false}"><img src="magazine/size' + size + '/s' + size + '-' + Pad(ii, 2) + '.jpg" width="100%" height="100%" /></a>';
		pages[ii] = '<a href="magazine/zoom/z-' + Pad(ii, 2) + '-' + Pad(ii + 1, 2) + '.jpg" class="shadowbox" rel="shadowbox[ZoomImages];options={counterType:\'skip\',continuous:true,animate:false}"><img class="loader" src="images/ajax-loader.gif" style="position: absolute;z-index: 2;top: 45%;left: 50%;"><img class="pag" src="images/empty.gif" width="100%" height="100%" /></a>';
		if (ii != totalpages) pages[ii + 1] = '<a href="magazine/zoom/z-' + Pad(ii, 2) + '-' + Pad(ii + 1, 2) + '.jpg" class="shadowbox" rel="shadowbox[ZoomImages];options={counterType:\'skip\',continuous:true,animate:false}"><img class="loader" src="images/ajax-loader.gif" style="position: absolute;z-index: 2;top: 45%;left: 50%;"><img class="pag" src="images/empty.gif" width="100%" height="100%" /></a>';
		ii = ii + 2;
	};
	limit = pages.length;
}
function navigate(evt){
	
    if (!evt) 
        evt = window.event;
	var target = evt.target || evt.srcElement;
    if (evt.preventDefault) 
        evt.preventDefault();
    evt.stopPropagation();
    evt.cancelBubble = true;
	window.open(target.getAttribute("url"));
    return false;
    
}
function buildStack(){
	$("#pageflip > *:not(#holder):not(#sobre):not(#ajuda):not(#arquivo)").remove();
	for (var i = 0; i <= (limit - 1); i++) {
		var newpage = "";
		if (!(i % 2) || i == 0) { // Even Pages
			newpage = '<div id="left' + i + '" class="leftpage" style="z-index:' + (300 + i) + ';">';
			newpage += pages[i];
			newpage += '</div>';
			$("#pageflip").append(newpage);
			if (i == 0) {
				$("#left0").css("width", "50%").show()
			};
		}
		else { // Odd Pages
			newpage = '<div id="right' + i + '" class="rightpage" style="z-index:' + (300 - i) + ';">';
			newpage += pages[i];
			newpage += '</div>';
			$("#pageflip").append(newpage);
			if (i == 1) {
				$("#right1").show()
			};
		};
	};
}

// index
var thumbs =[]; // mais martelada
var ii = 0;
/*<ul style=
        "list-style-type: none; list-style-image: none; list-style-position: outside;">
            <li style=
            "display: inline; color: white; float: left;">
                <div style=
                "float: left; position: relative; width: 63px;">
                    <a href="javascript:setPage(0);"><img alt=""
                    src="magazine/thumbs/t-00_01.jpg"></a>

                    <div style=
                    "float: right; clear: left; padding-right: 30px;">
                        1
                    </div>
                </div>
				<div style="width: 20px; float: left;"></div>
            </li>

 * 
 * 
 */
while (ii <= totalpages) {
	var x = thumbs.length;
	thumbs[x] = '<li style="display: inline; color: white; float: left;">';
	if (ii == 0 || ii==totalpages) {
		thumbs[x] += '<div style="float: left; position: relative; width: 66px;">';
	}
	else {
		thumbs[x] += '<div style="float: left; position: relative; width: 132px;">';
	}
	thumbs[x] += '<a href="javascript:setPage(' + ii + ');"><img src="magazine/thumbs/t-' + Pad(ii, 2) + '-' + Pad(ii + 1, 2) + '.jpg" /></a>';
	if (ii != 0 && ii != totalpages) {
		thumbs[x] += '<div style= "float: right; clear: left; padding-right: 30px;padding-top: 5px;">' + (ii + 1) + '</div>';
		thumbs[x] += '<div style= "float: left; clear: left; padding-left: 30px;padding-top: 5px;">' + (ii) + '</div>';
	} else if (ii == 0) {
		thumbs[x] += '<div style= "float: right; clear: left; padding-right: 30px;padding-top: 5px;">' + (ii + 1) + '</div>';		
	} else {
		thumbs[x] += '<div style= "float: right; clear: left; padding-right: 30px;padding-top: 5px;">' + (ii) + '</div>';		
	}
	

	if (thumbs_ind[ii]) {
		thumbs[x] += '<div style="clear: both;" class="indexItem">'+thumbs_ind[ii]+'</div>';
	}
		thumbs[x] += '</div><div style="width: 20px; float: left;"></div></li>';
	ii = ii + 2;
}

// delay function
function pause(ms) {
	var date = new Date();
	var curDate = null;
	do { curDate = new Date(); }
	while(curDate-date < ms);
};

// change size handler
function change_size(){
	changingSize = true;
	var s = findSize();
	if (s != currentSize) {
		buildStackPages(s);
		buildStack();
		if (s == 1) {$("#pageflip").attr("class", "size1");};
		if (s == 2) {$("#pageflip").attr("class", "size2");};
		if (s == 3) {$("#pageflip").attr("class", "size3");};
		currentSize = s;
		setPage(currentpage);
		Shadowbox.clearCache();
		Shadowbox.setup($("#pageflip a.shadowbox"));
	};
	changingSize = false;
};

function toggleArquivo(){
	$("#holder").fadeOut();
	$("#sobre").fadeOut();
	$("#ajuda").fadeOut();
	$("#arquivo").toggleFade();
};
function toggleIndex(){
	$("#arquivo").fadeOut();
	$("#sobre").fadeOut();
	$("#ajuda").fadeOut();
	$("#holder").toggleFade();
};
function toggleSobre(){
	$("#arquivo").fadeOut();
	$("#holder").fadeOut();
	$("#ajuda").fadeOut();
	$("#sobre").toggleFade();
};
function toggleAjuda(){
	$("#arquivo").fadeOut();
	$("#holder").fadeOut();
	$("#sobre").fadeOut();
	$("#ajuda").toggleFade();
};
function fadeOutAll() {
	$("#arquivo").fadeOut();
	$("#holder").fadeOut();
	$("#sobre").fadeOut();
	$("#ajuda").fadeOut();
};

function fillPageNumber(page){
	if (page == 0) { $("#pagenumber").html(page + 1); }
	else if (page == totalpages) { $("#pagenumber").html(page); }
	else { $("#pagenumber").html(page + ' - ' + (page + 1)); }
};
function loadAdds(page,callback) {
    var idleft = '#left' + page;
	var idright = '#right' + (page + 1);
    if (!$(idleft).attr('loaded')) {
        $.ajax({
            url: "lib/anuncios.php?page=" + page,
            cache: false,
            success: function(html){
                $(idleft).append(html);
                $(idleft).attr('loaded', 'true');
                if ($(idright)[0]) {
                    if (!$(idright).attr('loaded')) {
                        $.ajax({
                            url: "lib/anuncios.php?page=" + (page + 1),
                            cache: false,
                            success: function(html){
                                $(idright).append(html);
                                $(idright).attr('loaded', 'true');
                                if ($(idleft + " a")[0]) {
                                    var images = $(idleft + ' > img:not(.shadowbox)');
                                    if (images.length > 0) {
                                        for (var x = 0; x < images.length; x++) {
                                            if (!$(idleft + " a")[0].links) {
                                                $(idleft + " a")[0].links = [];
                                            }
                                            $(idleft + " a")[0].links[$(idleft + " a")[0].links.length] = {
                                                top: images[x].offsetTop,
                                                left: images[x].offsetLeft,
                                                width: images[x].offsetWidth,
                                                height: images[x].offsetHeight,
												action: images[x].getAttribute("onclick"),
												url:  images[x].getAttribute("url") 												
												
                                            };
                                        }
                                    }
                                    if ($(idleft + " a")[0].links) {
                                        $(idright + " a")[0].links = $(idleft + " a")[0].links;
                                    }
                                    var images = $(idright + ' > img:not(.shadowbox)');
                                    if (images.length > 0) {
                                        for (var x = 0; x < images.length; x++) {
                                            if (!$(idright + " a")[0].links) {
                                                $(idright + " a")[0].links = [];
                                            }
                                            $(idright + " a")[0].links[$(idright + " a")[0].links.length] = {
                                                top: images[x].offsetTop,
                                                left: images[x].offsetLeft + $(idleft)[0].offsetWidth,
                                                width: images[x].offsetWidth,
                                                height: images[x].offsetHeight,
												action: images[x].getAttribute("onclick"),
												url:  images[x].getAttribute("url") 												
                                            };
                                        }
                                    }
                                    if ($(idright + " a")[0].links) {
                                        $(idleft + " a")[0].links = $(idright + " a")[0].links;
                                    }
                                    $(idleft + " a")[0].originalWidth = $(idleft)[0].offsetWidth + $(idright)[0].offsetWidth;
                                    $(idright + " a")[0].originalWidth = $(idleft)[0].offsetWidth + $(idright)[0].offsetWidth;
                                    $(idleft + " a")[0].originalHeight = $(idleft)[0].offsetHeight;
                                    $(idright + " a")[0].originalHeight = $(idright)[0].offsetHeight;
                                } else {
                                    var images = $(idright + ' > img:not(.shadowbox)');
                                    if (images.length > 0) {
                                        for (var x = 0; x < images.length; x++) {
                                            if (!$(idright + " a")[0].links) {
                                                $(idright + " a")[0].links = [];
                                            }
                                            $(idright + " a")[0].links[$(idright + " a")[0].links.length] = {
                                                top: images[x].offsetTop,
                                                left: images[x].offsetLeft,
                                                width: images[x].offsetWidth,
                                                height: images[x].offsetHeight,
												action: images[x].getAttribute("onclick"),
												url:  images[x].getAttribute("url") 												
                                            };
                                        }
                                    }
                                    $(idright + " a")[0].originalWidth = $(idright)[0].offsetWidth;
                                    $(idright + " a")[0].originalHeight = $(idright)[0].offsetHeight;
                                    
                                }
							if(callback)	
								callback();
                            }
                        });
                    }
                }
                else {
                    var images = $(idleft + ' > img:not(.shadowbox)');
                    if (images.length > 0) {
                        for (var x = 0; x < images.length; x++) {
                            if (!$(idleft + " a")[0].links) {
                                $(idleft + " a")[0].links = [];
                            }
                            $(idleft + " a")[0].links[$(idleft + " a")[0].links.length] = {
                                top: images[x].offsetTop,
                                left: images[x].offsetLeft,
                                width: images[x].offsetWidth,
                                height: images[x].offsetHeight,
								action: images[x].getAttribute("onclick"),
								url:  images[x].getAttribute("url") 												
                            };
                        }
                    }
                    $(idleft + " a")[0].originalWidth = $(idleft)[0].offsetWidth;
                    $(idleft + " a")[0].originalHeight = $(idleft)[0].offsetHeight;
					if(callback)
					 callback();
                }
            }
        });
    } else {
		if(callback)	
			callback();
                            
	}
}
function setPage(page,callback){
	if ((page == currentpage) && !changingSize) {
		return;
	}
	else {
		var idleft = '#left' + page;
		var idright = '#right' + (page + 1);
		var idleft2 = '#left' + (page + 2);
		var idright2 = '#right' + (page + 3);
		$("#pageflip > *:not(#holder):not(#sobre):not(#ajuda):not(#arquivo)").hide();
		if ($(idleft + ' a img.pag')[0]) {
			$(idleft + ' a img.pag')[0].onload = function(){
				if ($(idleft + ' a img.loader')[0]) {
					$(idleft + ' a img.loader')[0].parentNode.removeChild($(idleft + ' a img.loader')[0]);
				}
			};
		}
		$(idleft + ' a img.pag').attr('src','magazine/size' + currentSize + '/s' + currentSize + '-' + Pad(page, 2) + '.jpg');		
		if ($(idright + ' a img.pag')[0]) {
			$(idright + ' a img.pag')[0].onload = function(){
				if ($(idright + ' a img.loader')[0]) {
					$(idright + ' a img.loader')[0].parentNode.removeChild($(idright + ' a img.loader')[0]);
				}
			};
		}
		$(idright + ' a img.pag').attr('src','magazine/size' + currentSize + '/s' + currentSize + '-' + Pad((page + 1), 2) + '.jpg');

		$(idleft).css("width","50%").show();
		$(idright).css("width","50%").show();
		if ($(idleft2 + ' a img.pag')[0]) {
			$(idleft2 + ' a img.pag')[0].onload = function(){
				if ($(idleft2 + ' a img.loader')[0]) {
					$(idleft2 + ' a img.loader')[0].parentNode.removeChild($(idleft2 + ' a img.loader')[0]);
				}
			};
		}
		$(idleft2 + ' a img.pag').attr('src','magazine/size' + currentSize + '/s' + currentSize + '-' + Pad((page + 2), 2) + '.jpg');
		if ($(idright2 + ' a img.pag')[0]) {
			$(idright2 + ' a img.pag')[0].onload = function(){
				if ($(idright2 + ' a img.loader')[0]) {
					$(idright2 + ' a img.loader')[0].parentNode.removeChild($(idright2 + ' a img.loader')[0]);
				}
			};
		}
		$(idright2 + ' a img.pag').attr('src','magazine/size' + currentSize + '/s' + currentSize + '-' + Pad((page + 3), 2) + '.jpg');
		currentpage = page;
		$("#holder").fadeOut();
		fillPageNumber(currentpage);
		if(callback)
			loadAdds(currentpage,callback);
		else
			loadAdds(currentpage,callback);			
	};
};

$(document).ready(function(){

	MM_preloadImages('images/navbarc.jpg','images/but-left-on.jpg','images/but-right-on.jpg','images/arquivo-on.jpg','images/indice-on.jpg','images/pdf-on.jpg','images/setaleft-on.jpg','images/setaright-on.jpg','images/sobre-on.jpg','images/ajuda-on.jpg','images/navbar-z-left-off.gif','images/navbar-z-right-off.gif','images/navbar-z-close-off.gif','images/navbar-z-left-on.gif','images/navbar-z-right-on.gif','images/navbar-z-close-on.gif','images/transparent.gif','images/ajax-loader.gif','images/loading.gif');

// Initialize
	Shadowbox.init(sboptions);
	var isFliping = false;	// bitoque detect
	change_size();  // sets size when page loads
	window.onresize = change_size;  // sets resize handler. Important: without "()"
	fillPageNumber(currentpage);

// Event Handlers

	// Index button
	$("#button_index").click(toggleIndex);
	
	// Sobre button
	$("#button_sobre").click(toggleSobre);
	
	// Ajuda button
	$("#button_ajuda").click(toggleAjuda);
	
	// Arquivo button
	$("#button_arquivo").click(toggleArquivo);
	
	// next and previous buttons
	$(".button_next").click(function(){
		fadeOutAll();
		if (isFliping) return;	// Does nothing if fliping
		if ((currentpage + 3) > limit) {	// if last page
			if (wrap_around) {				// wrap_around = true
				setPage(0);
				return;
			} else {
				return;						// wrap_around = false
			}
		}
		isFliping = true;
		r = $("#right" + (currentpage + 1));	//Selectors
		l = $("#left" + (currentpage + 2));
		nr = $("#right" + (currentpage + 3));
		pl = $("#left" + currentpage);        
		var idnr = '#right' + (currentpage + 3);
		var idl = '#left' + (currentpage + 2);
		//if (!((currentpage + 5) > limit)) {
			var idnr2 = '#right' + (currentpage + 5);
			var idl2 = '#left' + (currentpage + 4);
		//};
		// animate
		nr.css("width","50%").show();
		l.css("width","0px");
		r.animate({width:0},t,"easeInSine",function(){
			l.animate({width: "50%"},t,"easeOutSine",function(){
				if ($(idnr + ' a img.pag')[0]) {
					$(idnr + ' a img.pag')[0].onload = function(){
						if ($(idnr + ' a img.loader')[0]) {
							$(idnr + ' a img.loader')[0].parentNode.removeChild($(idnr + ' a img.loader')[0]);
						}
					};
				}			
				$(idnr + ' a img.pag').attr('src','magazine/size' + currentSize + '/s' + currentSize + '-' + Pad((currentpage + 3), 2) + '.jpg');
				if ($(idl + ' a img.pag')[0]) {
					$(idl + ' a img.pag')[0].onload = function(){
						if ($(idl + ' a img.loader')[0]) {
							$(idl + ' a img.loader')[0].parentNode.removeChild($(idl + ' a img.loader')[0]);
						}
					};
				}			
				$(idl + ' a img.pag').attr('src','magazine/size' + currentSize + '/s' + currentSize + '-' + Pad((currentpage + 2), 2) + '.jpg');
				if ($(idnr2 + ' a img.pag')[0]) {
					$(idnr2 + ' a img.pag')[0].onload = function(){
						if ($(idnr2 + ' a img.loader')[0]) {
							$(idnr2 + ' a img.loader')[0].parentNode.removeChild($(idnr2 + ' a img.loader')[0]);
						}
					};
				}		
				$(idnr2 + ' a img.pag').attr('src','magazine/size' + currentSize + '/s' + currentSize + '-' + Pad((currentpage + 5), 2) + '.jpg');
				if ($(idl2 + ' a img.pag')[0]) {
					$(idl2 + ' a img.pag')[0].onload = function(){
						if ($(idl2 + ' a img.loader')[0]) {
							$(idl2 + ' a img.loader')[0].parentNode.removeChild($(idl2 + ' a img.loader')[0]);
						}
					};
				}		
				$(idl2 + ' a img.pag').attr('src','magazine/size' + currentSize + '/s' + currentSize + '-' + Pad((currentpage + 4), 2) + '.jpg');
				currentpage += 2;
				r.hide();
				pl.hide();
				r = null;
				l = null;
				nr = null;
				pl = null;
				isFliping = false;
				fillPageNumber(currentpage);
				loadAdds(currentpage);				
			});  //end of callback
		});
		return false;
	});
	
	$(".button_previous").click(function(){
		fadeOutAll();
		if (isFliping) return;	// Does nothing if fliping
		if (currentpage == 0) {	// if first page
			if (wrap_around) {				// wrap_around = true
				setPage(totalpages);
				return;
			} else {
				return;						// wrap_around = false
			}
		}
		if ((currentpage == 0) || isFliping) return;	// Does nothing if first page or fliping
		isFliping = true;
		r = $("#right" + (currentpage - 1));	//Selectors
		l = $("#left" + (currentpage));
		nr = $("#right" + (currentpage + 1));
		pl = $("#left" + (currentpage - 2));        
		var idpl = '#left' + (currentpage - 2);
		var idr = '#right' + (currentpage - 1);
		//if (!((currentpage - 4) <= 0)) {
			var idpl2 = '#left' + (currentpage - 4);
			var idr2 = '#right' + (currentpage - 3);
		//};
		// animate
		pl.css("width","50%").show();
		r.css("width","0px");
		l.animate({width:0},t,"easeInSine",function(){
			r.animate({width: "50%"},t,"easeOutSine",function(){
				if ($(idpl + ' a img.pag')[0]) {
					$(idpl + ' a img.pag')[0].onload = function(){
						if ($(idpl + ' a img.loader')[0]) {
							$(idpl + ' a img.loader')[0].parentNode.removeChild($(idpl + ' a img.loader')[0]);
						}
					};
				}
				$(idpl + ' a img.pag').attr('src','magazine/size' + currentSize + '/s' + currentSize + '-' + Pad((currentpage - 2), 2) + '.jpg');				
				if ($(idpl2 + ' a img.pag')[0]) {
					$(idpl2 + ' a img.pag')[0].onload = function(){
						if ($(idpl2 + ' a img.loader')[0]) {
							$(idpl2 + ' a img.loader')[0].parentNode.removeChild($(idpl2 + ' a img.loader')[0]);
						}
					};
				}	
				$(idpl2 + ' a img.pag').attr('src','magazine/size' + currentSize + '/s' + currentSize + '-' + Pad((currentpage - 4), 2) + '.jpg');
				if ($(idr + ' a img.pag')[0]) {
					$(idr + ' a img.pag')[0].onload = function(){
						if ($(idr + ' a img.loader')[0]) {
							$(idr + ' a img.loader')[0].parentNode.removeChild($(idr + ' a img.loader')[0]);
						}
					};
				}		
				$(idr + ' a img.pag').attr('src','magazine/size' + currentSize + '/s' + currentSize + '-' + Pad((currentpage - 1), 2) + '.jpg');				
				if ($(idr2 + ' a img.pag')[0]) {
					$(idr2 + ' a img.pag')[0].onload = function(){
						if ($(idr2 + ' a img.loader')[0]) {
							$(idr2 + ' a img.loader')[0].parentNode.removeChild($(idr2 + ' a img.loader')[0]);
						}
					};
				}	
				$(idr2 + ' a img.pag').attr('src','magazine/size' + currentSize + '/s' + currentSize + '-' + Pad((currentpage - 3), 2) + '.jpg');		

				currentpage -= 2;
				l.hide();
				nr.hide();
				r = null;
				l = null;
				nr = null;
				pl = null;
				isFliping = false;
				fillPageNumber(currentpage);
				loadAdds(currentpage);				
			});  //end of callback
		});
		return false;
	});
	$('#indice')[0].innerHTML = thumbs.join(" ");
// Preload Zoom images
/*

	var zoomArray = [];
	var counterArray = 0;
	var imgArray = [];
	var imgObject;
	
	for (var i = 0 ; i < 55; i++) {
		zoomArray[counterArray] = 'magazine/zoom/z-' + Pad(i,2) + '_' + Pad(i+1,2) + '.jpg';
		counterArray += 1;
		i += 1;
	}

	//setTimeout( function(){
		for (var abc = 0; abc < zoomArray.length; abc++) {
			imgObject = document.createElement('img');
			imgObject.src = zoomArray[abc];
			imgArray[abc] = imgObject;
		}
	//},500);


*/
}); // fim do document ready
