

var http = new XMLHTTPObject();   //used for save page

function doRecordDownload(){
	var parms = "mybutton=recorddownload";
        var formaction ="../php/doform.php";
        var myurl =formaction+"?"+parms;    //not using return but it finishes the format 
        
	//might be a synchronization issue in IE6.0 -- not sure, but FF doesn't like 'false' (synchronized)
	http.open("GET",myurl,true);
	http.onreadystatechange = doRecordDownloadState;   //order important - form would not chain in IE7
	try {} catch (e) {alert(e);}

	http.send(null);

	return false;//Prevent the form from being submited
}

function doRecordDownloadState(){
if(http.readyState == 4) 
{
if(http.status == 200) 
{
//not much to do here

window.location.reload();

}  //end status 200 check
}  //end readystate check	
	
	
	
}

function doUsername() {
//this retrieves the username from the server, if in session
var parms = "mybutton=findusername";
var formaction = "../php/doform.php";
var myurl = formaction+"?"+parms;

http.open("GET",myurl,true);
http.onreadystatechange = doSaveUsername;
try {} catch(e) {alert(e);}
http.send(null);
return false;
}   //end doUsername

function doSaveUsername(){


//this is for paypal - if in session save the username
if(http.readyState == 4) 
{
if(http.status == 200) 
{
	var request = http.responseText;     //sent by the server code called
	
	document.paypal_form.custom.value=request;  //username paypal translates to cm
	
	document.paypal_form.submit();  //submit form when ready
}
}

}   //end doSaveUsername	


function doLogout() {
var parms = "mybutton=logout";
var formaction ="../php/doform.php";
var myurl =formaction+"?"+parms;    //not using return but it finishes the format 



//might be a synchronization issue in IE6.0 -- not sure, but FF doesn't like 'false' (synchronized)
http.open("GET",myurl,true);
http.onreadystatechange = doLogoutState;   //order important - form would not chain in IE7
try {} catch (e) {alert(e);}

http.send(null);

return false;//Prevent the form from being submited

}  //end doLogout

function doLogoutState(){
//main form processing function

if(http.readyState == 4) 
{
if(http.status == 200) 
{
//not much to do here


//window.location.reload();

window.location.href="../index.php";

}  //end status 200 check
}  //end readystate check

}  //end logoutstate function





var browser=navigator.userAgent.toLowerCase();
function XMLHTTPObject() {
   
   var xmlhttp=false;
   
   
    try {xmlhttp = new XMLHttpRequest();}
        catch(e) {
            try {xmlhttp = new ActiveXObject("MSXML2.XMLHTTP.3.0");} 
              catch(e) {
                
                try {xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}

		catch (e) {}
               }
              
    }
   
    return xmlhttp; 
    } 
    
function saveData(formname) 
{
//alert("saveData "+formname.name);	
//new version that handles multiple forms on a page use 'this.form' in the onclick event to pass object.




//By calling this file, we process the data, value of button tells how
//need to derive the formaction dynamically
//why doesn't it take 'formname' in this line???

var parms="";
for (i = 0; i < formname.length; i++) 
{
//alert(formname.elements[i].name+" "+formname.elements[i].value);
if(formname.elements[i].type =='radio'&&!formname.elements[i].checked) continue;           //only take the checked ones of the radio buttons
if(formname.elements[i].type =='checkbox'&&!formname.elements[i].checked) continue; 
parms = parms + formname.elements[i].name+"="+formname.elements[i].value+"&";

}



var myurl =formname.action+"?"+parms+"return=confirm";    //not using return but it finishes the format 


//alert(myurl);


//might be a synchronization issue in IE6.0 -- not sure, but FF doesn't like 'false' (synchronized)
http.open("GET",myurl,true);
http.onreadystatechange = doReadyState;   //order important - form would not chain in IE7
try {} catch (e) {alert(e);}

http.send(null);

return false;//Prevent the form from being submited

}  //end saveData


function doReadyState(){
//main form processing function

if(http.readyState == 4) 
{
if(http.status == 200) 
{
var result = http.responseText;     //sent by the server code called

//alert("doReadyState "+result);

//must differentiate between login errors and join errors

var form_array = result.split("::");   //should indicate error div and content div

var divtouse = form_array[0];
//alert(divtouse);
//alert(form_array[1]);
//this little hacklet was put in because the reload on the server stopped working
if(result.indexOf('Login Successful')>=0) {setTimeout("window.location.reload()",10);return;}


document.getElementById(divtouse).innerHTML=form_array[1];
return;

//if (result.indexOf('Login Error:')>=0) {document.getElementById("login_error").innerHTML = result; return;}

//if (result.indexOf('RE:')>=0) {document.getElementById("retrieval_error").innerHTML=result;return;}
  	
//means we have an error, so just display the error without changing the display
//in the join form
//error_box must also be passed dynamically

//if (result.indexOf('ERROR:')>=0) {document.getElementById("error_box").innerHTML = result;return;}

//"form elements" must be derived dynamically. 

//document.getElementById("form_elements").innerHTML = result;   //send all results to replace form which form?

//in some cases we may want to blank out the form here




}  //end status 200 check
}  //end readystate check

}  //end readystatechange function







<!-- Copyright 2002 Bontrager Connection, LLC

function getCalendarDate()
{
	

   var months = new Array(13);
   months[0]  = "January";
   months[1]  = "February";
   months[2]  = "March";
   months[3]  = "April";
   months[4]  = "May";
   months[5]  = "June";
   months[6]  = "July";
   months[7]  = "August";
   months[8]  = "September";
   months[9]  = "October";
   months[10] = "November";
   months[11] = "December";
   var now         = new Date();
   var monthnumber = now.getMonth();
   var monthname   = months[monthnumber];
   var monthday    = now.getDate();
   var year        = now.getYear();
   if(year < 2000) { year = year + 1900; }
   var dateString = monthname +
                    ' ' +
                    monthday +
                    ', ' +
                    year;
   return dateString;
} // function getCalendarDate()

function getClockTime()
{
   var now    = new Date();
   var hour   = now.getHours();
   var minute = now.getMinutes();
   var second = now.getSeconds();
   var ap = "AM";
   if (hour   > 11) { ap = "PM";             }
   if (hour   > 12) { hour = hour - 12;      }
   if (hour   == 0) { hour = 12;             }
   if (hour   < 10) { hour   = "0" + hour;   }
   if (minute < 10) { minute = "0" + minute; }
   if (second < 10) { second = "0" + second; }
   var timeString = hour +
                    ':' +
                    minute +
                    ':' +
                    second +
                    " " +
                    ap;
   return timeString;
} 

function doOpen(file)  {

window.open (file,"mywindow","status=0,toolbar=0,width=700,height=475,scrollbars=yes"); 

}

function a(loc) {
//location.href = "http://www.google.com/";
var download_location = "http://bizyweb.com/downloads/productfile/build043009_ff.zip";
location.href = eval(loc);
}

function doClearDiv(divname){
	
	document.getElementById(divname).innerHTML="";
	

	return;
}

function doClear(formname) {
	
	//alert(formname+" "+formname.length);
	//must find the input fields (not the submit) and clear them
	formobj = document.getElementById(formname);
	//alert(formobj.length);
	for (i = 0; i < formobj.length; i++) 
	{
		
	if(formobj.elements[i].type == 'submit') continue;

	formobj.elements[i].value = "";
}
	return;
}


function fetchData(url,objectID){
       
 
	var pageRequest = false
	if (window.XMLHttpRequest) {
		pageRequest = new XMLHttpRequest()
	}
	else if (window.ActiveXObject){ 
		try {
			pageRequest = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e) {
			try{
				pageRequest = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	}
	else return false
	pageRequest.onreadystatechange=function() {	
		var object = document.getElementById(objectID);
		object.innerHTML = pageRequest.responseText;
		
	
	}
	        
		pageRequest.open('GET',url,true);
		
		pageRequest.send(null);
			
}
    

