/*
 * wwk.js - functions
 * Authors: SundayLaunch (Dean Pollard / Rob Jones)
*/

function RunGenericFunctions()
{
	// place all functions here that need to be called in the page onload
	// Commented out the following line 11/8/03 RJ - for testing purposes
	// window.document.oncontextmenu=new Function("return false;");
	
}

var LargeImageWin; 
	
// function name: 	bigImage()
// author:			Dean Pollard / Rob Jones
// copyright:		Sunday Launch Limited www.sundaylaunch.co.uk
// description:		this function is called from hyperlinks over an image
//					to display a larger image of itself, passing the
//					image name and the width and height
// parameters:		strImageName - the image name (including location)
//					w - width
//					h - height
// return value:	none
// global refs:		LargeImageWin - the name of the window to open, tested against
//					to enusre that not more than one window gets opened
function bigImage(strImageName,w,h)
{
	//idBigImage.src = strImageName; 
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,status=no,toolbar=no,menubar=no,location=no';
	if (LargeImageWin != null)
		LargeImageWin.close();
			
	LargeImageWin=window.open(strImageName,"LargeImageWin",settings);
	LargeImageWin.focus();
}

function navMenu(p_strAction, p_objThis, p_strColor)
{
	// called when mouse over, out, down, up, and onclick for the tab menu items
	// resets the class used to animate the menu items
	
	if (p_strColor == null) p_strColor = "";

	switch (p_strAction.toUpperCase())
	{
		case "OVEROCO":
			p_objThis.className = "tabmenuitemoveroco" + p_strColor;
			break;
		case "OVEROK":
			p_objThis.className = "tabmenuitemoverok" + p_strColor;
			break;
		case "OVEROB":
			p_objThis.className = "tabmenuitemoverob" + p_strColor;
			break;
		case "OVEROO":
			p_objThis.className = "tabmenuitemoveroo" + p_strColor;
			break;
		case "OVEROC":
			p_objThis.className = "tabmenuitemoveroc" + p_strColor;
			break;
		case "OUTOCO":
			p_objThis.className = "tabmenuitemoco" + p_strColor;
			break;
		case "OUTOK":
			p_objThis.className = "tabmenuitemok" + p_strColor;
			break;
		case "OUTOB":
			p_objThis.className = "tabmenuitemob" + p_strColor;
			break;
		case "OUTOO":
			p_objThis.className = "tabmenuitemoo" + p_strColor;
			break;
		case "OUTOC":
			p_objThis.className = "tabmenuitemoc" + p_strColor;
			break;
		case "DOWN":
			p_objThis.className = "tabmenuitemdown" + p_strColor;
			break;
		case "UPOCO":
			p_objThis.className = "tabmenuitemoco" + p_strColor;
			break;
		case "UPOK":
			p_objThis.className = "tabmenuitemok" + p_strColor;
			break;
		case "UPOB":
			p_objThis.className = "tabmenuitemob" + p_strColor;
			break;
		case "UPOO":
			p_objThis.className = "tabmenuitemoo" + p_strColor;
			break;
		case "UPOC":
			p_objThis.className = "tabmenuitemoc" + p_strColor;
			break;
		case "CLICK":
			window.location = p_objThis;
			break;
		default:
			p_objThis.className = "tabmenuitem" + p_strColor;
	}
}

function changeMap(p_strMapType)
{
	// simply switches the type of map image to display
	if (p_strMapType == null) p_strMapType = "LOCAL";

	var l_strImage = "";
	var l_strTitle = "";
	
	switch (p_strMapType.toUpperCase())
	{
		case "LOCAL":
			l_strImage = "images/local.jpg";
			l_strTitle = "local map image";
			break;
		case "AREA":
			l_strImage = "images/area.jpg";
			l_strTitle = "area map image";
			break;
		default:
			l_strImage = "images/local.jpg";
			l_strTitle = "local map image";			
	}

	imgFindUs.src = l_strImage;
	imgFindUs.alt = l_strTitle;
}

