// general functions
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function () {
            oldonload();
            func();
        }
    }
}

function pageLoad(sender, args) {
    if (args.get_isPartialLoad()) {
        //tb_init('a.thickbox');   
    }
}

function getElementByClass(classname) {
    var messages = new Array();
    var inc = 0;
    var alltags = document.all ? document.all : document.getElementsByTagName("*");

    for (i = 0; i < alltags.length; i++) {
        if (alltags[i].className.match(classname)) {
            messages[inc++] = alltags[i];
        }
    }
    if (messages != null) { return messages; }
    else { return null; }
}

function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt, "Left"); }
function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt, "Top"); }
function getAbsPos(elt, which) {
    var iPos = 0;
    while (elt != null) {
        iPos += elt["offset" + which];
        elt = elt.offsetParent;
    }
    return iPos;
}

function enlargeImageThumb(x) {
    var eleMainImage = document.getElementById('ctl00_cph_content_main_img');
    var eleMainLnk = document.getElementById('ctl00_cph_content_main_lnk');
    var eleMainZoomLnk = document.getElementById('ctl00_cph_content_main_zoomlnk');
    var eleThumbImage = getElementByClass('thumb');

    if (eleMainLnk != null) {
        var s = x.href.split("?hi-res=");
        //alert(s[1]);
        eleMainZoomLnk.href = s[1];
        eleMainLnk.href = s[1];
        eleMainImage.src = x.href;
    }
    return false;
}

function applyEventsToImages() {
    var eleThumbLnk = getElementByClass('thumblnk');
    if (eleThumbLnk != null) {
        for (var intCounter = 0; intCounter < eleThumbLnk.length; intCounter++) {
            eleThumbLnk[intCounter].onmouseover = function () {
                enlargeImageThumb(this);
                return false;
            }
            eleThumbLnk[intCounter].onclick = function ()
            { return false; }
        }
    }
}

function validatePostCode(value, strDefault) {
    var postcodeFilter = /^[A-Za-z]{1,2}[0-9A-Za-z]{1,2}[ ]?[0-9]{0,1}[A-Za-z]{2}$/;

    if (!postcodeFilter.test(value) && value == '' || value == strDefault) {
        return true;
    }
    else {
        return false;
    }
}


function switchStyleSheet() {
    var objMac = document.getElementById('ctl00_cssMac');
    var isMac = navigator.userAgent.indexOf("Mac") != -1;

    if (objMac != null) {
        objMac.disabled = true;
        if (isMac) { objMac.disabled = false; }
    }

}


function checkPostCode(toCheck) {

    // Permitted letters depend upon their position in the postcode.
    var alpha1 = "[abcdefghijklmnoprstuwyz]";                       // Character 1
    var alpha2 = "[abcdefghklmnopqrstuvwxy]";                       // Character 2
    var alpha3 = "[abcdefghjkstuw]";                                // Character 3
    var alpha4 = "[abehmnprvwxy]";                                  // Character 4
    var alpha5 = "[abdefghjlnpqrstuwxyz]";                          // Character 5

    // Array holds the regular expressions for the valid postcodes
    var pcexp = new Array();

    // Expression for postcodes: AN NAA, ANN NAA, AAN NAA, and AANN NAA
    pcexp.push(new RegExp("^(" + alpha1 + "{1}" + alpha2 + "?[0-9]{1,2})(\\s*)([0-9]{1}" + alpha5 + "{2})$", "i"));

    // Expression for postcodes: ANA NAA
    pcexp.push(new RegExp("^(" + alpha1 + "{1}[0-9]{1}" + alpha3 + "{1})(\\s*)([0-9]{1}" + alpha5 + "{2})$", "i"));

    // Expression for postcodes: AANA  NAA
    pcexp.push(new RegExp("^(" + alpha1 + "{1}" + alpha2 + "?[0-9]{1}" + alpha4 + "{1})(\\s*)([0-9]{1}" + alpha5 + "{2})$", "i"));

    // Exception for the special postcode GIR 0AA
    pcexp.push(/^(GIR)(\s*)(0AA)$/i);

    // Standard BFPO numbers
    pcexp.push(/^(bfpo)(\s*)([0-9]{1,4})$/i);

    // c/o BFPO numbers
    pcexp.push(/^(bfpo)(\s*)(c\/o\s*[0-9]{1,3})$/i);

    // Overseas Territories
    pcexp.push(/^([A-Z]{4})(\s*)(1ZZ)$/i);

    // Load up the string to check
    var postCode = toCheck;

    // Assume we're not going to find a valid postcode
    var valid = false;

    // Check the string against the types of post codes
    for (var i = 0; i < pcexp.length; i++) {
        if (pcexp[i].test(postCode)) {

            // The post code is valid - split the post code into component parts
            pcexp[i].exec(postCode);

            // Copy it back into the original string, converting it to uppercase and
            // inserting a space between the inward and outward codes
            postCode = RegExp.$1.toUpperCase() + " " + RegExp.$3.toUpperCase();

            // If it is a BFPO c/o type postcode, tidy up the "c/o" part
            postCode = postCode.replace(/C\/O\s*/, "c/o ");

            // Load new postcode back into the form element
            valid = true;

            // Remember that we have found that the code is valid and break from loop
            break;
        }
    }

    // Return with either the reformatted valid postcode or the original invalid 
    // postcode
    if (valid) { return postCode; } else return false;
}

function ismaxlength(obj) {
    var mlength = obj.getAttribute ? parseInt(obj.getAttribute("maxlength")) : ""
    if (obj.getAttribute && obj.value.length > mlength)
        obj.value = obj.value.substring(0, mlength)
}


function doOpenMediaBox(evt, width, height, obj) {
    var md = document.getElementById('box-wrap');

    if (md != null) {
        if (md.style.display == '' || md.style.display == 'none') {
            doMedia(evt, width, height, obj)
            obj.className = 'media visible';
            //return false;
        }
        else { obj.className = 'media'; }
    }
}

function isValidEmail(email) {
    var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
    var address = email
    if (reg.test(address) == false) {
        return false;
    }
    else { return true; }
}

function doResetSelector() {
    var links = document.getElementById('media-bar');

    // Reset links
    if (links != null) {
        if (!links.getElementsByTagName) return false;
        var element = links.getElementsByTagName("li");
        for (var intCounter = 0; intCounter < element.length; intCounter++) {
            var strClass = element[intCounter].className;

            if (strClass.indexOf('selected') != -1) {
                strClass = strClass.substring(0, strClass.indexOf('selected'))
                element[intCounter].className = strClass;
            }
        }
    }

}

function showToolTip(e, text) {
    if (document.all) e = event;

    var obj = document.getElementById('bubble_tooltip');
    var obj2 = document.getElementById('bubble_tooltip_content');
    obj2.innerHTML = text;
    obj.style.display = 'block';
    var st = Math.max(document.body.scrollTop, document.documentElement.scrollTop);
    //if (navigator.userAgent.toLowerCase().indexOf('safari') >= 0) st = 0;
    var leftPos = e.clientX - 100;
    if (leftPos < 0) leftPos = 0;
    obj.style.left = leftPos + 'px';
    obj.style.top = e.clientY - obj.offsetHeight - 1 + st + 'px';
}

function hideToolTip() {
    document.getElementById('bubble_tooltip').style.display = 'none';
}

function setDefaultCookieValue(cookie_name, value) {
    var cookie = $.cookie(cookie_name);
    // if not set, set to value
    if (cookie == null) {
        $.cookie(cookie_name, value, { path: '/' });
    }
}
function hideTip() {
    $("#isp-tip").toggle();
}
this.tooltipSetup = function () {
    var timer = null;
    $(".tooltip").hover(
		function (e) {
		    if (timer) {
		        clearTimeout(timer);
		        timer = null;
		    }
		},
		function () {
		    timer = setTimeout('hideTip()', 1000);
		}
	);
    $("a[rel=tooltip]").hover(
		function (e) {
		    if (timer) {
		        clearTimeout(timer);
		        timer = null;
		    }
		    this.tip_id = this.title;
		    this.title = "";
		    $("#isp-tip").appendTo("isp_wrap");
		    $("#isp-tip").addClass("current").fadeIn("fast");
		},
		function () {
		    timer = setTimeout('hideTip()', 1000);
		}
	);
};

function doSelectBG(obj) {
    var ath = document.getElementById('ctl00_cph_content_tvFAQs');

    // update styles athletes
    if (ath != null) {
        var elementLI = ath.getElementsByTagName("li");

        for (var intCounter = 0; intCounter < elementLI.length; intCounter++) {
            var c = elementLI[intCounter].className;
            //alert(c);
            if (c.indexOf("AltRow AspNet-TreeView-Selected") >= 0) {
                elementLI[intCounter].className = 'AspNet-TreeView-Root AltRow';
            }
            else if (c.indexOf("AspNet-TreeView-Selected") >= 0) {
                elementLI[intCounter].className = 'AspNet-TreeView-Root';
            }
        }

        if (obj != null) {
            var elementLI = obj.parentNode.parentNode;
            var s = elementLI.className

            if (s.indexOf("AltRow AspNet-TreeView-Selected") >= 0) {
                elementLI.className = 'AspNet-TreeView-Root AltRow';
            }
            else if (s.indexOf("AspNet-TreeView-Selected") >= 0) {
                elementLI.className = 'AspNet-TreeView-Root';
            }
            else {
                //Cufon.refresh();
                elementLI.className += ' AspNet-TreeView-Selected';
            }

            $("#content-left").css("height", "auto");
            $("#content-right").css("height", "auto");
            $("#content-wrap").css("height", "auto");
        }
    }

}

function doShowDirections() {

    if ($('.directions').hasClass('open')) {
        $('.directions a').blur();
        $('.map .location').hide();
        $('.directions').animate({ height: '54px' }, { duration: 500, specialEasing: { height: 'swing' },
            complete: function () {
                //$('#lnkOpenClose span').text('Click here for Directions');
                $('.directions').removeClass('open');
            }
        });
        //$('.directions').animate({ height: '54px' }, { duration: 1000, specialEasing: { bottom: 'swing'} });
    }
    else {
        $('.directions a').blur();
        $('.directions').animate({ height: '94px' }, { duration: 500, specialEasing: { height: 'swing' },
            complete: function () {
                $('.map .location').show();
                //$('#lnkOpenClose span').text('Click to Close Directions');
                $('.directions').addClass('open')
            }
        });
        //$('.directions').animate({ height: '94px' }, { duration: 1000, specialEasing: { bottom: 'swing'} });
    }

}


function doOpenTab() {

    if ($('#media-bar').css("bottom") == '0px' || $('#media-bar').css("bottom") == '59px') {
        doCloseMedia()
    }
    else {
        $('#media-bar').animate({ bottom: '59px' }, { duration: 500, specialEasing: { bottom: 'swing'} });
        $('#bg-message').addClass('hide')
    }
}

function doCloseMedia() {
    $("#eventsPopupWrapper").hide();
    $('#close').addClass('hide');
    $('.menu a').removeClass('selected');
    $('#media-bar').css('z-index', '999');
    $('#media-content').animate({ height: '0px' }, { duration: 500, specialEasing: { height: 'swing' },
        complete: function () {
            $('#media-content').addClass('hide');
            $('#media-bar').css('z-index', '50');
            //Cufon($('#media-bar li a'), { fontFamily: 'FuturaLT', color: '#ffffff' })
            //$('#media-bar').css('bottom', '19px');
            $('#media-bar').animate({ bottom: '54px' }, { duration: 100, specialEasing: { bottom: 'swing'} });
            $('#media-content').css('padding-top', '0px');
            $('#media-content').css('margin-top', '0px');
            //$('#media-bar').css('bottom', '56px');
            $('#media_iframe').attr('src', '/media/blank.htm');

            $('#bg-overlay').fadeOut('fast', function () {
                $('#bg-overlay').css('opacity', '0.7');
                $('#bg-overlay').addClass('hide');
            });
        }
    });
}

function doMedia(opt, url, height) {
    if (!jQuery.browser.msie || jQuery.browser.version != 7) {
        $('#bg-overlay').removeClass('hide');
    }

    $('#close').removeClass('hide');
    $('#bg-overlay').show();
    $('#media-bar').css('bottom', '0px');
    $('#media-bar').css('zIndex', '999');
    $('#media_iframe').attr('src', url);
    $('#media_iframe').css("height", height + 'px');
    $('#media-content').css('padding-top', '33px');
    $('#media-content').css('margin-top', '20px');
    $('#media-content').removeClass('hide');
    $('#media-content').animate({ height: height + 'px' }, { duration: 500, specialEasing: { height: 'swing'} });

    //menus
    $('.menu a').removeClass('selected');
    $("." + opt + " a").addClass('selected');
    $("#eventsPopupWrapper").hide();
}

function cookieSetup() {
    setDefaultCookieValue('footer_show', 'collapsed');
    var footer_show = $.cookie('footer_show');

    // set up initial state
    if (footer_show == 'collapsed') {
        //$('.footer-bar', '#footer').removeClass('hider');
        //$('#footer-sections', '#footer').toggle();
        $('.footer-bar a.show', '#footer').html('Open Website Sitemap');
        Cufon.replace('.footer-bar a', { fontFamily: 'Copperplate Gothic Bold', color: '#595959' });
    } else {
        $('#footer-sections', '#footer').show();
        $('.footer-bar a.show', '#footer').html('Close Website Sitemap');
        $('.footer-bar', '#footer').addClass('hider');
        Cufon.replace('.footer-bar a', { fontFamily: 'Copperplate Gothic Bold', color: '#797979' });
        $('#footer-sections').equalHeights();
    }

    $('.footer-bar a.show', '#footer').mouseover(function () {
        Cufon($(this), { fontFamily: 'Copperplate Gothic Bold', color: '#797979' });
    });

    $('.footer-bar a.show', '#footer').mouseout(function () {
        Cufon($(this), { fontFamily: 'Copperplate Gothic Bold', color: '#595959' });
    });

    $('.footer-bar a.show', '#footer').click(
		function () {
		    footer_show = $.cookie('footer_show');
		    if (footer_show == 'collapsed') {
		        $('#footer-sections', '#footer').slideToggle();
		        $('.footer-bar a.show', '#footer').html('Close Website Sitemap');
		        Cufon.replace('.footer-bar a', { fontFamily: 'Copperplate Gothic Bold', color: '#797979' });
		        $('.footer-bar', '#footer').addClass('hider');
		        $('.footer-bar a.show', '#footer').blur();
		        $.cookie('footer_show', 'expanded', { path: '/' });
		        $('#footer-sections').equalHeights();
		    }
		    if (footer_show == 'expanded') {
		        $('.footer-bar', '#footer').removeClass('hider');
		        $('#footer-sections', '#footer').slideToggle();
		        $('.footer-bar a.show', '#footer').html('Open Website Sitemap');
		        $('.footer-bar a.show', '#footer').blur();
		        Cufon.replace('.footer-bar a', { fontFamily: 'Copperplate Gothic Bold', color: '#595959' });
		        $.cookie('footer_show', 'collapsed', { path: '/' });
		    }
		    return false;
		}
	);
}

function TreeViewSetup() {
    // setup the drop-down media selector
    var e = $('.AspNet-TreeView-ClickableNonLink');
    var c = $('.AspNet-TreeView-Collapse');

    e.click(function () {
        $("#content-wrap").css("height", "auto");
        $("#content-left").css({ 'height': 'auto', 'min-height': '800px' });
        $("#content-right").css({ 'height': 'auto', 'min-height': '400px' });
        $('#content-wrap').equalHeights();
    });

    c.click(function () {
        $("#content-wrap").css("height", "auto");
        $("#content-left").css({ 'height': 'auto', 'min-height': '800px' });
        $("#content-right").css({ 'height': 'auto', 'min-height': '400px' });
        $('#content-wrap').equalHeights();
    });
}

var carouselLinks;
var autoscroll;
var firedonce;
var timer;
var size = 3;
var step = 3;
function doCarouselSetup() {

    var obj = document.getElementById('carousel');

    if (obj != null) {
        carouselLinks = new glow.widgets.Carousel("#carousel", {
            id: "layeredCarousel",
            loop: true,
            size: size,
            step: step,
            animDuration: 2,
            pageNav: true,
            theme: "redtheme"
        });

        var carouselConfig = {
            interval: 100,
            sensitivity: 3,
            over: carouselHoverOver,
            timeout: 200,
            out: carouselHoverOut
        };

        $("#carousel a.lnkImg").hoverIntent(carouselConfig);

        $("#carousel a.lnkImg").mouseover(function () {
            Cufon($('.heading', this), { fontFamily: 'Copperplate Gothic Bold' });
        });

        $("#carousel a.lnkImg").mouseout(function () {
            Cufon($('.heading', this), { fontFamily: 'Copperplate Gothic Bold' });
        });

        timer = window.setTimeout(doCarouselRotate, delaytime);
    }
}

function carouselHoverOut() {
    autoscroll = false;
    Cufon($('.heading', this), { fontFamily: 'Copperplate Gothic Bold' });
    //$('.title', this).animate({ top: '100px' }, { duration: 500, specialEasing: { top: 'swing'} });
    timer = window.setTimeout(doCarouselRotate, delaytime);
}

function carouselHoverOver() {
    timer = window.clearTimeout(timer);
    autoscroll = true;
    Cufon($('.heading', this), { fontFamily: 'Copperplate Gothic Bold' });
    // $('.title', this).animate({ top: '0px' }, { duration: 500, specialEasing: { top: 'swing'} });
}

function doCarouselPrev() {
    carouselLinks.prev();
    autoscroll = true;
    timer = window.clearTimeout(timer);
}
function doCarouselNext() {
    carouselLinks.next();
    autoscroll = true;
    timer = window.clearTimeout(timer);
}
function doCarouselRotate() {
    Cufon($('#carousel a.lnkImg .heading'), { fontFamily: 'Copperplate Gothic Bold' });
    if (!(autoscroll)) {
        carouselLinks.next();
        timer = window.setTimeout(doCarouselRotate, delaytime);
    }
}

function newsSetup() {
    // setup the drop-down media selector
    var link = $('#nhlines a');
    link.mouseover(function () {
        link.blur()
        $('#nhlines li').removeClass('selected');
        $(this).parent().addClass('selected')
        return false;
    });
}


function quotestatSetup() {
    var timeout = 8000;
    var fadeout = 1500;
    var fadein = 1500;
    var duration = 2000;

    var quote = $('#main-wrapper .quote')
    var quote_wrap = $('#main-wrapper .quote .quote_wrap')
    var quote_source = $('#main-wrapper .quote .source')
    var stats = $('#main-wrapper .stats')

    if (quote.length > 0 && stats.length > 0) {
        quote.animate({ opacity: ['toggle', 'swing'] }, { duration: duration, specialEasing: { opacity: 'linear'} });
        //quote_wrap.animate({ opacity: ['toggle', 'swing'] }, { duration: duration, specialEasing: { opacity: 'linear' }});
        //quote_source.animate({ opacity: ['toggle', 'swing'] }, { duration: duration, specialEasing: { opacity: 'linear'} });            
        stats.animate({ opacity: ['toggle', 'swing'] }, { duration: duration, specialEasing: { opacity: 'linear'} });
        window.setTimeout(function () { quotestatSetup() }, timeout);
    }
    else if (stats.length > 0) {
        stats.show();
    }

}

var counter = 0;
function nextTweet() {
    var msg = $('#twitter #tweetMsg p.msg');
    var p = $('#twitter #tweetMsg p.posted');

    if (typeof (arrTweet) !== 'undefined') {
        if (arrTweet != null) {
            var numtweets = arrTweet.length;
            if (counter == numtweets) { counter = 0; }
            var tweet = arrTweet[counter];
            var id = arrStatusId[counter];
            var name = arrUserScreenName[counter];
            var posted = arrUserCreated[counter];

            msg.html(tweet).text();
            p.html('last updated ' + posted).text();

            counter += 1;
            $('#twitter #lnkReply').attr('href', 'http://twitter.com/home/?status=@' + account_name + '&in_reply_to_status_id=' + id + '&in_reply_to=' + name);
            $('#twitter #lnkRetweet').attr('href', 'http://twitter.com/home/?status=RT+@' + name + '+' + msg.html(tweet).text());
            $('#twitter #lnkFollow').attr('href', 'http://twitter.com/' + account_name);
            showTweet();
        }
    }
    else {
        var msg = $('#twitter #tweetMsg p.msg');
        var msg_wait = $('#twitter #tweetMsg p.msg-wait')
        var p = $('#twitter #tweetMsg p.posted');
        msg_wait.css("display", "none");
        $("#twitter #tweetMsg").css({ 'display': 'block' });
        msg.text('Twitter not available or maximum hit limit reached. I will try again in a few minutes...');
        p.text('');
    }
}

function showTweet() {
    var msg = $('#twitter #tweetMsg .container')
    var msg_wait = $('#twitter #tweetMsg p.msg-wait')
    msg_wait.css("display", "none");
    msg.animate({ opacity: ['toggle', 'swing'] }, { duration: duration, specialEasing: { width: 'linear'} });
    setTimeout(function () { msg.fadeOut(fadeout, nextTweet); }, timeout);
}

function marketingSetup() {
    var link = $('#promo_area .sidebar .item a');

    link.mouseover(function () {
        link.blur()
        $('#promo_area .sidebar .item a').removeClass('selected');
        $(this).addClass('selected')

        var index = $(this).parent('li').index();
        var area = $('#promo_area .content .item');
        area.removeClass('selected');
        area.eq(index).addClass('selected');
        return false;
    });
}


function doCloseMediaMessage() {
    $('#bg-message').addClass('hide')
    $.cookie('media_message', 'true');
}

function mediaMessageSetup() {
    setDefaultCookieValue('media_message', 'false');
    var result = $.cookie('media_message');

    if (result == 'false') {
        $('#bg-message').removeClass('hide')
        $.cookie('media_message', 'true', { path: '/' });
    }
}


function siteInit() {
    cookieSetup();
    tooltipSetup();
    mediaMessageSetup();
    //newsSetup();
    //marketingSetup();
    doCarouselSetup();
    quotestatSetup();
    nextTweet();
    $('#bg-overlay').click(function () { doCloseMedia(); });
    var browser = jQuery.uaMatch(navigator.userAgent).browser;
    $('body').addClass(browser);

    setTimeout(function () {
        // Set the navigation hover a states for CUFON
        $('#smart-menu #menuitems > li > a').each(function () {
            if ($(this).hasClass('CURRENT')) { Cufon($(this), { fontFamily: 'Copperplate Gothic Bold', color: '#595959' }); Cufon($('span.txt', this), { fontFamily: 'Copperplate Gothic Bold', color: '#595959' }); }
        });
    }, 10);

    //    $("#smart-menu #menuitems > li > a").mouseover(function () {
    //       if ($(this).hasClass('CURRENT')) { Cufon($(this), { fontFamily: 'FuturaLT', color: '#E3DB46' });}
    //        else { Cufon($(this), { fontFamily: 'FuturaLT', color: '#a6a6a6' }); }
    //    });
    //    $("#smart-menu #menuitems > li > a").mouseout(function () {
    //        if ($(this).hasClass('CURRENT')) {Cufon($(this), { fontFamily: 'FuturaLT', color: '#E3DB46' }); }
    //        else {Cufon($(this), { fontFamily: 'FuturaLT', color: '#ffffff' }); }
    //    });

    // Set the media hover a states for CUFON
    //    $("#media-bar .menu ul li a").mouseover(function () {
    //        if ($(this).hasClass('selected')) { Cufon($(this), { fontFamily: 'Copperplate Gothic Bold', color: '#E3DB46' }); }
    //        else { Cufon($(this), { fontFamily: 'FuturaLT', color: '#E3DB46' }); }
    //    });
    //    $("#media-bar .menu ul li a").mouseout(function () {
    //        if ($(this).hasClass('selected')) { Cufon($(this), { fontFamily: 'Copperplate Gothic Bold', color: '#E3DB46' }); }
    //        else {Cufon($(this), { fontFamily: 'FuturaLT', color: '#ffffff' }); }
    //    });

}

function colorboxInit() {
    $(".cb_link").colorbox({ innerWidth: 740, innerHeight: 457, iframe: true });
    $(".cb_link_news").colorbox({ innerWidth: 805, innerHeight: 520, iframe: true });
    $(".cb_link_events").colorbox({ innerWidth: 805, innerHeight: 487, iframe: true });
    $(".cb_link_map").colorbox({ innerWidth: 763, innerHeight: 580, iframe: true });
    $(".cb_link_media_youtube").colorbox({ innerWidth: 830, innerHeight: 475, iframe: true });
    $(".cb_link_media_flickr").colorbox({ innerWidth: 830, innerHeight: 485, iframe: true });
    $(".cb_link_media").colorbox({ innerWidth: 736, innerHeight: 460, iframe: true });
    $(".cb_link_image").colorbox({ photo: true, scalePhotos: true, overlayClose: true });
}

$(document).ready(function () {
    siteInit();
    //colorboxInit();
});

switchStyleSheet();

