/*******************************************
 Javascript functions for dwpub.com
*******************************************/

var shown;

function toggleDiv(show) 
{
	// if one is displayed, close it.
	if(shown) {
		new Effect.BlindUp(shown);
	}

	// if we're clicking the title of a just shown item, exit here so we don't expand again
	if(shown == show) {
		shown = false;
		return;
	}

        new Effect.BlindDown(show);
        shown = show;
}

function HideShow(divID) {
  var item = document.getElementById(divID);
  if (item) {
    item.className=(item.className=='hide')?'show':'hide';
  }
}


function addBookmark(title,url) 
{
		if (window.sidebar) 
		{
			window.sidebar.addPanel(title, url,"");
		}
		else if( document.all ) 
		{
			window.external.AddFavorite( url, title);
		} 
		else if( window.opera && window.print ) 
		{
			return true;
		}
} 

// Used in the contact forms
function toggleAll() {
		if ($('#all').is(':checked')) 
		{
			$('.clearfix :checkbox').removeAttr('checked');
			$('.clearfix :checkbox').attr('disabled', true);
			$('.clearfix :label').addClass('grey');
			$('#all').attr('checked', true);	
			$('#all').removeAttr('disabled');
			$('#all_label').addClass('black');
		}  
		else
		{
			$('.clearfix :checkbox').removeAttr('disabled');
			$('.clearfix :label').addClass('black');
			$('#all').removeAttr('checked');
			//$('#all').attr('disabled',true);
			$('#all').addClass('grey');
		}
}
function toggleIndividual() {
			$('#all').removeAttr('checked');
			//$('#all').attr('disabled',true);
			$('#all_label').addClass('grey');
}
