 /////////////////////////////////////

 //                                 //

 //  Iomega Customer Sat.           //

 //  Michael Walker, Web Designer   //

 //  Roy, UT 84067                  //


 //  www.iomega.com                 //

 //                                 //

 /////////////////////////////////////
originalDefaultStatus = window.defaultStatus;

function restoreWindowToPreviousState() {
  // Set window.onerror and window.defaultStatus
  // to their initial state when leaving the page.
  window.defaultStatus = originalDefaultStatus;
}

function handleErrors(msg, errUrl, line) {
        errUrl = this.location;    
        msg = 'Unspecified JS Error';  
        line = 'MSIE';          
}

function commentsSubmitted() {
	var qs = window.location.search;

	if ( qs.indexOf("comments=1") != -1 )	{
		return true;
	}
	else {
		return false;
	}
}

function disableCommentsForm(commentsForm) {

/*	jolApply.TXA_Q_DESC.value = "Thanks for your feedback!";
    alert(document.jolApply.elements.length);
    for (var i=0;i<document.jolApply.elements.length;i++ ) {
        alert(document.jolApply.elements[i].name);
        
        document.jolApply.elements[i].disabled=true
    }
*/
	commentsForm.RAD_Q1[0].disabled = true;
	commentsForm.RAD_Q1[1].disabled = true;
	commentsForm.RAD_Q1[2].disabled = true;
	commentsForm.TXA_Q_DESC.value = "Thanks for your feedback!";
	commentsForm.TXA_Q_DESC.disabled = true;
	commentsForm.SUB_BTN.disabled = true;
    //alert("ending disableCommentsForm");
}

function checkForComments(whichForm) {
	if ( commentsSubmitted() ) {
		disableCommentsForm(whichForm);
        //alert("returning true from checkForComments()");
		return true;
	}
	else {
        //alert("returning false from checkForComments()");
		return false;
	}
}

	
function checkResponse(jolApply)	{
//alert(document.jolApply.THANKSPAGE.value);
	if (document.jolApply.RAD_Q1[1].checked == true) {
		document.jolApply.THANKSPAGE.value = "http://www.iomega.com/support/askiomega_options.html"
	} if (document.jolApply.RAD_Q1[0].checked == true){
        document.jolApply.THANKSPAGE.value = "http://www.iomega.com/support/documents/survey/doc_survey_thanks.html"
    }if (document.jolApply.RAD_Q1[2].checked == true){
        document.jolApply.THANKSPAGE.value = docs + document.jolApply.TXT_DOCID.value + "?comments=1";
    }  //end if's
    //alert(document.jolApply.THANKSPAGE.value);
    return true;
}

window.onUnload = restoreWindowToPreviousState;

window.onerror = handleErrors;
