//JavaScript Document
// gbellucci 
// 12/12/2009
// Add hooktour popup window for online campus pages
$(document).ready(
        function() {

            $("a#starttour").attr("href", "http://tours.sapha.com/ecpi").click(
                    function() {
                        open_dbx($(this).attr("href"));
                        return (false);
                    });
        });

// dialogbox open
function open_dbx(url) {

    // reposition the window
    $('html, body')
            .animate({scrollTop : 30}, 1600,
                    function() {
                        $("#db").dialog({
                            title : 'ECPI Online Campus Tour',
                            width : 800,
                            height : 600,
                            closeOnEscape : false,
                            modal : true,
                            resizable : false,
                            position : top,
                            close : function(event, ui) {$(this).dialog('destroy');},
                             open : function(event, ui) {
                                        var iframe = '<iframe id="htour" style="width:780px;" '
                                        + ' scrolling="no" frameborder="0" marginwidth="5" '
                                        + 'marginheight="5" src="'
                                        + url + '"></iframe>';
                                        $("#db").html(iframe);
                                        $("#htour").load(
                                            function() {
                                                $(this).css({"height" : "550px"});
                                            });
                                        }
                                   });
                    });

}/* end function */