/***************************************
          Static logo script
Written by Mark Wilton-Jones, 27/5/2002
****************************************

Please see http://www.howtocreate.co.uk/jslibs/ for details of this script
Please see http://www.howtocreate.co.uk/jslibs/termsOfUse.html for terms of use


This script is deprecated and is no longer supported, use CSS fixed positioning instead.


To use:

	Add the following line in between the <head> tags:

	<script src="PATH TO SCRIPT/staticlogo.js" type="text/javascript" language="javascript1.2"></script>

	Add the following lines just before the </body> tag - you can use more than one:

<script type="text/javascript" language="javascript1.2"><!--
drawLogo(
	'<a href="home.html"><img src="ourlogo.gif" height="30" width="50" border="0" alt="[Home]"></a>', //logo contents - you can include HTML also
	'',  //background colour - blank for transparent
	50,  //width required by logo
	30,  //height required by logo
	4,   //position of logo: 1 = top-left, 2 = top-right, 3 = bottom-left, 4 = bottom-right
	100, //horizontal offset from normal position in corner (normally 0)
	50,  //vertical offset from normal position in corner (normally 0)
	true //scroll with screen
);
//--></script>

*/

function getRefToDivNest( divID, oDoc ) {
	if( !oDoc ) { oDoc = document; }
	if( document.layers ) {
		if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
			for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
				y = getRefToDivNest(divID,oDoc.layers[x].document); }
			return y; } }
	if( document.getElementById ) { return document.getElementById(divID); }
	if( document.all ) { return document.all[divID]; }
	return document[divID];
}
function drawLogo(l,b,w,h,p,xOf,yOf,s) {
	window.logoCount = ( typeof( window.logoCount ) == 'number' ) ? window.logoCount + 1 : 0;
	//create the logo
	if( document.layers ) {
		document.write( '<layer id="logoNum' + window.logoCount + '" height="'+h+'" width="'+w+'" left="0" top="0"'+(b?' bgcolor="'+b+'"':'')+'>'+l+'</layer>' );
	} else {
		document.write( '<div id="logoNum' + window.logoCount + '" style="position:absolute;left:0px;top:0px;'+(b?'background-color:'+b+';':'')+'height:'+h+'px;width:'+w+'px;">'+l+'</div><br>' );
	}
	window.setInterval('aniLogo(' + p + ',' + s + ',' + w + ',' + h + ',' + xOf + ',' + yOf + ',' + window.logoCount + ')',50);
}
function aniLogo(p,s,w,h,xOf,yOf,n) {
	var myLogo = getRefToDivNest('logoNum'+n);
	if( !myLogo ) { return; } //not loaded yet or not supported
	if( myLogo.style ) { myLogo = myLogo.style; }
	//get the screen size so that we can put it in a corner and scroll . . .
	var scrW = 0, scrH = 0, scrOfX = 0, scrOfY = 0;
	if( typeof( window.innerWidth ) == 'number' ) { scrW = window.innerWidth; scrH = window.innerHeight; } else {
		if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			scrW = document.documentElement.clientWidth; scrH = document.documentElement.clientHeight; } else {
			if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
				scrW = document.body.clientWidth; scrH = document.body.clientHeight; } } }
	if( typeof( window.pageYOffset ) == 'number' ) { scrOfY = pageYOffset; scrOfX = pageXOffset; } else {
		if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else {
			if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } }
	}
	//now we have the screen settings in all known DHTML browsers - cool huh?
	//apply those settings along with positioning and scrolling preference to find offset positions
	var oPix = document.childNodes ? 'px' : 0;
	myLogo.left = ( xOf + ( ( p % 2 ) ? 0 : scrW - w ) + ( s ? scrOfX : 0 ) ) + oPix;
	myLogo.top = ( yOf + ( ( p < 3 ) ? 0 : scrH - h ) + ( s ? scrOfY : 0 ) ) + oPix;
}