/*******************************************
 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').each(function(){
					if($(this).attr('id') != 'all'){
						$(this).attr('disabled', true);
						$(this).removeAttr('checked');
					}
				});
			}  
			else
			{
				$('.clearfix :checkbox').each(function(){
					if($(this).attr('id') != 'all'){
						$(this).removeAttr('disabled');
					}
				});
			}
	*/
	if ($('#all').is(':checked')) 
    {
    	$('.clearfix :checkbox').removeAttr('checked');
    	$('.clearfix :checkbox').attr('disabled', true);
    	$('.clearfix label').addClass('grey');
    	$('.clearfix #all:checkbox').attr('checked', true);	
    	$('.clearfix #all:checkbox').removeAttr('disabled');
    	$('.clearfix #all label').addClass('black');
    }  
    else
    {
    	$('.clearfix :checkbox').removeAttr('disabled');
    	$('.clearfix label').addClass('black');
    	$('.clearfix #all:checkbox').removeAttr('checked');
    	//$('.clearfix #all:checkbox').attr('disabled',true);
    	$('.clearfix #all label').addClass('grey');
    }

}
function toggleIndividual() {	
	$('#all').removeAttr('checked');
	$('#all').attr('disabled',true);
	$('.clearfix #all label').addClass('grey');		
}

