
// JavaScript Document			
			


	//This script handles the mulitple onload events





addOnload(rolloverInit);
addOnload(rotate);
addOnload(alsorotate);


function addOnload(newFunction) {
	var oldOnload = window.onload;
	
	if (typeof oldOnload == "function") {
		window.onload = function() {
			if (oldOnload) {
				oldOnload();
			}
			newFunction();
		}
	}
	else {
		window.onload = newFunction;
	} 
}

	//This script creates the home_logo rollover
	
function rolloverInit() {
	for (var i=0; i<document.images.length; i++){
			if (document.images[i].parentNode.
				tagName == "A") {
					setupRollover(document.images[i]);
				}
			}
		}
		
function setupRollover(thisImage) {
	thisImage.outImage = new Image();
	thisImage.outImage.src = thisImage.src;
	thisImage.onmouseout = rollOut;
	
	thisImage.overImage = new Image();
	thisImage.overImage.src = "images/"+
		thisImage.id + "_on.gif";
	thisImage.onmouseover = rollOver;
}

function rollOver() {
	this.src = this.overImage.src;
}

function rollOut() {
	this.src = this.outImage.src;
}







	//This script will rotate the cover images on the index page
	
	var coverImages = new Array("1969_pics/69_left_main.jpg","1969_pics/69_front_left_2_main.jpg","1969_pics/69_front_left_main.jpg");
	var thisCover = 0;
	
		
function rotate() {
	thisCover++;
	if (thisCover == coverImages.length) {
		thisCover = 0;	
	}
	document.getElementById("sixtynine_quarter").src = coverImages[thisCover];
	
	setTimeout("rotate()",2.5 * 1000);
	}


	var rImages = new Array("1965_68pics/911r_main.jpg","1965_68pics/67_911R_prototype_2.jpg","1965_68pics/911_r_rgruppe.jpg");
	var thisR = 0;
	
		
function alsorotate() {
	thisR++;
	if (thisR == rImages.length) {
		thisR = 0;	
	}
	document.getElementById("rPrototype").src = rImages[thisR];
	
	setTimeout("rotate()",2.5 * 1000);
	}





	
