// JavaScript Document
//=======================================
//Version 1 iFrame Loader
//From Winn.ws
//Need help? Email Greg at greg@winn.ws
//Help is free!!
//=======================================
// Greg Winn = www.winn.ws


var pageCount = new Array(0,0,0,0);
window.onload = initFrames;

function initFrames()	{
	for (var i=0; i<document.links.length; i++) {
		document.links[i].onclick = writeContent;
		document.links[i].thisPage = i+1;
	}
}

function writeContent()	{
	pageCount[this.thispage]++;
	
	// you may edit this -------------------------------------------
	var newText = "<h1>You are now looking at page " + this.thisPage;
	//-------------------------------------------
	// you may edit this -------------------------------------------
	newText += ".<br\/>You have been to this page ";
	//-------------------------------------------
	// you may edit this -------------------------------------------
	newText += pageCount[this.thisPage] + " times.<\/h1>";
	//-------------------------------------------
	
	
	// dont edit below this <------------------
	var contentWin = document.getElementById("content").contentWindow.document;
	
	contentWin.body.innerHTML = newText;
	return false;
}

window.onload = initFrame;
function initFrame()	{
	for( var i=0; i<document.links.length; i++)	{
		document.links[i].target = "content";
		document.links[i].onclick = setiFrame;
	}
}

function setiFrame() {
	
	document.getElementById("content").contentWindow.document.location.href = this.href;
	return false;
}
