﻿// JScript File

//   var loginAttempt = false;
    
jQuery(document).ready(function() {

        $(".staticNavBtx a[disabled=true]").parent().parent().parent().parent().each(function(i) { 
            $(this).css('display','none');
        });
        
        $("#btnLogin").fancybox({
            'width'			: 190,
			'height'		: 235,
			'overlayOpacity'    : 0.5,
		    'type'				: 'iframe',
	        'scrolling'		    : 'no',
	        'titleShow'		    : false,
	        'onClosed'		    : function() {
	            location.reload();
	        },
	        'onComplete'            : function() {
	          $.fancybox.resize();  
	        }
        });
        
        $(".sidebarCalEvents").find("a").each(function(i) {
            var date = $(this).parent().attr('date');
            $(this).css('text-decoration', 'none');
            if($(this).html() == "&lt;" || $(this).html() == "&gt;")
                return;

            $(this).href = "#";
            if(date != null)
            {
                var url = $("#txtRoot").val()+'Training/ClassDetails.aspx?nomaster=true&date='+date;
                $(this).css('color', '#FFFFFF');
                $(this).click(function() {
                    $.fancybox(url,
                    {
		                'width'				: 800,
		                'height'			: '75%',
                        'autoScale'     	: false,
                        'transitionIn'		: 'none',
		                'transitionOut'		: 'none',
		                'type'				: 'iframe',
		                'overlayOpacity'    : 0.5
	                });
                    return false;
                });
            }
            else
            {
                $(this).css('cursor', 'default');
                $(this).click(function() { 
                    return false; 
                });
            }
            
         });
        
        $(".lnkHelp").click(function() {
            return confirm($("#txtLanguageSwitchWarning").val());
        });
        
        $("#toggleSideBar").click(function() {
            $("#collapsableSideBar").toggle();
        });

	    return false;
});

var blank = new Image();


function fixPng(png) {
   // get src
   var src = png.src;
   // set width and height
   if (!png.style.width) { png.style.width = $(png).width(); }
   if (!png.style.height) { png.style.height = $(png).height(); }
   // replace by blank image
   png.onload = function() { };
   png.src = blank.src;
   // set filter (display original image)
   png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
 }


