﻿var mccUtils = function() { var b = ''; var c = function() { $.ajax({ url: mccUtils.ajax_url, type: 'GET', data: 'qId=qot', dataType: 'json', success: mccUtils.QuoteList.Initialize }) }; var d = function() { if (mccUtils.QuoteList.quotes) { $('#mquo').animate({ opacity: 0 }, 400, "linear", mccUtils.NextQuote) } }; var e = function() { f.injectQuote(); if (f.currentId < mccUtils.QuoteList.length) { f.increment() } $('#mquo').animate({ 'opacity': 1 }, 400) }; var f = { currentId: 0, length: 0, quotes: null, Initialize: function(a) { if (a) { f.length = a.quotes.length; f.quotes = a.quotes; this.currentId = 0; d(); g.InitializeTimer() } else { this.length = 0 } }, increment: function() { this.currentId += 1 }, decrement: function() { this.currentId = (this.currentId <= 0) ? 0 : this.currentId - 1 }, injectQuote: function() { if (this.currentId >= this.length) { this.currentId = 0 } var a = f.quotes[this.currentId]; if (a) { f.DisplayQuote(a) } }, DisplayQuote: function(a) { if (a) { $("#quote-body").html(a.body); if (a.role != "") { $("#small-quote").html("- " + a.author + ", <i>" + a.role + "</i>") } else { $("#small-quote").html("- " + a.author) } $('#mquo').animate({ 'opacity': 1 }, 400) } } }; var g = { secs: 0, timerID: null, timerRunning: false, delay: 500, InitializeTimer: function() { this.secs = 10; this.StopTimer(); this.StartTimer() }, StopTimer: function() { if (this.timerRunning) clearTimeout(this.timerID); this.timerRunning = false }, StartTimer: function() { this.timerID = setInterval("mccUtils.Home.GetNextQuote()", 20000) } }; return { init: function(a) { b = a } } } (); function FetchQuote() { $('#mquo').animate({ opacity: 0 }, 400, "linear", FetchNextQuote) } function FetchNextQuote() { $.ajax({ url: mccUtils.Home.ajax_url, type: 'GET', data: 'qId=qid', dataType: 'json', success: DisplayQuote }) } function DisplayQuote(a) { if (a) { $("#quote-body").html(a.body); if (a.role != "") { $("#small-quote").html("- " + a.author + ", <i>" + a.role + "</i>") } else { $("#small-quote").html("- " + a.author) } $('#mquo').animate({ 'opacity': 1 }, 400) } } mccUtils.Tools = function() { return { Get_Cookie: function(a) { var b = document.cookie.split(';'); var c = ''; var d = ''; var e = ''; var f = false; for (i = 0; i < b.length; i++) { c = b[i].split('='); d = c[0].replace(/^\s+|\s+$/g, ''); if (d == a) { f = true; if (c.length > 1) { e = unescape(c[1].replace(/^\s+|\s+$/g, '')) } return e; break } c = null; d = '' } if (!f) { return null } }, Set_Cookie: function(a, b, c, d, e, f) { var g = new Date(); g.setTime(g.getTime()); if (c) { c = c * 1000 * 60 * 60 * 24 } var h = new Date(g.getTime() + (c)); document.cookie = a + "=" + escape(b) + ((c) ? ";expires=" + h.toGMTString() : "") + ((d) ? ";path=" + d : "") + ((e) ? ";domain=" + e : "") + ((f) ? ";secure" : "") }, Delete_Cookie: function(a, b, c) { if (Get_Cookie(a)) document.cookie = a + "=" + ((b) ? ";path=" + b : "") + ((c) ? ";domain=" + c : "") + ";expires=Thu, 01-Jan-1970 00:00:01 GMT" } } } (); var MccInit = function() { var c = ''; var d = function() { $(function highlight_menu_links() { $("ul#nmenu a").each(function() { var a = this.href; if (document.location.href.toLowerCase() == a.toLowerCase()) { $(this).addClass("active") } }) }); $('#q').focus(function() { if ($(this).val() == "Search...") { $(this).val('').css({ 'color': '#000000' }) } }).blur(function() { if ($(this).val() == "") { $(this).val('Search...').css({ 'color': '#999999' }) } }); $('#q').bind('keypress', function(e) { var a = (e.keyCode ? e.keyCode : e.which); if (a == 13) { var b = $('#q').val(); document.location.href = c + 'search?q=' + escape(b) } }); (function($) { jQuery.fn.center = function() { this.css("position", "absolute"); this.css("top", ($(window).height() - this.height()) / 2 + $(window).scrollTop() + "px"); this.css("left", ($(window).width() - this.width()) / 2 + $(window).scrollLeft() + "px"); return this } })(jQuery); $('#lnkWhoAreWe').click(function() { $('#about_details').slideToggle('fast') }); $(function() { var a = mccUtils.Tools.Get_Cookie('mcc_ift'); if (!a) { mccUtils.Tools.Set_Cookie('mcc_ift', 1, 30); $('#about_details').show() } }) }; return { InitDef: function(a) { c = a; d() } } } ();