/* ---------------------------------------------------- */
/* Copyright (c) 2005 RocketSalad. All rights reserved. */
/* ---------------------------------------------------- */
/* ----------------------------------------------- */
// Set up email addresses.
// Home page message fade up.
// Find DOM id utility.
// Set CSS class of object (e.g. menu).
// Bookmark page.
/* ----------------------------------------------- */
// Set up email addresses.
// Used with dedicated inc_ files.
var v_domain = "rocketsalad.co.uk"
var v_webmaster = "webmaster"
var e_webmaster = v_webmaster + "@" + v_domain + "?subject=Email Webmaster"
var e_webmaster = "mailto:" + e_webmaster
var v_info = "info"
var e_info = v_info + "@" + v_domain + "?subject=RFI"
var e_info = "mailto:" + e_info
var v_colin = "colin"
var e_colin = v_colin + "@" + v_domain
var e_colin = "mailto:" + e_colin
/* ----------------------------------------------- */
// Home page message fade up.
cc=30;		// Number of frames in the animation.
aa=0;			// Initial value used as color parameter for Red, Green and Blue channels. 
tt=0;			// Aux counter - the left position of the element. 
el=0;			// Index of the element. 
function fadeUp() {
	if(cc>0) {
		tt+=cc;			// tt value is used to update the left position.
		// Sets the left position using tt parameter...
		document.getElementById("text"+el).style.left=tt+"px";
		// Increment aa color value...
		aa+=10;
		// Set the color value...
		document.getElementById("text"+el).style.color="rgb("+aa+","+aa+","+aa+")";
		// Decrease the animation counter...
		cc--;
		// Call procedure again...
		setTimeout("fadeUp()",40);
	} else {
		// Reset animation parameters...
		cc=30;
		aa=0;
		tt=0;
		// Call again the procedure increasing the el index until all 
		// elements have been animated...
		if(el<5) {
			el++;
			setTimeout("fadeUp()",40);
		}
	}
}
/* ----------------------------------------------- */
// Find DOM id utility.
// Called by other routines.
var isDHTML = 0;
var isID = 0;
var isAll = 0;
var isLayers = 0;
if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
if (document.all) {isAll = 1; isDHTML = 1;}
else {
browserVersion = parseInt(navigator.appVersion);
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
}}
function findDOM(objectID,withStyle) {
	if (withStyle == 1) {
		if (isID) { return (document.getElementById(objectID).style) ; }
		else { 
			if (isAll) { return (document.all[objectID].style); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
	else {
		if (isID) { return (document.getElementById(objectID)) ; }
		else { 
			if (isAll) { return (document.all[objectID]); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
}
/* ----------------------------------------------- */
// Set CSS class of object.
// Use: onBlur="setClass(object_id,class-name);"
// Both args passed as srtings.
function setClass(objectID,newClass) {
	var dom = findDOM(objectID,0);
	dom.className = newClass;
}
/* ----------------------------------------------- */
// Bookmark page.
// Use: <a href="javascript:void();" onClick="javascript:doBookmark();" onKeyPress="javascript:doBookmark();"><img src="bookmark_plain_SBAR.png" alt="">Bookmark this page</a>
function doBookmark() {
if( window.sidebar && window.sidebar.addPanel ) {
	// Mozilla
	window.sidebar.addPanel( document.title, document.location.href, '' );
} else if( window.external && ( navigator.platform == 'Win32' || ( window.ScriptEngine && ScriptEngine().indexOf('InScript') + 1 ) ) ) {
	// IE
	window.external.AddFavorite( location.href, document.title );
} else if( window.opera && window.print ) {
	return true;
} else if( document.layers ) {
	window.alert( 'Please click OK then press Ctrl+D to create a bookmark.' );
} else {
	window.alert( 'Please use your browser\'s bookmarking facility to create a bookmark.' );
}
return false;
}
