  /*	All this is copyright Anton Ward 2007 - www.knew.com.au	 . . . demonstrated in the perforated Rod Lavers */  var selectCol = '#000000'; var dotBgNormal; var dotBgHover; var dotBgSelect; var dotBgVisited;  var dotSelectedId;  var dotArr = new Array(); var dotString; var dotLocId;    function init(indexA, indexB, indexC, colNormal, colVisited){  //	alert(dotArr.length);  	dotBgNormal = colNormal;	dotBgVisited = colVisited;		selectMenuItem('a', indexA);	if(indexB!=null){		selectMenuItem('b', indexB);	}		var contentObj = document.getElementById('content');	var itemObj = contentObj.getElementsByTagName('div');	var totalItems = contentObj.getElementsByTagName('div').length;		var itemCount = 0;		for(var i=0; i<totalItems; i++){		if(contentObj.getElementsByTagName('div')[i].className == 'item'){			itemCount++;		}	}		for(var i=0; i<totalItems; i++){		if(contentObj.getElementsByTagName('div')[i].className == 'item'){			//alert();			var dotCol = contentObj.getElementsByTagName('div')[i].getAttribute('dotCol');			var indexNum = itemCount;			if(itemCount>1){				addDot(indexNum, dotCol);			}			contentObj.getElementsByTagName('div')[i].style.visibility='hidden';					}	}		if(itemCount>1){		makeDots(dotLocId);		dotSelectedId = indexC;		selectDotMenu(indexC);	}		selectNewContent(indexC);}function addDot(idStr, hiLiteCol){	var dotObj = new Object();	dotObj.idStr = idStr;	dotObj.hiLiteCol = hiLiteCol;		dotArr.push(dotObj);}function setDotLocation(idLoc){	dotLocId = idLoc;}function setString(newString){	dotString = newString;}function makeDots(idName){	var menuObj = document.getElementById(idName);	var itemObj = menuObj.getElementsByTagName('ul')[0];		//itemObj.write(dotString);	var totalDots = dotArr.length;	var writeStr = dotString;		for(var i=0; i<(totalDots-1); i++){		writeStr += dotString;	}		itemObj.innerHTML = writeStr;}   function selectMenuItem(id, indexNumber){ 			var idName = 'menu-' + id;	var myClass = 'itemSelected-' + id;		 	var menuObj = document.getElementById(idName);	var itemObj = menuObj.getElementsByTagName('li')[indexNumber];	var linkObj = itemObj.getElementsByTagName('a')[0];		//		//linkObj.className = myClass;			linkObj.style.color = selectCol;			 }  function selectDotMenu(indexNumber){		// onclick	// onmouseover	// onmouseout	// onmousedown		var menuObj = document.getElementById('menu-c');	var totalDots = menuObj.getElementsByTagName('li').length;		for(var i=0; i<totalDots; i++){			var itemObj = menuObj.getElementsByTagName('li')[i];		var linkObj = itemObj.getElementsByTagName('a');				linkObj[0].theid = i;				linkObj[0].selCol = dotArr[i].hiLiteCol;				if(i!=indexNumber){					linkObj[0].style.background = dotBgNormal;			linkObj[0].hasVisited = false;		}else{			linkObj[0].style.background = linkObj[0].selCol;			linkObj[0].hasVisited = true;		}				linkObj[0].onmouseover = function() {			if(this.theid != dotSelectedId){				this.style.background = this.selCol;			}			return false;		}				linkObj[0].onmouseout = function() {			if(this.theid != dotSelectedId){				if(this.hasVisited == true){					this.style.background = dotBgVisited;				}else{					this.style.background = dotBgNormal;				}			}			return false;		}				linkObj[0].onclick = function() {			this.hasVisited = true;			dotSelectedId = this.theid;			selectNewDot(this.theid);			selectNewContent(this.theid);			return false;		}			}		 } function selectNewDot(exceptionId){	var menuObj = document.getElementById('menu-c');	var totalDots = menuObj.getElementsByTagName('li').length;		for(var i=0; i<totalDots; i++){			var itemObj = menuObj.getElementsByTagName('li')[i];		var linkObj = itemObj.getElementsByTagName('a');			if(i!=exceptionId){				if(linkObj[0].hasVisited == true){				linkObj[0].style.background = dotBgVisited;			}else{				linkObj[0].style.background = dotBgNormal;			}		}else{			//linkObj[0].style.background = dotBgSelect;						linkObj[0].style.background = linkObj[0].selCol;		}		}}function selectNewContent(exceptionId){	var contentObj = document.getElementById('content');	var itemObj = contentObj.getElementsByTagName('div');	var totalItems = contentObj.getElementsByTagName('div').length;		var itemClassCount = 0;	var itemArr = new Array();	for(var i=0; i<totalItems; i++){		if(itemObj[i].className == 'item'){			itemArr[itemClassCount] = i;			itemClassCount++;		}			}		for(var j=0; j<itemArr.length; j++){		if(j!=exceptionId){				itemObj[itemArr[j]].style.visibility='hidden'		}else{			itemObj[itemArr[j]].style.visibility='visible';		}	}	}// validate formfunction validForm(contactForm) {	// validate email if it exists	var email = contactForm.theemail.value;		if (email.length != 0) { 			if (email.indexOf("@") == -1) { 			//contactForm.theemail.focus(); 			alert("Please enter a valid email address");  			return false; 		}	   	   		if (email.indexOf(",") != -1) { 			//contactForm.theemail.focus(); 			alert("Please enter a valid email address");   			return false; 		}		if (email.indexOf("#") != -1 ) { 			//contactForm.theemail.focus();			alert("Please enter a valid email address"); 			return false; 		}		if (email.indexOf("!") != -1) { 			//contactForm.theemail.focus();			alert("Please enter a valid email address"); 			return false; 		}		if (email.indexOf(" ") != -1) { 			//contactForm.theemail.focus();			alert("Please enter a valid email address");  			return false; 		}		if (email.lastIndexOf(".") < email.indexOf("@")) { 			//contactForm.theemail.focus();			alert("Please enter a valid email address");  			return false; 		}		if (email.lastIndexOf(".") >  (email.length-3)) { 			//contactForm.theemail.focus();			alert("Please enter a valid email address");  			return false; 		}				if (email.length == (email.indexOf("@")+1) ){			//contactForm.theemail.focus();			alert("Please enter a valid email address"); 			return false;		}			} else {		alert("Please enter a valid email address"); 		return false;	}		alert("Thanks, you message has been submitted"); 		return true;		contactForm.themessage.value = "";		contactForm.theemail.value = "";	}//