
// Original:  Jonathan Feaster (support@archreality.com) 
// Web Site:  http://www.archreality.com/ -->
// Based on: FTP Server Login (Reinout Verkerk) and htaccess Login (Gordon Hudson) -->

function openpage(url) {

	var browser=navigator.appName;
//	var version=navigator.appVersion;
   	if (browser.indexOf("Netscape") >= 0) {
		window.location.href = url;
		return;
	}
	window.open("./support/index.html");
	return;
	
//	alert(url);
//	window.open(url);
//	window.location.href = url;
//	window.location.reload();
//	alert("Welcome to ZetaWare surrport website");
}

function Login(form) {
	var username = form.username.value;
	var password = form.password.value;

	letters = "abcdefghijklmnopqrstuvwxyz/.1234567890~_:";
	encrypt = new Array(
	"%61","%62","%63","%64","%65","%66","%67","%68","%69","%6a","%6b","%6c",
	"%6d","%6e","%6f","%70","%71","%72","%73","%74","%75","%76","%77","%78",
	"%79","%7a","/",".","%31","%32","%33","%34","%35","%36","%37","%38",
	"%39","%30","~","_","!",":");

	var input = password;
	encpass = "";
  	for(var count = 0; count < input.length; count++) {
    	daChar = input.charAt(count);
    	for (i = 0; i < letters.length; i++) {
      		if (daChar == letters.charAt(i)) {
        		encpass += encrypt[i];
        		break;
      		}
    	}
  	}
	if (username == "" && password == "") {
		alert("Enter your Username and Password!");
		login.username.focus();
		return false;
	}
	if (username == "") {
		alert("Enter your Username!");
		login.username.focus();
		return false;
	}
	if (password == "") {
		alert("Enter your Password!");
		login.password.focus();
		return false;
	}
	else {
		var htsite = "http://" + username + ":" + password + "@www.zetaware.com/support/index.html";
		openpage(htsite);
	}
}


function loadPage() {
   // find which browser it is
   if (browser.indexOf("Netscape") >= 0) {
      // find which version
      if (version.indexOf("3.") >= 0) {
         window.location="netscape3.html";
      }
      if (version.indexOf("4.") >= 0) {
         window.location="netscape4.html";
      }
      if (version.indexOf("5.") >= 0) {
         window.location="netscape5.html";
      }
   }

   if (browser.indexOf("Microsoft") >= 0) {
      // find which version
      if (version.indexOf("3.") >= 0) {
         window.location="microsoft3.html";
      }
      if (version.indexOf("4.") >= 0) {
         window.location="microsoft4.html";
      }
      if (version.indexOf("5.") >= 0) {
         window.location="microsoft5.html";
      }
   }
}

