<!--
function rndInteger(n) {
	return Math.floor(Math.random() * n);
	}
	
	
function nextImg() {
	rndImgNum ++; // increment by 1 & move to next welcome image
	if (rndImgNum > (imgNum-1)) {
		rndImgNum = 0;
		}
	//alert(rndImgNum);
	//document.welcomeImg.src = 'images/welcome/' + rndImgNum + '.jpg';
	jumpToImg(rndImgNum);
	}
	
	
function allImages() {
	var strAllImages = "";
	for (i=0; i<imgNum; i++) {
		//alert(i);
		if (rndImgNum == i) {
			strAllImages += "<span class=viewLinkSelected>"+(i+1)+"</span>";
			} else {
				strAllImages += "<a class=viewLink href=javascript:jumpToImg("+i+");>"+(i+1)+"</a>";
			}
		}
	document.getElementById("allImage").innerHTML = strAllImages;
	}
	
	
function displayImg() {
	document.write('<img src="' + file + '" id="contentImg" name="contentImg" width="458" height="264" alt="Click for another view..." />');
	}
	
	
function displayViewLinks() {
	var viewLinks_start = '<p class="viewsPara">views <span id="allImage">';
	var viewLinks_end = '</span></p>';
	
	document.write(viewLinks_start);
	allImages();
	document.write(viewLinks_end);
	}

	
function jumpToImg(tgImg) {
	rndImgNum = tgImg; // set to picture jumped to
	//alert(rndImgNum);
	document.contentImg.src = 'images/'+tgDir+'/'+tgImg+'.jpg'; // show image chosen
	allImages(); // re-write 'allImage' span
	}
	
	
function validateEmail(str, formName, fieldName) {

		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if (str.indexOf(at)==-1){
		   alert("Please input a valid email address");
		   document[formName][fieldName].select();
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Please input a valid email address");
		   document[formName][fieldName].select();
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Please input a valid email address");
			document[formName][fieldName].select();
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please input a valid email address");
			document[formName][fieldName].select();
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please input a valid email address");
			document[formName][fieldName].select();
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please input a valid email address");
			document[formName][fieldName].select();
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Please input a valid email address");
			document[formName][fieldName].select();
		    return false;
		 }

 		 return true;					
	}	
//-->