
/*
 * 
 */

$(document).ready(function(){

	$("tr:nth-child(odd)").addClass("zebra");
	
	$(".longDescription").bind("click", function(){
		$(".tip-container").hide();
		$(this).siblings(".tip-container").show();
		});
	
	$("#byConferenceCall1, #byWorkshop1").bind("click", function(e){
		
	//	console.log('person ->  ' + $('#byWorkshop1:checked').val() + ' | conference -> ' + $('#byConferenceCall1:checked').val());
		
		if (($('#byConferenceCall1:checked').val() == 'true') && ($('#byWorkshop1:checked').val() != 'true'))  
		{
			toggleLocation('off');
		}
		else
		{
			toggleLocation('on');
		}
		
    });
	
	if (($('#byConferenceCall1:checked').val() == 'true') && ($('#byWorkshop1:checked').val() != 'true')) 
	{
		toggleLocation('off');
	}
	
	
});

function hidePopUp()
{
	$(".tip-container").hide();
}

// Enable and disable the Location select boxes based on the checked state of the Conference Call check box. 
function toggleLocation(flag)
{
	if(flag == 'off')
	{
		$('#v2 #region, #city, #location_label').css('color','#CFCFCF');
		$('#region, #city').attr("disabled","disabled");
	}
	else
	{
		$('#v2 #region, #city, #location_label').css('color','#000');
		$('#region, #city').attr("disabled","");
	}
}

// Toggle the visibility of a block object (first variable is class name, second is state *must be 'show' or 'hide')
function toggle(className, state)
{	
	if(state == "show")
	{
		$("." + className).show();
	}
	
	if(state == "hide")
	{
		$("." + className).hide();
	}
}