function preloadImages(){ //  Example: preloadImages('file.gif', 'http://www.x.com/y.gif');
	if(document.images){
		if(!document.imageArray) document.imageArray = new Array();
			var i,j = document.imageArray.length, args = preloadImages.arguments;
    
			for(i=0; i<args.length; i++){
				if (args[i].indexOf("#")!=0){
					document.imageArray[j] = new Image;
					document.imageArray[j++].src = args[i];
			}
		}
	}
}

function switchImage(imgName, imgSrc){
	if (document.images){
		if (imgSrc != "none"){
			document.images[imgName].src = imgSrc;
	    }
	}
}

function flashGetPageType() {
	window.document.fl_menu.SetVariable("/:tier1Down", tier1Down);
	window.document.fl_menu.SetVariable("/:tier2Down", tier2Down);
}


function getContest(){
	var addy = document.contest.contest_email.value
	getPage('contest_entry.asp?email=' + addy,'contestEntry',600,500,'yes','center','no','no','yes','no','no','no');
}

function getPromo(url,winFocus,winName){
	getPage(url,winName,630,450,'yes','center','no','no','no','no','no','no')
}

function getPage(mypage,myname,w,h,scroll,winPos,location,dirs,status,menubar,toolbar,resize){
	
	if(winPos == "random") {
		LeftPosition = (screen.width)?Math.floor(Math.random() * (screen.width - w)):100;
		TopPosition = (screen.height)?Math.floor(Math.random() * ((screen.height - h) - 75)):100;
	
	}
	
	else if(winPos == "center") {
		LeftPosition = (screen.width)?(screen.width - w) / 2:100;
		TopPosition = (screen.height)?(screen.height - h) / 2:100;
	
	}
	
	else if ((winPos != "center" && winPos != "random") || winPos==null) {
		LeftPosition = (screen.width)?(screen.width - w) - 10:100;
		TopPosition = 5;
	
	}
	
	settings = 'width='+ w +',height='+ h +',top='+ TopPosition +',left='+ LeftPosition +',scrollbars='+ scroll +',location=' + location + ',directories=' + dirs + ',status=' + status + ',menubar=' + menubar + ',toolbar=' + toolbar + ',resizable=' + resize;
	popWin = window.open(mypage,myname,settings);

}

function getStandings(){
	w = 450;
	h = 480;
	url = 'http://schedule.oua.ca/OUASchedule.ASP?WCI=Command&WCE=Hockey*Mens*2003-2004*standings'
	LeftPosition = (screen.width)?(screen.width - w) / 2:100;
	TopPosition = (screen.height)?(screen.height - h) / 2:100;
	settings = 'width=' + w + ',height=' + h + ',top='+ TopPosition +',left='+ LeftPosition +',scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	popWin = window.open(url,'Standings',settings);
}



function FDK_playFlash(ID) {
	loc = eval("window.document."+ID);
	if (!FDK_loaded) {
		while (!FDK_loaded) {
			if(loc.PercentLoaded() == 100)  {
				loc.Play();
				FDK_loaded = true;
			}
		}
	}
	else  {
		loc.Play();
	}
}

function MM_findObj(n, d) { //v4.0 Macromedia Function
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0 Macromedia Function used by opening flashDiv animation...
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
  	if (v == 'hidden'){
  		if (playPromo == 'true'){
			getPage('tourneyAdSm.asp','tourneyAd',285,150,'no',null,'no','no','no','no','no','no');
		} 
	}
	if (tier1Down == ""){
		//switchImage('frtBotAd', frtBotAdImg);
	}		
}

function populate() {
	
	
	
}

function scrollmarquee() {
	if (iedom){
		if (parseInt(cross_marquee.style.left) > (actualwidth*(-1) + 8)){
			cross_marquee.style.left = parseInt(cross_marquee.style.left) - copyspeed;
		} else {
		cross_marquee.style.left = marqueewidth + 8;
		}
	} else if (document.layers){
		if (ns_marquee.left > (actualwidth*(-1) + 8)){
			ns_marquee.left -= copyspeed;
		} else {
			ns_marquee.left = marqueewidth + 8;
		}
	}	
}