//////////////////////////////////////////////////////////////////////////////////////
// Name			: ShowMenu															//
// Description	: Sets the style visibility to visible to show a hidden layer.		//
// Parameters	:-																	//
//	  layerName : Name of the layer to be shown.									//
// Author		: Brett Schumann (brett@nakedvision.co.uk)							//
// Date			: 19 / 02 / 2004													//
// Copyright	: © Naked Vision													//
//////////////////////////////////////////////////////////////////////////////////////
function ShowMenu(layerName){
	document.getElementById(layerName).style.visibility="visible";
}

//////////////////////////////////////////////////////////////////////////////////////
// Name			: HideMenu															//
// Description	: Sets the style visibility to hidden to show a hidden layer.		//
// Parameters	:-																	//
//	  layerName : Name of the layer to be hidden.									//
// Author		: Brett Schumann (brett@nakedvision.co.uk)							//
// Date			: 19 / 02 / 2004													//
// Copyright	: © Naked Vision													//
//////////////////////////////////////////////////////////////////////////////////////
function HideMenu(layerName){
	document.getElementById(layerName).style.visibility="hidden";
}

//////////////////////////////////////////////////////////////////////////////////////
// Name			: Hyperlink															//
// Description	: Sends the user to the specified URL/Address.						//
// Parameters	:-																	//
//	        URL : Address of where to navigate to.									//
// Author		: Brett Schumann (brett@nakedvision.co.uk)							//
// Date			: 19 / 02 / 2004													//
// Copyright	: © Naked Vision													//
//////////////////////////////////////////////////////////////////////////////////////
function Hyperlink(URL){
	window.location.href=URL;
//	window.navigate(URL);
}
//////////////////////////////////////////////////////////////////////////////////////
// Name			: ConfirmDelete														//
// Description	: Confirm message and nagivate to specified URL.					//
// Parameters	:-																	//
//		Message : Message to display to user for comfirmation.						//
//	        URL : Address of where to navigate to.									//
// Author		: Brett Schumann (brett@nakedvision.co.uk)							//
// Date			: 23 / 02 / 2004													//
// Copyright	: © Naked Vision													//
//////////////////////////////////////////////////////////////////////////////////////
function ConfirmDelete(Message,URL){
	if(confirm(Message)){
		window.location.href=URL;
		window.navigate(URL);
	}
}
//////////////////////////////////////////////////////////////////////////////////////
// Name			: OpenWindow														//
// Description	: Create a popup window without all the fancy trimmings.			//
// Parameters	:-																	//
//	        URL : URL of page to display in popup.									//
// Author		: Brett Schumann (brett@nakedvision.co.uk)							//
// Date			: 20 / 02 / 2004													//
// Copyright	: © Naked Vision													//
//////////////////////////////////////////////////////////////////////////////////////
function OpenWindow(URL){
	windowA = window.open(URL,"windowA","toolbar=no,width=300,height=350,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=no");
}
//////////////////////////////////////////////////////////////////////////////////////
// Name			: OpenWindow2														//
// Description	: Create a popup window without all the fancy trimmings.			//
// Parameters	:-																	//
//	        URL : URL of page to display in popup.									//
//        WIDTH : width of popup.													//
//       HEIGHT : height of popup.													//
// Author		: Brett Schumann (brett@nakedvision.co.uk)							//
// Date			: 20 / 02 / 2004													//
// Copyright	: © Naked Vision													//
//////////////////////////////////////////////////////////////////////////////////////
function OpenWindow2(URL,WIDTH,HEIGHT){
	windowA = window.open(URL,"windowA","toolbar=no,width="+WIDTH+",height="+HEIGHT+",toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=no");
}

//////////////////////////////////////////////////////////////////////////////////////
// Name			: CheckEmail														//
// Description	: Validates the pasted value to see if it is am email address		//
// Parameters	:-																	//
//	      email : string to check to see if valid email address.					//
// Author		: Brett Schumann (brett@nakedvision.co.uk)							//
// Date			: 20 / 02 / 2004													//
// Copyright	: © Naked Vision													//
//////////////////////////////////////////////////////////////////////////////////////
function CheckEmail(email)
{
	if( ((email.lastIndexOf('@') == -1) ||
		(email.lastIndexOf('.') == -1)) ||
		email.length < 7	)
	{			
		return false;
	}
	else return true;
}

//////////////////////////////////////////////////////////////////////////////////////
// Name			: findPosX															//
// Description	: Get the horizontal position of an object							//
// Parameters	:-																	//
//	        obj : Object to get the location of.									//
// Author		: Brett Schumann (brett@nakedvision.co.uk)							//
// Date			: 16 / 04 / 2004													//
// Copyright	: © Naked Vision													//
//////////////////////////////////////////////////////////////////////////////////////
function findPosX(obj){
    var curleft = 0;
    if (obj.offsetParent){
         while (obj.offsetParent){
              curleft += obj.offsetLeft
              obj = obj.offsetParent;
         }
    }
    else if (obj.x)
         curleft += obj.x;
    return curleft;
}

//////////////////////////////////////////////////////////////////////////////////////
// Name			: findPosY															//
// Description	: Get the vertical position of an object							//
// Parameters	:-																	//
//	        obj : Object to get the location of.									//
// Author		: Brett Schumann (brett@nakedvision.co.uk)							//
// Date			: 16 / 04 / 2004													//
// Copyright	: © Naked Vision													//
//////////////////////////////////////////////////////////////////////////////////////
function findPosY(obj){
    var curtop = 0;
    if (obj.offsetParent)
    {
         while (obj.offsetParent)
         {
              curtop += obj.offsetTop
              obj = obj.offsetParent;
         }
    }
    else if (obj.y)
         curtop += obj.y;
    return curtop;
}

//////////////////////////////////////////////////////////////////////////////////////
// Name			: SetLayerXY														//
// Description	: Sets the layers location											//
// Parameters	:-																	//
//	        obj : Object to set the location of.									//
// Author		: Brett Schumann (brett@nakedvision.co.uk)							//
// Date			: 16 / 04 / 2004													//
// Copyright	: © Naked Vision													//
//////////////////////////////////////////////////////////////////////////////////////
function SetLayerXY(obj,Img){
//	var e = event
	var imgx = findPosX(document.getElementById(Img));
	var imgy = findPosY(document.getElementById(Img));
	document.getElementById(obj).style.top=findPosY(document.getElementById(Img));
	document.getElementById(obj).style.left=findPosX(document.getElementById(Img)) + 7;
	
}
