Shadowbox.init({
    // skip the automatic setup again, we do this later manually
    skipSetup: true
});




$(document).ready(function() {
	$('#sb-player .checkboxRegisterMember').attr('checked', false);
	$('.expanderLink').live({
		click:function(){
			positionClicked = $('.expanderLink').index($(this));
			$(this).toggleClass('active');
			$($('div.expanderContent').get(positionClicked)).slideToggle();
		}
	})

	
	$('#registrationButton').live({
		'click': function(){
			Shadowbox.open({
				content:    $('.registrationButtonContent').html(),
				height:     480,
				player:		'html',
				width:      480
			});
		}
	})

	$('.linkHandler').each(function(index) {
		$(this).click(function(){
			divClassName = $(this).attr('href').replace('#' , '');
			$('.' + divClassName).slideToggle();
			if ($(this).children('img').attr('src') == '/images/plus_sign.png')
			{
				$(this).children('img').attr('src' , '/images/minus_sign.png');
			}
			else
			{
				$(this).children('img').attr('src' , '/images/plus_sign.png');
			}
		})
	});


	$('.registrationButton').live({
		'click': function() {
			if ($('#sb-player .checkboxRegisterMember').attr('checked') != 'checked')
			{
				$('.legalAcknowledgement').css('color','red');
			}
			else
			{
				$('.legalAcknowledgement').css('color','#000000');
			}

			if ($('input[name=regSelect]:checked').val())
			{
				$('.appropriateOption').css('color','#000000');
			}
			else
			{
				$('.appropriateOption').css('color','red');
			}
			
			if ($('input[name=regSelect]:checked').val() && $('#sb-player .checkboxRegisterMember').attr('checked') == 'checked')
			{
				switch($('input[name=regSelect]:checked').val())
				{
					case "1":
						window.location = 'https://welcome.intel.com/login.aspx?Target=https%3a%2f%2fssl.intel.com%2fform-app%2findex.aspx%3f8631&LANG=ENG';
						break;
					case "2":
						window.location = 'https://welcome.intel.com/login.aspx?Target=https%3a%2f%2fssl.intel.com%2fform-app%2findex.aspx%3f8631&LANG=ENG';
						break;
					case "3":
						window.location = 'https://ssl.intel.com/reg-app/register.aspx?target=https://ssl.intel.com/form-app/index.aspx?8631&AppID=101';
						break;
					default:
						break;
				}
			}
		}
	})

	$('a.lightboxwindow').live({
		'click':function (eventHandler){
			Shadowbox.open({
				content:    $(this).attr('href'),
				height:     600,
				player:		'iframe',
				width:      600
			});
			eventHandler.preventDefault();
		}
	})
    

});

function register(){
	Shadowbox.open({
		content:    $('.registrationButtonContent').html(),
		height:     480,
		player:		'html',
		width:      480
	});
}

