var shiftRight='0px';

function init(){/*sorts out top div for Opera*/
	if(navigator.appName == "Netscape"){
		var divToChange=document.getElementById('top');
		divToChange.style.marginRight = shiftRight;
	}
}

window.onload=init;

function get_random_img() {
	// String before random number
	var imgPrefix = "<div class='img_mainpic'><img src='pics/leftnav";
	// String after random number
	var imgSuffix = ".jpg' width='173' height='90' vspace='0'></div>";
	// Generate random integer between 0 and 3
	var ranNum = Math.round(Math.random() * 4) +1;
	// Build image name
	var imgName = imgPrefix + ranNum + imgSuffix;
	return imgName;
}

function Validate(form) {
			with (form) {
				if (!realname.value || !email.value || !question.value) {
					alert("Please fill in all the fields");
					return false;
				} else {
				// validate e-mail address
				with (email) {
					apos = value.indexOf("@"); 
					dotpos = value.lastIndexOf(".");
					lastpos = value.length - 1;
					if (apos < 1 || dotpos - apos < 2 || lastpos - dotpos > 4 || lastpos - dotpos < 2) {
						alert("Your e-mail address does not appear to be valid.");
						return false;
					} else {
						return true;
					}
				}
			}
		}
	}
