$(document).ready(

	function() {
	    $("#quickLinks").change(function() {
	        var url = $(this).find(':selected').attr("url");
	        window.location = url;
	    });

	    $("#toggleSiteMap2").click(function() {
	        $("#sitemapContainer2").slideToggle("fast", function() {
	            if ((document.getElementById("sitemapContainer2").style.display) == 'none') {
	                $("#toggleSiteMap2").css({ backgroundPosition: '90px 17px' });
	            } else {
	                $("#toggleSiteMap2").css({ backgroundPosition: '90px -64px' });
	            };
	        });
	    });

	    if ((document.getElementById("sitemapContainer2").style.display) == 'none') {
	        $("#toggleSiteMap2").css({ backgroundPosition: '90px 17px' });
	    } else {
	        $("#toggleSiteMap2").css({ backgroundPosition: '90px -64px' });
	    };

	    $("#news").easySlider({
	        controlsBefore: '<span id="controls">',
	        controlsAfter: '</span>',
	        prevId: 'newsLeft',
	        nextId: 'newsRight'
	    });




	    $("#spotlight #items").easySlider({
	        auto: true,
	        vertical: true,
	        continuous: true,
	        pause: 8000,
	        prevId: 'prevBtn2',
	        prevText: '<img style="border:none; padding:2px;" src="/Style%20Library/cotc-assets/images/arrow/arrow-up-blue.gif"/>',
	        nextId: 'nextBtn2',
	        nextText: '<img style="border:none; padding:2px;" src="/Style%20Library/cotc-assets/images/arrow/arrow-down-blue.gif"/>'

	    });


	    $("#events").easySlider({
	        controlsBefore: '<span id="controls">',
	        controlsAfter: '</span>',
	        vertical: true,
	        controlsFade: false,
	        prevId: 'prevBtn',
	        prevText: '<img style="border:none; padding:2px;" src="/Style%20Library/cotc-assets/images/arrow/arrow-up-blue.gif"/>',
	        nextId: 'nextBtn',
	        nextText: '<img style="border:none; padding:2px;" src="/Style%20Library/cotc-assets/images/arrow/arrow-down-blue.gif"/>'


	    });

	    $("#headerImages").innerfade({
	        speed: 750, timeout: 10000
	    });

	    $("#logoBar").click(function() {

	        $(".submenu").slideUp("fast");
	        $(".men").css({
	            backgroundPosition: 'center 100px'
	        });
	        $("#navHolder").animate({ marginTop: "190px" }, 500);
	    });


	    $(".men").hover(function() {
	        var back = $(this).css("background-color");
	        var temp = $(this).find('div');
	        $(this).find('div ul').css({ "background-color": back });
	        temp.stop(true, true);
	        temp.slideDown("fast");
	    }, function() {
	        var temp = $(this).find('div');
	        temp.stop(true, true);
	        temp.slideUp("fast");
	    });




	    $("#eventItems2").easySlider({
	        auto: true,
	        vertical: false,
	        continuous: true,
	        pause: 8000,
	        controlsShow: false
	    });

	    $("#mainButtonsContainer div").hover(
		function() {
		    $(this).stop(true);
		    $(this).animate({ width: "180px" });
		},
		function() {
		    $(this).stop(true);
		    $(this).animate({ width: "150px" });
		}
		);

	    $("a[@href^=http]").each(
        function() {
            if (this.href.indexOf(location.hostname) == -1) {
                $(this).attr('target', '_blank');
            }
        }
      )

	    $("*[id$='_RichImageField'] img").removeAttr("style").addClass("greenBox");

	    $("input.search").Watermark("Search COTC");

	    $("input.search").keypress(function(e) {
	        if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
	            $('input[type=image].default').click();
	            return false;
	        } else {
	            return true;
	        }
	    });

	}


);