//
// <script language="Javascript" type="text/javascript" src="/fadeheader.js"></script>
// <body onLoad="qU();">
// <table><tr><td id="q1" name="q1"><img id="q2" name="q2"></td></tr></table>
//

// prefix, number to rotate (1-x), suffix, background id, image id, frequency, speed (1 is faster)
//qS = new Array('/i/hp/', 6, '.jpg', 'q1', 'q2', 5000, 1, 'h2');
//

//qN = 1;
qN = 0; // Needs to be 0
qM = 100;
if (navigator.appName == 'Microsoft Internet Explorer') {
	qZ = true;
}
else {
	qZ = false;
}
function qU () {
	if (qS[1] > 0) {
		setTimeout('qL();', qS[5]-500);
	}
}
function qL () {
	if (qS[1] > 0) {
		if (qZ) {
			qE(qS[4]).src = qS[0] + hI[qN][0] + qS[2];
			qE(qS[4]).style.visibility = 'visible';
		}
		//qY = Math.floor(Math.random()*qS[1]);
		qY = Math.floor(Math.random()*(qS[1]+1)+1);
		qY = qY-1;
		
		if (qY > qS[1]) {
			qY = qS[1];
		}

		if (qY == qN) {
			qY = qN + 1;
			if (qY > qS[1]) {
				qY = 1;
			}
		}
		if (qE(qS[3])) {
			qE(qS[3]).style.backgroundImage = 'url(' + qS[0] + hI[qY][0] + qS[2] + ')';
			qN = qY;
			qM = 100;
			setTimeout('qR();', 500);
		}
	}
}
function qR () {
	qT = qE(qS[4]);
	if (qT) {
//alert ('1');
		qM = qM - 1;
//alert (qM);
		if (qM > 0) {
//alert ('2');
			if (qM < 10) {
				qV = '0' + qM;
			}
			else {
				qV = qM;
			}
			if (qZ) {
				qT.style.filter="blendTrans(duration=2)";
				if (qT.filters.blendTrans.status != 2) {
					qT.filters.blendTrans.apply();
					qT.style.visibility = "hidden";
					qT.filters.blendTrans.play();
				}
				qU();
			}
			else {
				qT.style.opacity = '.' + qV;
				qT.style.filter = 'alpha(opacity=' + qN + ')';
				setTimeout('qR();', qS[6]);
			}
		}
		else {
//alert ('3');
			qT.src = qS[0] + hI[qN][0] + qS[2];
			if (qS[7].length > 0) {
//alert ('4');
				qI = Layer(qS[7]);
				if (qI) {
//alert ('5');
					qI.href = hI[qY][1];
				}
			}
			qT.style.opacity = '1.00';
			qT.style.filter = 'alpha(opacity=100)';
			qU();
		}
	}
}
function qE (nM) {
	if (document.getElementById) {
		return document.getElementById(nM);
	}
	if (document.all) {
		return document.all[nM];
	}
	if (document.layers) {
		if (document.layers[nM]) {
			return document.layers[nM];
		}
		if (document[nM]) {
			return document[nM];
		}
	}
	return false;
}

function qGo () {
	qHr = hI[qN][1];
	qNw = hI[qN][2];
	if (qHr.indexOf('#') < 0) {
		if (qNw == '1') {
			window.open(qHr);
		}
		else {
			location.href = qHr;
		}
	}
}

//function qGo () {
//	qHr = hI[qN][1];
//	if (qHr.indexOf('#') < 0) {
//		location.href = qHr;
//	}
//}