﻿var IsLoggedIn;
var CurrentFileNodeId = "";

$(document).ready(function() {

    $('.leftmenu ul li:last').css('background', 'none');

    $('.featured-content').cycle({
        timeout: 4000,
        speed: 1000,
        cleartypeNoBg: true,
        fx: 'fade'
    });

    $("a.iframe").fancybox({
        'autoDimensions': false,
        'width': 500,
        'height': 215,
        'overlayOpacity': 0.7
    });

    $('.boxright ul li a, .files ul li a').click(function() {
        var nodeId = $(this).attr('rel');
        if (!IsLoggedIn) {
            CurrentFileNodeId = $(this).attr('rel');
            $('a.iframe').click();
			return false;
        }
        else {
            if (nodeId != "") {
                $.ajax({
                    type: "POST",
                    url: "WebServices/AjaxServices.asmx/GetFileInstanceId",
                    data: "{nodeId:'" + nodeId + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function(result) {
                        if (result.d != '<%= Guid.Empty %>') {
                            window.location = "ShowFile.ashx?FileInstanceId=" + result.d;
                        }
                    }
                });
            }
        }
    });

    $('.news').textOverflow({ "lines": 4 });
	

});

        



