 
/* Frame Navigation */
function clickOnLocation(c,t)
{
//alert(top.location);alert(top.fraWestFrame.location);alert(top.fraWestFrame.fraDeeptree.location)
	if ( isFrameSite() )
	{
		if ( !(c==""||c==null||c=="undefined") )
		{
			top.fraContentFrame.fraContent.location=c;
		}
		if (t==""||t==null||t=="undefined"){return;}
		
		top.fraWestFrame.fraDeeptree.location=t;
	}
	else if ( !(c==""||c==null||c=="undefined") ) window.location=c;
}
			    
/* Write Cascading Style Sheet To Current [Frame] Page */
function ActiveCSS(path)	// entry point ... must write to correct document ...
{	
//	var path_f      = path || "../css/"; // except if path == '' it goes bang ...
	var iV=0;

//	path_f = trim( path_f )

	iV=GetCookie("MontegoStyleSheetNumber"); // see cookies.js
	
	if ( iV == null )
	{
		var expdate = new Date ();
		expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000)); // 24 hrs from now 
		iV=1;

//alert( '************************************\n* cookies.js:GetCookie() Failed. Attempting To Add *\n* Title  : MontegoStyleSheetNumber *\n* Value  : ' + iV +	'\n* Expires: ' + expdate );
		 
		SetCookie("MontegoStyleSheetNumber",iV,expdate);
	}


	if ( iV == null || iV == 0 || isNaN(iV) ) {	iV=1; SetCookie("MontegoStyleSheetNumber",iV);	}

//alert( self.document == document )	

//alert( "inside ActiveCSS(" + path + ")\nActiveCSS writing:\n" + "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"" + path + "sample" + iV + ".css\"> \ntop.location  [" + top.location + "]\nself.location[" + self.location + "]\ndocument.location [" +	document.location + "]\n" );

	document.write( '<LINK REL="stylesheet" TYPE="text/css" HREF="' + path + 'sample' + iV + '.css">' );
}

/* For When User Has To Pass ' ' for '' argument see RenderSuite */
function trim( key1 )
{
	var key = key1;
	while ( key.length && key.charAt( key.length - 1 ) == " "  ) key = key.slice(0, -1);
	while ( key.length && key.charAt( 0 ) == " " ) key = key.substring( 1 ) ;		
	
	return key;
}

/* Cannot Apply jswindowCallBack.js mousehandlers with FRAMESET for winlib.js parent search */
function isFrameSite()
{
	var b=0;
	var s;

	try
	{
/*
x = 0x01|0x02|0x04|0x08|0x10|0x20;
00000001 0x01	1  
00000010 0x02	2 
00000100 0x04	4 
00001000 0x08	8 
00010000 0x10  16 
00100000 0x20  32 
01000000 0x40  64
10000000 0x80 128
x &= ~
*/
		s = top.fraToolbar.location;					b |= 0x01;
		s = top.fraWestFrame.fraSearchTab.location;		b |= 0x02;
		s = top.fraWestFrame.fraDTBar.location; 		b |= 0x04;
		s = top.fraWestFrame.fraDeeptree.location;		b |= 0x08;
		s = top.fraContentFrame.fraContentBar.location;	b |= 0x10;
		s = top.fraContentFrame.fraContent.location;	b |= 0x20;
//		alert(s)
	}
	catch(exception)
	{
//		alert('Not Using FRAME Version')
		s="";
	}									  	

	return b;
}

/* Private Function Part Of document Rendering see: RenderSuite() */
function loadTemplate(iNumber,url) 
{
	//parent.location.href = url;
	//window.location.href = url;

//alert( "inside (parent.location.href = url) loadTemplate(" + iNumber + "," + url + ") \ntop.location [" + top.location + "] \n*self.location [" + self.location + "] \nparent.location.href [" + parent.location.href + "]\n" );
	
	self.location = url;

	var expdate = new Date ();
	expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000)); // 24 hrs from now 
	
//alert( '************************************\n* Attempting To Set Cookie *\n* Title  : MontegoStyleSheetNumber *\n* Value  : ' + iNumber +	'\n* Expires: ' + expdate );
		 
	SetCookie("MontegoStyleSheetNumber",iNumber, expdate);
}



function disableSelection(target){
if (typeof target.onselectstart!="undefined") //IE route
	target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
	target.style.MozUserSelect="none"
else //All other route (ie: Opera)
	target.onmousedown=function(){return false}
target.style.cursor = "default"
}


//  if parent == fraWestFrame then ; parent.frames[0].document.bgColor='slateblue'	 /* frameWest\search.htm */
//  if parent == fraWestFrame then ; parent.frames[1].document.bgColor='slateblue'  /* frameWest\dtbar.htm */
//  if parent == fraWestFrame then ; parent.frames[2].document.bgColor='slateblue'	 /* frameWest\deeptree.htm */
//document.writeln( '<STYLE>																		  ' );
//document.writeln( 'BODY         { margin:0; font:8pt MS Sans Serif; color:black; }				  ' );
//document.writeln( '.clsMenuItem { cursor:hand; padding:10; margin-right:30; width:30; }			  ' );
//document.writeln( '</STYLE>')
//top.fraToolbar
//top.fraWestFrame.fraSearchTab.location
//top.fraWestFrame.fraDTBar.location 	 
//top.fraWestFrame.fraDeeptree.location  
//top.fraContentFrame.fraContentBar.location 
//top.fraContentFrame.fraContent.location
// IFrameDoc=parent.document.getElementById("divWindow"+i).contentWindow.document;
//  parent.frames[0].document.bgColor='slateblue'	 /* frameWest\search.htm */


function clickOnCurrentHome(h,c,t)
{
	SetCookie ( "Content", c, null, "/" );
	SetCookie ( "Tree"   , t, null, "/" );
	top.location = h;
}

// See contentHome.htm which Must call this method
			    
function redirection()
{
	var c = GetCookie("Content"); 
	var t = GetCookie("Tree"); 
	SetCookie ( "Content", null, null, "/" );
	SetCookie ( "Tree"   , null, null, "/" );
	if ( c != "null" && t != "null" )	clickOnLocation(c,t)  
}

// render.js		    

function pageTopLinks(topURL,fwTree)
{
	var Faces =	["Standard", "CRT", "Halloween", "Executive", "Express"];
	var pU = topURL || "../JScriptMain.htm";
	var pT = fwTree || "../frameWest/deeptree.htm";
	var url  = "" + self.location + "";
	var nCSS = GetCookie("MontegoStyleSheetNumber");

	if ( nCSS == null || isNaN(nCSS) ) nCSS = 1;

	document.write( "<table height=24 cellSpacing=0 cellPadding=2 width=\"100%\" border=0><tbody><tr><td class=pageTopTdBorder vAlign=center align=left><a class=SmallLink href=" ); 

	if ( self == top ) 
	{
		document.write( "\"javascript:clickOnCurrentHome('" + pU + "','" + self.location + "','"+ pT + "');\">Current Home </a> &gt; " );
	}
	else 
	{
		document.write( "\"" + self.location + "\"   target=_top>Location </a> &gt; " ); 
	}
	if ( url.indexOf( "Brochure/cv.htm" ) == -1 ) document.write( "<a class=SmallLink href=\"" + "http://www.montegodata.co.uk/Brochure/cv.htm" + "\" target=_top>Resume (C.V.)</a>\n" ); 

	document.write("</td><td align=right class=pageTopTdBorder>Faces: ");
																			   
	for ( var i = 1; i <= Faces.length; i++ )
		document.write(	"<span onClick=\"" + "loadTemplate("+ i + ",'" + self.location + "');\"" + " class='Menu' onMouseOver=\"this.className='MenuOn'\" onMouseOut=\"this.className='Menu'\">"+ Faces[i-1]  +  (nCSS == i ? " ["+ i +"] " : " ") +"</span>&nbsp;" );

	document.write("&nbsp;&nbsp;&nbsp;&nbsp;</td></tr></tbody></table>\n" );
}

function RenderSuite( nAct,	 colorLogo, pathFooter ) 
{
	var n_Act       = nAct       ||	(0x01|0x02|0x04|0x08);
	var color_Logo	= colorLogo  || "white";		   
	var path_Footer = pathFooter || "../Company/";

document.write( "<table width='100%' align=right border=0 cellPadding=0 cellSpacing=0>" );

if ( n_Act & 0x01 ) {		// search form
document.write( "<tr><td align=right>");
document.write( "<form style='display: inline; padding: 0px; margin-right: 10px; ' name='seek' method='get' action='http://intra.whatUseek.com/query.go' target='_self'>");
document.write( "<b><i><small>Search </small></i></b>");
document.write( "<input type='radio'  name='crid' value='0b7573f42f98ea43' checked>&nbsp;This Site&nbsp;"); 
document.write( "<input type='radio'  name='crid' value='web'                     >&nbsp;The Web&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
document.write( "</td></tr>");
document.write( "<tr><td align=right>");
document.write( "<input type='text'   name='query' size='22' maxlength='100' value >&nbsp;");
document.write( "<input type='submit' name='B1'   value='Search' >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
document.write( "</form></td></tr>");
document.write( "<tr><td align=right bgcolor=" + color_Logo + ">");
document.write( "<a href='http://sitelevel.whatuseek.com?synd=box&chan=1'>Get a Search Engine For Your Web Site</a>&nbsp;&nbsp;&nbsp;");
document.write( "</td></tr>");
}

if ( n_Act & 0x04 ) {		
path_Footer = trim( path_Footer )					
document.write("<tr vAlign=center><td><p class=FooterText>");												

if ( n_Act & 0x08 ) {	
document.write("<span class=Footerspan onClick='javascript:history.back();'>&nbsp;Back&nbsp;</span>");	//&nbsp;");
document.write("<span class=Footerspan'><a class=Footerspan href='../index.htm' target=_top>Site Entry Point</a></span>&nbsp;");
}

document.write("<a class=Footerlink href='" + path_Footer + "legal.htm'>Legal Disclaimer</a>&nbsp; © Copyright by 1997 - 2010 Montego Data Limited® All rights reserved.&nbsp;");
document.write("<a class=Footerlink onMouseOver=\"this.className='Footerlink'\" onMouseOut=\"this.className='Footerlink'\" href = \"mailto:darrenwebb@montegodata.co.uk\">darrenwebb@montegodata.co.uk</a>" );
document.write("&nbsp;<span class=Footerspan>"+window.location.href+"</span>");

document.write("</p></td></tr>");

}

document.write( "</table>");

}







//#contextMenu { position: absolute; visibility: hidden; 
//               width: 200px; 
//			   background-color: lightgrey; layer-background-color: lightgrey; 
//			   border: 1px outset white; z-index:1; } 

function showMenu(evt) 
{ 
	if (document.all) 
	{ 
		document.all.contextMenu.style.pixelLeft = event.clientX; 
		document.all.contextMenu.style.pixelTop = event.clientY + document.body.scrollTop; 
		document.all.contextMenu.style.visibility = 'visible'; 

		return false; 
	} 
	else if (document.layers || document.getElementById&&!document.all ) 
	{ 
		if (evt.which == 3) 
		{ 
			var obj = document.getElementById("contextMenu");
			document.contextMenu.onMouseOut = function (evt) { this.visibility = 'hide' }; 
			document.contextMenu.visibility = 'show' ; 
//alert("3");
			return false; 
		} 

		if (evt.which == 19) 
		{ 
			var obj = document.getElementById("contextMenu");
			obj.style.left=evt.pageX
			obj.style.top =evt.pageY
			obj.style.visibility= 'visible'; 
//alert("19");
			return false; 
		} 
	} 
	return true;        
} 

function enableMenu()
{
	document.oncontextmenu=showMenu;
}


