function formCheck(formobj){
	
	var fieldRequired = Array("FirstName", "LastName", "CompanyName", "PhoneNumber", "EmailAddress", "AmountRequested");
	var fieldDescription = Array("First Name", "Last Name", "Company", "Primary Phone", "Email", "Amount Requested");
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}


function selectTab(tabIndex){
    currentTabIndex = tabIndex;
    
    var divworks = document.getElementById('divworks');
    var divqualify = document.getElementById('divqualify');
    var divcontact = document.getElementById('divcontact');

    if(tabIndex == 0){
    
        divworks.style.display = '';
        document['works'].src = "images/tabs/howitworks_on.png";

        divqualify.style.display = 'none';
        document['qualify'].src = "images/tabs/qualify_off.png";
        
        divcontact.style.display = 'none';
        document['contact'].src = "images/tabs/contact_off.png";
        
        
    } 
    
    else if(tabIndex == 1){
    
        divworks.style.display = 'none';
        document['works'].src = "images/tabs/howitworks_off.png";

        divqualify.style.display = '';
        document['qualify'].src = "images/tabs/qualify_on.png";
        
        divcontact.style.display = 'none';
        document['contact'].src = "images/tabs/contact_off.png";
        
     } 
     
     else if(tabIndex == 2){
     	
        divworks.style.display = 'none';
        document['works'].src = "images/tabs/howitworks_off.png";

        divqualify.style.display = 'none';
        document['qualify'].src = "images/tabs/qualify_off.png";
        
        divcontact.style.display = '';
        document['contact'].src = "images/tabs/contact_on.png";
    }
    
}

