function setOpacity (ele, opacityLevel){ ele.style.opacity = opacityLevel/100; ele.style.filter = "alpha(opacity="+(opacityLevel)+")"; }
function updateOpacity(){
if(currentopac > 100){ currentopac=100; }
if(currentopac == 100){ direction=-10; }
if(currentopac < 0){ currentopac=0; }
if(currentopac == 0){ document.getElementById('prop'+livepic).style.zIndex='0'; direction=10; livepic++; if(livepic>properties.length-1){ livepic=0; } document.getElementById('prop'+livepic).style.zIndex='5'; }
currentopac = currentopac + direction;
if((currentopac >= 0) && (currentopac <= 100)){ thispic = document.getElementById('prop'+livepic); setOpacity(thispic, currentopac); }
if(currentopac == 100){ setTimeout("updateOpacity()", displaytime); }
if(currentopac != 100){ setTimeout("updateOpacity()", 50); }
}
var displaytime=5000,currentopac=100,livepic=0,direction=-10;
var properties = new Array();
properties[0] = new Array(2861,"22 Elzy Road","Staxigoe","Price On Application","0");
properties[1] = new Array(2860,"2 The Crescent, Lybster","Wick","In The Region Of","77,000");
properties[2] = new Array(2859,"Mount Pleasant, Strath, Watten","WICK","In The Region Of","130,000");
properties[3] = new Array(2858,"Bluebell Cottage, Freswick","WICK","Offers Over","125,000");
properties[4] = new Array(2857,"37 Towerhill Road","Thurso","In The Region Of","67,000");
var num_props = properties.length;
document.write("<div style='position:relative;width:100%;height:180px;'>");
for (i=0; i<num_props; i++){ document.write("<p id='prop"+i+"' style='position:absolute;top:0px;text-align:center;font-weight:bold;font-size:11px;opacity:0;filter:alpha(opacity=0);-ms-filter:\'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)\';'><a href='http://www.caithness-business.co.uk/property.php?id="+properties[i][0]+"'>"+properties[i][1]+", "+properties[i][2]+"<br><img src='http://www.caithness-business.co.uk/image_cache/sp"+properties[i][0]+"_tn.jpg'><br>"+properties[i][3]+"<br>&pound;"+properties[i][4]+"</a></p>"); }
document.write("</div>");
setOpacity(document.getElementById('prop0'),100);
setTimeout("updateOpacity()", displaytime);

