$(function() {
	$('.iFrameLoginModal').dialog({
		bgiframe: true,
		autoOpen: false,
		width: 960,
		height: 620,
		modal: true,
		resizable: false,
		position: 'center',
		closeOnEscape: true
	});
	$('.openModalForLogin').click(function() {
	    var urlContent = $('.hdnHrefForLogin').val();
	    var seasonPassURl=urlContent.search("SeasonPass");
	    if (seasonPassURl>0)
	    {
	    closeModalDialog();
	    document.location.href=urlContent;
	    return false;
	    }
	  	$('#iframeload')
		    .attr('src',urlContent)
		    .attr('width','100%')
		    .attr('height','100%')
		    .attr('scrolling','no');
		$('.iFrameLoginModal').dialog('open');
		return false;
	});	
	
	// accordian
	 if ($('.accordion').text()) {
	$('.accordion').accordion({
		header: '.heading',
		collapsible: true
	});
	}

});

function closeModalDialog(){
    $('.iFrameLoginModal').dialog('close');
}

//This function sets the username in the header of the page.
function SetUserNameInHeader(username)
{
    window.parent.SetUserText(username);
}
