//
// preloading menu images
//
home = new Image();
home.src = "/images/menu/home.gif";


about_us = new Image();
about_us.src = "/images/menu/about_us.gif";

tournaments_and_events = new Image();
tournaments_and_events.src = "/images/menu/tournaments_and_events.gif";

junior_golf = new Image();
junior_golf.src = "/images/menu/junior_golf.gif";

bc_golf_courses = new Image();
bc_golf_courses.src = "/images/menu/bc_golf_courses.gif";

sponsors = new Image();
sponsors.src = "/images/menu/sponsors.gif";

trade_show = new Image();
trade_show.src = "/images/menu/trade_show.gif";


award_winners = new Image();
award_winners.src = "/images/menu/award_winners.gif";

useful_links = new Image();
useful_links.src = "/images/menu/useful_links.gif";

contact_us = new Image();
contact_us.src = "/images/menu/contact_us.gif";



on_home = new Image();
on_home.src = "/images/menu/on_home.gif";


on_about_us = new Image();
on_about_us.src = "/images/menu/on_about_us.gif";

on_tournaments_and_events = new Image();
on_tournaments_and_events.src = "/images/menu/on_tournaments_and_events.gif";

on_junior_golf = new Image();
on_junior_golf.src = "/images/menu/on_junior_golf.gif";

on_bc_golf_courses = new Image();
on_bc_golf_courses.src = "/images/menu/on_bc_golf_courses.gif";

on_sponsors = new Image();
on_sponsors.src = "/images/menu/on_sponsors.gif";

on_trade_show = new Image();
on_trade_show.src = "/images/menu/on_trade_show.gif";

on_award_winners = new Image();
on_award_winners.src = "/images/menu/on_award_winners.gif";

on_useful_links = new Image();
on_useful_links.src = "/images/menu/on_useful_links.gif";

on_contact_us = new Image();
on_contact_us.src = "/images/menu/on_contact_us.gif";




function swapImage(name,new_src)
{

	document.images[name].src = eval( new_src + ".src" )

}


function popup(url,name,options)
{
	var win = window.open(url,name,options);
	return win;
}

function setBorderHeight()
{
	var rb = document.getElementById('border_right');
	var cont = document.getElementById('content');
	var h1 = cont.offsetHeight;
	
	if(h1 < 400)
	{
		cont.style.height = '400px';
		h1 = 400
	}
	
	if(rb)
	{
		rb.style.height = ( h1 + 38 ) + 'px';
	}
}






var newWindow = null;

function closeWin(){
	if (newWindow != null){
		
		if(!newWindow.closed)
			newWindow.close();
		
	}
}

function popUpWin(url, type, strWidth, strHeight){
	
	
	closeWin();
	
	if (type == "fullScreen"){
		strWidth = screen.availWidth - 10;
		strHeight = screen.availHeight - 160;
	}
	
	var tools="";
	if (type == "standard" || type == "fullScreen") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top=0,left=0";
	if (type == "console") tools = "resizable,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left=325,top=125";
	
	newWindow = window.open(url, 'newWin', tools);
	//newWindow.focus();
}