var dlorigin = 'http://download.winzip.com/';
var dlfile = 'winzip160.exe';
var productName = 'wz';
var os = 'win';

function getDL ()
{
    var request = HTTP.newRequest();
    if (request != null) {
        request.open("GET","/cgi-bin/getdlo.cgi",false);
        request.send(null);
        // did the script return an error?
        if (request.status != 200)              { return; }
        // did the script return successfully, but with nothing?
        else if (request.responseText.length < 1)    { return; }
        if (request.responseText != null)
            dlorigin = request.responseText;
    }
}

function dln(thisForm,origin,file,option)
{
/*
    if (chkems) {
        var val = document.getElementById("wz_reg");
        var err = document.getElementById("wz_regErr");
        if (!isValidEmail(val.value)) {
            err.value = "A valid email address is required";
            val.focus();
            return false;
        }
    }
*/
    var email = '',
        emailError = '';

    var ads = "y";
        
    if (typeof thisForm != 'undefined' && thisForm != null) {
	    if (typeof thisForm.emailError != 'undefined') {emailError = thisForm.emailError.value;}
	    if (typeof thisForm.email != 'undefined') {email = thisForm.email.value.replace(/(Enter Your 	Email Address|Your Email)/i, '');}
    }
    
    if (typeof option != 'undefined') {
	if (option.ads != null) {ads = (option.ads == true)?"y":"n";}
    }
    if (origin == "Download.com") {
        //downloadNow('ftp://ftp.download.com/pub/win95/utilities/filecomp/winzip111.exe','/linkfpp.cgi?o=1&email=' + thisForm.email.value,'0');
        location.href = '/linkfpp.cgi?o=1&email=' + email.value,'0';
    }
    else {
        downloadNowWZ(origin+file,'/downauto.cgi?ads='+ads+'&o=1&file='+origin+file+'&email=' + email+'&er='+emailError+'&os='+os, '0');
    }
}

