function show(object) 
	{
	if (document.layers && document.layers[object])
		{
 		document.layers[object].visibility = 'visible';
 		}
	else if (document.getElementById(object)) 
		{
 		document.getElementById(object).style.visibility = 'visible';
 		document.getElementById(object).style.zIndex = 100;
 		}
}

function hide(object)
{
	if (document.layers && document.layers(object))
 		{
 		document.layers(object).visibility = 'hidden';
 		}
	else if (document.getElementById(object))
		{
 		document.getElementById(object).style.visibility = 'hidden';
		}
}

function swapSelect(theSelect) {
	if(theSelect.selectedIndex==(theSelect.length-1)) {
		document.cgi.primary_os2.disabled=false;
		document.cgi.primary_os2.focus();
		}
	else {
		document.cgi.primary_os2.value="";
		document.cgi.primary_os2.disabled=true;
		document.cgi.primary_os.focus();
	}
}

function popCenter(url, name, width, height) {
	winTop = (screen.height - height)/2;
	left = (screen.width - width)/2;
	features = "width="+width+",height="+height+",left="+left+",top="+winTop+",toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes";
	window.open(url, name, features);
}

function checkReg(theForm) {
	var base="You failed to provide the following required information :\n";
	var error="You failed to provide the following required information :\n";
	
	if(theForm.first_name.value.length==0) {
		error+='first name\n';
		}
	
	if(theForm.last_name.value.length==0) {
		error+='last name\n';
		}
	
	if(theForm.user_name.value.length==0) {
		error+='user name\n';
		}
	
	if(theForm.email.value.length==0) {
		error+='public email address\n';
		}
	
	if(theForm.private_email.value.length==0) {
		error+='private email address\n';
		}
	
	if(theForm.lasso_version.selectedIndex==0) {
		error+='current lasso version\n';
		}
	
	if(theForm.primary_os.selectedIndex==0 && theForm.primary_os2.value.length==0) {
		error+='primary OS\n';
		}

	if(theForm.lasso_year.selectedIndex==0) {
		error+='the first year you started using Lasso\n';
		}
	
	if(theForm.Log.value.length==0) {
		error+='login name/id\n';
		}
	
	if(theForm.pass.value.length==0) {
		error+='password\n';
		}
	
	if(error == base) {
		return true;
		}
	else {
		alert(error);
		return false;
		}

}

function checkUpload() {
	var extArray = new Array(".sit",".sitx", ".zip", ".gz", ".tgz");	
	var file=document.uploadfile.Filename.value;
	var ok=false;
	
	if (document.uploadfile.VS.value.length==0) {
		alert("You must give a version number.");
		return false;
		}
	if (document.uploadfile.compatibility.selectedIndex == 0) {
		alert("You must select a supported version.");
		return false;
		}
	if (file == "") {
		alert("You must select something to upload!");
		return false;
		}
	if (document.uploadfile.ReleaseNotes.value.length==0) {
		alert("You must provide a release note.");
		return false;
		}
		
		
	temp=file.split(".");
	ext=("." + temp[temp.length-1]);
	for (var i = 0; i < extArray.length; i++) {
		if (extArray[i] == ext) { 
			ok = true;
		}
	}	
	
	if (ok) {
		document.location="#top";
		show("uploading");
		pgressi();
		fadeLoad();
		return true;
		}
	else { 
		alert("Please only upload files that end in types:  \n" + (extArray.join("  ")) + "\nPlease select a new " + "file to upload and submit again.");
		document.uploadfile.Filename.focus();
		return false;
		}
	return false;	

}