function LoginFtp(form)
{
    var browser = navigator.appName ;
    var username = form.username.value;
    var password = form.password.value;
    var ftpwindow ;

    form.username.value = '' ;
    form.password.value = '' ;


    if (username && password)
    {
        var ftpsite = "ftp://" + username + ":" + password + "@ftp.acqiris.com/";
        ftpwindow=window.open(ftpsite,'ftpDownload','location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500,status=no') ;
    }
    else
    {
        alert("Please enter your username and password.");
    }
}


function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
userAgent = window.navigator.userAgent;
browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
mustInitImg = true;
function initImgID() {di = document.images; if (mustInitImg && di) { for (var i=0; i<di.length; i++) { if (!di[i].id) di[i].id=di[i].name; } mustInitImg = false;}}
function findElement(n,ly) {
	d = document;
	if (browserVers < 4)		return d[n];
	if ((browserVers >= 6) && (d.getElementById)) {initImgID; return(d.getElementById(n))};
	var cd = ly ? ly.document : d;
	var elem = cd[n];
	if (!elem) {
		for (var i=0;i<cd.layers.length;i++) {
			elem = findElement(n,cd.layers[i]);
			if (elem) return elem;
		}
	}
	return elem;
}
function changeImages() {
	d = document;
	if (d.images) {
		var img;
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			img = null;
			if (d.layers) {img = findElement(changeImages.arguments[i],0);}
			else {img = d.images[changeImages.arguments[i]];}
			if (img) {img.src = changeImages.arguments[i+1];}
		}
	}
}


function check_email(e) {
ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";

for(i=0; i < e.length ;i++){
if(ok.indexOf(e.charAt(i))<0){
return (false);
}
}

if (document.images) {
re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (!e.match(re) && e.match(re_two)) {
return (-1);
}

}

}

function check_detail_form(f) { // f is the form (passed using the this keyword)
if(document.getElementById("Answer")){
if(f.Answer.value.length < 1){
alert("Please provide a valid solution to the equation.");
f.Answer.focus(); // put the prompt in the name field
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.Answer.style.background = "white";
}
// make sure the form is not submitted
return false;
}
}

if(f.FirstName.value.length < 1){
alert("Please add your first name.");
f.FirstName.focus(); // put the prompt in the name field
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.FirstName.style.background = "white";
}
// make sure the form is not submitted
return false;
}

if(f.LastName.value.length < 1){
alert("Please add your last name");
f.LastName.focus(); // put the prompt in the name field
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.LastName.style.background = "white";
}
// make sure the form is not submitted
return false;
}

// check the first email address ( the exclamation means "not" )
if(!check_email(f.Email.value)){
alert("Please add your e-mail address.");
f.Email.focus();
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.Email.style.background = "white";
}
// make sure the form is not submitted
return false;
}
// if second email exists check if different
if(document.getElementById("ConfirmEmail")){
   if (f.Email.value != f.ConfirmEmail.value)
   {
    alert("Please confirm your e-mail address.");
    f.ConfirmEmail.focus();
    f.ConfirmEmail.style.background = "white";
    // make sure the form is not submitted
    return false;
   }
}

if(document.getElementById("AdCodeNumber")){
if(f.AdCodeNumber.value.length < 1){
alert("Please include the Ad Code Number from the printed publicity item.");
f.AdCodeNumber.focus(); // put the prompt in the name field
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.AdCodeNumber.style.background = "white";
}
// make sure the form is not submitted
return false;
}
}

if(document.getElementById("AcceptConditions")){
if(!f.AcceptConditions.checked){
alert("To participate, you must accept the Terms and Conditions by selecting the checkbox.");
f.AcceptConditions.focus(); // put the prompt in the name field
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.AcceptConditions.style.background = "white";
}
// make sure the form is not submitted
return false;
}
}

}


