var xMediaContent  = new Array();
var xMediaImage    = new Image;
var iCurrentImage  = 0;
var iInternalCount = 5000;
var xTimerHandle   = null;
var bTimerRunning  = false;
	
	//sctca logo
	image01off=new Image()
	image01on=new Image()

	image01off.src="./images/sctca.jpg"
	image01on.src="./images/sctca.jpg"


//---------------------------------------------------------------------||
// USER DEFINED VARIABLES                                              ||
// PURPOSE:     Set these variables to customize your script           ||
//              TimeInSecondsBetweenCycles - Seconds to wait before    ||
//                                           cycling to the next image ||
//              LoadInNewWindow            - When true, the link will  ||
//                                           be opened in a new window ||
//                                           otherwise, it will load in||
//                                           the current window.       ||
//              WrapAtEnd                  - Wraps to start at end.    ||
//                                                                     ||
//              MEDIAIMAGE                - Needs defined in your HTML ||
//                                           page as an image name.    ||
//---------------------------------------------------------------------||
var TimeInSecondsBetweenCycles = 5;
var LoadInNewWindow = false;
var WrapAtEnd       = true;


//---------------------------------------------------------------------||
// MEDIA FILES TO LOAD                                                 ||
// PURPOSE:     This is the image that you wish displayed, followed by ||
//              the URL to link to.  All images should be on even      ||
//              numbered lines, URLS on odd.  Pay careful attention to ||
//              increment the counter inside of the [] symbols when you||
//              add more images.  There is no maximum to the amount of ||
//              images you can load.                                   ||
//---------------------------------------------------------------------||
xMediaContent[0] = "./images/frontpage/largelogowbcc.jpg";
xMediaContent[1] = "./images/dashow.jpg";
xMediaContent[2] = "./images/oldground2.jpg";
xMediaContent[3] = "./images/oldground4.jpg";
xMediaContent[4] = "./images/raza1.jpg";
xMediaContent[5] = "./images/jatrip/DSCN0142.jpg";
xMediaContent[6] = "./images/jatrip/DSCN0143.jpg";
xMediaContent[7] = "./images/jatrip/DSCN0227.jpg";
xMediaContent[8] = "./images/Final 2004/pic 2.jpg";
xMediaContent[9] = "./images/Final 2004/pic 3.jpg";
xMediaContent[10] = "./images/Final 2004/pic 4.jpg";
xMediaContent[11] = "./images/Final 2004/pic 5.jpg";
xMediaContent[12] = "./images/Bridgeport.gif";



//---------------------------------------------------------------------||
// FUNCTION:    MediaStop                                              ||
// PARAMETERS:                                                         ||
// RETURNS:                                                            ||
// PURPOSE:     Moves the media                                        ||
//---------------------------------------------------------------------||
function MediaStop()
{
    if( bTimerRunning )
        clearTimeout( xTimerHandle );

    bTimerRunning = false;
}


//---------------------------------------------------------------------||
// FUNCTION:    MediaGoBack                                            ||
// PARAMETERS:                                                         ||
// RETURNS:                                                            ||
// PURPOSE:     Moves the media                                        ||
//---------------------------------------------------------------------||
function MediaGoBack()
{
    MediaStop();

    if (WrapAtEnd)
      (iCurrentImage == 0) ? iCurrentImage = (xMediaContent.length - 1) : iCurrentImage-=1;
    else
      (iCurrentImage == 0) ? iCurrentImage = 0 : iCurrentImage-=1;

    document.MEDIAIMAGE.src = xMediaContent[iCurrentImage];
}


//---------------------------------------------------------------------||
// FUNCTION:    MediaGoForward                                         ||
// PARAMETERS:                                                         ||
// RETURNS:                                                            ||
// PURPOSE:     Moves the media                                        ||
//---------------------------------------------------------------------||
function MediaGoForward()
{
    MediaStop();

    if (WrapAtEnd)
      (iCurrentImage == (xMediaContent.length - 1)) ? iCurrentImage = 0 : iCurrentImage+=1;
    else
      (iCurrentImage == (xMediaContent.length - 1)) ? iCurrentImage = iCurrentImage : iCurrentImage+=1;

    document.MEDIAIMAGE.src = xMediaContent[iCurrentImage];
}


//---------------------------------------------------------------------||
// FUNCTION:    MediaInternalCycle                                     ||
// PARAMETERS:                                                         ||
// RETURNS:                                                            ||
// PURPOSE:     Internal media cycle routine                           ||
//---------------------------------------------------------------------||
function MediaInternalCycle()
{
    (iCurrentImage == (xMediaContent.length - 1)) ? iCurrentImage = 0 : iCurrentImage+=1;
    if( document.MEDIAIMAGE ) document.MEDIAIMAGE.src = xMediaContent[iCurrentImage];

    xTimerHandle   = setTimeout("MediaInternalCycle()", iInternalCount);
    bTimerRunning  = true;
}


//---------------------------------------------------------------------||
// FUNCTION:    MediaStart                                             ||
// PARAMETERS:                                                         ||
// RETURNS:                                                            ||
// PURPOSE:     Starts the media cycling. Call with 'OnLoad' from body ||
//              tag to have an image start cycling on page load.       ||
//---------------------------------------------------------------------||
function MediaStart()
{
	iInternalCount = TimeInSecondsBetweenCycles * 1000;
    MediaStop();
    MediaInternalCycle();
}


//---------------------------------------------------------------------||
// FUNCTION:    MediaClick                                             ||
// PARAMETERS:                                                         ||
// RETURNS:                                                            ||
// PURPOSE:     Clicks straight through to your media URL              ||
//---------------------------------------------------------------------||
function MediaClick()
{
    if( LoadInNewWindow ) {
        URL = xMediaContent[iCurrentImage+1];
        win=window.open(URL,"NewWindow","");
        if (!win.opener)win.opener=self;
    } else
        document.location.href = xMediaContent[iCurrentImage+1];
}


//---------------------------------------------------------------------||
// FUNCTION:    MediaClickWithInfo                                     ||
// PARAMETERS:                                                         ||
// RETURNS:                                                            ||
// PURPOSE:     Clicks to the URL you have listing in your media, plus ||
//              the value passed in as 'ADDITIONAL INFO'.  This is     ||
//              useful if you have defined your media URL's as         ||
//              directories, and have multiple files in those directori||
//---------------------------------------------------------------------||
function MediaClickWithInfo( AdditionalInfo )
{
    if( LoadInNewWindow ) {
        URL = xMediaContent[iCurrentImage+1] + AdditionalInfo;
        win=window.open(URL,"NewWindow","");
        if (!win.opener)win.opener=self;
    } else
        document.location.href = (xMediaContent[iCurrentImage+1] + AdditionalInfo);
}

//scrolling script
var scroll = true;
var myDir = 'L';

var scrollingText = "Bridgeport has won 5 games out of 6. " +
                     "BCC has jumped to second position in the league's point table..........." +
                     "BCC will be travelling to Waterbury to play UCC this Sunday.............." +
                     " ";

function scrollit() {
    if (scroll) {
        document.scrolling.textbox.value = scrollingText;
        if (myDir == 'L') 
            scrollingText = scrollingText.substring(1) +
                             scrollingText.substring(0,1);
        else
            scrollingText =  scrollingText.substring(scrollingText.length-1,scrollingText.length) +
                              scrollingText.substring(0,scrollingText.length-1);
        setTimeout('scrollit()',300);
    }
}

function dropdown(mySel)
{
var myWin, myVal;
myVal = mySel.options[mySel.selectedIndex].value;
if(myVal)
   {
   if(mySel.form.target)myWin = parent[mySel.form.target];
   else myWin = window;
   if (! myWin) return true;
   myWin.location = myVal;
   }
return false;
}

			////mouse over
			var bName = navigator.appName; 
			var bVer = parseInt(navigator.appVersion); 
			var NS4 = (bName == "Netscape" && bVer >= 4); 
			var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4); 
			function ColorOn (id,mycolor)
			{ 
			if (!mycolor) 
				{ 
					mycolor = '#cc6666' 					
				}; 
			if (NS4) 
			{ 
				eval ('window.document.' + id + '.bgColor = \'' + mycolor + '\''); 
			} 
			else if (IE4) 
			{ 
				eval (id + '.style.background = \'' + mycolor + '\''); 
			} 
			} 
			function ColorOff (id)
			{ 
				if (NS4) 
				{ 
					eval ('window.document.'+ id + '.bgColor = null'); 
				} 
				else if (IE4) 
				{ 
					eval (id + '.style.background = \'\''); 
				} 
			}




/***********************************************
* Carousel Slideshow script- © Ger Versluis 2003
* Permission granted to DynamicDrive.com to feature script
* This notice must stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

/********************************************************
	Create a div with transparent place holder in your html	
	<div id="Carousel" style="position:relative">
		<img src="placeholder.gif" width="404" height="202">
	</div>
	placeholder width:
		 4 sided: 1.42 * carousel image width + 3
		 6 sided: 2 * carousel image width +4
		 8 sided: 2.62 * carousel image width + 5
		12 sided: 3.87 * carousel image width + 7
	placeholder height: 
		carousel image height+2

	Insert onload in body tag
		<body onload="Carousel()">	
*********************************************************/

			// 7 variables to control behavior
	
	var Car_Image_Width=200;
	var Car_Image_Height=200;
	var Car_Border=true;		// true or false
	var Car_Border_Color="white";
	var Car_Speed=2;
	var Car_Direction=true;		// true or false
	var Car_NoOfSides=8;		// must be 4, 6, 8 or 12

/* array to specify images and optional links. 
	For 4 sided carousel specify at least 2 images
	For 6 sided carousel specify at least 3
	For 8 sided carousel specify at least 4
	For 12 sided carousel specify at least 6
 If Link is not needed keep it ""
*/
	Car_Image_Sources=new Array(
		"Picture001_1.JPG", "",
    "Picture002_2.JPG", "",
    "Picture003_3.JPG", "",
    "Picture004_4.JPG", "",
    "Picture005_5.JPG", "",
    "Picture006_6.JPG", "",
    "Picture007_7.JPG", "",
    "Picture008_8.JPG", "",
    "Picture009_9.JPG", "",
    "Picture010_10.JPG", "",
    "Picture011_11.JPG", "",
    "Picture012_12.JPG", "",
    "Picture013_13.JPG", "",
    "Picture014_14.JPG", "",
    "Picture015_15.JPG", "",
    "Picture016_16.JPG", "",
    "Picture017_17.JPG", "",
    "Picture018_18.JPG", "",
    "Picture019_19.JPG", "",
    "Picture020_20.JPG", "",
    "Picture021_21.JPG", "",
    "Picture022_22.JPG", "",
    "Picture023_23.JPG", "",
    "Picture024_24.JPG", "",
    "Picture025_25.JPG", "",
    "Picture026_26.JPG", "",
    "Picture027_27.JPG", "",
    "Picture028_28.JPG", "",
    "Picture029_29.JPG", "",
    "Picture030_30.JPG", "",
    "Picture031_31.JPG", "",
    "Picture032_32.JPG", "",
    "Picture033_33.JPG", "",
    "Picture034_34.JPG", "",
    "Picture035_35.JPG", "",
    "Picture036_36.JPG", "",
    "Picture037_37.JPG", "",
    "Picture038_38.JPG", "",
    "Picture039_39.JPG", "",
    "Picture040_40.JPG", "",
    "Picture041_41.JPG", "",
    "Picture042_42.JPG", "",
    "Picture043_43.JPG", "",
    "Picture044_44.JPG", "",
    "Picture045_45.JPG", "",
    "Picture046_46.JPG", "",
    "Picture047_47.JPG", "",
    "Picture048_48.JPG", "",
    "Picture049_49.JPG", "",
    "Picture050_50.JPG", "",
    "Picture051_51.JPG", "",
    "Picture052_52.JPG", "",
    "Picture053_53.JPG", "",
    "Picture054_54.JPG", "",
    "Picture055_55.JPG", "",
    "Picture056_56.JPG", "",
    "Picture057_57.JPG", "",
    "Picture058_58.JPG", "",
    "Picture059_59.JPG", "",
    "Picture060_60.JPG", "",
    "Picture061_61.JPG", "",
    "Picture062_62.JPG", "",
    "Picture063_63.JPG", "",
    "Picture064_64.JPG", "",
    "Picture065_65.JPG", "",
    "Picture066_66.JPG", "",
    "Picture067_67.JPG", "",
    "Picture068_68.JPG", "",
    "Picture069_69.JPG", "",
    "Picture070_70.JPG", "",
    "Picture071_71.JPG", "",
    "Picture072_72.JPG", "",
    "Picture073_73.JPG", "",
    "Picture074_74.JPG", "",
    "Picture075_75.JPG", "",
    "Picture076_76.JPG", "",
    "Picture077_77.JPG", "",
    "Picture078_78.JPG", "",
    "Picture079_79.JPG", "",
    "Picture080_80.JPG", "",
    "Picture081_81.JPG", "",
    "Picture082_82.JPG", "",
    "Picture083_83.JPG", "",
    "Picture084_84.JPG", "",
    "Picture085_85.JPG", "",
    "Picture086_86.JPG", "",
    "Picture087_87.JPG", "",
    "Picture088_88.JPG", "",
    "Picture089_89.JPG", "",
    "Picture090_90.JPG", "",
    "Picture091_91.JPG", "",
    "Picture092_92.JPG",""				
		);

/***************** DO NOT EDIT BELOW **********************************/
	CW_I=new Array(Car_NoOfSides/2+1);C_ClcW=new Array(Car_NoOfSides/2);
	C_Coef=new Array(
		3*Math.PI/2,0,3*Math.PI/2,11*Math.PI/6,Math.PI/6,3*Math.PI/2,7*Math.PI/4,	0,
		Math.PI/4,3*Math.PI/2,5*Math.PI/3,11*Math.PI/6,0,Math.PI/6,Math.PI/3);
	var C_CoefOf=Car_NoOfSides==4?0:Car_NoOfSides==6?2:Car_NoOfSides==8?5:9;
	C_Pre_Img=new Array(Car_Image_Sources.length);
	var C_Angle=Car_Direction?Math.PI/(Car_NoOfSides/2):0,C_CrImg=Car_NoOfSides,C_MaxW,C_TotalW,
	C_Stppd=false,i,C_LeftOffset,C_HalfNo=Car_NoOfSides/2;

	function Carousel(){
		if(document.getElementById){
			for(i=0;i<Car_Image_Sources.length;i+=2){
				C_Pre_Img[i]=new Image();C_Pre_Img[i].src=Car_Image_Sources[i]}
			C_MaxW=Car_Image_Width/Math.sin(Math.PI/Car_NoOfSides)+C_HalfNo+1;
			Car_Div=document.getElementById("Carousel");
			for(i=0;i<C_HalfNo;i++){
				CW_I[i]=document.createElement("img");Car_Div.appendChild(CW_I[i]);	
				CW_I[i].style.position="absolute";
				CW_I[i].style.top=0+"px";
				CW_I[i].style.height=Car_Image_Height+"px";
				if(Car_Border){
					CW_I[i].style.borderStyle="solid";
					CW_I[i].style.borderWidth=1+"px";
					CW_I[i].style.borderColor=Car_Border_Color}
				CW_I[i].src=Car_Image_Sources[2*i];
				CW_I[i].lnk=Car_Image_Sources[2*i+1];
				CW_I[i].onclick=C_LdLnk;
				CW_I[i].onmouseover=C_Stp;
				CW_I[i].onmouseout=C_Rstrt}
			CarImages()}}

	function CarImages(){
		if(!C_Stppd){
			C_TotalW=0;
			for(i=0;i<C_HalfNo;i++){
				C_ClcW[i]=Math.round(Math.cos(Math.abs(C_Coef[C_CoefOf+i]+C_Angle))*Car_Image_Width);
				C_TotalW+=C_ClcW[i]}
			C_LeftOffset=(C_MaxW-C_TotalW)/2;
			for(i=0;i<C_HalfNo;i++){
				CW_I[i].style.left=C_LeftOffset+"px";
				CW_I[i].style.width=C_ClcW[i]+"px";
				C_LeftOffset+=C_ClcW[i]}
			C_Angle+=Car_Speed/720*Math.PI*(Car_Direction?-1:1);
			if((Car_Direction&&C_Angle<=0)||(!Car_Direction&&C_Angle>=Math.PI/C_HalfNo)){
				if(C_CrImg==Car_Image_Sources.length)C_CrImg=0;
				if(Car_Direction){
					CW_I[C_HalfNo]=CW_I[0];
					for(i=0;i<C_HalfNo;i++)CW_I[i]=CW_I[i+1];
					CW_I[C_HalfNo-1].src=Car_Image_Sources[C_CrImg];
					CW_I[C_HalfNo-1].lnk=Car_Image_Sources[C_CrImg+1]}
				else{	for(i=C_HalfNo;i>0;i--)CW_I[i]=CW_I[i-1];
					CW_I[0]=CW_I[C_HalfNo];
					CW_I[0].src=Car_Image_Sources[C_CrImg];
					CW_I[0].lnk=Car_Image_Sources[C_CrImg+1]}
				C_Angle=Car_Direction?Math.PI/C_HalfNo:0;C_CrImg+=2}}
		setTimeout("CarImages()",50)}

	function C_LdLnk(){if(this.lnk)window.location.href=this.lnk}
	function C_Stp(){this.style.cursor=this.lnk?"pointer":"default";C_Stppd=true;}
	function C_Rstrt() { C_Stppd = false }






	/* This script and many more are available free online at
	The JavaScript Source :: http://javascript.internet.com
	Created by: Travis Beckham :: http://www.squidfingers.com | http://www.podlob.com
	version date: 06/02/03 :: If want to use this code, feel free to do so,
	but please leave this message intact. (Travis Beckham) */

	// Node Functions

	if (!window.Node) {
	    var Node = { ELEMENT_NODE: 1, TEXT_NODE: 3 };
	}

	function checkNode(node, filter) {
	    return (filter == null || node.nodeType == Node[filter] || node.nodeName.toUpperCase() == filter.toUpperCase());
	}

	function getChildren(node, filter) {
	    var result = new Array();
	    var children = node.childNodes;
	    for (var i = 0; i < children.length; i++) {
	        if (checkNode(children[i], filter)) result[result.length] = children[i];
	    }
	    return result;
	}

	function getChildrenByElement(node) {
	    return getChildren(node, "ELEMENT_NODE");
	}

	function getFirstChild(node, filter) {
	    var child;
	    var children = node.childNodes;
	    for (var i = 0; i < children.length; i++) {
	        child = children[i];
	        if (checkNode(child, filter)) return child;
	    }
	    return null;
	}

	function getFirstChildByText(node) {
	    return getFirstChild(node, "TEXT_NODE");
	}

	function getNextSibling(node, filter) {
	    for (var sibling = node.nextSibling; sibling != null; sibling = sibling.nextSibling) {
	        if (checkNode(sibling, filter)) return sibling;
	    }
	    return null;
	}
	function getNextSiblingByElement(node) {
	    return getNextSibling(node, "ELEMENT_NODE");
	}

	// Menu Functions & Properties

	var activeMenu = null;

	function showMenu() {
	    if (activeMenu) {
	        activeMenu.className = "";
	        getNextSiblingByElement(activeMenu).style.display = "none";
	    }
	    if (this == activeMenu) {
	        activeMenu = null;
	    } else {
	        this.className = "active";
	        getNextSiblingByElement(this).style.display = "block";
	        activeMenu = this;
	    }
	    return false;
	}

	function initMenu() {
	    var menus, menu, text, a, i;
	    menus = getChildrenByElement(document.getElementById("menu"));
	    for (i = 0; i < menus.length; i++) {
	        menu = menus[i];
	        text = getFirstChildByText(menu);
	        a = document.createElement("a");
	        menu.replaceChild(a, text);
	        a.appendChild(text);
	        a.href = "#";
	        a.onclick = showMenu;
	        a.onfocus = function() { this.blur() };
	    }
	}

	if (document.createElement) window.onload = initMenu;

