﻿var RootUrl = "";

//v2.0.30511.0
if (!window.Silverlight) window.Silverlight = {}; Silverlight._silverlightCount = 0; Silverlight.__onSilverlightInstalledCalled = false; Silverlight.fwlinkRoot = "http://go2.microsoft.com/fwlink/?LinkID="; Silverlight.__installationEventFired = false; Silverlight.onGetSilverlight = null; Silverlight.onSilverlightInstalled = function() { window.location.reload(false) }; Silverlight.isInstalled = function(b) { if (b == undefined) b = null; var a = false, m = null; try { var i = null, j = false; if (window.ActiveXObject) try { i = new ActiveXObject("AgControl.AgControl"); if (b === null) a = true; else if (i.IsVersionSupported(b)) a = true; i = null } catch (l) { j = true } else j = true; if (j) { var k = navigator.plugins["Silverlight Plug-In"]; if (k) if (b === null) a = true; else { var h = k.description; if (h === "1.0.30226.2") h = "2.0.30226.2"; var c = h.split("."); while (c.length > 3) c.pop(); while (c.length < 4) c.push(0); var e = b.split("."); while (e.length > 4) e.pop(); var d, g, f = 0; do { d = parseInt(e[f]); g = parseInt(c[f]); f++ } while (f < e.length && d === g); if (d <= g && !isNaN(d)) a = true } } } catch (l) { a = false } return a }; Silverlight.WaitForInstallCompletion = function() { if (!Silverlight.isBrowserRestartRequired && Silverlight.onSilverlightInstalled) { try { navigator.plugins.refresh() } catch (a) { } if (Silverlight.isInstalled(null) && !Silverlight.__onSilverlightInstalledCalled) { Silverlight.onSilverlightInstalled(); Silverlight.__onSilverlightInstalledCalled = true } else setTimeout(Silverlight.WaitForInstallCompletion, 3e3) } }; Silverlight.__startup = function() { navigator.plugins.refresh(); Silverlight.isBrowserRestartRequired = Silverlight.isInstalled(null); if (!Silverlight.isBrowserRestartRequired) { Silverlight.WaitForInstallCompletion(); if (!Silverlight.__installationEventFired) { Silverlight.onInstallRequired(); Silverlight.__installationEventFired = true } } else if (window.navigator.mimeTypes) { var b = navigator.mimeTypes["application/x-silverlight-2"], c = navigator.mimeTypes["application/x-silverlight-2-b2"], d = navigator.mimeTypes["application/x-silverlight-2-b1"], a = d; if (c) a = c; if (!b && (d || c)) { if (!Silverlight.__installationEventFired) { Silverlight.onUpgradeRequired(); Silverlight.__installationEventFired = true } } else if (b && a) if (b.enabledPlugin && a.enabledPlugin) if (b.enabledPlugin.description != a.enabledPlugin.description) if (!Silverlight.__installationEventFired) { Silverlight.onRestartRequired(); Silverlight.__installationEventFired = true } } if (!Silverlight.disableAutoStartup) if (window.removeEventListener) window.removeEventListener("load", Silverlight.__startup, false); else window.detachEvent("onload", Silverlight.__startup) }; if (!Silverlight.disableAutoStartup) if (window.addEventListener) window.addEventListener("load", Silverlight.__startup, false); else window.attachEvent("onload", Silverlight.__startup); Silverlight.createObject = function(m, f, e, k, l, h, j) { var d = {}, a = k, c = l; d.version = a.version; a.source = m; d.alt = a.alt; if (h) a.initParams = h; if (a.isWindowless && !a.windowless) a.windowless = a.isWindowless; if (a.framerate && !a.maxFramerate) a.maxFramerate = a.framerate; if (e && !a.id) a.id = e; delete a.ignoreBrowserVer; delete a.inplaceInstallPrompt; delete a.version; delete a.isWindowless; delete a.framerate; delete a.data; delete a.src; delete a.alt; if (Silverlight.isInstalled(d.version)) { for (var b in c) if (c[b]) { if (b == "onLoad" && typeof c[b] == "function" && c[b].length != 1) { var i = c[b]; c[b] = function(a) { return i(document.getElementById(e), j, a) } } var g = Silverlight.__getHandlerName(c[b]); if (g != null) { a[b] = g; c[b] = null } else throw "typeof events." + b + " must be 'function' or 'string'"; } slPluginHTML = Silverlight.buildHTML(a) } else slPluginHTML = Silverlight.buildPromptHTML(d); if (f) f.innerHTML = slPluginHTML; else return slPluginHTML }; Silverlight.buildHTML = function(a) { var b = []; b.push('<object type="application/x-silverlight" data="data:application/x-silverlight,"'); if (a.id != null) b.push(' id="' + Silverlight.HtmlAttributeEncode(a.id) + '"'); if (a.width != null) b.push(' width="' + a.width + '"'); if (a.height != null) b.push(' height="' + a.height + '"'); b.push(" >"); delete a.id; delete a.width; delete a.height; for (var c in a) if (a[c]) b.push('<param name="' + Silverlight.HtmlAttributeEncode(c) + '" value="' + Silverlight.HtmlAttributeEncode(a[c]) + '" />'); b.push("</object>"); return b.join("") }; Silverlight.createObjectEx = function(b) { var a = b, c = Silverlight.createObject(a.source, a.parentElement, a.id, a.properties, a.events, a.initParams, a.context); if (a.parentElement == null) return c }; Silverlight.buildPromptHTML = function(b) { var a = "", d = Silverlight.fwlinkRoot, c = b.version; if (b.alt) a = b.alt; else { if (!c) c = ""; a = "<a href='javascript:Silverlight.getSilverlight(\"{1}\");' style='text-decoration: none;'><img src='{2}' alt='Get Microsoft Silverlight' style='border-style: none'/></a>"; a = a.replace("{1}", c); a = a.replace("{2}", d + "108181") } return a }; Silverlight.getSilverlight = function(e) { if (Silverlight.onGetSilverlight) Silverlight.onGetSilverlight(); var b = "", a = String(e).split("."); if (a.length > 1) { var c = parseInt(a[0]); if (isNaN(c) || c < 2) b = "1.0"; else b = a[0] + "." + a[1] } var d = ""; if (b.match(/^\d+\056\d+$/)) d = "&v=" + b; Silverlight.followFWLink("149156" + d) }; Silverlight.followFWLink = function(a) { top.location = Silverlight.fwlinkRoot + String(a) }; Silverlight.HtmlAttributeEncode = function(c) { var a, b = ""; if (c == null) return null; for (var d = 0; d < c.length; d++) { a = c.charCodeAt(d); if (a > 96 && a < 123 || a > 64 && a < 91 || a > 43 && a < 58 && a != 47 || a == 95) b = b + String.fromCharCode(a); else b = b + "&#" + a + ";" } return b }; Silverlight.default_error_handler = function(e, b) { var d, c = b.ErrorType; d = b.ErrorCode; var a = "\nSilverlight error message     \n"; a += "ErrorCode: " + d + "\n"; a += "ErrorType: " + c + "       \n"; a += "Message: " + b.ErrorMessage + "     \n"; if (c == "ParserError") { a += "XamlFile: " + b.xamlFile + "     \n"; a += "Line: " + b.lineNumber + "     \n"; a += "Position: " + b.charPosition + "     \n" } else if (c == "RuntimeError") { if (b.lineNumber != 0) { a += "Line: " + b.lineNumber + "     \n"; a += "Position: " + b.charPosition + "     \n" } a += "MethodName: " + b.methodName + "     \n" } alert(a) }; Silverlight.__cleanup = function() { for (var a = Silverlight._silverlightCount - 1; a >= 0; a--) window["__slEvent" + a] = null; Silverlight._silverlightCount = 0; if (window.removeEventListener) window.removeEventListener("unload", Silverlight.__cleanup, false); else window.detachEvent("onunload", Silverlight.__cleanup) }; Silverlight.__getHandlerName = function(b) { var a = ""; if (typeof b == "string") a = b; else if (typeof b == "function") { if (Silverlight._silverlightCount == 0) if (window.addEventListener) window.addEventListener("onunload", Silverlight.__cleanup, false); else window.attachEvent("onunload", Silverlight.__cleanup); var c = Silverlight._silverlightCount++; a = "__slEvent" + c; window[a] = b } else a = null; return a }; Silverlight.onRequiredVersionAvailable = function() { }; Silverlight.onRestartRequired = function() { }; Silverlight.onUpgradeRequired = function() { }; Silverlight.onInstallRequired = function() { }; Silverlight.IsVersionAvailableOnError = function(d, a) { var b = false; try { if (a.ErrorCode == 8001 && !Silverlight.__installationEventFired) { Silverlight.onUpgradeRequired(); Silverlight.__installationEventFired = true } else if (a.ErrorCode == 8002 && !Silverlight.__installationEventFired) { Silverlight.onRestartRequired(); Silverlight.__installationEventFired = true } else if (a.ErrorCode == 5014 || a.ErrorCode == 2106) { if (Silverlight.__verifySilverlight2UpgradeSuccess(a.getHost())) b = true } else b = true } catch (c) { } return b }; Silverlight.IsVersionAvailableOnLoad = function(b) { var a = false; try { if (Silverlight.__verifySilverlight2UpgradeSuccess(b.getHost())) a = true } catch (c) { } return a }; Silverlight.__verifySilverlight2UpgradeSuccess = function(d) { var c = false, b = "2.0.31005", a = null; try { if (d.IsVersionSupported(b + ".99")) { a = Silverlight.onRequiredVersionAvailable; c = true } else if (d.IsVersionSupported(b + ".0")) a = Silverlight.onRestartRequired; else a = Silverlight.onUpgradeRequired; if (a && !Silverlight.__installationEventFired) { a(); Silverlight.__installationEventFired = true } } catch (e) { } return c }

function onSilverlightError(sender, args) {
    var appSource = "";
    if (sender != null && sender != 0) {
        appSource = sender.getHost().Source;
    }

    var errorType = args.ErrorType;
    var iErrorCode = args.ErrorCode;

    if (errorType == "ImageError" || errorType == "MediaError") {
        log("Image or Media error in Silverlight");
        return;
    }

    var errMsg = "Error in Silverlight Application " + appSource + "\n";

    errMsg += "Code: " + iErrorCode + "    \n";
    errMsg += "Category: " + errorType + "       \n";
    errMsg += "Message: " + args.ErrorMessage + "     \n";

    if (errorType == "ParserError") {
        errMsg += "File: " + args.xamlFile + "     \n";
        errMsg += "Line: " + args.lineNumber + "     \n";
        errMsg += "Position: " + args.charPosition + "     \n";
    }
    else if (errorType == "RuntimeError") {
        if (args.lineNumber != 0) {
            errMsg += "Line: " + args.lineNumber + "     \n";
            errMsg += "Position: " + args.charPosition + "     \n";
        }
        errMsg += "MethodName: " + args.methodName + "     \n";
    }
    onHandledErrorMessage(errMsg);
}

///////////////////////////////////////////////////////////////////////////////
//
//  Silverlight.supportedUserAgent.js   	version 2.0.40211.0
//
//  This file is provided by Microsoft as a helper file for websites that
//  incorporate Silverlight Objects. This file is provided under the Microsoft
//  Public License available at 
//  http://code.msdn.microsoft.com/SLsupportedUA/Project/License.aspx.  
//  You may not use or distribute this file or the code in this file except as 
//  expressly permitted under that license.
// 
//  Copyright (c) Microsoft Corporation. All rights reserved.
//
///////////////////////////////////////////////////////////////////////////////

if (!window.Silverlight) {
    window.Silverlight = {};
}

///////////////////////////////////////////////////////////////////////////////
//
// supportedUserAgent:
//
// NOTE: This function is strongly tied to current implementations of web 
// browsers. The implementation of this function will change over time to 
// account for new Web browser developments. Visit 
// http://code.msdn.microsoft.com/SLsupportedUA often to ensure that you have
// the latest version.
//
// Determines if the client browser is supported by Silverlight. 
//
//  params:
//   version [string] 
//         determines if a particular version of Silverlight supports
//         this browser. Acceptable values are "1.0" and "2.0"
//   userAgent [string]
//         optional. User Agent string to be analized. If null then the
//         current browsers user agent string will be used.
//
//  return value: boolean
//
///////////////////////////////////////////////////////////////////////////////
Silverlight.supportedUserAgent = function(version, userAgent) {
    try {
        var ua = null;

        if (userAgent) {
            ua = userAgent;
        }
        else {
            ua = window.navigator.userAgent;
        }

        var slua = { OS: 'Unsupported', Browser: 'Unsupported' };

        //Silverlight does not support pre-Windows NT platforms
        if (ua.indexOf('Windows NT') >= 0 || ua.indexOf('Mozilla/4.0 (compatible; MSIE 6.0)') >= 0) {
            slua.OS = 'Windows';
        }
        else if (ua.indexOf('PPC Mac OS X') >= 0) {
            slua.OS = 'MacPPC';
        }
        else if (ua.indexOf('Intel Mac OS X') >= 0) {
            slua.OS = 'MacIntel';
        }
        else if (ua.indexOf('Linux') >= 0) {
            slua.OS = 'Linux';
        }

        if (slua.OS != 'Unsupported') {
            if (ua.indexOf('MSIE') >= 0) {
                if (navigator.userAgent.indexOf('Win64') == -1) {
                    if (parseInt(ua.split('MSIE')[1]) >= 6) {
                        slua.Browser = 'MSIE';
                    }
                }
            }
            else if (ua.indexOf('Firefox') >= 0) {
                var versionArr = ua.split('Firefox/')[1].split('.');
                var major = parseInt(versionArr[0]);
                if (major >= 2) {
                    slua.Browser = 'Firefox';
                }
                else {
                    var minor = parseInt(versionArr[1]);
                    if ((major == 1) && (minor >= 5)) {
                        slua.Browser = 'Firefox';
                    }
                }
            }

            else if (ua.indexOf('Safari') >= 0) {
                slua.Browser = 'Safari';
            }
        }

        //detect all unsupported platform combinations (IE on Mac, Safari on Win)
        var supUA = (!(slua.OS == 'Unsupported' ||                             //Unsupported OS
                            slua.Browser == 'Unsupported' ||                        //Unsupported Browser
                            (slua.OS == 'Windows' && slua.Browser == 'Safari') ||   //Safari is not supported on Windows
                            (slua.OS.indexOf('Mac') >= 0 && slua.Browser == 'MSIE')   //IE is not supported on Mac
                                ));

        if (version == '2.0') {
            //add PPC and Linux to unsupported list
            return ((supUA && (slua.OS != 'MacPPC' && slua.OS != 'Linux')));
        }
        else if (version == '1.0') {
            //add win2k to unsupported list
            return (supUA && (ua.indexOf('Windows NT 5.0') < 0));
        }
        else {
            return (supUA);
        }
    }
    catch (e) {
        return false;
    }
}

function onSourceDownloadProgressChanged(sender, eventArgs) {
    var progress = sender.findName("Progress");
    var progressText = sender.findName("ProgressText");
    progress.Width = eventArgs.progress * 196;
    progressText.Text = parseInt(eventArgs.progress * 100) + "% loaded";
}

function onSourceDownloadComplete(sender, eventArgs) {
}

/// <reference path="~/UI/JScript/jquery-1.2.6.js" />

/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* $LastChangedDate: 2007-12-20 08:43:48 -0600 (Thu, 20 Dec 2007) $
* $Rev: 4257 $
*
* Version: 1.2
*
* Requires: jQuery 1.2+
*/
eval(function(p, a, c, k, e, r) { e = function(c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function(e) { return r[e] } ]; e = function() { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p } ('(5($){$.19={P:\'1.2\'};$.u([\'j\',\'w\'],5(i,d){$.q[\'O\'+d]=5(){p(!3[0])6;g a=d==\'j\'?\'s\':\'m\',e=d==\'j\'?\'D\':\'C\';6 3.B(\':y\')?3[0][\'L\'+d]:4(3,d.x())+4(3,\'n\'+a)+4(3,\'n\'+e)};$.q[\'I\'+d]=5(b){p(!3[0])6;g c=d==\'j\'?\'s\':\'m\',e=d==\'j\'?\'D\':\'C\';b=$.F({t:Z},b||{});g a=3.B(\':y\')?3[0][\'8\'+d]:4(3,d.x())+4(3,\'E\'+c+\'w\')+4(3,\'E\'+e+\'w\')+4(3,\'n\'+c)+4(3,\'n\'+e);6 a+(b.t?(4(3,\'t\'+c)+4(3,\'t\'+e)):0)}});$.u([\'m\',\'s\'],5(i,b){$.q[\'l\'+b]=5(a){p(!3[0])6;6 a!=W?3.u(5(){3==h||3==r?h.V(b==\'m\'?a:$(h)[\'U\'](),b==\'s\'?a:$(h)[\'T\']()):3[\'l\'+b]=a}):3[0]==h||3[0]==r?S[(b==\'m\'?\'R\':\'Q\')]||$.N&&r.M[\'l\'+b]||r.A[\'l\'+b]:3[0][\'l\'+b]}});$.q.F({z:5(){g a=0,f=0,o=3[0],8,9,7,v;p(o){7=3.7();8=3.8();9=7.8();8.f-=4(o,\'K\');8.k-=4(o,\'J\');9.f+=4(7,\'H\');9.k+=4(7,\'Y\');v={f:8.f-9.f,k:8.k-9.k}}6 v},7:5(){g a=3[0].7;G(a&&(!/^A|10$/i.16(a.15)&&$.14(a,\'z\')==\'13\'))a=a.7;6 $(a)}});5 4(a,b){6 12($.11(a.17?a[0]:a,b,18))||0}})(X);', 62, 72, '|||this|num|function|return|offsetParent|offset|parentOffset|||||borr|top|var|window||Height|left|scroll|Left|padding|elem|if|fn|document|Top|margin|each|results|Width|toLowerCase|visible|position|body|is|Right|Bottom|border|extend|while|borderTopWidth|outer|marginLeft|marginTop|client|documentElement|boxModel|inner|version|pageYOffset|pageXOffset|self|scrollTop|scrollLeft|scrollTo|undefined|jQuery|borderLeftWidth|false|html|curCSS|parseInt|static|css|tagName|test|jquery|true|dimensions'.split('|'), 0, {}));

/* Copyright (c) 2008 Kean Loong Tan http://www.gimiti.com/kltan
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* jFlow
* Version: 1.0 (May 13, 2008)
* Requires: jQuery 1.2+
*/

/**
* jQuery Lightbox
* Version 0.5 - 11/29/2007
* @author Warren Krewenki
*
* This package is distributed under the BSD license.
* For full license information, see LICENSE.TXT
*
* Based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
* Originally written to make use of the Prototype framework, and Script.acalo.us, now altered to use jQuery.
*
*
**/

(function($) {

    $.fn.lightbox = function(options) {
        // build main options
        var opts = $.extend({}, $.fn.lightbox.defaults, options);

        return this.each(function() {
            $(this).click(function() {
                // initalize the lightbox
                initialize();
                start(this);
                return false;
            });
        });

        /**
        * initalize()
        *
        * @return void
        * @author Warren Krewenki
        */

        function initialize() {
            $('#overlay').remove();
            $('#lightbox').remove();
            opts.inprogress = false;

            // if jsonData, build the imageArray from data provided in JSON format
            if (opts.jsonData && opts.jsonData.length > 0) {
                var parser = opts.jsonDataParser ? opts.jsonDataParser : $.fn.lightbox.parseJsonData;
                opts.imageArray = [];
                opts.imageArray = parser(opts.jsonData);
            }

            var outerImage = '<div id="outerImageContainer"><div id="imageContainer"><iframe id="lightboxIframe" /><img id="lightboxImage"><div id="hoverNav"><a href="javascript://" title="' + opts.strings.prevLinkTitle + '" id="prevLink"></a><a href="javascript://" id="nextLink" title="' + opts.strings.nextLinkTitle + '"></a></div><div id="loading"><a href="javascript://" id="loadingLink"><img src="' + opts.fileLoadingImage + '"></a></div></div></div>';
            var imageData = '<div id="imageDataContainer" class="clearfix"><div id="imageData"><div id="imageDetails"><span id="caption"></span><span id="numberDisplay"></span></div><div id="bottomNav">';

            if (opts.displayHelp)
                imageData += '<span id="helpDisplay">' + opts.strings.help + '</span>';

            imageData += '<a href="javascript://" id="bottomNavClose" title="' + opts.strings.closeTitle + '"><img src="' + opts.fileBottomNavCloseImage + '"></a></div></div></div>';

            var string;

            if (opts.navbarOnTop) {
                string = '<div id="overlay"></div><div id="lightbox">' + imageData + outerImage + '</div>';
                $("body").append(string);
                $("#imageDataContainer").addClass('ontop');
            } else {
                string = '<div id="overlay"></div><div id="lightbox">' + outerImage + imageData + '</div>';
                $("body").append(string);
            }

            $("#overlay").click(function() { end(); }).hide();
            $("#lightbox").click(function() { end(); }).hide();
            $("#loadingLink").click(function() { end(); return false; });
            $("#bottomNavClose").click(function() { end(); return false; });
            $('#outerImageContainer').width(opts.widthCurrent).height(opts.heightCurrent);
            $('#imageDataContainer').width(opts.widthCurrent);

            if (!opts.imageClickClose) {
                $("#lightboxImage").click(function() { return false; });
                $("#hoverNav").click(function() { return false; });
            }
        };

        function getPageSize() {
            var jqueryPageSize = new Array($(document).width(), $(document).height(), $(window).width(), $(window).height());
            return jqueryPageSize;
        };

        function getPageScroll() {
            var xScroll, yScroll;

            if (self.pageYOffset) {
                yScroll = self.pageYOffset;
                xScroll = self.pageXOffset;
            } else if (document.documentElement && document.documentElement.scrollTop) {  // Explorer 6 Strict
                yScroll = document.documentElement.scrollTop;
                xScroll = document.documentElement.scrollLeft;
            } else if (document.body) {// all other Explorers
                yScroll = document.body.scrollTop;
                xScroll = document.body.scrollLeft;
            }

            var arrayPageScroll = new Array(xScroll, yScroll);
            return arrayPageScroll;
        };

        function pause(ms) {
            var date = new Date();
            var curDate = null;
            do { curDate = new Date(); }
            while (curDate - date < ms);
        };

        function start(imageLink) {
            $("span.sel .spike").fadeOut();
            $("select, embed, object").hide();
            var arrayPageSize = getPageSize();
            $("#overlay").hide().css({ width: '100%', height: arrayPageSize[1] + 'px', opacity: opts.overlayOpacity }).fadeIn();
            imageNum = 0;

            // if data is not provided by jsonData parameter
            if (!opts.jsonData) {
                opts.imageArray = [];
                // if image is NOT part of a set..
                if (!imageLink.rel || (imageLink.rel == '')) {
                    // add single image to Lightbox.imageArray
                    opts.imageArray.push(new Array(imageLink.href, opts.displayTitle ? imageLink.title : ''));
                } else {
                    // if image is part of a set..
                    $("a").each(function() {
                        if (this.href && (this.rel == imageLink.rel)) {
                            opts.imageArray.push(new Array(this.href, opts.displayTitle ? this.title : ''));
                        }
                    });
                }
            }

            if (opts.imageArray.length > 1) {
                for (i = 0; i < opts.imageArray.length; i++) {
                    for (j = opts.imageArray.length - 1; j > i; j--) {
                        if (opts.imageArray[i][0] == opts.imageArray[j][0]) {
                            opts.imageArray.splice(j, 1);
                        }
                    }
                }
                while (opts.imageArray[imageNum][0] != imageLink.href) { imageNum++; }
            }

            // calculate top and left offset for the lightbox
            var arrayPageScroll = getPageScroll();
            var lightboxTop = arrayPageScroll[1] + (arrayPageSize[3] / 10);
            var lightboxLeft = arrayPageScroll[0];
            $('#lightbox').css({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show();


            if (!opts.slideNavBar)
                $('#imageData').hide();

            changeImage(imageNum);
        };

        function changeImage(imageNum) {
            if (opts.inprogress == false) {
                opts.inprogress = true;
                opts.activeImage = imageNum; // update global var

                // hide elements during transition
                $('#loading').show();
                $('#lightboxImage').hide();
                $('#hoverNav').hide();
                $('#prevLink').hide();
                $('#nextLink').hide();

                if (opts.slideNavBar) { // delay preloading image until navbar will slide up
                    // $('#imageDataContainer').slideUp(opts.navBarSlideSpeed, $.fn.doChangeImage);
                    $('#imageDataContainer').hide();
                    $('#imageData').hide();
                    doChangeImage();
                } else {
                    doChangeImage();
                }
            }
        };

        function doChangeImage() {

            imgPreloader = new Image();

            // once image is preloaded, resize image container
            imgPreloader.onload = function() {
                var newWidth = imgPreloader.width;
                var newHeight = imgPreloader.height;


                if (opts.fitToScreen) {
                    var arrayPageSize = getPageSize();
                    var ratio;
                    var initialPageWidth = arrayPageSize[2] - 2 * opts.borderSize;
                    var initialPageHeight = arrayPageSize[3] - 200;

                    if (imgPreloader.height > initialPageHeight) {
                        newWidth = parseInt((initialPageHeight / imgPreloader.height) * imgPreloader.width);
                        newHeight = initialPageHeight;
                    }
                    else if (imgPreloader.width > initialPageWidth) {
                        newHeight = parseInt((initialPageWidth / imgPreloader.width) * imgPreloader.height);
                        newWidth = initialPageWidth;
                    }
                }

                $('#lightboxImage').attr('src', opts.imageArray[opts.activeImage][0])
							       .width(newWidth).height(newHeight);
                resizeImageContainer(newWidth, newHeight);
            };

            imgPreloader.src = opts.imageArray[opts.activeImage][0];
        };

        function end() {
            disableKeyboardNav();
            $("span.sel .spike").fadeIn();
            $('#lightbox').hide();
            $('#overlay').fadeOut();
            $('select, object, embed').show();

        };

        function preloadNeighborImages() {
            if (opts.loopImages && opts.imageArray.length > 1) {
                preloadNextImage = new Image();
                preloadNextImage.src = opts.imageArray[(opts.activeImage == (opts.imageArray.length - 1)) ? 0 : opts.activeImage + 1][0]

                preloadPrevImage = new Image();
                preloadPrevImage.src = opts.imageArray[(opts.activeImage == 0) ? (opts.imageArray.length - 1) : opts.activeImage - 1][0]
            } else {
                if ((opts.imageArray.length - 1) > opts.activeImage) {
                    preloadNextImage = new Image();
                    preloadNextImage.src = opts.imageArray[opts.activeImage + 1][0];
                }
                if (opts.activeImage > 0) {
                    preloadPrevImage = new Image();
                    preloadPrevImage.src = opts.imageArray[opts.activeImage - 1][0];
                }
            }
        };

        function resizeImageContainer(imgWidth, imgHeight) {
            // get current width and height
            opts.widthCurrent = $("#outerImageContainer").outerWidth();
            opts.heightCurrent = $("#outerImageContainer").outerHeight();

            // get new width and height
            var widthNew = Math.max(350, imgWidth + (opts.borderSize * 2));
            var heightNew = (imgHeight + (opts.borderSize * 2));

            // scalars based on change from old to new
            opts.xScale = (widthNew / opts.widthCurrent) * 100;
            opts.yScale = (heightNew / opts.heightCurrent) * 100;

            // calculate size difference between new and old image, and resize if necessary
            wDiff = opts.widthCurrent - widthNew;
            hDiff = opts.heightCurrent - heightNew;

            $('#imageDataContainer').animate({ width: widthNew }, opts.resizeSpeed, 'linear');
            $('#outerImageContainer').animate({ width: widthNew }, opts.resizeSpeed, 'linear', function() {
                $('#outerImageContainer').animate({ height: heightNew }, opts.resizeSpeed, 'linear', function() {
                    showImage();
                });
            });

            // if new and old image are same size and no scaling transition is necessary,
            // do a quick pause to prevent image flicker.
            if ((hDiff == 0) && (wDiff == 0)) {
                if (jQuery.browser.msie) { pause(250); } else { pause(100); }
            }

            $('#prevLink').height(imgHeight);
            $('#nextLink').height(imgHeight);
        };

        function showImage() {
            $('#loading').hide();
            $('#lightboxImage').fadeIn("fast");
            updateDetails();
            preloadNeighborImages();

            opts.inprogress = false;
        };

        function updateDetails() {

            $('#numberDisplay').html('');

            if (opts.imageArray[opts.activeImage][1]) {
                $('#caption').html(opts.imageArray[opts.activeImage][1]).show();
            }

            // if image is part of set display 'Image x of x'
            if (opts.imageArray.length > 1) {
                var nav_html;

                nav_html = opts.strings.image + (opts.activeImage + 1) + opts.strings.of + opts.imageArray.length;

                if (!opts.disableNavbarLinks) {
                    // display previous / next text links
                    if ((opts.activeImage) > 0 || opts.loopImages) {
                        nav_html = '<a title="' + opts.strings.prevLinkTitle + '" href="#" id="prevLinkText">' + opts.strings.prevLinkText + "</a>" + nav_html;
                    }

                    if (((opts.activeImage + 1) < opts.imageArray.length) || opts.loopImages) {
                        nav_html += '<a title="' + opts.strings.nextLinkTitle + '" href="#" id="nextLinkText">' + opts.strings.nextLinkText + "</a>";
                    }
                }

                $('#numberDisplay').html(nav_html).show();
            }

            if (opts.slideNavBar) {
                $("#imageData").slideDown(opts.navBarSlideSpeed);
            } else {
                $("#imageData").show();
            }

            var arrayPageSize = getPageSize();
            $('#overlay').height(arrayPageSize[1]);
            updateNav();
        };

        function updateNav() {
            if (opts.imageArray.length > 1) {
                $('#hoverNav').show();

                // if loopImages is true, always show next and prev image buttons 
                if (opts.loopImages) {
                    $('#prevLink,#prevLinkText').show().click(function() {
                        changeImage((opts.activeImage == 0) ? (opts.imageArray.length - 1) : opts.activeImage - 1); return false;
                    });

                    $('#nextLink,#nextLinkText').show().click(function() {
                        changeImage((opts.activeImage == (opts.imageArray.length - 1)) ? 0 : opts.activeImage + 1); return false;
                    });

                } else {
                    // if not first image in set, display prev image button
                    if (opts.activeImage != 0) {
                        $('#prevLink,#prevLinkText').show().click(function() {
                            changeImage(opts.activeImage - 1); return false;
                        });
                    }

                    // if not last image in set, display next image button
                    if (opts.activeImage != (opts.imageArray.length - 1)) {
                        $('#nextLink,#nextLinkText').show().click(function() {

                            changeImage(opts.activeImage + 1); return false;
                        });
                    }
                }

                enableKeyboardNav();
            }
        };

        function keyboardAction(e) {
            var o = e.data.opts
            var keycode = e.keyCode;
            var escapeKey = 27;

            var key = String.fromCharCode(keycode).toLowerCase();

            if ((key == 'x') || (key == 'o') || (key == 'c') || (keycode == escapeKey)) { // close lightbox
                end();
            } else if ((key == 'p') || (keycode == 37)) { // display previous image
                if (o.loopImages) {
                    disableKeyboardNav();
                    changeImage((o.activeImage == 0) ? (o.imageArray.length - 1) : o.activeImage - 1);
                }
                else if (o.activeImage != 0) {
                    disableKeyboardNav();
                    changeImage(o.activeImage - 1);
                }
            } else if ((key == 'n') || (keycode == 39)) { // display next image
                if (opts.loopImages) {
                    disableKeyboardNav();
                    changeImage((o.activeImage == (o.imageArray.length - 1)) ? 0 : o.activeImage + 1);
                }
                else if (o.activeImage != (o.imageArray.length - 1)) {
                    disableKeyboardNav();
                    changeImage(o.activeImage + 1);
                }
            }
        };

        function enableKeyboardNav() {
            $(document).bind('keydown', { opts: opts }, keyboardAction);
        };

        function disableKeyboardNav() {
            $(document).unbind('keydown');
        };

    };

    $.fn.lightbox.parseJsonData = function(data) {
        var imageArray = [];

        $.each(data, function() {
            imageArray.push(new Array(this.url, this.title));
        });

        return imageArray;
    };

    $.fn.lightbox.defaults = {
        fileLoadingImage: RootUrl + '/App_Themes/Default/images/Gallery/loading.gif',
        fileBottomNavCloseImage: RootUrl + '/App_Themes/Default/images/Gallery/closelabel.gif',
        overlayOpacity: 0.8,
        borderSize: 10,
        imageArray: new Array,
        activeImage: null,
        inprogress: false,
        resizeSpeed: 350,
        widthCurrent: 250,
        heightCurrent: 250,
        xScale: 1,
        yScale: 1,
        displayTitle: true,
        navbarOnTop: false,
        slideNavBar: false, // slide nav bar up/down between image resizing transitions
        navBarSlideSpeed: 350,
        displayHelp: false,
        strings: {
            help: ' \u2190 / P - previous image\u00a0\u00a0\u00a0\u00a0\u2192 / N - next image\u00a0\u00a0\u00a0\u00a0ESC / X - close image gallery',
            prevLinkTitle: 'previous image',
            nextLinkTitle: 'next image',
            prevLinkText: '&laquo; Previous',
            nextLinkText: 'Next &raquo;',
            closeTitle: 'close image gallery',
            image: 'Image ',
            of: ' of '
        },
        fitToScreen: false, 	// resize images if they are bigger than window
        disableNavbarLinks: false,
        loopImages: false,
        imageClickClose: true,
        jsonData: null,
        jsonDataParser: null
    };

})(jQuery);


(function($) {

    $.fn.jFlow = function(options) {
        var opts = $.extend({}, $.fn.jFlow.defaults, options);
        var cur = 0;
        var maxi = $(".jFlowControl").length;
        $(this).find(".jFlowControl").each(function(i) {
            $(this).click(function() {
                $(".jFlowControl").removeClass("jFlowSelected");
                $(this).addClass("jFlowSelected");
                var dur = Math.abs(cur - i + 1);
                $(opts.slides).animate({
                    marginLeft: "-" + (i * $(opts.slides).find(":first-child").width() + "px")
                }, opts.duration * (dur));
                cur = i;
                log($(this).get(0).innerText);
            });
        });

        $(opts.slides).before('<div id="jFlowSlide"></div>').appendTo("#jFlowSlide");

        $(opts.slides).find("div.item").each(function() {
            $(this).before('<div class="jFlowSlideContainer"></div>').appendTo($(this).prev());
        });

        //initialize the controller
        $(".jFlowControl").eq(cur).addClass("jFlowSelected");

        var resize = function(x) {
            $("#jFlowSlide").css({
                position: "relative",
                width: opts.width,
                height: opts.height,
                overflow: "hidden"
            });

            $(opts.slides).css({
                position: "relative",
                width: $("#jFlowSlide").width() * $(".jFlowControl").length + "px",
                height: $("#jFlowSlide").height() + "px",
                overflow: "hidden"
            });

            $(opts.slides).children().css({
                position: "relative",
                width: $("#jFlowSlide").width() + "px",
                height: $("#jFlowSlide").height() + "px",
                "float": "left"
            });

            $(opts.slides).css({
                marginLeft: "-" + (cur * $(opts.slides).find(":first-child").width() + "px")
            });
        }

        resize();

        $(window).resize(function() {
            resize();
        });

        $(".jFlowPrev").click(function() {
            if (cur > 0)
                cur--;
            else
                cur = maxi - 1;

            $(".jFlowControl").removeClass("jFlowSelected");
            $(opts.slides).animate({
                marginLeft: "-" + (cur * $(opts.slides).find(":first-child").width() + "px")
            }, opts.duration);
            $(".jFlowControl").eq(cur).addClass("jFlowSelected");
        });

        $(".jFlowNext").click(function() {
            if (cur < maxi - 1)
                cur++;
            else
                cur = 0;

            $(".jFlowControl").removeClass("jFlowSelected");
            $(opts.slides).animate({
                marginLeft: "-" + (cur * $(opts.slides).find(":first-child").width() + "px")
            }, opts.duration);
            $(".jFlowControl").eq(cur).addClass("jFlowSelected");
        });
    };

    $.fn.jFlow.defaults = {
        easing: "swing",
        duration: 400,
        width: "100%"
    };

})(jQuery);


function initializeContentSlider() {
    if ($("div.FrontMenu") == null) return;
    $(".FrontMenu").fadeIn("slow");
    $(".Graduate").css({ "display": "block" });
    $("div.FrontMenu div.Bar span.item:first").addClass("sel");

    $("div.FrontMenu div.Bar a").click(function() {
        $("div.FrontMenu div.Bar").children("span.sel").removeClass("sel");
        $(this).parent().addClass("sel");
        return false;
    });

    $(".FrontMenu").jFlow({
        slides: ".FrontMenu .Panel",
        width: "662px",
        height: "360px",
        duration: 300
    });

    $(".FrontMenu div.Panel > *").addClass("item");

    $(".FrontMenu div.Panel .CmsContentBox").show();

    $(".FrontMenu .Bar a").mouseover(function() { $(this).addClass("hover"); });
    $(".FrontMenu .Bar a").mouseout(function() { $(this).removeClass("hover"); });

}

// Handles specified cliend side exception.
function onHandledError(exception) {
    if (exception) onHandledErrorMessage(exception.message);
}

// Handles specified client side error message by calling server-side error handler.
function onHandledErrorMessage(errorMessage) {
    try {
        PageMethods.OnJavaScriptError(errorMessage);
    }
    catch (exception) {
        // don't handle errors while logging errors.
    }
}

// Handles specified unhandled Silverlight error message.
function onUnhandledErrorMessage(errorMessage) {
    //minimizeApplication();
    onHandledErrorMessage(errorMessage);
    //throw new Error("Unhandled Error in Silverlight " + errorMessage);
    //alert("Error in Silverlight: " + errorMessage);
}

// Log client side events on server. 
function log(message) {
    try {
        PageMethods.JavaScriptLog(message);
    }
    catch (exception) {
        // don't handle errors while logging.
        //throw (exception);
    }
}

jQuery.fn.switchClass = function(fromClassName, toClassName) {
    this.removeClass(fromClassName);
    this.addClass(toClassName);
    return this;
};

jQuery.fn.delay = function(time, func) {
    return this.each(function() {
        setTimeout(func, time);
    });
};

jQuery.fn.setFocus = function() {
    var control = this.get(0);
    control.hasFocus = true;
    control.focus();
    return this;
};

jQuery.fn.removeFocus = function() {
    this.get(0).hasFocus = false;
    return this;
};

jQuery.fn.hasFocus = function() {
    return this.get(0).hasFocus;
};

jQuery.fn.widthContainer = function() {
    return this.width() + this.outerWidth();
};

jQuery.fn.heightContainer = function() {
    return this.height() + this.outerHeight();
};

// Set focus on control specified by clientId.
function setFocus(focusControlId) {
    if (!focusControlId || focusControlId == "") return;
    var focusControl = $("#" + focusControlId);
    if (!focusControl) return;
    try {
        focusControl.setFocus();
    }
    catch (e) {
        onHandledError(e);
    }
}

var applicationDiv = $("#"); // to get JQuery Intellisense
var applicationContainer = $("#");
var applicationObject = $();
var applicationContainerDefaultWidth;
var applicationContainerDefaultHeight;
var applicationDivDefaultPosition;
var resizeTimer = null;
var windowWidth, windowHeight, documentHeight, documentWidth;

$(document).ready(function() {
    initialize();
});

$(window).bind('resize', function() {
    if (resizeTimer) clearTimeout(resizeTimer);
    resizeTimer = setTimeout(onResize, 100);
});

$(window).bind('unload', function() {

});

function initialize() {
    initializeBrowserDetection();
    applicationDiv = $("#ApplicationId");
    applicationContainer = $("#ApplicationContainer");
    applicationObject = $("#ClientApplication");
    applicationDivDefaultPosition = applicationDiv.position();
    applicationContainerDefaultWidth = applicationContainer.width();
    applicationContainerDefaultHeight = applicationContainer.height();
    calculateWindowDimension();
    //wrapButton();
    initializeTextBox();
    initializeButton();
    initializeDropDownList();
    initializeLink();
    //initializeMascot();
    if (!isAnimationSupported()) applicationDiv.css({ "position": "absolute" });
    //alert(applicationObject.height() + ' ' + applicationDiv.height() + ' ' + applicationContainer.height());
    initializeNotification();
    initializeContentSlider();
    initializeReadMore();
}

function initializeBrowserDetection() {
    $.browser.msie6 = (document.all && !window.opera && !window.XMLHttpRequest && $.browser.msie) ? true : false; // specific detection for IE6 browser.
}

// Returns whether animation is supported for application resizing.
function isAnimationSupported() {
    return !($.browser.mozilla || $.browser.msie6);
    // for some reason IE6 and Mozilla doesn't work ok for application resizing animation.
    // IE7 and Safari works ok. 
}

function maximizeApplication() {
    applicationDiv.css({ "position": "absolute", "top": applicationDivDefaultPosition.top, "left": applicationDivDefaultPosition.left });
    applicationContainer.css({ "display": "block", "width": applicationContainerDefaultWidth, "height": applicationContainerDefaultHeight });
    if (isAnimationSupported()) {
        applicationDiv.animate({ top: "0", left: "0", width: windowWidth, height: windowHeight }, 750, 'swing',
        function() {
            applicationDiv.css({ "width": "100%", "height": "100%" });
        });
    }
    else {
        applicationDiv.css({ top: "0", left: "0" });
        applicationDiv.width("100%");
        applicationDiv.height("100%");
    }
    log("Maximized");
}

function minimizeApplication() {
    if (isAnimationSupported()) {
        applicationDiv.css({ "width": windowWidth, "height": windowHeight });
        applicationDiv.animate({ width: "512", height: "384", top: applicationDivDefaultPosition.top, left: applicationDivDefaultPosition.left }, 750, 'swing',
        function() {
            applicationDiv.css({ "position": "relative", "top": 0, "left": 0 });
        });
    }
    else {
        applicationDiv.css({ "top": applicationDivDefaultPosition.top, "left": applicationDivDefaultPosition.left });
        applicationDiv.width(512);
        applicationDiv.height(384);
    }
    log("Minimized");
}

function hideApplication() {
    //applicationObject.switchClass("Application", "ApplicationHide");
    applicationObject.css({ "top": "-10000" });
    //alert('hide');
}

function showApplication() {
    applicationObject.css({ "top": "0" });
}

function initializeTextBox() {
    var textBox = $(":text, :password");
    textBox.focus(
        function() {
            $(this).setFocus();
            $(this).switchClass("TextBoxBlur", "TextBoxFocus");
        });
    textBox.blur(
        function() {
            $(this).removeFocus();
            $(this).switchClass("TextBoxFocus", "TextBoxBlur");
            $(this).removeClass("TextBoxMouseOver");
        });
    textBox.mouseover(
        function() {
            $(this).switchClass("TextBoxMouseOut", "TextBoxMouseOver");
        });
    textBox.mouseout(
        function() {
            if (!($(this).hasFocus())) {
                $(this).switchClass("TextBoxMouseOver", "TextBoxMouseOut");
            }
        });
    //    textBox.keydown(
    //        function() {
    //            $(this).removeClass("TextBoxKeyUp").addClass("TextBoxKeyDown");
    //        });
    //    textBox.keyup(
    //        function() {
    //            $(this).removeClass("TextBoxKeyDown").addClass("TextBoxKeyUp");
    //        });
    //        textBox.keypress(
    //        function() {
    //            $(this).removeClass("TextBoxKeyUp").addClass("TextBoxKeyDown").delay(250,
    //                function() {
    //                    $(this).removeClass("TextBoxKeyDown");
    //                    $(this).addClass("TextBoxKeyUp");
    //                });
    //        });

}

function initializeButton() {
    var button = $(":submit");
    button.focus(
        function() {
            //            $(this).setFocus();
            //            $(this).switchClass("ButtonBlur", "ButtonFocus");
        });
    //    button.blur(
    //        function() {
    //            $(this).removeFocus();
    //            $(this).switchClass("ButtonFocus", "ButtonBlur");
    //            $(this).removeClass("ButtonMouseOver");
    //        });
    button.mouseover(
        function() {
            $(this).switchClass("ButtonMouseOut", "ButtonMouseOver");
        });
    button.mouseout(
        function() {
            if (!($(this).hasFocus())) {
                $(this).switchClass("ButtonMouseOver", "ButtonMouseOut");
            }
        });
}

function initializeDropDownList() {
    var dropdownlist = $(".DropDownList");
    dropdownlist.focus(
        function() {
            $(this).switchClass("DropDownListBlur", "DropDownListFocus");
        });
    dropdownlist.blur(
        function() {
            $(this).switchClass("DropDownListFocus", "DropDownListBlur");
        });
}

function initializeLink() {
    var link = $("a");
    link.focus(
        function() {
            //$(this).switchClass("DropDownListBlur", "DropDownListFocus");
        });
    link.blur(
        function() {
            //$(this).switchClass("DropDownListFocus", "DropDownListBlur");
        });
}

function wrapButton() {
    var button = $(":submit");
    var divWrapper = document.createElement("div");
    divWrapper.setAttribute("class", "Button");
    var dlWrapper = document.createElement("dl");
    var dtWrapper = document.createElement("dt");
    divWrapper.appendChild(dlWrapper).appendChild(dtWrapper);
    button.wrap(divWrapper);
    button.mouseover(
        function() {
            var divWrapper = getWrapperDiv($(this));
            divWrapper.removeClass();
            divWrapper.addClass("ButtonOver");
        });
    button.mouseout(
        function() {
            var divWrapper = getWrapperDiv($(this));
            divWrapper.removeClass();
            divWrapper.addClass("Button");
        });
}

function getWrapperDiv(button) {
    return button.parent().parent().parent();
}

function calculateWindowDimension() {
    windowHeight = $(window).height();
    windowWidth = $(window).width();
    documentHeight = $(document).height();
    documentWidth = $(document).width();
}

function onResize() {
    calculateWindowDimension();
    initializeNotification();
    //log("Resized to " + windowWidth + " x " + windowHeight); // log all resizing events.
}

function initializeNotification() {
    if (hasNotification()) {
        notification = $(".Notification");
        var notificationWidth = notification.width();
        var left = (windowWidth - notificationWidth) / 2;
        notification.css({ "left": left, "top": 0, "visibility": "visible" });
        notification.click(
            function() {
                $(this).fadeOut(500);
                log("Hide server notification.");
            });
        notification.mouseover(
            function() {
                $(this).addClass("NotificationHover");
            });
        //moveNotificationTo(null, null);
    }
}

function hasNotification() {
    var notification = $(".Notification");
    return (notification.find("div").length != 0);
}

function beginAjaxRequestHandle(sender, args) {

}

function endAjaxRequestHandle(sender, args) {
    initializeNotification();
    //initializeMascot();
}

function page_init() {
    Sys.Application.add_navigate(onStateChanged);
}

function onStateChanged(sender, e) {
    // When the page is navigated, this event is raised.
    var state = e.get_state().state;
    //alert('Revert to state ' + state);
    //    var val = parseInt(e.get_state().s || '0');
}

// Set a history point in client script.
function addHistoryPoint(stateInfo) {
    //Sys.Application.addHistoryPoint({ state: stateInfo }, "Title:" + val);
    //if (stateInfo == '') return;
    //window.location.hash = stateInfo;
    log(stateInfo);
    Sys.Application.addHistoryPoint({ state: stateInfo });
}

function showReadMore(id, e) {
    hideReadMoreLayers();
    var layer = $("#" + id);
    if (layer == null) return;
    var top = e.pageY + 20 + "px";
    var left = (windowWidth - layer.width()) / 2 + "px";
    //    layer.css({"top": top, "left": left, "position" : "absolute", "zIndex": "1000000" });
    layer.css({ "top": top, "left": left, "position": "absolute", "display": "block", opacity: "0" });
    layer.animate({ opacity: "0.90" }, 1000, "swing");
}

this.setReadMore = function() {
    //    $("a.tooltip").mousemove(function(e) {
    //        $("#tooltip")
    //			.css("top", (e.pageY - yOffset) + "px")
    //			.css("left", (e.pageX + xOffset) + "px");
    //        var height = $("#tooltip").height();
    //        yOffset = height - 40;
    //    });
    //    $("a.tooltip").mouseover(function(e) {
    //        if (!isFirst) return;
    //        this.t = this.title;
    //        this.title = "";
    //        isFirst = false;
    //    });
    $("a.ReadMoreLink").click(function(e) {
        //        $("body").append("<div id='tooltip'><div class='tooltipCont'><h4>The Card Security Number</h4>" + this.t + "</div></div>");
        //        //var height = $("#tooltip").height();		
        //        var height = 447;
        //        yOffset = height - 40;
        //        $("#tooltip")
        //			.css("top", (e.pageY - yOffset) + "px")
        //			.css("left", (e.pageX + xOffset) + "px")
        //			.fadeIn("fast");
        var rel = $(this).attr("rel");
        showReadMore(rel, e);
        return false;
    },
	function() {
	    //	    this.title = this.t;
	    //	    $("#tooltip").remove();
	});

};

function initializeReadMore() {
    setReadMore();
    $("body").click(function(e) {
        var target = $(e.target);
        var obj = target.get(0);
        if (obj && obj.className && obj.className == 'ReadMoreLink') return;
        hideReadMoreLayers();
    });
}

function hideReadMoreLayers() {
    var readMoreLayers = $(".ReadMoreLayer");
    if (readMoreLayers == null) return;
    readMoreLayers.each(function() {
        if (this.style.display != 'none') {
            $(this).fadeOut("fast");
        }
    });
}

function printApplication() {
    window.print();
}

function setPrintContainer(content) {
    $("#Print").append(content);
}

function showHideMoreInfo() {
    var moreInfoPanel = $("#MoreInfoPanel");
    if (!moreInfoPanel) return;
    var div = moreInfoPanel.get(0);
    if (div.style.display == 'none') {
        moreInfoPanel.show();
    }
    else {
        moreInfoPanel.hide();
    }
}