document.write(''); var pictureAmount = 7 //8; //9; //specify number of pics var imgList = new Array(); //array of images imgCount = 0; //photos format new Array(image_src, link_url, target) /*imgList[imgCount++] = new Array('photos/lock_fixed_rate.jpg','/apply/',''); imgList[imgCount++] = new Array('photos/soft-landing.jpg','/apply/',''); imgList[imgCount++] = new Array('photos/pre-approval.jpg','/apply/',''); imgList[imgCount++] = new Array('photos/mortgage_capital.jpg','/apply/',''); imgList[imgCount++] = new Array('photos/mortgage_capital_associates.jpg','/apply/',''); imgList[imgCount++] = new Array('photos/reduced-doc.jpg','/apply/','/apply/',''); imgList[imgCount++] = new Array('photos/first-time_homebuyer.jpg','/apply/',''); imgList[imgCount++] = new Array('photos/equity_loan_programs.jpg','/apply/',''); imgList[imgCount++] = new Array('photos/soft-landing2.jpg','/apply/','');*/ // old // new list 03-11-08, 04-03-08 imgList[imgCount++] = new Array('photos/mtgcapone.jpg','/apply/',''); imgList[imgCount++] = new Array('photos/mtgcaptwo.jpg','/apply/',''); imgList[imgCount++] = new Array('photos/mtgcapthree.jpg','/apply/',''); imgList[imgCount++] = new Array('photos/mtgcapfour.jpg','/apply/',''); imgList[imgCount++] = new Array('photos/mtgcapfive.jpg','/rate_tracker.html?r=1',''); imgList[imgCount++] = new Array('photos/mtgcapsix.jpg','/apply/',''); imgList[imgCount++] = new Array('photos/mtgcapseven.jpg','/apply/',''); //imgList[imgCount++] = new Array('photos/mtgcapeight.jpg','/apply/',''); var srcImageID = "photos"; //id of image var srcLinkID = "links"; //id of link var changeRate = 10; //seconds /*----------------------Do Not Edit Below Line---------------------------*/ function switch_img(key){ var imgObject = document.getElementById(srcImageID); var linkObject = document.getElementById(srcLinkID); imgObject.src = '/images/'+imgList[key][0]; linkObject.href = imgList[key][1]; linkObject.target = imgList[key][2]; //imgObject.onclick = 'document.location=' . imgList[key][1]; window.setTimeout("fade('"+srcImageID+"','0','in',"+key+")", 20); window.setTimeout("fade('"+srcImageID+"','100','out',"+key+")", changeRate*1000); } function fade(objID,opacity,direction,key) { if (document.getElementById) { obj = document.getElementById(objID); if(direction == "out"){ if (opacity >= 0) { setOpacity(objID, opacity); opacity -= 10; window.setTimeout("fade('"+objID+"',"+opacity+",'"+direction+"',"+key+")", 20); } else { switch_img((key+1) > imgList.length-1?0:(key+1)); } } else { if (opacity < 100) { setOpacity(objID, opacity); opacity += 10; window.setTimeout("fade('"+objID+"',"+opacity+",'"+direction+"',"+key+")", 50); } } } } function setOpacity(objID, opacity) { obj = document.getElementById(objID); opacity = (opacity == 100)?99.999:opacity; // IE/Win obj.style.filter = "alpha(opacity:"+opacity+")"; // Safari<1.2, Konqueror obj.style.KHTMLOpacity = opacity/100; // Older Mozilla and Firefox obj.style.MozOpacity = opacity/100; // Safari 1.2, newer Firefox and Mozilla, CSS3 obj.style.opacity = opacity/100; } switch_img(Math.floor(Math.random()*pictureAmount));