function doDownloadType(thisForm) {

   selectBox = thisForm.find('select.type'); 
   inputBox = thisForm.find('input.other'); 
   if (selectBox.val() != '0') {
    if (selectBox.val() == 'Download' || inputBox.val() != '') {
     return true;
    } else {
     alert('Please specify...');
     return false;
    }//if
   }//if
   
   return false;   
   
 
}//function

$(document).ready(function() {

 $('body.checkout div#leftcol a').click( function() {
 	return confirm("Are you sure you want to leave the checkout?");
 });

 $('body.checkout ul#header-navigation a').click( function() {
 	return confirm("Are you sure you want to leave the checkout?");
 });

 $('body.checkout div#footer a').click( function() {
 	return confirm("Are you sure you want to leave the checkout?");
 });

 //Disable download buttons after download
 $('form input.button.download').parent('form').submit( function() {
 	alert('Your download may take a few moments - please be patient...');

 	//Can't just disable the button as this stops the form submitting in IE - need to hide the button and reveal an already disabled one instead!
 	$(this).find('input.button.download').css('display', 'none');
 	$(this).find('input.downloadhidden').css('display', 'inline');
 });

 //Disable download buttons after download
 $('form input.button.once').click( function() {
  $(this).parent('form').submit();
  $(this).attr('disabled', 'disabled');
  return false;
 }); 
 
 //Disable request license button if type select box not chosen
 $('select.type').each( function() {
  $(this).parents('form').submit( function() { 
    selectBox = $(this).find('select.type'); 
    inputBox = $(this).find('input.other'); 
    if (selectBox.val() != '0') {
     if (selectBox.val() == 'Download' || inputBox.val() != '') {
      $(this).find('input.button').attr('disabled', 'disabled');
      return true;
     } else {
      alert('Please specify...');
      return false;
     }//if
    }//if
    
    return false;   
  
  });
 });
 
 //News toggle stuff
 if ($('a.toggle').length > 0) {
  $('a.toggle').click( function() {
   
   if ($(this).hasClass('on')) {
    $(this).removeClass('on');
    $(this).parents('div.newsListContainer').find('ul.newsList').hide();
   } else {
    $(this).addClass('on');
    $(this).parents('div.newsListContainer').find('ul.newsList').show();
   }//if
   
   /*   
   $(this).parents('div.newsListContainer').find('ul.newsList').animate({
     opacity: 1
    ,height: 'toggle'
    }, 500);
    */
  });
   
 }//if
 
});
