var bigstring = " "

function doesexist(inputValue, inputExpected, defaultValue) {
  var aCharExists=0
  if (inputValue != defaultValue){
	  if (inputValue) {
	    for (var i=0; i<inputValue.length; i++) {
	      if (inputValue.charAt(i) != " ") {
	        aCharExists = 1
	      }
	    }
	  }
  }
  if (!aCharExists) {
    bigstring = bigstring += inputExpected += "\n ";
  }
}
function doesexistradio(inputValue, inputExpected, size) {
	sum=0;
	for(i=0; i<size; i++)
		if (inputValue[i].checked == true)
			sum++;
	if (!sum) {
		bigstring = bigstring += inputExpected += "\n ";
		return false
  	}
  	return true
  	
}

function checkem() {
	var where_to= confirm("Are you sure you want to submit your application?");
	if (where_to== false)
	{
		return false
	}
	
  
  
  
  
   
  if (bigstring != " "){
    alert("Please complete the following fields: \n" + bigstring)
    bigstring = " "
    return false
  }
  return true
}

function reset_first_to_null(a){
	if(a.value == "First Name"){
		a.value = "";
	}
}
function reset_middle_to_null(a){
	if(a.value == "Middle"){
		a.value = "";
	}
}
function reset_last_to_null(a){
	if(a.value == "Last Name"){
		a.value = "";
	}
}

function media_track_company_change_type(the_field) {
	var l        = location.href;
	var lpos     = l.indexOf('?');
	var box_name = the_field.name;
	
	if (lpos > 0) {
	    l = l.substring(0, lpos);
	} // end if
	
	location.href = l + "?" + box_name + '=' + escape(the_field.value);
}

function media_track_company_change_region(the_field) {
	var l        = location.href;
	var lpos     = l.indexOf('&region');
	var box_name = the_field.name;
	
	if (lpos > 0) {
	    l = l.substring(0, lpos);
	} // end if
	
	location.href = l + "&" + box_name + '=' + escape(the_field.value);
}

function media_track_company_change_city(the_field) {
	var l        = location.href;
	var lpos     = l.indexOf('&city');
	var box_name = the_field.name;
	
	if (lpos > 0) {
	    l = l.substring(0, lpos);
	} // end if
	
	location.href = l + "&" + box_name + '=' + escape(the_field.value);
}