var Arr_SlideImages= new Array('volunteer-banner-large.png||Volunteering saves lives','sbc-volunteer-banner-750.png||Volunteer today and make great things happen for the SBC dogs','foster-banner-large-1.png||Fostering a dog or cat for a rescue can save a life','outtathecagebnr.png|https://www.outtathecage.org/|Click her to support our efforts in saving lives'); var arrayLength = Arr_SlideImages.length var bnrCnt = 0; //parseInt(arrayLength); var defaultImg = ''; var curClick = ''; var defHeight = '220'; var mWidth = window.innerWidth + 'px'; if(window.innerWidth > '750') { mWidth='750px' } var defWidth = '750px'; var width = '750px'; var wSet = 0; var checkSlidePageLoad = function() { document.readyState !== "complete" ? setTimeout(checkSlidePageLoad,5) : slidesLoad(); } checkSlidePageLoad(); function divShrinkWidth() { width = parseInt(width) - 30; var ThisDiv = document.getElementById("lrgbnr"); if(parseInt(width) > 0) { //alert(width); ThisDiv.style.width = width + 'px'; setTimeout(divShrinkWidth, 2); } else { wSet = 0; width = 0; ThisDiv.style.width = width + 'px' ; divExpandWidth() } } function divExpandWidth() { if(width==0) { var ThisDiv = document.getElementById("lrgbnr"); if(defaultImg =='') { // get original image defaultImg = ThisDiv.src; curClick = ThisDiv.getAttribute('onclick'); ThisDiv.style.cursor ='hand'; } if(parseInt(bnrCnt)== parseInt(arrayLength)) { ThisDiv.style.cursor =''; if(curClick != null && curClick != '') { ThisDiv.style.cursor ='hand'; ThisDiv.onclick= function() { curClick; } } else { ThisDiv.onclick= function(){return false;} ThisDiv.removeAttribute("onclick"); } ThisDiv.title=''; ThisDiv.alt=''; ThisDiv.src = defaultImg; bnrCnt = 0; } else { var res = Arr_SlideImages[bnrCnt].split("|"); var thisImg = './images/' + res[0] //alert(thisImg); if(res[1]!='') { ThisDiv.style.cursor ='hand'; ThisDiv.title=res[2]; ThisDiv.alt=res[2]; ThisDiv.onclick= function() { if(res[1].indexOf("http://")!=-1 || res[1].indexOf("https://")!=-1 ) { window.open(res[1]); } else { document.location.href = res[1]; } } } else { ThisDiv.style.cursor ='hand'; ThisDiv.title=res[2]; ThisDiv.alt=res[2]; ThisDiv.onclick= function(){return false;} ThisDiv.removeAttribute("onclick"); } ThisDiv.src = thisImg; // alert(thisImg); if(parseInt(bnrCnt) < parseInt(arrayLength)) { bnrCnt = ++bnrCnt; } } } //alert(bnrCnt); var ThisDiv = document.getElementById("lrgbnr"); width = parseInt(width) + 30; if(parseInt(width) < parseInt(defWidth)) { ThisDiv.style.width = width; setTimeout(divExpandWidth, 2); } else { width = '750px'; ThisDiv.style.width = width ; ThisDiv.style.cursor ='hand'; setTimeout(slidesLoad,10000) } } function slidesLoad() { if(document.getElementById("lrgbnr")!=null) { divShrinkWidth(); } }