<!--
//======================================
// Author Ray Pooley 2009 : http://SMEGateway.co.uk 
//======================================
var bigImgObj;
var alphaVal;
var imgVal 	= 1;
var imgValMax 	= 17;
var waitTime 	= 5;
var waitCount	= 0;
var faderate	= 60;
var imageloaded = 0;
var txtList = "Debi Jones .....@@Sefton Central Conservative Association .....@@... Suite 3, 62 Liverpool Rd, Crosby, L23 5SJ@@... Tel: 0151 924 1055@@";
txtList+="... <a class=\"textLink\"href=\"mailto:debi.jones@telldebi.co.uk?subject=Email from TellDebi.co.uk website\">Email: debi.jones@telldebi.co.uk</a> ...@@... a dedicated Local Conservative.";

var txtArray = txtList.split("@@");
var txtind = 0;

function waitAWhile(){
	if (waitCount<waitTime){
		waitCount++;
		window.setTimeout('waitAWhile()',1000);
	} else {
		waitCount	= 0
		swapBigImage();
	}
}
function swapBigImage(){
	bigImgObj=document.getElementById("BigImageDiv");
	document.getElementById("bigImage").src = "bigimages/img_"+imgVal+".gif";
	alphaVal = 100;
	fadeOutOld();
}

function fadeOutOld(){
	if (alphaVal>0){
		if (ie) {
			bigImgObj.style.filter="alpha(opacity="+alphaVal+")";
		} else {
		    if (ns){
			    bigImgObj.style.MozOpacity=(alphaVal/100);
	        } else {
	            if (ch) {
			        bigImgObj.style.opacity=(alphaVal/100);
			   } else {
			        if (sa){
			            bigImgObj.style.opacity=(alphaVal/100);
			        } else {
			            bigImgObj.style.opacity=(alphaVal/100);
			        }
			   } 
	        }
		}
		alphaVal= alphaVal-5
		window.setTimeout('fadeOutOld()',faderate);
	} else {
		if (imgVal< imgValMax){
			imgVal++;
		} else {
			imgVal = 1;
		}
		imageloaded = 0;
		document.getElementById("bigImage").src = "bigimages/img_"+imgVal+".gif";
		swapTxt();
		fadeInNew();
	}
}

function fadeInNew(){
	if (alphaVal<100){
		if (ie) {
			bigImgObj.style.filter="alpha(opacity="+alphaVal+")";
		} else {
		    if (ns){
			    bigImgObj.style.MozOpacity=(alphaVal/100);
	        } else {
	            if (ch) {
			        bigImgObj.style.opacity=(alphaVal/100);
		        } else {
			        if (sa){
			            bigImgObj.style.opacity=(alphaVal/100);
			        } else {
			            bigImgObj.style.opacity=(alphaVal/100);
			        }
			    }
	        }
		}
		if (imageloaded == 1){
			alphaVal+=5;
		}
		window.setTimeout('fadeInNew()',faderate);
	} else {
		waitAWhile();
	}
}

function swapTxt(){
   txtObj = document.getElementById("DivText");
   if (ie){  
        txtObj.innerHTML = txtArray[txtind];
    } else {
        txtObj.innerHTML = txtArray[txtind];
     }
   if (txtind<txtArray.length-1){
        txtind++;
   } else {
        txtind=0;
   }
}

//-->
