///////////////////////////////////////////////////////////////////
// Page Level JavaScripts for williamorbit.com (c) 2005 R.Shea ////
///////////////////////////////////////////////////////////////////
function PageLoaded(){
	if (parent.frames.length == 0 && location.href.indexOf('www\w') == -1) {
		//top.location.href="../index.html?page="+document.title
		//return false;
	}
	parent.show('Loading'); parent.show('LoadingText');
	PageTitle(this.document.title)
	parent.show('RSDiv');
	parent.show('RSFrame');

	MySection = self.document.title
	for (m=0; m<parent.SMenu.length; m++){
		Switch = "M"+m
		if (parent.SMenu[m][1] == MySection){
			setTimeout("parent.ActiveMenu("+m+")",1)
			setTimeout("parent.slideMenu.switchMenu("+m+")",1000)
		}

	}
	
}
/////////////////////////////////////////////////////////////
function PageUnLoaded(){
	// Zoom switched off for now...
	//parent.zoomBox('none',event,'void(0)',587,396,161,131)
}
/////////////////////////////////////////////////////////////
function PageTitle(Text){
	HTML = "<span class='loadingtext'>" + Text +"</span>"
	setTimeout("parent.WriteToLayer('LoadingText',HTML)",700)
}

/////////////////////////////////////////////////////////////

HTML = "<style type='text/css'><!--";
HTML += "body {background-image: url(../images/bg/"+parent.CurrIMG+"d.jpg);";
HTML += "background-repeat: no-repeat;";
HTML += "background-position: -162 -132;";
HTML += "background-attachment: fixed;";
HTML += "}//--></style>";
document.write(HTML);

/////////////////////////////////////////////////////////////
function EWebMaster(){
	var edress = 'richard_at_williamorbit_dot_com';
	var re= /_at_/gi;
	edress = edress.replace(re,'@');
	var re= /_dot_/gi;
	edress = edress.replace(re,'.');
	var the_link="mai" + "lto" +":"+edress+"?subject=Enquiry%20via%20williamorbit.com" ;
	window.location=the_link;
}
function EManager(){
	var edress = 'andy_at_aaminc_dot_com';
	var re= /_at_/gi;
	edress = edress.replace(re,'@');
	var re= /_dot_/gi;
	edress = edress.replace(re,'.');
	var the_link="mai" + "lto" +":"+edress+"?subject=Enquiry%20via%20williamorbit.com" ;
	window.location=the_link;
}
function LicenceEmail(){
	var edress = 'licence_at_williamorbit_dot_com';
	var re= /_at_/gi;
	edress = edress.replace(re,'@');
	var re= /_dot_/gi;
	edress = edress.replace(re,'.');
	var the_link="mai" + "lto" +":"+edress+"?subject=Licence%20Enquiry%20via%20williamorbit.com" ;
	window.location=the_link;
}
function GenEmail(){
	var edress = 'info_at_williamorbit_dot_com';
	var re= /_at_/gi;
	edress = edress.replace(re,'@');
	var re= /_dot_/gi;
	edress = edress.replace(re,'.');
	var the_link="mai" + "lto" +":"+edress+"?subject=General%20Enquiry%20via%20williamorbit.com" ;
	window.location=the_link;
}

/////////////////////////////////////////////////////////////

function ScrapBook(type){
	MaxPages=20;
	CurrPage = (this.location.href.substring(this.location.href.length-7,this.location.href.length-5))
	if (type == "index"){
		document.write ("<table width='100%' border='0' cellspacing='0' cellpadding='0'>")
		document.write ("<tr><td width='100'><div align='left'>")
		LastPage = CurrPage*1-1
		if (LastPage<10){LastPage="0"+LastPage}
		if (LastPage != "00"){
			document.write ("<a href='scrapbook"+LastPage+".html' style='text-decoration:none;'>&lt;&lt; Back</a>")
		}
		else {
			document.write ("Pages:")
		}
		document.write ("</div></td>")

		document.write ("<td><div align='center'><table width='100%' border='0' cellspacing='3' cellpadding='1'><tr>")
		 for (var i = 1; i < MaxPages; i++) {
		 	document.write ("<td width='5' onMouseover='CellFillOn(this);' onMouseout='CellFillOff(this);' bgcolor='#444444' nowrap>")
			if (i<10){x="0"+i}
			else {x=i}
			if (CurrPage == x){document.write ("<span class='orange'>"+x+"</span> ")}
			else {
				document.write ("<a href='scrapbook"+x+".html' style='text-decoration:none;'>")
				document.write (x)
				document.write ("</a> ")
			}
			document.write("</td>")
		}
		document.write ("</tr></table></div></td>")
		document.write ("<td width='100'><div align='right'>")
		NextPage = CurrPage*1+1
		if (NextPage < MaxPages){
			if (NextPage<10){NextPage="0"+NextPage}
			document.write ("<a href='scrapbook"+NextPage+".html' style='text-decoration:none;'>Next &gt;&gt;</a>")
		}
		else {
			document.write ("&nbsp;")
		}
		document.write ("</div></td></tr></table>")
	}
	else {
		document.write ("<span class='small'>")
		document.write ("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;page " + CurrPage + " of " +(MaxPages*1-1))
		document.write ("</span>")
	}
}

//onMouseover='CellFillOn(this);'
function CellFillOn(TD) {
	TD.style.backgroundColor='#000000';
	TD.style.cursor='hand';
}

function CellFillOff(TD) {
	TD.style.backgroundColor='';
}            

function RadCliffe(){
	URL="http://www.bbc.co.uk/radio/aod/mainframe.shtml?http://www.bbc.co.uk/radio/aod/radio2_aod.shtml?radio2/r2_radcliffe_wed"
	WinName="BBC"
	width=600
	height=550
	var x = 800-10, y = 600-10;
	if (document.all || document.layers) {
	        x= (screen.width - width) / 2 - 10;
	        y= (screen.height - height) / 2 - 15;
	}
	if (document.getElementById){
	        x= (screen.availWidth - width) / 2 - 10;
	        y= (screen.availHeight - height) / 2 - 15;
	
	}
	if (WinName == null || WinName == ""){WinName="popup"}
	var popWin = window.open(URL,WinName,'height='+height+',width='+width+',top='+y+',left='+x+',screenY='+y+',screenX='+x+',alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=0,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0,z-lock=0')
}