// Open Window
function MM_reloadPage(init) {
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function OpenPictureWindow(imageUrl,imageWidth,imageHeight,alt,posLeft,posTop, isScrollVisible) {
    var scrollbars = (!isScrollVisible)? "yes" : "no";
    
    newWindow = window.open("","pictureWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=" + scrollbars + ",left="+posLeft+",top="+posTop);
    newWindow.document.open();
    newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">');
    newWindow.document.write('<img src=\"'+imageUrl+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">');
    newWindow.document.write('</body></html>');
    newWindow.document.close();
    newWindow.focus();
}

function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function OpenWindow(pageUrl, windowName, features) {
	newwindow=window.open(pageUrl, windowName, features);
	if (window.focus) {newwindow.focus()}
	return false;
}

//Tab Menu
if (typeof jQuery != 'undefined') {
    $(function() {
        var tab = 0;
        if($('#BroadcastStreamMenu')) {
            var dayOfWeek = (new Date).getDay() - 1;
            tab = dayOfWeek;
        }
        if($('.SelectableMenu')) {
            switchTab(tab);
            $('.SelectableMenu li a').each(function(i) {
                $(this).click(function() {
                    switchTab(i);
                    return false;
                });
            });
        }
        if($('#ProgSchedulleBtn')) {
            switchDay(0);
            $('#ProgSchedulleBtn li a').each(function(i) {
                $(this).click(function() {
                    switchDay(i);
                    return false;
                });
            });
        }
    });
    function switchTab(pageId) {
        $('.TextPanels').hide();
        $('.TextPanels:eq('+pageId+')').fadeIn('slow');
        $('.SelectableMenu li a').removeClass('SelectedMenuItem');
        $('.SelectableMenu li a:eq('+pageId+')').addClass('SelectedMenuItem');
        return false;
    }
    
    function switchDay(dayId) {
        $('.ProgSchedulleDay').hide();
        $('.ProgSchedulleDay:eq('+dayId+')').fadeIn('slow');
        $('#ProgSchedulleBtn li a').removeClass('Selected');
        $('#ProgSchedulleBtn li a:eq('+dayId+')').addClass('Selected');
        return false;
    }

    /*(function($){
     $.fn.tooltip = function(options) {
        var defaults = {
         xOffset :  5,
         yOffset : 10
        };
        var options = $.extend(defaults, options);
        return this.each(function() {
	        $(this).hover(function(e){
		        if(this.title!="") {
		            this.t = this.title;
		            this.title = "";
		            $("body").append("<p id='tooltip'>"+ this.t +"</p>");
		            $("#tooltip")
		                .css({
		                    position:   'absolute',
		                    border:     '1px solid #333',
		                    background: '#f7f5d1',
		                    padding:    '2px 5px',
		                    color:      '#333',
		                    display:    'none'
		                })
		                .css("top",(e.pageY + options.yOffset) + "px")
		                .css("left",(e.pageX + options.xOffset) + "px")
			            .fadeIn(400);
			    }
	        },
	        function(){
	            if(typeof this.t != 'undefined') {
		            this.title = this.t;
		            $("#tooltip").remove();
		        }
	        });
	        $(this).mousemove(function(e){
		        $("#tooltip")
			        .css("top",(e.pageY + options.yOffset) + "px")
			        .css("left",(e.pageX + options.xOffset) + "px");
	        });
        });
     };
    })(jQuery);*/
}
