﻿    var hideLink = false;
    
    $(function() {

		$('.button').button();
		
	});


    $(function() {

		$('#webchat').dialog({
			autoOpen: false,
            width: 790,
            height: 400,
            resizable: true,
			autoResize: true,
			show: 'blind',
			hide: 'blind'
		});
		
		$('.chat-link').click(function() {
			$('#webchat').dialog('open');
			return false;
		});
	});

    $(function() {        

	    
        $(".tooltip").click(function(){
        
            var dialog = $("<div class='dialog' style='display:none'></div>")
            dialog.load(this.href).dialog(
            {
                autoOpen: true,
                width: 600,
                height: 400,
                resizable: true,
                autoResize: true,
                show: 'blind',
                hide: 'blind',
                title:'MvcConf Speaker: ' + this.innerText
            }
            );  
            return false;});

        $("a.feedback").each(function() {
            var link = $(this);
            if(hideLink) {
                link.hide();
            }
        });
        
        $("a.video").each(function(){
             var link = $(this);
             if(link.attr('href')==''){
                link.hide();
             }
            })            
            .click(function(){
            var dialog = $("<div style='display:none'></div>");
            var movie = $("<div id='movie' style='height:100%;width:100%'></div>").appendTo(dialog);
            movie.oembed(this.href);

            dialog.dialog({
                title:'Recorded presentation for MvcConf',
                autoOpen: true,
                width: 450,
                height: 425,
                resizable: true,
                autoResize: false,
                show: 'blind',
                hide: 'blind'
            });  
            
            
            return false;});
    });
