function checkDuplicate() {
	for(var i = 1; i < 4; i++) {
		if($("#slot"+i).attr("src") == "_img/index/slot"+window.imageNumber+".jpg") {
			window.imageNumber++;
			checkDuplicate();
		}
	}
}

function imageInput() {
	if(window.imageNumber == 11) {window.imageNumber = 1} 
	else {window.imageNumber++}	
	checkDuplicate();
	$("#slot"+slotchange).attr("src", "_img/index/slot"+window.imageNumber+".jpg");
}

function imageChange() {
	var changeTimer = setTimeout("imageInput()", 500);
	slotchange = (Math.floor(Math.random() * 3)) + 1;
	$("#slot"+slotchange).fadeTo(500, .025);
	$("#slot"+slotchange).fadeTo(500, 1.0);
}

$(document).ready(function() {
	window.imageNumber = 3;
	var slotchange;
	var timer = setInterval("imageChange()", 3000);
	
	if (document.images) {
		preloadSlots = new Image();
		imageUrl = new Array();
		imageUrl[0] = "_img/index/slot1.jpg";
		imageUrl[1] = "_img/index/slot2.jpg";
		imageUrl[2] = "_img/index/slot3.jpg";
		imageUrl[3] = "_img/index/slot4.jpg";
		imageUrl[4] = "_img/index/slot5.jpg";
		imageUrl[5] = "_img/index/slot6.jpg";
		imageUrl[6] = "_img/index/slot7.jpg";
		imageUrl[7] = "_img/index/slot8.jpg";
		imageUrl[8] = "_img/index/slot9.jpg";
		imageUrl[9] = "_img/index/slot10.jpg";
		imageUrl[10] = "_img/index/slot11.jpg";
		for(var n = 0; n <= 11; n++)
			preloadSlots.src = imageUrl[n];
    }

	if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf('6.')>0) {
		$("#logo").attr("src", "_img/cobble_hill_towers-Logo_solid.png");
		$(".iechange").css("background-color", "#001721");
		$(".iechange").css("background-image", "url(../_img/solid_bg.png)");
		$(".footerContent img").attr("src", "_img/copyright-Logo_solid.png");
		$("h1").css("background-image", "url(../_img/solid_bg.png)");
		$(".contact_box_border").css("background-color", "#9dd9ff");
		$(".contact_box_border").css("background-image", "url(../_img/contact_blue_solid.png)");
		$("#closebox img").attr("src", "lightbox/images/close_solid.png");
	}
});